/* Profile, dashboard, Send to a friend, Build together, confirm sheets. Loaded after design.css. */

/* ---------- confirm sheet ---------- */
.confirm-text { font-size: 16px; line-height: 1.5; margin: 0 0 16px; }
.confirm-actions { display: grid; gap: 8px; }
.danger-text { color: var(--danger) !important; }

/* ---------- profile ---------- */
.avatar { font-family: var(--brand-font); font-weight: 900; font-size: 16px; min-width: 40px; min-height: 40px; }
.profile-head { display: flex; gap: 14px; align-items: center; margin: 4px 0 16px; }
.profile-av { flex: none; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font: 900 26px var(--brand-font); }
.profile-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.profile-name { font: 800 19px var(--brand-font); }
.profile-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-pill { justify-self: start; margin-top: 4px; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); }
.profile-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; }
.pq { display: grid; gap: 4px; align-content: start; text-align: left; padding: 12px; border-radius: 16px; background: var(--surface-2); border: 0; color: var(--ink); text-decoration: none; min-height: 96px; }
.pq > .i { width: 22px; height: 22px; color: var(--accent); }
.pq b { font-size: 15px; font-family: var(--brand-font); }
.pq small { font-size: 12px; color: var(--muted); line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.advanced { margin: 12px 0 0; }
.advanced summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.sheet-input.one { min-height: 48px; margin: 8px 0 12px; }

/* ---------- dashboard ---------- */
.dash { max-width: 980px; margin: 0 auto; padding: 24px 16px 110px; }
.dash h2 { font-size: 20px; margin: 30px 0 12px; display: flex; gap: 8px; align-items: center; }
.dash h2 .count { font-size: 13px; font-weight: 800; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 2px 9px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 760px) { .stat-grid { grid-template-columns: 2fr repeat(4, 1fr); } }
.stat { background: var(--surface); border-radius: 20px; padding: 16px; box-shadow: var(--shadow); display: grid; gap: 4px; align-content: start; }
.stat span { font-size: 13px; font-weight: 700; color: var(--muted); }
.stat b { font: 850 26px/1.1 var(--brand-font); display: flex; align-items: center; gap: 6px; }
.stat small { font-size: 12.5px; color: var(--muted); }
.stat.hero { grid-column: 1 / -1; background: linear-gradient(150deg, #ff8a4c, #ff4d01); color: #fff; }
@media (min-width: 760px) { .stat.hero { grid-column: auto; } }
.stat.hero span, .stat.hero small { color: rgba(255, 255, 255, .9); }
.stat.hero b { font-size: 34px; }
.stat-star { display: inline-flex; color: var(--star); }
.stat-star .star { width: 20px; height: 20px; fill: currentColor; }
.dash-apps { display: grid; gap: 12px; }
@media (min-width: 760px) { .dash-apps { grid-template-columns: repeat(2, 1fr); } }
.dash-app { background: var(--surface); border-radius: 20px; padding: 16px; box-shadow: var(--shadow); cursor: pointer; display: grid; gap: 12px; }
.dash-app:hover { box-shadow: var(--shadow-lg); }
.dash-app-top { display: flex; gap: 12px; align-items: center; }
.dash-app-name { flex: 1; min-width: 0; display: grid; }
.dash-app-name b { font: 800 16.5px var(--brand-font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-app-name small { font-size: 13px; color: var(--muted); }
.chip-s { display: inline-flex; gap: 5px; align-items: center; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink); }
.chip-s .i { width: 14px; height: 14px; }
.chip-s.status-live { background: color-mix(in srgb, var(--leaf) 14%, var(--surface)); color: var(--leaf); }
.chip-s.status-pending { background: var(--warn-bg); color: var(--warn-ink); }
.dash-nums { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); padding-top: 12px; }
.dash-nums div { display: grid; text-align: center; }
.dash-nums div + div { border-left: 1px solid var(--line); }
.dash-nums b { font: 850 18px var(--brand-font); }
.dash-nums span { font-size: 12px; color: var(--muted); font-weight: 700; }
.dash-hint { margin: 0; }
.dash-empty { grid-column: 1 / -1; text-align: center; background: var(--surface); border-radius: 20px; padding: 28px 16px; color: var(--muted); box-shadow: var(--shadow-sm); }
.dash-empty > .i { width: 30px; height: 30px; color: var(--accent); }
.dash-reviews, .dash-sent { display: grid; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-sm); overflow: hidden; }
.dash-review, .dash-sent-row { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; }
.dash-sent-row { align-items: center; flex-wrap: wrap; }
.dash-review + .dash-review, .dash-sent-row + .dash-sent-row { border-top: 1px solid var(--line); }
.dash-review-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.dash-review-main p { margin: 6px 0 0; }
.dash-review .link-btn { justify-self: start; display: inline-flex; gap: 6px; align-items: center; text-decoration: none; font-weight: 700; color: var(--accent-text); }
.dash-sent-row.off { opacity: .55; }
.dash-pay { background: var(--surface); border-radius: 20px; padding: 16px; box-shadow: var(--shadow-sm); }
.dash .sell { margin-top: 16px; }
.dash-reviews > p.muted, .dash-sent > p.muted { padding: 16px; margin: 0; }

/* ---------- send to a friend ---------- */
.gift-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.gift-head b { font: 800 18px var(--brand-font); }
.gift-head p { margin: 2px 0 0; }
.gift-note { display: grid; gap: 4px; font-weight: 700; font-size: 14px; }
.gift-done { display: flex; gap: 8px; align-items: center; color: var(--leaf); font-weight: 800; }
.gift-hero { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 12px 0 20px; }
.gift-hero h1 { margin: 6px 0 0; font-size: 30px; }
.gift-hero p { margin: 0; }
.gift-from { display: inline-flex; gap: 8px; align-items: center; font-size: 15px; background: var(--accent-soft); color: var(--ink); padding: 8px 14px; border-radius: 999px; }
.gift-from .i { color: var(--accent); }
.gift-quote { margin: 4px 0; padding: 12px 16px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-sm); font-size: 16px; max-width: 360px; }
.gift-price { display: inline-flex; gap: 6px; align-items: center; font-weight: 800; color: var(--leaf); font-size: 14.5px; }
.gift-actions { display: grid; gap: 10px; margin-top: 6px; }
.center { text-align: center; }

/* ---------- build together ---------- */
.people { display: grid; background: var(--surface-2); border-radius: 16px; overflow: hidden; margin: 4px 0 8px; }
.person { display: flex; gap: 12px; align-items: center; padding: 10px 14px; min-height: 56px; }
.person + .person { border-top: 1px solid var(--line); }
.person-av { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font: 900 15px var(--brand-font); }
.person-main { flex: 1; min-width: 0; display: grid; }
.person-main small { color: var(--muted); font-size: 12.5px; }
.split { display: grid; gap: 8px; }
.split-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; }
.split-in { display: inline-flex; gap: 6px; align-items: center; }
.split-in input { width: 76px; min-height: 44px; font: inherit; font-size: 16px; text-align: right; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.split-owner { margin: 4px 0; font-weight: 800; color: var(--leaf); }
.split-owner.bad { color: var(--danger); }
.split .btn { justify-self: start; }
#join { max-width: 480px; }

/* ---------- safety ---------- */
.age { font-weight: 800; color: var(--ink); background: var(--surface-2); border-radius: 6px; padding: 1px 6px; font-size: 12.5px; }
.flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.flag { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-ink); }
.flag.red { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); color: var(--danger); }
.mod-card { background: var(--surface); border-radius: 16px; padding: 14px; box-shadow: var(--shadow-sm); display: grid; gap: 8px; margin-bottom: 10px; }
.mod-card.urgent { box-shadow: 0 0 0 2px var(--danger); }
.mod-top { display: flex; gap: 12px; align-items: center; }
.mod-card .mod { flex-wrap: wrap; align-items: center; }
.suspended-banner { display: flex; gap: 10px; align-items: flex-start; background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--ink); border-radius: 16px; padding: 12px 14px; margin-bottom: 14px; font-size: 14.5px; }
.suspended-banner .i { color: var(--danger); flex: none; margin-top: 2px; }

/* ---------- calls ---------- */
.call-screen { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-rows: 1fr auto; color: #fff;
  background: radial-gradient(120% 90% at 50% 0%, #2d3a33 0%, #121614 70%); font-family: var(--brand-font); }
.call-grid { position: absolute; inset: 0; display: grid; gap: 4px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.call-screen:not(.has-video) .call-grid { opacity: 0; pointer-events: none; }
.call-tile { position: relative; background: #000; overflow: hidden; }
.call-tile video { width: 100%; height: 100%; object-fit: cover; }
.call-tile-name { position: absolute; left: 12px; bottom: 12px; font-weight: 800; font-size: 14px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.call-info { position: relative; z-index: 1; align-self: start; justify-self: center; display: grid; justify-items: center; gap: 10px; margin-top: max(12vh, 60px); text-align: center; padding: 0 20px; }
.call-screen.has-video .call-info { margin-top: max(env(safe-area-inset-top), 16px); gap: 2px; }
.call-screen.has-video .call-av { display: none; }
.call-av { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; font: 900 50px var(--brand-font);
  background: linear-gradient(160deg, #7fd67f, #2e9437); box-shadow: 0 0 0 10px rgba(127, 214, 127, .12), 0 0 0 22px rgba(127, 214, 127, .06); }
.ringing .call-av { animation: ring-pulse 1.6s ease-in-out infinite; }
@keyframes ring-pulse { 50% { box-shadow: 0 0 0 16px rgba(127, 214, 127, .18), 0 0 0 34px rgba(127, 214, 127, .07); } }
@media (prefers-reduced-motion: reduce) { .ringing .call-av { animation: none; } }
.call-name { font-size: 28px; font-weight: 850; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.call-status { display: inline-flex; gap: 6px; align-items: center; font-size: 15px; font-weight: 700; color: rgba(255,255,255,.8); text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.call-local { position: absolute; z-index: 2; right: 14px; top: max(env(safe-area-inset-top), 14px); width: 104px; height: 150px; object-fit: cover;
  border-radius: 16px; background: #000; box-shadow: 0 6px 20px rgba(0,0,0,.4); transform: scaleX(-1); }
.call-controls { position: relative; z-index: 2; display: flex; justify-content: center; gap: 18px; padding: 22px 16px max(30px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0,0,0,.5), transparent); }
.call-controls.answer { gap: 44px; }
.call-btn { width: 62px; height: 62px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff;
  background: rgba(255,255,255,.16); backdrop-filter: blur(8px); transition: transform .12s, background .12s; }
.call-btn:hover { background: rgba(255,255,255,.26); }
.call-btn:active { transform: scale(.94); }
.call-btn .i { width: 27px; height: 27px; }
.call-btn.off { background: #fff; color: #121614; }
.call-btn.end { background: #e5483b; }
.call-btn.accept { background: #2fb34a; animation: ring-pulse-btn 1.4s ease-in-out infinite; }
@keyframes ring-pulse-btn { 50% { transform: scale(1.08); } }

/* tab bar: three tabs */
.tabbar a { max-width: 160px; }

/* the zoombad wordmark in the app header */
.brand img.wordmark { width: auto; height: 28px; display: block; }
.empty-mascot, .success .mascot { object-fit: contain; }

/* sign-in: the 6-digit code field: full width, big centred digits with room around them */
#codeStep:not([hidden]) { display: grid; gap: 8px; margin-top: 8px; }
#loginCode { width: 100%; min-height: 60px; padding: 14px 16px 14px calc(16px + .4em); font-size: 28px; font-weight: 700; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
#loginCode::placeholder { letter-spacing: .4em; color: #c7c7cc; font-weight: 600; }
.login .btn.wide { margin-top: 6px; }
#resendCode { justify-self: start; min-height: 36px; padding: 4px 0; font-size: 14px; }

/* ---------- app icons: custom illustrated icons, and a soft shine on every icon ---------- */
.app-icon.img { background: none; box-shadow: 0 1px 2px rgba(0,0,0,.10), 0 6px 14px -6px rgba(0,0,0,.30); overflow: visible; }
.app-icon.img > img { width: 100%; height: 100%; display: block; border-radius: inherit; }
.app-icon.xs.img { box-shadow: none; }
.app-icon:not(.img):not(.emoji)::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.30) 0%, rgba(255,255,255,0) 55%); }
.app-icon:not(.img):not(.emoji) > .i { filter: none; position: relative; }

/* sign-in form: more breathing room between the parts */
.login { gap: 14px; }
.login label { margin-bottom: -4px; }
.login input { min-height: 52px; padding: 14px 16px; }
#codeStep:not([hidden]) { gap: 12px; margin-top: 10px; }
#loginCode { min-height: 68px; padding: 16px 18px 16px calc(18px + .4em); }
#resendCode { margin-top: 2px; }
.login .btn.wide { margin-top: 10px; }

/* Connect page: warning for apps that only call themselves Claude/ChatGPT */
.unverified { background: #fff4e5; border: 1px solid #f5b971; color: #7a3d00; border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45; }
.unverified code { display: block; margin-top: 6px; word-break: break-all; font-size: 12.5px; color: #3d2000; }

/* ---------- tab bar: the chosen tab sits in a raised round bubble ---------- */
.tabbar { gap: 0; padding-top: 6px; background: var(--surface); border-top: 0; box-shadow: 0 -1px 0 var(--line), 0 -6px 18px rgba(0,0,0,.05); backdrop-filter: none; }
.tabbar a { position: relative; max-width: 120px; height: 52px; padding: 0; justify-content: center; gap: 0; background: none !important; border-radius: 0; color: var(--muted); -webkit-tap-highlight-color: transparent; }
.tabbar .tb-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; transition: transform .28s cubic-bezier(.3,1.4,.5,1), background-color .2s, box-shadow .2s; }
.tabbar a span.i { width: 25px; height: 25px; }
.tabbar a b { position: absolute; bottom: -3px; font-size: 12px; font-weight: 800; color: var(--ink); opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; white-space: nowrap; }
.tabbar a.on { color: var(--surface); }
.tabbar a.on .tb-ic { background: var(--ink); transform: translateY(-16px); box-shadow: 0 0 0 5px var(--surface), 0 6px 14px rgba(0,0,0,.18); }
.tabbar a.on b { opacity: 1; transform: none; }
.tabbar a:not(.on):active .tb-ic { background: var(--line); }
.tabbar a:focus-visible { outline: none; }
.tabbar a:focus-visible .tb-ic { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .tabbar .tb-ic, .tabbar a b { transition: none; } }

/* New app / Change: the steps from Copy to the app appearing */
.ask-steps { margin: 6px 0 12px; padding-left: 22px; display: grid; gap: 6px; font-size: 15px; line-height: 1.45; }
.ask-steps li::marker { color: var(--accent-text); font-weight: 800; }
.ask-open { display: flex; gap: 8px; margin-bottom: 16px; }
.ask-open .btn { flex: 1; }
.sheet .label { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 6px 0 8px; }
/* Change sheet: brand colours, not purple */
.edit-box { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }

/* toasts: wrap instead of being cut off, and never cover the tab bar */
.toast { white-space: normal; text-align: center; border-radius: 18px; line-height: 1.35; width: max-content; z-index: 40; } /* above sheets */
.toast button { flex: none; }
.toast.above-tabs { bottom: calc(84px + env(safe-area-inset-bottom)); }

/* sheets: a visible close button (desktop users don't swipe) */
/* (the panel is already absolutely positioned, which also anchors the close button) */
.sheet-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--line); color: var(--ink); cursor: pointer; }
.sheet-x .i { width: 18px; height: 18px; }
#sheetTitle { padding-right: 44px; }

.sheet .need { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }

/* app header wordmark: fox + live text, so it follows light and dark mode */
.brand.wordmark-live { display: flex; align-items: center; gap: 6px; margin: 0; }
.brand.wordmark-live img { width: 28px; height: 28px; object-fit: contain; }
.brand.wordmark-live span { font-family: var(--brand-font); font-weight: 900; font-size: 21px; letter-spacing: -.02em; color: var(--ink); text-transform: lowercase; }

/* links inside sheets use the brand colour (the default blue is unreadable in dark mode) */
.sheet a:not(.btn) { color: var(--accent-text); font-weight: 700; }
@media (prefers-color-scheme: dark) { .sheet a:not(.btn) { color: var(--accent); } }

/* moderation: enough to decide */
.mod-card { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 14px; margin: 10px 0; display: grid; gap: 8px; }
.mod-head { display: flex; gap: 12px; align-items: center; }
.mod-head > span { display: grid; gap: 2px; }
.mod-tag { margin: 0; font-weight: 700; }
.mod-desc { margin: 0; white-space: pre-wrap; max-height: 8em; overflow: auto; }
.mod-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mod-actions .mod { margin-left: auto; display: flex; gap: 8px; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.code-view { max-height: 60vh; overflow: auto; font-size: 12px; background: var(--bg); padding: 12px; border-radius: 12px; white-space: pre-wrap; word-break: break-word; }

/* plan tags and badges */
.plan-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 800; vertical-align: 1px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent-text); }
.badge-current { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 800; color: var(--leaf, #2e9e4f); white-space: nowrap; }
.badge-current .i { width: 15px; height: 15px; }
/* paywall perks: simple check rows, not boxes that look like buttons */
.perks li { background: none; border: 0; border-radius: 0; padding: 4px 0; display: flex; gap: 10px; align-items: flex-start; }
.perks li .i { color: var(--accent-text); flex: none; margin-top: 2px; }

/* Store polish */
.eyebrow.nowrap { white-space: nowrap; }
.store-empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 36px 16px; border: 1px dashed var(--line); border-radius: 20px; margin: 12px 0; }
.store-empty > .i { width: 36px; height: 36px; color: var(--accent-text); }
.store-empty p { margin: 0 0 8px; max-width: 34ch; }
.scard .scard-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chips { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 24px; }
.lp-head h1 { font-size: clamp(22px, 6vw, 28px); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* Dashboard welcome for new creators */
.dash-welcome { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; margin-bottom: 18px; }
.dash-welcome > .i { width: 28px; height: 28px; color: var(--accent-text); flex: none; }
.dash-welcome p { margin: 4px 0 8px; color: var(--muted); }
.dash-welcome ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.scard-foot { gap: 6px; flex-wrap: wrap; }
.scard-foot .muted { white-space: nowrap; }

/* home grid */
.grid-head { grid-column: 1 / -1; margin: 10px 2px -2px; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.tile-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tile-meta:empty { display: none; }
.code-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.code-links .link-btn { min-height: 40px; }

.trouble { margin-top: 8px; }
.trouble summary { cursor: pointer; font-weight: 700; color: var(--accent-text); }



/* tab bar (like the SBB app): icons in one row; the chosen one is a black circle with a grey ring,
   sitting in a round bite cut out of the white bar (soft corners where the bar bends), name below. */
:root { --tab-ring: #c7c7cc; }
@media (prefers-color-scheme: dark) { :root { --tab-ring: #48484a; } }
.tabbar { padding: 0; gap: 0; background: var(--surface); box-shadow: 0 -1px 12px rgba(0,0,0,.07); border-top: 0; }
.tabbar a { flex: 1; max-width: none; height: calc(76px + env(safe-area-inset-bottom)); padding: 0 0 env(safe-area-inset-bottom);
  justify-content: flex-start; align-items: center; isolation: isolate; }
.tabbar a .tb-ic { margin-top: 4px; }
.tabbar a b { top: 57px; bottom: auto; }
.tabbar a.on .tb-ic { transform: none; box-shadow: 0 0 0 6px var(--tab-ring); }
/* the bite: circle radius 36px around the circle's centre (28px below the bar's top), 14px soft corners */
.tabbar a::before {
  content: ""; position: absolute; z-index: -1; top: 0; left: 50%; width: 73px; height: 64px; transform: translateX(-50%);
  background:
    radial-gradient(circle at 50% 28px, var(--bg) 35.5px, transparent 36px) center top / 100% 100% no-repeat,
    radial-gradient(circle at 0 100%, transparent 13.5px, var(--bg) 14px) left top / 14px 14px no-repeat,
    radial-gradient(circle at 100% 100%, transparent 13.5px, var(--bg) 14px) right top / 14px 14px no-repeat;
  opacity: 0; transition: opacity .2s;
}
.tabbar a.on::before { opacity: 1; }
.tabbar a::after { content: none; }
.toast.above-tabs { bottom: calc(92px + env(safe-area-inset-bottom)); }
#home, #store, .dash { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }

/* ---------- My apps: an icon grid like a phone home screen ---------- */
/* 4 columns on phones (3 on very small ones), 6 from 560px; the bottom padding leaves room for the tab bar */
#home { max-width: 960px; padding: 24px 20px calc(110px + env(safe-area-inset-bottom)); }
.home-head { align-items: center; margin-bottom: 12px; }
@media (max-width: 360px) { .home-head { flex-wrap: wrap; } .home-head .head-actions { margin-left: auto; } }
.library-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; margin: 0 0 20px; }
.library-summary p { margin: 0; font-size: 14px; }
.updates-shortcut { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 8px 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent); background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 800; }
.updates-shortcut::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
#home.editing .library-summary { display: none; }
#grid, #myGames { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 8px; align-items: start; }
@media (max-width: 360px) { #grid, #myGames { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 560px) {
  #home { padding-top: 36px; padding-inline: 28px; }
  #grid, #myGames { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 32px 16px; }
}
#grid .tile { background: none; box-shadow: none; border: 0; border-radius: 0; padding: 0; gap: 7px; min-height: 0;
  align-items: center; text-align: center; -webkit-tap-highlight-color: transparent; }
#grid .tile:hover { box-shadow: none; }
#grid .tile .app-icon.lg, #myGames .tile .app-icon.lg, .fav-dock .tile .app-icon.lg { --s: 64px; transition: transform .15s; }
@media (min-width: 560px) { #grid .tile .app-icon.lg, #myGames .tile .app-icon.lg, .fav-dock .tile .app-icon.lg { --s: 76px; } }
#grid .tile:hover .app-icon { transform: translateY(-2px); }
#grid .tile:active .app-icon { transform: scale(.92); }
.data-backup { padding: 12px 0; border-top: 1px solid var(--line); }
.update-review-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.update-review-row b { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.update-review-row button { min-height: 44px; flex-shrink: 0; }
.app-menu-exit { margin-top: 16px; border-top: 1px solid var(--line); }
.app-menu-exit .menu-item { border-bottom: 0; }
#grid .tile-name, #myGames .tile-name { font-size: 12px; font-weight: 750; line-height: 1.35; margin: 2px 0 0; max-width: 100%; min-height: 2.7em;
  display: -webkit-box; white-space: normal; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
@media (min-width: 560px) { #grid .tile-name, #myGames .tile-name { font-size: 14px; } }
#grid .tile-meta { display: none; }
/* an update waiting: an orange dot on the icon (the name says it for screen readers) */
#grid .tile.has-update .app-icon::after { content: ""; position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2.5px solid var(--bg); }
#grid .src-badge { width: 22px; height: 22px; right: -5px; bottom: -5px; border-color: var(--bg); }
#grid .src-badge .i { width: 11px; height: 11px; }
#grid .grid-head { margin: 8px 2px 0; }

/* One consistent finish for illustrated, glyph and legacy emoji icons. */
.app-icon { border-radius: calc(var(--s) * .235); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 2px 3px rgba(0,0,0,.05), 0 6px 14px -8px rgba(0,0,0,.2); }
.app-icon.img { box-shadow: 0 2px 3px rgba(0,0,0,.05), 0 6px 14px -8px rgba(0,0,0,.2); }
.app-icon.img > img { object-fit: contain; }
.app-icon.xs, .app-icon.xs.img { box-shadow: none; }
.app-icon:not(.img):not(.emoji)::before { opacity: .65; }

/* tab bar, closer to the SBB app: rounder white corners, the bite hugs the ring, black icons */
:root { --tab-ring: #b9b9be; }
@media (prefers-color-scheme: dark) { :root { --tab-ring: #545458; } }
.tabbar a { color: var(--ink); }
.tabbar a .tb-ic { margin-top: 2px; }
.tabbar a b { top: 58px; font-weight: 600; }
.tabbar a.on .tb-ic { box-shadow: 0 0 0 6px var(--tab-ring); }
/* bite: radius 34px around the circle's centre (26px below the top); 22px rounded white corners */
.tabbar a::before {
  width: 88px; height: 60px;
  background:
    radial-gradient(circle at 50% 26px, var(--bg) 33.5px, transparent 34px) center top / 100% 100% no-repeat,
    radial-gradient(circle at 0 100%, transparent 21.5px, var(--bg) 22px) left top / 22px 22px no-repeat,
    radial-gradient(circle at 100% 100%, transparent 21.5px, var(--bg) 22px) right top / 22px 22px no-repeat;
}
/* a hairline along the curve, so the bite shows even on our light page */
.tabbar a::before {
  background:
    radial-gradient(circle at 50% 26px, var(--bg) 33.5px, var(--line) 34px, var(--line) 34.8px, transparent 35.3px) center top / 100% 100% no-repeat,
    radial-gradient(circle at 0 100%, transparent 20.7px, var(--line) 21.2px, var(--line) 22px, var(--bg) 22.5px) left top / 22px 22px no-repeat,
    radial-gradient(circle at 100% 100%, transparent 20.7px, var(--line) 21.2px, var(--line) 22px, var(--bg) 22.5px) right top / 22px 22px no-repeat;
}
.tabbar { box-shadow: 0 -0.5px 0 var(--line), 0 -2px 12px rgba(0,0,0,.05); }

/* make the bend obvious: the gap is a clearly darker grey than the white bar, and a bit wider */
:root { --tab-bite: #e3e3e8; }
@media (prefers-color-scheme: dark) { :root { --tab-bite: #000; } }
.tabbar a::before {
  width: 104px; height: 64px;
  background:
    radial-gradient(circle at 50% 26px, var(--tab-bite) 37.5px, transparent 38px) center top / 100% 100% no-repeat,
    radial-gradient(circle at 0 100%, transparent 23.5px, var(--tab-bite) 24px) left top / 24px 24px no-repeat,
    radial-gradient(circle at 100% 100%, transparent 23.5px, var(--tab-bite) 24px) right top / 24px 24px no-repeat;
}
.tabbar a.on .tb-ic { box-shadow: 0 0 0 6px var(--tab-ring), 0 4px 10px rgba(0,0,0,.18); }

/* tab bar, final: the white background is a separate layer with a real round hole cut out (SVG mask from app.js).
   A 1px line layer just above it traces the same edge, so the bend is visible on our light page. */
.tabbar { background: transparent; box-shadow: none; }
.tabbar::before, .tabbar::after { content: ""; position: absolute; left: 0; right: 0; pointer-events: none;
  -webkit-mask: var(--bar-mask) 0 0 / 100% 100% no-repeat; mask: var(--bar-mask) 0 0 / 100% 100% no-repeat; }
.tabbar::before { top: 0; bottom: 0; z-index: -1; background: var(--surface); }
.tabbar::after { top: -1px; bottom: 1px; z-index: -2; background: color-mix(in srgb, var(--ink) 16%, transparent); }
.tabbar a::before { content: none; }
.tabbar a .tb-ic { margin-top: 4px; }
.tabbar a { height: calc(82px + env(safe-area-inset-bottom)); }
.tabbar a .tb-ic { margin-top: 2px; }
.tabbar a b { top: 64px; }
.toast.above-tabs { bottom: calc(96px + env(safe-area-inset-bottom)); }

/* tab bar, smooth: one number (--bite-x) moves the hole and the circle together; the browser animates it */
@property --bite-x { syntax: '<length>'; inherits: true; initial-value: 0px; }
.tabbar { --bite-x: 0px; }
.tabbar.bite-ready { transition: --bite-x .42s cubic-bezier(.32, .72, 0, 1); }
.tabbar::before, .tabbar::after {
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--bite-x) - 57px) 0 / 114px 61px no-repeat, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--bite-x) - 57px) 0 / 114px 61px no-repeat, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.tabbar::after { top: -1px; bottom: 1px; }
/* the one black circle that slides from tab to tab */
.tab-ind { position: absolute; top: 2px; left: 0; width: 48px; height: 48px; border-radius: 50%; pointer-events: none; z-index: 0;
  background: var(--ink); box-shadow: 0 0 0 6px var(--tab-ring), 0 4px 10px rgba(0,0,0,.18);
  transform: translateX(calc(var(--bite-x) - 24px)); will-change: transform; }
.tabbar a { position: relative; z-index: 1; }
.tabbar a .tb-ic, .tabbar a.on .tb-ic { background: transparent !important; box-shadow: none !important; transform: none !important; }
.tabbar a .tb-ic { transition: color .3s; }
.tabbar a.on { color: var(--surface); }
.tabbar a b { transition: opacity .3s .05s, transform .3s .05s; }
@media (prefers-reduced-motion: reduce) { .tabbar.bite-ready { transition: none; } }

/* tab bar animation (like a train app): at the new tab the white bar dips down to make room and the black
   circle drops in from above; at the old tab the bar rises back and the circle shrinks away. */
@property --h0 { syntax: '<length>'; inherits: true; initial-value: 0px; }
@property --h1 { syntax: '<length>'; inherits: true; initial-value: 0px; }
@property --h2 { syntax: '<length>'; inherits: true; initial-value: 0px; }
.tabbar { --h0: 0px; --h1: 0px; --h2: 0px; transition: none; }
.tabbar:has(#tabApps.on) { --h0: 61px; }
.tabbar:has(#tabStore.on) { --h1: 61px; }
.tabbar:has(#tabDash.on) { --h2: 61px; }
.tabbar.bite-ready { transition: --h0 .5s cubic-bezier(.34, 1.36, .5, 1), --h1 .5s cubic-bezier(.34, 1.36, .5, 1), --h2 .5s cubic-bezier(.34, 1.36, .5, 1); }
.tabbar::before, .tabbar::after {
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%20preserveAspectRatio%3D'none'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--x0) - 57px) 0 / 114px var(--h0) no-repeat, url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%20preserveAspectRatio%3D'none'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--x1) - 57px) 0 / 114px var(--h1) no-repeat, url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%20preserveAspectRatio%3D'none'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--x2) - 57px) 0 / 114px var(--h2) no-repeat, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%20preserveAspectRatio%3D'none'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--x0) - 57px) 0 / 114px var(--h0) no-repeat, url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%20preserveAspectRatio%3D'none'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--x1) - 57px) 0 / 114px var(--h1) no-repeat, url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%20preserveAspectRatio%3D'none'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--x2) - 57px) 0 / 114px var(--h2) no-repeat, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
/* the circle belongs to each tab: hidden above, it drops in when the tab is chosen */
.tab-ind { display: none; }
.tabbar a .tb-ic { position: relative; }
.tabbar a .tb-ic::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; z-index: -1;
  background: var(--ink); box-shadow: 0 0 0 6px var(--tab-ring), 0 4px 10px rgba(0,0,0,.18);
  opacity: 0; transform: translateY(-34px) scale(.45);
  transition: transform .28s cubic-bezier(.4, 0, 1, 1), opacity .2s;
}
.tabbar a.on .tb-ic::before {
  opacity: 1; transform: none;
  transition: transform .5s .08s cubic-bezier(.34, 1.5, .5, 1), opacity .2s .08s;
}
.tabbar a .tb-ic .i { transition: color .25s; }
.tabbar a.on .tb-ic { color: var(--surface); transition: color .25s .18s; }
.tabbar a:not(.on) .tb-ic { color: var(--ink); }
@media (prefers-reduced-motion: reduce) {
  .tabbar.bite-ready { transition: none; }
  .tabbar a .tb-ic::before, .tabbar a.on .tb-ic::before { transition: none; }
}

/* ---------- your own home: greeting, wallpaper, favourites, arranging ---------- */
.home-date { margin: 2px 0 0; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: capitalize; }
#homeTitle { font-size: clamp(24px, 7vw, 32px); line-height: 1.1; margin: 2px 0 0; }
.add-name { padding: 2px 0; font-size: 14px; }
#wallpaper { position: fixed; inset: 0; z-index: -1; display: none; background-size: cover; background-position: center; }
body.has-wall:has(#home:not([hidden])) #wallpaper { display: block; }
body.has-wall #home .brand span, body.has-wall #home .home-date, body.has-wall #home #homeTitle, body.has-wall #home .add-name,
body.has-wall #home .grid-head, body.has-wall #home .tile-name, body.has-wall #home .fav-hint, body.has-wall #home .library-summary p { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
body.has-wall #home .src-badge, body.has-wall #home .tile.has-update .app-icon::after { border-color: transparent; }

.fav-dock { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 14px 8px 12px; margin: 0 0 22px;
  border-radius: 26px; background: color-mix(in srgb, var(--surface) 70%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border: 1px solid color-mix(in srgb, var(--ink) 6%, transparent); }
body.has-wall .fav-dock { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.3); }
.fav-dock .tile { background: none; box-shadow: none; padding: 0; gap: 6px; align-items: center; text-align: center; }
.fav-dock .tile-name { font-size: 12px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; display: block; }
.fav-dock .tile-meta { display: none; }
@media (min-width: 560px) { .fav-dock { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; padding: 16px; } .fav-dock .tile-name { font-size: 14px; } }
.fav-hint { grid-column: 1 / -1; margin: 0; text-align: center; font-size: 13px; color: var(--muted); }

/* arranging: icons wiggle, drag them, star favourites */
@keyframes wiggle { 0%, 100% { transform: rotate(-1.6deg); } 50% { transform: rotate(1.6deg); } }
#home.editing .tile .app-icon { animation: wiggle .28s ease-in-out infinite; }
#home.editing .tile:nth-child(2n) .app-icon { animation-delay: -.14s; }
#home.editing .tile { touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; position: relative; }
#home .tile { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
#home .tile.dragging { z-index: 10; cursor: grabbing; transition: none; }
#home .tile.dragging .app-icon { animation: none; box-shadow: 0 14px 30px rgba(0,0,0,.28); }
.fav-toggle { position: absolute; top: -6px; left: calc(50% - 40px); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); color: var(--muted); box-shadow: 0 1px 4px rgba(0,0,0,.25); z-index: 2; }
.fav-toggle .i { width: 14px; height: 14px; }
.fav-toggle.on { background: #ffcc00; color: #5a4300; }
@media (prefers-reduced-motion: reduce) { #home.editing .tile .app-icon { animation: none; } }

/* the "Your home screen" sheet */
.wall-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
.wall-swatch { border: 0; background: none; padding: 0; display: grid; gap: 4px; justify-items: center; cursor: pointer; color: var(--ink); }
.wall-swatch span { width: 100%; aspect-ratio: 9 / 16; border-radius: 12px; border: 1px solid var(--line); display: grid; place-items: center; background-size: cover; background-position: center; }
.wall-swatch span.photo { color: var(--muted); background-color: var(--bg); }
.wall-swatch small { font-size: 11.5px; font-weight: 700; }
.wall-swatch.on span { outline: 3px solid var(--accent); outline-offset: 2px; }
/* with a wallpaper, the page itself is see-through so the wallpaper shows */
html:has(body.has-wall #home:not([hidden])), body.has-wall:has(#home:not([hidden])) { background: transparent; }
#home .head-actions { flex: none; }
#home .head-actions .ghost, #editDone { white-space: nowrap; }
#home .home-head > div:first-child { min-width: 0; }

/* ---------- app lock: keypad and lock badge ---------- */
.lockpad { display: grid; justify-items: center; gap: 6px; padding: 4px 0 8px; outline: none; }
.lock-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--surface); }
.lock-ic .i { width: 24px; height: 24px; }
.lock-title { margin: 6px 0 0; font-size: 19px; font-weight: 800; text-align: center; }
.lock-sub { margin: 0; text-align: center; max-width: 30ch; font-size: 14px; }
.lock-dots { display: flex; gap: 14px; margin: 14px 0 2px; }
.lock-dots i { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--ink); transition: background .12s; }
.lock-dots i.on { background: var(--ink); }
@keyframes lock-shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
.lock-dots.shake { animation: lock-shake .38s; }
.lock-err { min-height: 18px; margin: 0; font-size: 13.5px; color: var(--danger); font-weight: 700; }
.lock-keys { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px 22px; margin: 4px 0 10px; }
.lock-keys button { width: 72px; height: 72px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--ink); font: 600 28px/1 var(--brand-font); cursor: pointer; display: grid; place-items: center; -webkit-tap-highlight-color: transparent; }
.lock-keys button:active { background: color-mix(in srgb, var(--ink) 20%, transparent); }
.lock-keys button[data-k="del"] { background: none; }
.lock-keys button .i { width: 26px; height: 26px; }
.lock-face { max-width: 280px; }
.lock-badge { position: absolute; left: -5px; bottom: -5px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--surface); border: 2px solid var(--bg); }
.lock-badge .i { width: 11px; height: 11px; }

/* tab bar with four tabs: My apps, Games, Store, Dashboard */
@property --h3 { syntax: '<length>'; inherits: true; initial-value: 0px; }
.tabbar { --h0: 0px; --h1: 0px; --h2: 0px; --h3: 0px; }
.tabbar:has(#tabApps.on) { --h0: 61px; --h1: 0px; --h2: 0px; --h3: 0px; }
.tabbar:has(#tabGames.on) { --h0: 0px; --h1: 61px; --h2: 0px; --h3: 0px; }
.tabbar:has(#tabStore.on) { --h0: 0px; --h1: 0px; --h2: 61px; --h3: 0px; }
.tabbar:has(#tabDash.on) { --h0: 0px; --h1: 0px; --h2: 0px; --h3: 61px; }
.tabbar.bite-ready { transition: --h0 .5s cubic-bezier(.34, 1.36, .5, 1), --h1 .5s cubic-bezier(.34, 1.36, .5, 1), --h2 .5s cubic-bezier(.34, 1.36, .5, 1), --h3 .5s cubic-bezier(.34, 1.36, .5, 1); }
.tabbar::before, .tabbar::after { -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%20preserveAspectRatio%3D'none'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--x0) - 57px) 0 / 114px var(--h0) no-repeat, url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%20preserveAspectRatio%3D'none'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--x1) - 57px) 0 / 114px var(--h1) no-repeat, url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%20preserveAspectRatio%3D'none'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--x2) - 57px) 0 / 114px var(--h2) no-repeat, url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%20preserveAspectRatio%3D'none'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--x3) - 57px) 0 / 114px var(--h3) no-repeat, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%20preserveAspectRatio%3D'none'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--x0) - 57px) 0 / 114px var(--h0) no-repeat, url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%20preserveAspectRatio%3D'none'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--x1) - 57px) 0 / 114px var(--h1) no-repeat, url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%20preserveAspectRatio%3D'none'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--x2) - 57px) 0 / 114px var(--h2) no-repeat, url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%20preserveAspectRatio%3D'none'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--x3) - 57px) 0 / 114px var(--h3) no-repeat, linear-gradient(#000 0 0); mask-composite: exclude; }
.tabbar a b { font-size: 11.5px; }
#games { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }

/* ---------- Games tab ---------- */
.games-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.games-head h1 { margin: 2px 0 0; font-size: 32px; }
.games-hero { position: relative; overflow: hidden; border-radius: 24px; padding: 20px; margin-bottom: 22px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #ff8a4c 0%, #ff4d01 35%, #7c2bd9 100%); }
.games-hero h2 { margin: 0 0 6px; font-size: 22px; }
.games-hero p { margin: 0 0 14px; opacity: .92; max-width: 34ch; }
.games-hero .btn { background: #fff; color: #1d1d1f; }
.games-hero .gh-art { position: absolute; right: -10px; bottom: -14px; width: 120px; height: 120px; opacity: .22; color: #fff; }
.games-hero .gh-art .i { width: 100%; height: 100%; }
.games h2.sec { font-size: 20px; margin: 22px 0 12px; }
.games .game-ideas { display: grid; gap: 8px; }
#games { max-width: 980px; margin: 0 auto; padding: 24px 16px calc(110px + env(safe-area-inset-bottom)); box-sizing: border-box; }
/* your games: the same icon grid as My apps */
/* columns, icon size and names are shared with My apps (see the icon grid above) */
#myGames { display: grid; }
#myGames .tile { background: none; box-shadow: none; border: 0; padding: 0; gap: 7px; min-height: 0; align-items: center; text-align: center; }

/* the required name step: no close button, no closing by tapping outside */
.sheet.must .sheet-x, .sheet.must .sheet-grab { display: none; }
.sheet.must .sheet-backdrop { pointer-events: none; }
.name-form .error { color: var(--danger); font-weight: 700; margin: 0; }

/* My apps in pages: swipe sideways like a phone home screen */
#grid.paged { display: flex; grid-template-columns: none; gap: 0; overflow-x: auto; overflow-y: visible; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; margin-inline: -20px; padding-bottom: 6px; }
#grid.paged::-webkit-scrollbar { display: none; }
#grid.paged .home-page { flex: 0 0 100%; box-sizing: border-box; padding-inline: 20px; scroll-snap-align: start; scroll-snap-stop: always;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 8px; align-content: start; }
@media (max-width: 360px) { #grid.paged .home-page { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 560px) { #grid.paged { margin-inline: -28px; } #grid.paged .home-page { padding-inline: 28px; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 32px 16px; } }
.page-dots { display: flex; justify-content: center; gap: 8px; margin: 14px 0 4px; }
.page-dots .dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--ink) 25%, transparent); cursor: pointer; transition: background .2s, transform .2s; }
.page-dots .dot.on { background: var(--ink); transform: scale(1.15); }
body.has-wall #home .page-dots .dot { background: rgba(255,255,255,.45); }
body.has-wall #home .page-dots .dot.on { background: #fff; }
#grid.paged { align-items: flex-start; transition: height .25s ease; }

/* quick open: the phone's own apps */
.quick-row { display: flex; gap: 6px; justify-content: space-between; margin: 0 0 22px; padding: 10px 8px; border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 70%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border: 1px solid color-mix(in srgb, var(--ink) 6%, transparent); overflow-x: auto; scrollbar-width: none; }
.quick-row::-webkit-scrollbar { display: none; }
body.has-wall .quick-row { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.3); }
.quick-tile { flex: 1 0 56px; max-width: 80px; border: 0; background: none; padding: 0; display: grid; justify-items: center; gap: 5px; cursor: pointer; color: var(--ink); -webkit-tap-highlight-color: transparent; }
.quick-tile .app-icon.md { --s: 46px; }
.quick-tile .q-name { font-size: 11px; font-weight: 750; white-space: nowrap; }
.quick-tile:active .app-icon { transform: scale(.92); }
body.has-wall #home .quick-tile .q-name { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.quick-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.quick-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; cursor: pointer; }
.quick-opt .q-name { flex: 1; text-align: left; }
.quick-opt > .i { width: 18px; height: 18px; color: var(--muted); }
.quick-opt.on { border-color: var(--accent); }
.quick-opt.on > .i { color: var(--accent-text); }


/* ================= tab bar animation, final ================= */
/* Each tab has a hole in the white bar. The chosen tab's hole sinks into the bar from above (its true shape,
   never stretched); the old one rises back out. Then the black circle drops into the new hole with a small,
   soft bounce, while the old circle shrinks away where it is. Only one number per tab moves (--yN). */
@property --y0 { syntax: '<length>'; inherits: true; initial-value: -62px; }
@property --y1 { syntax: '<length>'; inherits: true; initial-value: -62px; }
@property --y2 { syntax: '<length>'; inherits: true; initial-value: -62px; }
@property --y3 { syntax: '<length>'; inherits: true; initial-value: -62px; }
.tabbar { --y0: -62px; --y1: -62px; --y2: -62px; --y3: -62px; transition: none; }
.tabbar:has(#tabApps.on) { --y0: 0px; }
.tabbar:has(#tabGames.on) { --y1: 0px; }
.tabbar:has(#tabStore.on) { --y2: 0px; }
.tabbar:has(#tabDash.on) { --y3: 0px; }
.tabbar.bite-ready { transition: --y0 .38s cubic-bezier(.22, .9, .3, 1), --y1 .38s cubic-bezier(.22, .9, .3, 1), --y2 .38s cubic-bezier(.22, .9, .3, 1), --y3 .38s cubic-bezier(.22, .9, .3, 1); }
.tabbar::before, .tabbar::after {
  -webkit-mask: linear-gradient(#000 0 0), url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--x0) - 57px) var(--y0) / 114px 61px no-repeat, url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--x1) - 57px) var(--y1) / 114px 61px no-repeat, url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--x2) - 57px) var(--y2) / 114px 61px no-repeat, url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--x3) - 57px) var(--y3) / 114px 61px no-repeat;
  -webkit-mask-composite: source-out, source-over, source-over, source-over, source-over;
  mask: linear-gradient(#000 0 0), url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--x0) - 57px) var(--y0) / 114px 61px no-repeat, url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--x1) - 57px) var(--y1) / 114px 61px no-repeat, url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--x2) - 57px) var(--y2) / 114px 61px no-repeat, url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'114'%20height%3D'61'%20viewBox%3D'0%200%20114%2061'%3E%3Cpath%20d%3D'M0.14%200A22%2022%200%200%201%2022.09%2023.54A35%2035%200%201%200%2091.91%2023.54A22%2022%200%200%201%20113.86%200Z'%2F%3E%3C%2Fsvg%3E") calc(var(--x3) - 57px) var(--y3) / 114px 61px no-repeat;
  mask-composite: subtract, add, add, add, add;
}

/* the circle: drops in a moment after the hole opens; the old one shrinks where it is */
.tabbar a .tb-ic::before {
  opacity: 0; transform: scale(.5);
  transition: transform .16s cubic-bezier(.4, 0, 1, 1), opacity .14s linear;
  will-change: transform, opacity;
}
.tabbar a.on .tb-ic::before {
  opacity: 1; transform: none;
  animation: tab-drop .46s .08s cubic-bezier(.3, 1.32, .55, 1) both;
  transition: none;
}
@keyframes tab-drop {
  from { opacity: 0; transform: translateY(-22px) scale(.62); }
  35% { opacity: 1; }
  to { opacity: 1; transform: none; }
}
/* icon turns white as the circle arrives; back to black at once when leaving */
.tabbar a .tb-ic { transition: color .12s linear; }
.tabbar a.on .tb-ic { transition: color .2s .18s linear; }
/* the name fades in under the new circle, out quickly under the old one */
.tabbar a b { transition: opacity .12s linear, transform .12s linear; }
.tabbar a.on b { transition: opacity .25s .14s ease-out, transform .3s .14s cubic-bezier(.22, .9, .3, 1); }
/* no animation on the very first draw */
.tabbar:not(.bite-ready) a.on .tb-ic::before { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .tabbar.bite-ready { transition: none; }
  .tabbar a .tb-ic::before, .tabbar a.on .tb-ic::before { animation: none; transition: none; }
}

/* ---------- the You tab: profile, creator numbers, settings ---------- */
#accountBtn, .head-actions .avatar { display: none !important; }
.you-card { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); margin: 6px 0 14px; }
.you-av { flex: none; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font: 800 26px/1 var(--brand-font); }
.you-main { min-width: 0; flex: 1; display: grid; gap: 3px; }
.you-name { margin: 0; font-size: 21px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.you-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.you-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.you-pills .plan-pill { margin: 0; }
.credit-pill { display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 800; cursor: pointer;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent-text); }
.credit-pill .i { width: 14px; height: 14px; }
.you-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.you-stat { border: 1px solid var(--line); background: var(--surface); border-radius: 18px; padding: 12px 8px; display: grid; gap: 2px; text-align: center; cursor: pointer; color: var(--ink); }
.you-stat b { font: 800 19px/1.2 var(--brand-font); }
.you-stat span { font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.you-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.you-tile { border: 1px solid var(--line); background: var(--surface); border-radius: 18px; padding: 14px; display: grid; gap: 3px; justify-items: start; text-align: left; cursor: pointer; color: var(--ink); }
.you-tile > .i { width: 22px; height: 22px; color: var(--accent-text); margin-bottom: 4px; }
.you-tile b { font-size: 15px; }
.you-tile small { color: var(--muted); font-size: 12.5px; }
.you-tile:active, .you-stat:active { transform: scale(.98); }
h2.you-sec { font-size: 20px; margin: 8px 0 6px; }
.you-settings { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 4px 14px 14px; }
.you-settings .section-title:first-child { margin-top: 10px; }

/* ---------- a calmer My apps: apps first ---------- */
#home .home-head { align-items: center; gap: 10px; margin-bottom: 14px; }
#homeTitle { font-size: clamp(22px, 6.6vw, 28px); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#home .home-head > div:first-child { flex: 1; min-width: 0; }
.round-plus { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--ink); color: var(--surface); box-shadow: 0 2px 8px rgba(0,0,0,.15); flex: none; }
.round-plus .i { width: 20px; height: 20px; }
.updates-pill { border: 0; border-radius: 999px; padding: 7px 11px; font-size: 12.5px; font-weight: 800; cursor: pointer; white-space: nowrap;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent-text); display: inline-flex; align-items: center; gap: 6px; }
.updates-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
body.has-wall #home .updates-pill { background: rgba(255,255,255,.9); }
/* the dock: one row, scroll sideways when full */
.quick-row { justify-content: flex-start; gap: 4px; margin-bottom: 18px; scroll-snap-type: x proximity; }
.quick-tile { flex: 0 0 calc((100% - 16px) / 5.4); max-width: none; scroll-snap-align: start; } /* the next one peeks out: swipe for more */
.quick-tile .q-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* the install hint: one slim line */
.install-banner { padding: 8px 10px 8px 12px; gap: 10px; border-radius: 16px; margin-bottom: 14px; align-items: center; }
.install-banner img { width: 24px; height: 24px; }
.install-banner b { font-size: 14px; }
.install-banner > div > span { display: none; }
.install-banner .btn.small { padding: 5px 12px; }
/* pop-ups: anchored to the bottom, above the tab bar, with room for the iPhone home bar */
.sheet { z-index: 30; }
.sheet-panel { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }

/* updates: a row in You, and a small dot on the You tab */
.you-updates { width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px 16px; margin: 0 0 10px; border-radius: 18px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); color: var(--ink); text-align: left; }
.you-updates > .i:first-child { width: 22px; height: 22px; color: var(--accent-text); }
.you-updates b { flex: 1; font-size: 15px; }
.you-updates .you-count { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 13px; font-weight: 800; }
.you-updates > .i:last-child { width: 18px; height: 18px; color: var(--muted); }
#tabDash .tb-ic::after { content: ''; position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  border: 2px solid var(--surface); opacity: 0; transition: opacity .2s; }
#tabDash.has-dot .tb-ic::after { opacity: 1; }
#tabDash.on .tb-ic::after { border-color: var(--ink); }

/* long-press menu and the "copied" tip */
.qm-head { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; }
.qm-head b { font-size: 16px; }
.sheet:has(.qm-head) #sheetTitle { display: none; }
.ask-tip { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0; padding: 10px 12px; border-radius: 14px; font-size: 14px; line-height: 1.4;
  background: color-mix(in srgb, var(--leaf, #2e9e4f) 12%, var(--surface)); }
.ask-tip .i { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--leaf, #2e9e4f); }
/* icon grid spacing like a phone home screen: one-line names, tight rows */
#grid, #myGames, #grid.paged .home-page { row-gap: 16px; column-gap: 8px; }
#grid .tile, #myGames .tile { gap: 6px; }
#grid .tile-name, #myGames .tile-name { min-height: 0; display: block; white-space: nowrap; -webkit-line-clamp: unset; line-height: 1.25; font-size: 12px; }
@media (min-width: 560px) { #grid, #myGames, #grid.paged .home-page { row-gap: 24px; column-gap: 16px; } #grid .tile-name, #myGames .tile-name { font-size: 13px; } }

/* an app being made or changed: a faded icon with a filling circle, like a phone installing an app */
@property --pend { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
.tile.pending { pointer-events: none; }
.tile.pending .app-icon > img, .tile.pending .app-icon > .i { opacity: .55; filter: saturate(.6); }
.pend { position: absolute; inset: 0; border-radius: inherit; background: rgba(0,0,0,.38); display: grid; place-items: center; z-index: 2; }
.pend i { width: 44%; aspect-ratio: 1; border-radius: 50%; box-sizing: border-box; border: 2.5px solid rgba(255,255,255,.95);
  background: conic-gradient(rgba(255,255,255,.95) var(--pend), transparent 0) content-box; padding: 3px;
  animation: pend-fill 120s cubic-bezier(.12, .7, .25, 1) forwards; }
@keyframes pend-fill { from { --pend: 2%; } to { --pend: 94%; } }
.tile.pending .tile-name { color: var(--muted); }
body.has-wall #home .tile.pending .tile-name { color: rgba(255,255,255,.85); }
@media (prefers-reduced-motion: reduce) { .pend i { animation-duration: 1ms; } }

/* Change this app: the paid button, then the free way */
.edit-free { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.edit-free .ask-open { margin-bottom: 0; }
.center { text-align: center; }

/* You tab: Settings folded into one row */
.you-more { margin-top: 18px; border-radius: 18px; background: var(--card, #fff); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.you-more > summary { list-style: none; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px; cursor: pointer; font-weight: 800; font-size: 17px; }
.you-more > summary::-webkit-details-marker { display: none; }
.you-more > summary > span:not(.i) { flex: 1; text-align: left; }
.you-more > summary .i:last-child { transition: transform .2s ease; color: var(--muted); }
.you-more[open] > summary .i:last-child { transform: rotate(180deg); }
.you-more .you-settings { padding: 0 12px 12px; }

/* no red dots on app icons (like the App Store, updates wait quietly in You → App updates) */
#grid .tile.has-update .app-icon::after, #home .tile.has-update .app-icon::after { display: none; }
/* quick row: whole icons only — 5 per screen, swipe for the next 5 */
.quick-row { scroll-snap-type: x mandatory; }
.quick-tile { flex-basis: calc((100% - 16px) / 5); scroll-snap-align: start; }

/* Phone keypad (iPhone and computers: websites can't open the Phone app itself) */
.dialer { display: grid; justify-items: center; gap: 14px; padding-bottom: 6px; }
.dial-num { width: 100%; border: 0; background: none; text-align: center; font: inherit; font-size: 34px; font-weight: 700; letter-spacing: .5px; color: var(--ink); min-height: 48px; outline: none; }
.dial-keys { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px 26px; }
.dial-keys button { width: 76px; height: 76px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--ink); display: grid; place-content: center; justify-items: center; cursor: pointer; font: inherit; -webkit-tap-highlight-color: transparent; }
.dial-keys button:active { background: color-mix(in srgb, var(--ink) 22%, transparent); }
.dial-keys b { font-size: 32px; font-weight: 500; line-height: 1; }
.dial-keys small { font-size: 9px; font-weight: 800; letter-spacing: 2px; min-height: 11px; color: var(--muted); }
.dial-bottom { display: grid; grid-template-columns: repeat(3, 76px); gap: 26px; align-items: center; justify-items: center; }
.dial-call { width: 76px; height: 76px; border-radius: 50%; border: 0; background: #34c759; color: #fff; display: grid; place-items: center; cursor: pointer; }
.dial-call .i { width: 32px; height: 32px; background: #fff; }
.dial-del { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 12px; }
.dial-del .i { width: 26px; height: 26px; }

/* App updates list */
.upd-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.upd-row:last-of-type { border-bottom: 0; }
.upd-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.upd-main b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upd-main small { color: var(--muted); font-size: 13px; line-height: 1.3; }
.upd-btn { border-radius: 999px; min-width: 86px; }
.upd-btn.done { background: none; color: var(--muted); box-shadow: none; }

/* a locked app is hidden while Zoombad is in the background, until the code is entered again */
body.lock-cover #frame { visibility: hidden; }

/* Folders: one icon holding several apps (a frosted square with tiny icons, like on a phone) */
.folder-icon { background: color-mix(in srgb, var(--surface) 62%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid color-mix(in srgb, var(--ink) 8%, transparent); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 6px 14px -8px rgba(0,0,0,.25); padding: 12%; box-sizing: border-box; }
body.has-wall #home .folder-icon { background: rgba(255,255,255,.32); border-color: rgba(255,255,255,.35); }
.fgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9%; width: 100%; height: 100%; align-content: start; }
.fgrid .app-icon.xs { width: 100%; height: auto; aspect-ratio: 1; --s: 14px; border-radius: 26%; box-shadow: none; }
.fgrid .app-icon.xs > .i { width: 58%; height: 58%; }
.fgrid .app-icon .emo { font-size: 9px; }
/* the open folder */
.folder-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 8px; padding: 6px 0 14px; }
.folder-grid .tile { background: none; box-shadow: none; border: 0; padding: 0; display: grid; justify-items: center; gap: 7px; min-height: 0; cursor: pointer; color: var(--ink); }
.folder-grid .tile .app-icon.lg { --s: 64px; }
.folder-grid .tile .tile-meta { display: none; }
.folder-grid .tile .tile-name { font-size: 12px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-rename { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; padding: 6px 0; }
/* while arranging: hold an app over another to make a folder */
.tile.merge-target .app-icon { transform: scale(1.14); box-shadow: 0 0 0 3px var(--accent, #ff5a1f), 0 8px 20px -6px rgba(0,0,0,.35); transition: transform .15s; }
.folder-icon { background: color-mix(in srgb, var(--ink) 9%, var(--surface)); padding: 11%; }
.fgrid { gap: 8%; }
body.has-wall #home .folder-icon { background: rgba(255,255,255,.3); }
.name-form .guardian { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 600; line-height: 1.35; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--accent, #ff5a1f) 10%, var(--surface)); }
.name-form .guardian[hidden] { display: none; }
.name-form .guardian input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; }
.name-form input[readonly] { opacity: .7; }

/* Privacy check (public/privacy.js) */
.pc-app { display: flex; gap: 10px; align-items: center; margin: 10px 0 4px; }
.pc-app b { font-size: 15px; }
.person-av .i { width: 18px; height: 18px; }
.person-av .app-icon.sm, .person-av.pc-icon-av { background: transparent; }
.pc-actions { display: grid; justify-items: end; gap: 0; flex: none; }
.pc-actions .link-btn { min-height: 36px; padding: 4px 0; text-align: right; }
.pc-log { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; background: var(--surface-2); border-radius: 16px; overflow: hidden; }
.pc-log li { padding: 10px 14px; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.pc-log li + li { border-top: 1px solid var(--line); }
.pc-log small { color: var(--muted); }
.pc-promise { display: flex; gap: 8px; align-items: flex-start; margin: 18px 0 6px; color: var(--muted); font-size: 13.5px; }
.pc-promise .i { flex: none; width: 18px; height: 18px; color: var(--good, var(--accent)); }

/* Opening an app: feedback before its code arrives; the tile is marked without moving */
.app-loading { position: fixed; left: 50%; bottom: calc(108px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 25; display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 32px);
  padding: 12px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow); font-size: 14px; pointer-events: none; }
.app-loading[hidden] { display: none; }
.app-loading .dot-pulse { flex: none; }
#appLoadingText { overflow-wrap: anywhere; }
.runner-open .app-loading { bottom: calc(24px + env(safe-area-inset-bottom)); }
.tile.is-opening { border-radius: 16px; background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }

/* Change sheet: manual copy, and the app's original chat */
.change-request { width: 100%; min-height: 120px; margin: 8px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px;
  font: inherit; font-size: 13px; line-height: 1.5; background: var(--surface); color: var(--ink); }
.change-request[hidden] { display: none; }

/* Reduced Motion: no pulses (connecting, calls) either */
@media (prefers-reduced-motion: reduce) {
  .dot-pulse, .call-btn.accept { animation: none; }
}

/* ---------- tab bar: calm switching ----------
   Only the outline moves: the curved hole glides to the chosen tab in about 200 ms, without a bounce.
   Icons, the circle behind them and the names switch instantly: no movement, scaling or fading. */
.tabbar.bite-ready { transition: --y0 .2s cubic-bezier(.25, .8, .25, 1), --y1 .2s cubic-bezier(.25, .8, .25, 1), --y2 .2s cubic-bezier(.25, .8, .25, 1), --y3 .2s cubic-bezier(.25, .8, .25, 1); }
.tabbar a .tb-ic::before, .tabbar a.on .tb-ic::before { animation: none !important; transition: none !important; transform: none !important; will-change: auto; }
.tabbar a .tb-ic, .tabbar a.on .tb-ic, .tabbar a .tb-ic .i { transition: none !important; }
.tabbar a b, .tabbar a.on b { transition: none !important; }
.tabbar a.on b { transform: none; }

/* back from ChatGPT without Zoombad: the steps to switch it on */
.help-steps { margin: 4px 0 12px; padding-left: 22px; display: grid; gap: 8px; line-height: 1.4; }
.help-steps b { font-weight: 650; }

/* Updating / making: Zoombad's own look. The icon turns gray and fills back up with its colour from the
   bottom (a glowing level line that rises as the AI works), while a small orange comet circles its edge. */
@property --pend-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.tile.pending .app-icon > img, .tile.pending .app-icon > .i { opacity: 1; filter: none; }
.pend { background: none; display: block; overflow: hidden; }
/* the part still to fill: gray, a little dimmed */
.pend::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: calc(100% - var(--pend));
  background: rgba(30, 30, 34, .42); -webkit-backdrop-filter: grayscale(1) brightness(.92); backdrop-filter: grayscale(1) brightness(.92);
  box-shadow: 0 1.5px 0 rgba(255, 255, 255, .95), 0 0 10px 2px color-mix(in srgb, var(--accent) 70%, transparent);
  animation: pend-fill 120s cubic-bezier(.12, .7, .25, 1) var(--pend-delay, 0s) forwards, pend-wave 2.4s ease-in-out infinite; }
@supports ((backdrop-filter: grayscale(1)) or (-webkit-backdrop-filter: grayscale(1))) { .pend::before { background: rgba(30, 30, 34, .18); } }
@keyframes pend-wave { 0%, 100% { border-bottom-left-radius: 0 0; border-bottom-right-radius: 40% 3px; } 50% { border-bottom-left-radius: 40% 3px; border-bottom-right-radius: 0 0; } }
/* the comet circling the edge */
.pend i { position: absolute; inset: 0; width: auto; aspect-ratio: auto; border: 0; padding: 2.5px; border-radius: inherit; box-sizing: border-box;
  background: conic-gradient(from var(--pend-a), transparent 0 70%, color-mix(in srgb, var(--accent) 30%, transparent) 82%, var(--accent) 95%, #fff 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
  filter: drop-shadow(0 0 3px var(--accent)); animation: pend-orbit 1.8s linear infinite !important; }
@keyframes pend-orbit { to { --pend-a: 360deg; } }
.tile.pending .tile-name { background: linear-gradient(90deg, var(--muted) 0 40%, var(--accent) 50%, var(--muted) 60% 100%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: pend-text 2.4s linear infinite; }
body.has-wall #home .tile.pending .tile-name { background-image: linear-gradient(90deg, rgba(255,255,255,.85) 0 40%, #fff 50%, rgba(255,255,255,.85) 60% 100%); color: transparent; }
@keyframes pend-text { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .pend::before { animation: pend-fill 1ms forwards; }
  .pend i { animation: none !important; --pend-a: 120deg; }
  .tile.pending .tile-name { animation: none; }
}

/* Tab bar, liquid (like the SBB app): the white bar, its notch and the black circle are one SVG drawn by
   TabLiquid in app.js. On a tab change the notch flows across and the circle moves like a drop of ink. */
.tabbar::before, .tabbar::after { display: none !important; }
.tabbar a .tb-ic::before { display: none !important; }
.tabbar .tb-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; overflow: visible; }
.tabbar .tb-fill { fill: var(--surface); }
.tabbar .tb-line { fill: none; stroke: color-mix(in srgb, var(--ink) 16%, transparent); stroke-width: 1; transform: translateY(-.5px); }
.tabbar .tb-ring { fill: var(--tab-ring); }
.tabbar .tb-ink { fill: var(--ink); }
.tabbar .tb-bg.moving .tb-ring, .tabbar .tb-bg.moving .tb-ink { filter: url(#tbGoo); }
.tabbar a { z-index: 1; }
.tabbar a.on .tb-ic { color: var(--surface); }
.tabbar.tb-moving a.on .tb-ic { color: var(--ink); }

/* a longer sign-in code (the reviewer test account): smaller, closer digits so all of them stay visible */
#loginCode.long, #loginCode.long::placeholder { font-size: 21px; letter-spacing: .12em; }
#loginCode.long { padding-left: calc(12px + .12em); padding-right: 12px; }
