/* Sary-OS Lite: one stylesheet for the phone interface.
 * Calm and still by default: no blur, no video, no motion beyond short fades.
 * Effects (the particle field behind every screen) are opt-in from Account;
 * the LiveLoop stage always keeps its field. */
:root {
  --bg: #05070d;
  --bg-2: #0a0e18;
  --surface: #0f1422;
  --surface-2: #151b2c;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #eef2ff;
  --muted: #8d95ab;
  --faint: #5c6479;
  --accent: #63f5ff;
  --accent-2: #1a4bff;
  --accent-ink: #03141a;
  --accent-soft: rgba(99, 245, 255, .12);
  --accent-line: rgba(99, 245, 255, .5);
  --toast: #1b2236;
  --code: #0b0f1a;
  --spin: rgba(255, 255, 255, .2);
  --danger: #ff6b7d;
  --ok: #5ef2a8;
  --radius: 18px;
  --radius-sm: 12px;
  --tab-h: 62px;
  --top-h: 54px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 400 16px/1.45 var(--font); }
body { overflow: hidden; overscroll-behavior: none; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent); }
[hidden] { display: none !important; }
svg { display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- app frame ---------- */
#lite { position: fixed; inset: 0; display: flex; flex-direction: column; padding-left: var(--safe-l); padding-right: var(--safe-r); }
#backdrop { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .8s ease; }
body.fx-on #backdrop { opacity: .55; }
.topbar { position: relative; z-index: 3; flex: none; height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) 14px 0; display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: baseline; gap: 6px; font: 700 18px/1 var(--mono); letter-spacing: .01em; white-space: nowrap; }
.brand b { font-weight: 700; }
.brand span { color: var(--accent); }
.brand small { font: 600 10px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-2); border-radius: 99px; padding: 4px 7px; transform: translateY(-2px); }
.topbar .spacer { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill svg { width: 15px; height: 15px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); display: grid; place-items: center; font-weight: 700; font-size: 14px; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
main#views { position: relative; z-index: 1; flex: 1; min-height: 0; }
.view { position: absolute; inset: 0; display: flex; flex-direction: column; opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.view.active { opacity: 1; pointer-events: auto; }

/* ---------- tab bar ---------- */
.tabbar { position: relative; z-index: 3; flex: none; display: grid; grid-template-columns: repeat(4, 1fr); height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: var(--bg); border-top: 1px solid var(--line); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--faint); transition: color .15s; }
.tab svg { width: 23px; height: 23px; }
.tab.active { color: var(--text); }
.tab.active svg { color: var(--accent); }
body.keyboard .tabbar { display: none; }

/* ---------- shared controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 99px; font-weight: 650; font-size: 15px; background: var(--surface-2); border: 1px solid var(--line-2); transition: transform .08s, opacity .15s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg { width: 18px; height: 18px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--text); flex: none; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:active { background: var(--surface-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; flex: none; }
.chip svg { width: 14px; height: 14px; opacity: .8; }
.chip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 3px; }
.segmented button { height: 36px; border-radius: 99px; font-size: 14px; font-weight: 650; color: var(--muted); }
.segmented button.on { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.input { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line-2); outline: none; font-size: 16px; }
.input:focus { border-color: var(--accent-line); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { margin: auto; max-width: 30ch; text-align: center; color: var(--muted); padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty b { color: var(--text); font-size: 17px; }
.empty svg { width: 34px; height: 34px; color: var(--faint); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--spin); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- composer (one shell for LiveLoop, Chat and Create) ---------- */
.composer { flex: none; padding: 8px 12px 10px; position: relative; z-index: 2; }
.composer .box { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 22px; padding: 10px 10px 8px 14px; }
.composer textarea { width: 100%; resize: none; border: 0; outline: none; background: transparent; font-size: 16px; line-height: 1.4; max-height: 132px; min-height: 24px; padding: 2px 0; }
.composer textarea::placeholder { color: var(--faint); }
.composer .row { display: flex; align-items: center; gap: 8px; }
.composer .row .chips { flex: 1; min-width: 0; }
.composer .note-line { font-size: 12px; line-height: 1.35; color: var(--muted); padding: 0 4px 2px; }
.composer .note-line.warn { color: var(--danger); }
.send { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; transition: transform .08s, opacity .15s; }
.send svg { width: 20px; height: 20px; }
.send:active { transform: scale(.92); }
.send[disabled] { opacity: .35; }
.send.stop { background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); }

/* ---------- sheets ---------- */
.sheet-scrim { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .2s; }
.sheet-scrim.show { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: calc(100% - var(--safe-t) - 24px); display: flex; flex-direction: column; background: var(--bg-2); border-top: 1px solid var(--line-2); border-radius: 24px 24px 0 0; padding: 8px 0 var(--safe-b); transform: translateY(100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1); }
.sheet.show { transform: none; }
.sheet .grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 2px auto 6px; flex: none; }
.sheet header { display: flex; align-items: center; gap: 8px; padding: 4px 10px 8px 18px; flex: none; }
.sheet header h2 { margin: 0; font-size: 18px; flex: 1; }
.sheet .body { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
/* Rows keep their size and the sheet scrolls (they used to shrink to fit the screen). */
.sheet .body > * { flex-shrink: 0; }
.list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list .item { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; width: 100%; }
.list .item:last-child { border-bottom: 0; }
.list .item:active { background: var(--surface-2); }
.list .item .grow { flex: 1; min-width: 0; }
.list .item .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .item .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .item.sel .title { color: var(--accent); }
.list .item svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.list .item .check { color: var(--accent); }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 4px 4px -6px; }
.switch { position: relative; width: 50px; height: 30px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line-2); flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #c9cfdd; transition: transform .18s; }
.switch.on { background: var(--accent); border-color: transparent; }
.switch.on::after { transform: translateX(20px); background: #fff; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 84px); z-index: 40; transform: translate(-50%, 10px); max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 14px; background: var(--toast); color: var(--text); border: 1px solid var(--line-2); font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(255, 107, 125, .5); }

/* ---------- LiveLoop ---------- */
#view-liveloop .stage { position: relative; flex: 1; min-height: 0; margin: 0 12px; border-radius: 22px; overflow: hidden; background: #03050a; border: 1px solid var(--line); }
#view-liveloop .stage canvas.field { position: absolute; inset: 0; width: 100%; height: 100%; }
#view-liveloop .stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; opacity: 0; transition: opacity .35s; }
#view-liveloop .stage iframe.ready { opacity: 1; }
#view-liveloop .stage-bar { display: flex; align-items: center; gap: 8px; padding: 0 12px 8px; }
#view-liveloop .stage-bar .project { flex: 1; min-width: 0; justify-content: flex-start; }
#view-liveloop .stage-bar .project span { overflow: hidden; text-overflow: ellipsis; }
/* Voice: idle is a plain mic; a call glows, and pulses while LiveLoop speaks. */
#view-liveloop .voice-btn { position: relative; }
#view-liveloop .voice-btn[data-state="connecting"] { color: var(--accent); opacity: .7; animation: voice-wait 1.2s ease-in-out infinite; }
#view-liveloop .voice-btn:is([data-state="live"],[data-state="speaking"]) { color: var(--accent-ink); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
#view-liveloop .voice-btn[data-state="speaking"] { animation: voice-speak .9s ease-in-out infinite; }
#view-liveloop .voice-time { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 8px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
@keyframes voice-wait { 50% { opacity: .35; } }
@keyframes voice-speak { 50% { box-shadow: 0 0 0 9px var(--accent-soft); } }
.stage-hello { position: absolute; left: 0; right: 0; bottom: 0; padding: 70px 20px 22px; background: linear-gradient(to top, rgba(3,5,10,.92) 0%, rgba(3,5,10,.7) 55%, rgba(3,5,10,0) 100%); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.stage-hello h1 { margin: 0; font-size: 28px; line-height: 1.1; letter-spacing: -.01em; font-weight: 750; }
.stage-hello p { margin: 0; color: var(--muted); max-width: 30ch; }
.stage-status { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: rgba(5, 7, 13, .78); border: 1px solid var(--line-2); font-size: 14px; }
.stage-status .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest { pointer-events: auto; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.stage-status + .stage-status { top: 64px; }
.stage-status .chip { height: 30px; }
.ll-reply { flex: none; display: flex; align-items: flex-start; gap: 4px; margin: 8px 12px 0; padding: 10px 4px 10px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); max-height: 30vh; }
.ll-reply-text { flex: 1; min-width: 0; overflow-y: auto; max-height: calc(30vh - 20px); font-size: 15px; line-height: 1.5; }
.ll-reply-text p { margin: 0 0 .5em; }
.ll-reply-text p:last-child { margin: 0; }
.ll-reply-text pre { white-space: pre-wrap; font-size: 12px; }
.ll-reply .icon-btn { width: 32px; height: 32px; color: var(--muted); }
.ll-reply .icon-btn svg { width: 16px; height: 16px; }
.full-close { position: absolute; top: calc(10px + var(--safe-t)); right: calc(10px + var(--safe-r)); z-index: 3; background: rgba(5, 7, 13, .7); border: 1px solid var(--line-2); }
body.stage-full .topbar, body.stage-full .tabbar, body.stage-full #view-liveloop .stage-bar,
body.stage-full #view-liveloop .composer, body.stage-full #view-liveloop .ll-reply { display: none; }
body.stage-full #view-liveloop .stage { margin: 0; border-radius: 0; border: 0; }
body.stage-full #lite { padding: 0; }

/* ---------- chat ---------- */
#view-chat .chat-head { display: flex; align-items: center; gap: 4px; padding: 0 6px 4px 12px; }
#view-chat .chat-head .title { flex: 1; min-width: 0; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.messages { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 14px 12px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 100%; word-wrap: break-word; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; max-width: 84%; background: var(--surface-2); border: 1px solid var(--line); padding: 10px 14px; border-radius: 20px 20px 6px 20px; white-space: pre-wrap; }
.msg.bot { align-self: stretch; font-size: 16px; line-height: 1.55; }
.msg.bot .status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.msg.bot p { margin: 0 0 .7em; }
.msg.bot p:last-child { margin-bottom: 0; }
.msg.bot h1, .msg.bot h2, .msg.bot h3 { font-size: 1.05em; margin: 1em 0 .4em; }
.msg.bot ul, .msg.bot ol { margin: 0 0 .7em; padding-left: 1.3em; }
.msg.bot li { margin: .2em 0; }
.msg.bot code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: .1em .35em; border-radius: 6px; }
.msg.bot pre { background: var(--code); border: 1px solid var(--line); border-radius: 12px; padding: 12px; overflow-x: auto; font-size: 13px; line-height: 1.5; margin: 0 0 .7em; }
.msg.bot pre code { background: none; padding: 0; }
.msg.bot blockquote { margin: 0 0 .7em; padding-left: 12px; border-left: 3px solid var(--line-2); color: var(--muted); }
.msg.bot a { word-break: break-all; }
.msg.bot img, .msg.bot video { max-width: 100%; border-radius: 14px; display: block; margin: 4px 0; }
.msg.bot .err { color: var(--danger); }
.msg-actions { display: flex; gap: 2px; margin-top: 4px; }
.msg-actions .icon-btn { width: 36px; height: 36px; color: var(--muted); }
.msg-actions .icon-btn svg { width: 17px; height: 17px; }

/* ---------- create ---------- */
#view-create .create-top { padding: 0 12px 10px; }
.slot { flex: 1; min-height: 0; margin: 0 12px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; position: relative; display: flex; }
.slot img, .slot video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.slot .overlay { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 8px; }
.slot .overlay .icon-btn { background: rgba(5, 7, 13, .8); border: 1px solid var(--line-2); }
.slot .working { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--muted); text-align: center; padding: 24px; }
.slot .working .spinner { width: 30px; height: 30px; border-width: 3px; }
.doc-out { flex: 1; overflow-y: auto; padding: 16px; font-size: 15px; line-height: 1.6; }
.doc-out textarea { width: 100%; height: 100%; min-height: 240px; resize: none; background: transparent; border: 0; outline: none; font-size: 15px; line-height: 1.6; }

/* ---------- gallery ---------- */
#view-gallery .gallery-top { padding: 0 12px 10px; display: flex; gap: 8px; }
.grid { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 12px 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 4px; align-content: start; }
.tile { position: relative; display: block; width: 100%; height: 0; padding: 0 0 100%; border-radius: 10px; overflow: hidden; background: var(--surface); }
/* A square by padding, not aspect-ratio: some Android WebViews let the image set the row height. */
.tile > img, .tile > video, .tile > .doc { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .badge { position: absolute; right: 6px; bottom: 6px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, .6); display: grid; place-items: center; }
.tile .badge svg { width: 12px; height: 12px; }
.tile .doc { display: flex; flex-direction: column; justify-content: flex-end; padding: 8px; font-size: 11px; color: var(--muted); }
.tile .doc b { color: var(--text); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.more { grid-column: 1 / -1; margin: 10px auto; }
.viewer { position: fixed; inset: 0; z-index: 30; background: #000; display: flex; flex-direction: column; padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l); }
.viewer .v-top { display: flex; align-items: center; gap: 6px; padding: 6px 8px; }
.viewer .v-top .grow { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer .v-media { flex: 1; min-height: 0; display: grid; place-items: center; }
.viewer .v-media img, .viewer .v-media video { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .v-bar { display: flex; justify-content: center; gap: 10px; padding: 10px; }

/* ---------- auth ---------- */
.auth-hero { text-align: center; padding: 6px 0 2px; }
.auth-hero .brand { justify-content: center; font-size: 26px; }
.auth-hero p { margin: 10px auto 0; max-width: 32ch; color: var(--muted); font-size: 15px; }
.note { font-size: 13px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; line-height: 1.5; }
.note b { color: var(--text); }
.note.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.balance { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.balance div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.balance b { display: block; font-size: 22px; letter-spacing: -.01em; }
.balance span { font-size: 12px; color: var(--muted); }

/* ---------- boot ---------- */
#boot { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: grid; place-items: center; transition: opacity .35s; }
#boot.gone { opacity: 0; pointer-events: none; }
#boot .brand { font-size: 26px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
/* Edge to edge on every screen and every rotation (owner, 2026-09-30, a Magic V6
 * fold): no centred column. On wide screens the reading surfaces keep a
 * comfortable measure inside the full-width frame. */
@media (min-width: 700px) {
  .messages { padding-left: max(14px, calc((100% - 820px) / 2)); padding-right: max(14px, calc((100% - 820px) / 2)); }
  .composer { padding-left: max(12px, calc((100% - 860px) / 2)); padding-right: max(12px, calc((100% - 860px) / 2)); }
  .sheet { left: 50%; right: auto; width: min(100%, 640px); transform: translate(-50%, 100%); }
  .sheet.show { transform: translate(-50%, 0); }
  .toast { max-width: 520px; }
}
/* Landscape on a phone: the frame gives the stage and the content the height. */
@media (orientation: landscape) and (max-height: 520px) {
  :root { --top-h: 44px; --tab-h: 52px; }
  .tab span { display: none; }
  .stage-hello h1 { font-size: 22px; }
  .stage-hello p { display: none; }
}

/* ---------- Google / Apple ---------- */
.btn.social { background: #fff; color: #111; border-color: transparent; }
.btn.social.apple { background: #000; color: #fff; border-color: #3a3a3a; }
.social-mark svg { width: 20px; height: 20px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- audio in the gallery ---------- */
.tile .doc.audio { background: linear-gradient(145deg, #1a4bff 0%, #7c3aed 55%, #ff3d81 100%); color: rgba(255,255,255,.8); }
.tile .doc.audio b { color: #fff; }
.tile .doc.audio .a-icon { width: 26px; height: 26px; margin-bottom: auto; color: #fff; opacity: .9; }
.viewer .v-audio { width: min(100%, 420px); padding: 28px 22px; border-radius: 22px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; background: linear-gradient(145deg, #1a4bff 0%, #7c3aed 55%, #ff3d81 100%); color: #fff; }
.viewer .v-audio .a-icon { width: 54px; height: 54px; }
.viewer .v-audio audio { width: 100%; }

/* ---------- light mode (Account > Appearance) ----------
 * The LiveLoop stage and the media viewer stay dark in every theme: they are
 * screens for what was made, and the field is light on dark. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6fa; --bg-2: #ffffff; --surface: #ffffff; --surface-2: #eef1f6;
  --line: rgba(12, 18, 34, .09); --line-2: rgba(12, 18, 34, .16);
  --text: #0c1222; --muted: #566077; --faint: #8a92a6;
  --accent: #0b8fb3; --accent-2: #1a4bff; --accent-ink: #ffffff;
  --accent-soft: rgba(11, 143, 179, .1); --accent-line: rgba(11, 143, 179, .45);
  --danger: #d23048; --ok: #12a36a;
  --toast: #ffffff; --code: #f1f3f8; --spin: rgba(12, 18, 34, .15);
}
:root[data-theme="light"] .toast { box-shadow: 0 8px 28px rgba(12, 18, 34, .14); }
:root[data-theme="light"] .sheet { box-shadow: 0 -10px 40px rgba(12, 18, 34, .12); }
:root[data-theme="light"] .sheet-scrim { background: rgba(12, 18, 34, .35); }
:root[data-theme="light"] .switch::after { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
:root[data-theme="light"] body.fx-on #backdrop { opacity: 0; }
#view-liveloop .stage, .viewer, .stage-full #view-liveloop .stage { --bg: #05070d; --bg-2: #0a0e18; --surface: #0f1422; --surface-2: #151b2c; --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.14); --text: #eef2ff; --muted: #8d95ab; --faint: #5c6479; --accent: #63f5ff; --accent-ink: #03141a; --accent-soft: rgba(99,245,255,.12); --accent-line: rgba(99,245,255,.5); --spin: rgba(255,255,255,.2); color: var(--text); }
:root[data-theme="light"] .btn.social:not(.apple) { border-color: var(--line-2); box-shadow: 0 1px 2px rgba(12, 18, 34, .06); }

/* ---------- profile photo ---------- */
.profile-row .avatar.big { width: 56px; height: 56px; font-size: 20px; position: relative; overflow: visible; }
.profile-row .avatar.big img { border-radius: 50%; }
.profile-row .avatar .cam { position: absolute; right: -4px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; border: 2px solid var(--surface); }
.profile-row .avatar .cam svg { width: 13px; height: 13px; color: var(--accent-ink); }
.list .item .sub.accent { color: var(--accent); font-weight: 600; }

/* ---------- the build status (owner, 2026-09-30: "make the thinking banner
 * clearer"). It sat half-transparent over the build and read into whatever was
 * behind it. Now a solid bar with a coloured edge and a moving progress line. */
.stage-status { background: #0b1222 !important; border: 1px solid rgba(99, 245, 255, .45) !important; box-shadow: 0 10px 30px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .4); color: #f1f5ff; font-size: 15px; font-weight: 600; padding: 12px 14px 14px; overflow: hidden; z-index: 4; }
.stage-status .spinner { width: 20px; height: 20px; border-width: 2.5px; border-color: rgba(255, 255, 255, .25); border-top-color: #63f5ff; }
.stage-status .grow { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; }
.stage-status.busy::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 40%; background: linear-gradient(90deg, transparent, #63f5ff, #1a4bff, transparent); animation: lite-scan 1.6s ease-in-out infinite; }
@keyframes lite-scan { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* The shop: inside the Sary-OS iOS app only (lite/shop.js, owner 2026-10-02). */
.shop { display: flex; flex-direction: column; gap: 10px; }
.shop-group { font-size: 13px; font-weight: 650; color: var(--muted); margin: 6px 4px -2px; }
.shop .item .sub { white-space: normal; }
.shop .btn.buy { min-height: 36px; padding: 0 14px; font-size: 14px; flex: none; }
.shop .btn.buy .spinner { border-color: rgba(0, 0, 0, .2); border-top-color: var(--accent-ink); }
.shop .tag { flex: none; font-size: 12px; font-weight: 650; color: var(--muted); border: 1px solid var(--line-2); border-radius: 99px; padding: 4px 10px; }
.shop .tag.on { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.shop-terms { margin: 2px 4px 0; line-height: 1.45; }
