/* Hub app prototype (widgets/hubapp/hubapp.js). The phone screen is designed at 270 × 585 and scaled with --k. */
.ha { container-type: size; background: var(--tile-bg); color: var(--ink-2); font-size: 13px; line-height: 1.4; }
.ha button { font: inherit; color: inherit; cursor: pointer; }
.ha__in { display: grid; grid-template-columns: auto minmax(0, max-content); gap: 24px; height: 100%; padding: 14px 22px 14px 18px; }
.ha__stage { height: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; }
.ha__phone { height: 100%; aspect-ratio: 316 / 666; padding: 7px; border-radius: 20px; background: #1b1c20; box-shadow: 0 16px 40px rgba(0,0,0,.18), inset 0 0 0 1.5px #3a3b40; }
.ha__screen { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 14px; background: #f3f4f7; }
.ha__ui { --hp: #0096d6; position: absolute; top: 0; left: 0; width: 270px; height: 585px; transform: scale(var(--k, .6)); transform-origin: 0 0; font-family: -apple-system, BlinkMacSystemFont, "Inter Tight", system-ui, sans-serif; font-size: 13px; color: #16171a; text-align: left; }
.ha__ui small { display: block; font-size: 11px; color: #7a7d86; }
.ha__status { position: absolute; top: 0; left: 0; right: 0; z-index: 5; height: 40px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 24px; font-size: 12px; font-weight: 600; }
/* Equal outer columns keep the island centred whatever the time and battery read. */
.ha__status > :last-child { justify-self: end; }
.ha__island { width: 84px; height: 24px; border-radius: 14px; background: #000; }
.ha__view { position: absolute; inset: 40px 0 62px; padding: 0 14px; overflow: hidden; opacity: 0; transform: translateX(16px); transition: opacity .35s ease, transform .45s cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.ha__view.is-on { opacity: 1; transform: none; pointer-events: auto; }
.ha__bar { display: flex; align-items: center; justify-content: space-between; height: 46px; }
.ha__bar b { font-size: 22px; letter-spacing: -.02em; }
.ha__view[data-v=photo] .ha__bar b, .ha__bar--chat b { font-size: 15px; }
.ha__gear { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: #555; font-size: 15px; }
.ha__back { width: 30px; font-size: 26px; line-height: 1; color: var(--hp); cursor: pointer; }
.ha__card { margin-bottom: 10px; padding: 12px; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.ha__row { display: flex; align-items: center; gap: 10px; }
.ha__row > div { flex: 1; min-width: 0; }
.ha__row b { font-size: 14px; }
.ha__logo { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--hp); color: #fff; font-weight: 700; font-style: italic; }
.ha__dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #34c759; vertical-align: 1px; }
.ha__store { height: 8px; margin: 12px 0 5px; border-radius: 4px; background: #e8e9ee; overflow: hidden; }
.ha__store i { display: block; height: 100%; border-radius: 4px; background: var(--hp); }
.ha__split { display: flex !important; justify-content: space-between; }
.ha__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.ha__head small { color: var(--hp); }
.ha__thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ha__thumb { aspect-ratio: 1; border: 0; border-radius: 10px; }
.ha__thumb:hover { outline: 2px solid var(--hp); outline-offset: 1px; }
.ha__art { width: 44px; height: 44px; border-radius: 8px; background: linear-gradient(135deg,#ff9a3c,#a8303a 55%,#1e1e28); }
.ha__pp { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #16171a; color: #fff !important; font-size: 11px !important; }
.ha__prog { height: 4px; margin-top: 10px; border-radius: 2px; background: #e8e9ee; overflow: hidden; }
.ha__prog i { display: block; height: 100%; width: 40%; background: #1db954; animation: ha-play 30s linear infinite; }
.ha__music.is-paused .ha__prog i { animation-play-state: paused; }
@keyframes ha-play { to { width: 100%; } }
.ha__search { margin-bottom: 10px; padding: 8px 12px; border-radius: 10px; background: #e6e7ec; color: #8a8d95; }
.ha__label { margin-bottom: 4px; text-transform: uppercase; letter-spacing: .05em; font-size: 10px !important; }
.ha__list { padding: 8px 12px; }
.ha__li { display: flex; align-items: center; gap: 10px; min-height: 40px; border-bottom: 1px solid #f0f1f4; font-size: 13.5px; }
.ha__li:last-child { border-bottom: 0; }
.ha__li > span:nth-child(2) { flex: 1; }
.ha__li i { color: #b7b9c0; font-style: normal; font-size: 18px; }
.ha__li input { margin-left: auto; appearance: none; width: 38px; height: 22px; border-radius: 11px; background: #ddd; position: relative; cursor: pointer; transition: background-color .2s; }
.ha__li input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s; }
.ha__li input:checked { background: #34c759; }
.ha__li input:checked::after { transform: translateX(16px); }
.ha__fi { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; background: #1877f2; color: #fff; font-weight: 700; }
.ha__fi--ig { background: linear-gradient(45deg,#f9ce34,#ee2a7b,#6228d7); }
.ha__fold { width: 26px; height: 20px; border-radius: 4px; background: #9fd4f2; position: relative; }
.ha__big { height: 250px; border-radius: 16px; transition: filter .3s ease; }
.ha__tabs { display: flex; justify-content: center; gap: 14px; margin: 14px 0 6px; }
.ha__tabs button { border: 0; background: none; color: #9a9da5 !important; font-size: 13.5px !important; font-weight: 600; }
.ha__tabs button[aria-pressed=true] { color: #16171a !important; }
.ha__slider { width: 100%; accent-color: var(--hp); }
.ha__cta { width: 100%; margin-top: 12px; padding: 12px; border: 0; border-radius: 14px; background: var(--hp); color: #fff !important; font-weight: 600 !important; }
.ha__pr { width: 48px; height: 40px; border-radius: 8px; background: linear-gradient(#dfe1e6, #b9bcc4); position: relative; }
.ha__pr::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: 6px; height: 4px; border-radius: 2px; background: #6c6f78; }
.ha__pr--b { background: linear-gradient(#3a3d45, #1f2126); }
.ha__ink { display: flex; gap: 14px; justify-content: flex-end; margin-top: 10px; }
.ha__ink div { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.ha__ink i { width: 12px; height: 54px; border-radius: 6px; background: linear-gradient(to top, var(--c) var(--l), #eceef2 var(--l)); }
.ha__borrowed { display: none; }
.ha__borrowed.is-on { display: block; animation: ha-pop .4s ease; }
@keyframes ha-pop { from { opacity: 0; transform: scale(.96); } }
.ha__ghost { width: 100%; padding: 12px; border: 0; border-radius: 14px; background: #fff; font-weight: 600 !important; }
/* Messages */
.ha__chat { inset: 40px 0 62px; padding: 0; background: #fff; }
.ha__bar--chat { display: grid; grid-template-columns: 1fr auto 1fr; padding: 0 14px; border-bottom: 1px solid #eee; }
.ha__who { display: flex; flex-direction: column; align-items: center; font-size: 11px; }
.ha__av { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(#b0b4bd, #7d818b); color: #fff; font-weight: 700; }
.ha__msgs { display: flex; flex-direction: column; gap: 5px; padding: 12px 12px 0; }
.ha__b { max-width: 78%; margin: 0; padding: 8px 12px; border-radius: 18px; font-size: 13.5px; line-height: 1.3; }
.ha__b--in { align-self: flex-start; background: #e9e9eb; }
.ha__b--out { align-self: flex-end; background: #0a84ff; color: #fff; }
.ha__doc, .ha__done { display: none; }
.ha__doc { position: relative; align-items: center; gap: 10px; overflow: hidden; background: #f2f3f5; color: #16171a; }
.ha__doc small { font-size: 11px; }
.ha__docbar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--hp); }
.is-sent .ha__doc { display: flex; animation: ha-pop .35s ease; }
.is-sent .ha__docbar { animation: ha-bar 1.7s linear forwards; }
@keyframes ha-bar { to { width: 100%; } }
.is-done .ha__done { display: block; animation: ha-pop .35s ease; }
.is-done .ha__docbar { background: #34c759; }
.ha__pdf { flex: none; width: 30px; height: 38px; display: grid; place-items: start center; padding-top: 4px; border-radius: 5px; background: #d93a3a; color: #fff; font-size: 9px; font-weight: 700; }
.ha__pdf--jpg { background: #e9a23b; }
.ha__compose { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fff; border-top: 1px solid #eee; }
.ha__compose span { flex: 1; padding: 6px 12px; border-radius: 16px; box-shadow: inset 0 0 0 1px #ddd; color: #aaa; }
.ha__hp { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--hp); color: #fff !important; font-weight: 700 !important; font-style: italic; }
.ha__drawer, .ha__sheet { position: absolute; left: 0; right: 0; bottom: 49px; padding: 12px; background: #f6f7fa; border-top: 1px solid #e3e4e8; transform: translateY(calc(100% + 60px)); transition: transform .4s cubic-bezier(.2,.8,.2,1); }
.ha__sheet { bottom: 0; z-index: 2; border-radius: 18px 18px 0 0; box-shadow: 0 -8px 24px rgba(0,0,0,.12); }
.is-drawer .ha__drawer, .is-sheet .ha__sheet { transform: none; }
.is-sent .ha__drawer { transform: translateY(calc(100% + 60px)); }
.ha__dhead { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; font-weight: 600; }
.ha__dhead small { display: inline !important; margin-left: 4px; }
.ha__files { display: flex; gap: 10px; }
.ha__file { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border: 0; border-radius: 12px; background: #fff; font-size: 11px !important; }
.ha__file:hover { outline: 2px solid var(--hp); }
.ha__opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.ha__opts div { padding: 8px 10px; border-radius: 10px; background: #fff; }
.ha__sbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ha__cancel, .ha__send { padding: 10px; border: 0; border-radius: 12px; font-weight: 600 !important; }
.ha__cancel { background: #e6e7ec; }
.ha__send { background: var(--hp); color: #fff !important; }
.ha__tabbar { position: absolute; left: 0; right: 0; bottom: 0; height: 62px; display: flex; justify-content: space-around; align-items: flex-start; padding-top: 10px; background: rgba(255,255,255,.92); border-top: 1px solid #e6e7ec; }
.ha__tabbar button { width: 48px; height: 32px; border: 0; background: none; }
.ha__tabbar svg { width: 24px; height: 24px; fill: #a3a6ae; }
.ha__tabbar button[aria-current=true] svg { fill: var(--hp); }
.ha__toast { position: absolute; left: 50%; bottom: 76px; z-index: 6; padding: 8px 14px; border-radius: 100px; background: #16171a; color: #fff; font-size: 12px; white-space: nowrap; opacity: 0; transform: translate(-50%, 8px); transition: opacity .25s ease, transform .3s ease; pointer-events: none; }
.ha__toast.is-on { opacity: 1; transform: translate(-50%, 0); }
/* Side panel */
/* The side column is as wide as the flow buttons; the text under them wraps to that width. */
.ha__side { min-width: 0; width: max-content; max-width: 230px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.ha__eyebrow { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.ha__flows { display: flex; flex-wrap: wrap; gap: 5px; }
.ha__flows button { padding: 5px 12px; border: 0; border-radius: 100px; background: none; box-shadow: inset 0 0 0 1px var(--line); text-align: left; transition: background-color .2s ease, color .2s ease; }
.ha__flows button b { font-weight: 500; font-size: 13px; }
.ha__flows button:hover { box-shadow: inset 0 0 0 1px var(--ink-2); }
.ha__flows button[aria-pressed=true] { background: var(--ink); color: var(--bg); box-shadow: none; }
.ha__about { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--ink); }
.ha__hint { margin: 0; font-size: 12px; color: var(--muted); }
/* Narrow frames (small windows, phones): phone on top, flows and text underneath, all centred. */
@container (max-width: 430px) {
  .ha__in { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 10px; padding: 12px; }
  .ha__side { width: auto; max-width: none; align-items: center; text-align: center; gap: 6px; }
  .ha__flows { justify-content: center; }
  .ha__eyebrow, .ha__hint { display: none; }
  .ha__about { min-height: 0; font-size: 12.5px; }
  }
@media (prefers-reduced-motion: reduce) { .ha__view, .ha__drawer, .ha__sheet { transition: none; } .ha__prog i { animation: none; } }
/* Stacked page: phone (sized in hubapp.js) above its controls, the frame as tall as both. */
.is-vertical .pic--hubapp .ha__side { max-width: 420px; margin-inline: auto; }
.is-vertical .pic--hubapp .ha__in { height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; }
.is-vertical .pic--hubapp .ha__stage { height: auto; }
