/* Lancelot — "Obsidian & Gold". Calm, regal, Jarvis-like. */
:root {
  --bg: #0a0a0e;
  --bg-2: #101019;
  --panel: #14141f;
  --panel-2: #1a1a28;
  --line: #25253a;
  --ink: #f3eddf;
  --ink-dim: #a39d8e;
  --ink-faint: #6f6a5e;
  --gold: #e8b64b;
  --gold-deep: #c8922f;
  --ember: #e07a3c;
  --live: #38d3c8;        /* listening/teal */
  --danger: #e0556b;
  --ok: #57c98a;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0,0,0,.55);
  --display: "Fraunces", Georgia, serif;
  --body: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--body);
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(232,182,75,.10), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(56,211,200,.06), transparent 55%),
    var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  letter-spacing: .1px;
}
a { color: inherit; text-decoration: none; }
button { font-family: var(--body); cursor: pointer; }

/* ---------- shell layout ---------- */
.app { max-width: 880px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column;
  padding: 0 18px 110px; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 22px 4px 14px; position: sticky;
  top: 0; z-index: 20;
  /* solid gradient (no backdrop blur — it's the biggest scroll-jank cost on phones) */
  background: linear-gradient(var(--bg) 0%, var(--bg) 58%, rgba(10,10,14,.86) 82%, transparent); }
.brand { display: flex; align-items: center; gap: 11px; }
.crest { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: url('/static/web/icons/icon-192.png') center/cover, #14141f;
  color: transparent; font-size: 0; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.wordmark { font-family: var(--display); font-size: 22px; font-weight: 500; letter-spacing: .3px; }
.wordmark b { color: var(--gold); font-weight: 600; }
.spacer { flex: 1; }
.pill-link { font-size: 13px; color: var(--ink-dim); padding: 7px 12px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--panel); }
.pill-link:hover { color: var(--ink); border-color: var(--gold-deep); }
/* Compact profile avatar in the header (replaces the name pill — the greeting personalises). */
.avatar-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--gold-deep); background: var(--panel) center/cover no-repeat;
  color: var(--gold); font-family: var(--display); font-weight: 700; font-size: 15px;
  text-decoration: none; flex: 0 0 auto; }
.avatar-btn.has-img { color: transparent; }
.avatar-btn:hover { border-color: var(--gold); }
/* "My Profile" row avatar in More */
.pr-avatar { width: 48px; height: 48px; border-radius: 50%; flex: 0 0 auto; display: grid;
  place-items: center; background: var(--panel) center/cover no-repeat; color: var(--gold);
  font-family: var(--display); font-weight: 700; font-size: 19px; border: 1px solid var(--gold-deep); }
.pr-avatar.has-img { color: transparent; }
.profile-row:hover { border-color: var(--gold-deep); }
/* Quick-access Mailbox icon in the header — shown only to users with an inbox. */
.icon-btn { position: relative; display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 11px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-dim);
  text-decoration: none; flex: 0 0 auto; }
.icon-btn[hidden] { display: none; }
.icon-btn:hover { color: var(--gold); border-color: var(--gold-deep); }
.ic-mail { font-size: 17px; line-height: 1; }
.mail-badge { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--gold); color: #14141f; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }
.mail-badge[hidden] { display: none; }

/* "What's New" update popup — floating, non-blocking, dismissible. */
.update-card { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h, 76px) + 12px);
  z-index: 80; max-width: 480px; margin: 0 auto; padding: 18px 18px 16px;
  background: linear-gradient(180deg, #1a1726, #14131d); border: 1px solid var(--gold-deep, #6b572a);
  border-radius: 18px; box-shadow: 0 18px 50px rgba(0,0,0,.55), 0 0 0 1px rgba(201,162,74,.12);
  transform: translateY(18px); opacity: 0; transition: transform .28s ease, opacity .28s ease; }
.update-card.show { transform: translateY(0); opacity: 1; }
.uc-x { position: absolute; top: 8px; right: 12px; background: none; border: 0; color: var(--ink-dim);
  font-size: 1.6rem; line-height: 1; cursor: pointer; }
.uc-head { display: flex; gap: 12px; align-items: center; margin: 0 24px 12px 0; }
.uc-spark { font-size: 26px; filter: drop-shadow(0 2px 6px rgba(201,162,74,.5)); }
.uc-title { font-family: var(--display); font-size: 19px; font-weight: 600; color: #fff; }
.uc-ver { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin-top: 2px; }
.uc-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.uc-list li { font-size: 14.5px; line-height: 1.45; color: var(--ink); padding-left: 2px; }
.uc-body { font-size: 13.5px; color: var(--ink-dim); line-height: 1.5; margin: 0 0 14px; }
.uc-ok { margin-top: 2px; }

h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: .2px; }
.page-title { font-size: 30px; margin: 8px 4px 18px; }
.muted { color: var(--ink-dim); }
.faint { color: var(--ink-faint); }
.center { text-align: center; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 14px; }
@media (min-width: 620px) { .grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.card { background: linear-gradient(160deg, var(--panel), var(--panel-2)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232,182,75,.5), transparent); }
.card h3 { margin: 0 0 12px; font-size: 16px; display: flex; align-items: center; gap: 9px; }
.card h3 .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.kpi { font-family: var(--display); font-size: 40px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.list { display: flex; flex-direction: column; gap: 10px; }
.item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.015); }
.item:hover { border-color: var(--gold-deep); }
.item .t { font-weight: 600; }
.item .s { color: var(--ink-dim); font-size: 13px; margin-top: 3px; }
.tag { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; padding: 3px 8px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--ink-dim); }
.tag.gold { color: var(--gold); border-color: var(--gold-deep); }
.tag.live { color: var(--live); border-color: #1f5c58; }
.tag.danger { color: var(--danger); border-color: #5c2330; }
.tag.ok { color: var(--ok); border-color: #21503a; }

/* ---------- buttons ---------- */
.btn { border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; transition: .15s; }
.btn:hover { border-color: var(--gold-deep); transform: translateY(-1px); }
.btn.primary { background: linear-gradient(145deg, var(--gold), var(--gold-deep)); color: #1a1205;
  border: none; box-shadow: 0 8px 22px rgba(232,182,75,.28); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: #5c2330; color: var(--danger); }
.btn.full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

input, textarea, select { width: 100%; background: #0d0d15; border: 1px solid var(--line);
  color: var(--ink); border-radius: 12px; padding: 13px 14px; font-family: var(--body); font-size: 15px; }
input:focus, textarea:focus { outline: none; border-color: var(--gold-deep); }
label { display: block; font-size: 13px; color: var(--ink-dim); margin: 14px 0 6px; }
textarea { resize: vertical; min-height: 120px; line-height: 1.5; }

/* ---------- bottom nav ---------- */
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: linear-gradient(transparent, rgba(8,8,12,.92) 30%); padding: 10px 14px max(14px, env(safe-area-inset-bottom)); }
.nav-inner { max-width: 560px; margin: 0 auto; display: flex; justify-content: space-between; gap: 2px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 6px; box-shadow: var(--shadow); }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px;
  color: var(--ink-faint); padding: 7px 2px; border-radius: 12px; flex: 1; min-width: 0; }
.nav a .ic { font-size: 18px; line-height: 1; }
.nav a.active { color: var(--gold); background: rgba(232,182,75,.08); }

/* ---------- voice orb / chat ---------- */
.chat-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.orb { --glow: var(--gold); width: 176px; height: 176px; border-radius: 50%; margin: 26px 0 10px;
  position: relative; display: grid; place-items: center; }
.orb .core { width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2a2a3d, #0d0d16 70%);
  border: 1px solid var(--line); box-shadow: 0 0 0 1px rgba(232,182,75,.15), inset 0 0 40px rgba(0,0,0,.6);
  display: grid; place-items: center; font-family: var(--display); font-size: 13px; color: var(--ink-dim);
  transition: .3s; }
.orb .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--glow);
  opacity: .0; }
.orb.idle .core { color: var(--ink-faint); }
.orb.listening { --glow: var(--live); }
.orb.thinking { --glow: var(--gold); }
.orb.speaking { --glow: var(--ember); }
.orb:not(.idle) .ring { animation: pulse 1.6s ease-out infinite; opacity: 1; }
.orb:not(.idle) .ring:nth-child(2) { animation-delay: .5s; }
.orb:not(.idle) .ring:nth-child(3) { animation-delay: 1s; }
.orb:not(.idle) .core { box-shadow: 0 0 60px var(--glow), inset 0 0 40px rgba(0,0,0,.5);
  border-color: var(--glow); color: var(--ink); }
@keyframes pulse { 0% { transform: scale(.78); opacity: .55; } 100% { transform: scale(1.25); opacity: 0; } }

.transcript { width: 100%; display: flex; flex-direction: column; gap: 12px; margin: 14px 0; }
.bubble { max-width: 86%; padding: 12px 15px; border-radius: 16px; line-height: 1.5; font-size: 15px; }
.bubble.user { align-self: flex-end; background: linear-gradient(145deg, #1d1d2c, #16161f);
  border: 1px solid var(--line); border-bottom-right-radius: 5px; }
.bubble.bot { align-self: flex-start; background: rgba(232,182,75,.06); border: 1px solid #3a3220;
  border-bottom-left-radius: 5px; }
.bubble .who { font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: var(--gold);
  margin-bottom: 5px; }
.bubble.partial { opacity: .55; font-style: italic; }
.bubble a.lnk { color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(232,182,75,.45);
  padding-bottom: 1px; white-space: nowrap; font-weight: 500; }
.bubble a.lnk:hover { border-bottom-color: var(--gold); }
.bubble a.btn { display: inline-block; text-decoration: none; margin-top: 4px; }

/* shared in-chat card surface (document delivery, post preview) — same gold accent,
   radius and panel as the rich preview cards so every followup feels of a piece. */
.chatcard { position: relative; background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: 16px; padding: 14px; overflow: hidden; }
.chatcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232,182,75,.5), transparent); }

/* ---------- rich preview cards (horizontal gallery) ---------- */
/* The cards bubble breaks out of the normal bubble chrome so the row can run full-width. */
.bubble.cards-bubble { max-width: 100%; background: transparent; border: none; padding: 4px 0 0;
  border-bottom-left-radius: 0; }
.bubble.cards-bubble .who { padding-left: 2px; }
.cardrow { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 10px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
  scrollbar-color: var(--gold-deep) transparent; }
.cardrow::-webkit-scrollbar { height: 6px; }
.cardrow::-webkit-scrollbar-track { background: transparent; }
.cardrow::-webkit-scrollbar-thumb { background: rgba(232,182,75,.28); border-radius: 999px; }
.cardrow::-webkit-scrollbar-thumb:hover { background: var(--gold-deep); }

.pcard { flex: 0 0 auto; width: 230px; scroll-snap-align: start; display: flex; flex-direction: column;
  background: linear-gradient(160deg, var(--panel), var(--panel-2)); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden; position: relative; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.pcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; z-index: 1;
  background: linear-gradient(90deg, transparent, rgba(232,182,75,.5), transparent); }
.pcard:hover { border-color: var(--gold-deep); transform: translateY(-2px); }
.pcard-photo { width: 100%; height: 126px; background: #0d0d15; overflow: hidden; }
.pcard-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard-body { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 4px; }
.pcard-title { font-weight: 600; font-size: 14.5px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-sub { color: var(--ink-dim); font-size: 12.5px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 2px;
  font-size: 12px; }
.pcard-rate { color: var(--gold); font-weight: 600; }
.pcard-open { color: var(--ok); font-weight: 600; }
.pcard-closed { color: var(--ink-dim); }
.pcard-actions { display: flex; gap: 8px; margin-top: 9px; }
.pchip { flex: 1; text-align: center; text-decoration: none; font-size: 12.5px; font-weight: 600;
  color: var(--gold); padding: 8px 10px; border: 1px solid var(--gold-deep); border-radius: 10px;
  background: rgba(232,182,75,.07); min-height: 36px; display: flex; align-items: center;
  justify-content: center; gap: 5px; transition: .15s; }
.pchip:hover { background: rgba(232,182,75,.16); }
/* product card */
.prod-badge { display: inline-block; font-size: 10px; font-weight: 700; color: #14131d;
  background: linear-gradient(135deg,#f3dd9b,#c9a24a); padding: 1px 6px; border-radius: 100px; vertical-align: middle; }
.prod-price { font-weight: 700; font-size: 14.5px; color: var(--gold); margin-top: 3px; }
.prod-oos { color: var(--ink-dim); font-weight: 500; font-size: 12px; }
.prod-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.prod-chip { font-size: 11px; color: var(--ink-dim); border: 1px solid var(--line);
  border-radius: 7px; padding: 2px 7px; }
.prod-buy { background: var(--gold); color: #14131d; border-color: var(--gold); }
.prod-buy:hover { filter: brightness(1.05); background: var(--gold); }
/* link card: domain eyebrow + headline */
.lcard .lcard-domain { font-size: 11px; letter-spacing: .4px; text-transform: lowercase;
  color: var(--gold); margin-bottom: 4px; }
.lcard { width: 210px; }
/* image card: pure photo + caption */
.icard { width: 180px; }
.icard img { width: 100%; height: 180px; object-fit: cover; display: block; }
.icard-cap { padding: 9px 11px; font-size: 12.5px; color: var(--ink-dim); line-height: 1.35; }

.composer { width: 100%; }
.composer-inner { max-width: 880px; margin: 0 auto; display: flex; gap: 10px; align-items: flex-end;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 10px; box-shadow: var(--shadow); }

/* ---- chat-first page layout ---- */
.chat-page { display: flex; flex-direction: column; }
.chat-hero { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.chat-hero .page-title { font-size: 26px; margin: 6px 4px 0; }
.starters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; max-width: 580px; }
.mic-help { color: #E9B84D !important; opacity: 1 !important; font-size: 14px; line-height: 1.55;
  max-width: 520px; margin: 6px auto 0; padding: 11px 15px; border: 1px solid rgba(233,184,77,.4);
  border-radius: 14px; background: rgba(233,184,77,.08); }
.mic-help b { color: #fff; }
.orb { background: none; border: none; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* EMPTY (home): orb + input centred in the viewport, presets beneath */
body.chat-empty .chat-page { min-height: calc(100vh - 168px); justify-content: center; gap: 6px; }
body.chat-empty .transcript { display: none; }
body.chat-empty .agents { justify-content: center; }
body.chat-empty .composer { max-width: 620px; margin: 16px auto 0; }
body.chat-empty .starters { margin: 16px auto 0; }

/* ACTIVE (conversation): transcript scrolls, input docks safely above the nav */
body.chat-active .chat-hero, body.chat-active .starters { display: none; }
body.chat-active .transcript { padding-bottom: 150px; }
body.chat-active .composer { position: fixed; left: 0; right: 0;
  bottom: calc(82px + env(safe-area-inset-bottom)); padding: 0 14px; z-index: 29; }
body.chat-active .composer .agents, body.chat-active #liveToggle { display: none; }
.composer textarea { border: none; background: transparent; min-height: 24px; max-height: 120px; padding: 10px; }
.mic-btn { width: 52px; height: 52px; border-radius: 50%; flex: none; border: none;
  background: linear-gradient(145deg, var(--gold), var(--gold-deep)); color: #1a1205; font-size: 22px;
  display: grid; place-items: center; box-shadow: 0 8px 22px rgba(232,182,75,.3); }
.mic-btn.rec { background: linear-gradient(145deg, var(--live), #209c93); color: #04201e;
  animation: micpulse 1.2s infinite; }
@keyframes micpulse { 0%,100% { box-shadow: 0 0 0 0 rgba(56,211,200,.5);} 50% { box-shadow: 0 0 0 12px rgba(56,211,200,0);} }
.send-btn { width: 52px; height: 52px; border-radius: 50%; flex: none; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--ink); font-size: 19px; }
/* 📎 attach is a <label> wrapping the file input; hide the input but keep the label tappable */
.attach-label { cursor: pointer; position: relative; overflow: hidden; }
.attach-label input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; }

/* ---------- assistant switcher ---------- */
.agents { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 2px; margin-bottom: 6px; }
.agent-chip { white-space: nowrap; font-size: 13px; padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-dim); }
.agent-chip.active { color: var(--gold); border-color: var(--gold-deep); background: rgba(232,182,75,.08); }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth .card { width: 100%; max-width: 380px; }
.auth .crest { width: 52px; height: 52px; font-size: 22px; margin: 4px auto 14px; }

/* ---------- misc ---------- */
.toast { position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: 60;
  background: var(--panel-2); border: 1px solid var(--gold-deep); color: var(--ink); padding: 12px 18px;
  border-radius: 12px; box-shadow: var(--shadow); opacity: 0; transition: .25s; max-width: 90%; }
.toast.show { opacity: 1; bottom: 162px; }
.empty { text-align: center; color: var(--ink-faint); padding: 40px 10px; }
.skeleton { background: linear-gradient(90deg, #14141f, #1c1c2a, #14141f); background-size: 200% 100%;
  animation: sk 1.2s infinite; border-radius: 10px; height: 14px; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.diff-add { color: var(--ok); }
hr.sep { border: none; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------- Lens (camera vision) ---------- */
.lens-stage { position: relative; border-radius: 20px; overflow: hidden; background: #000;
  border: 1px solid var(--line); aspect-ratio: 3/4; max-height: 64vh; margin: 6px 0 14px; }
.lens-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.lens-modes { position: absolute; top: 12px; left: 0; right: 0; display: flex; gap: 8px;
  justify-content: center; flex-wrap: wrap; padding: 0 10px; z-index: 3; }
.lens-modes .agent-chip { background: rgba(10,10,16,.6); backdrop-filter: blur(6px); }
.lens-hud { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 3;
  background: rgba(10,10,16,.72); backdrop-filter: blur(10px); border: 1px solid var(--line);
  border-radius: 14px; padding: 13px 15px; max-height: 38%; overflow-y: auto; }
.lens-hud .who { font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: var(--gold); }
.lens-hud .txt { font-size: 14.5px; line-height: 1.45; margin-top: 4px; }
.lens-scan { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; }
.lens-scan.on { opacity: 1; }
.lens-scan::after { content: ""; position: absolute; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--live), transparent); animation: scan 1.8s ease-in-out infinite; }
@keyframes scan { 0% { top: 6%; } 50% { top: 90%; } 100% { top: 6%; } }
.lens-controls { display: flex; align-items: center; justify-content: center; gap: 16px; }
.lens-shoot { width: 72px; height: 72px; border-radius: 50%; border: 4px solid var(--gold);
  background: linear-gradient(145deg, var(--gold), var(--gold-deep)); box-shadow: 0 8px 24px rgba(232,182,75,.35); }
.lens-shoot:active { transform: scale(.94); }
.lens-round { width: 50px; height: 50px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font-size: 20px; display: grid; place-items: center; }
.lens-round.on { color: var(--live); border-color: #1f5c58; }
.nav a img.ic { width: 22px; height: 22px; object-fit: contain; }
.tile-ic { width: 30px; height: 30px; object-fit: contain; }

/* ============================================================
   v2 polish + performance (2026-06) — seamless, fast, consistent
   ============================================================ */
html { scroll-behavior: smooth; }
body { overflow-x: hidden; overscroll-behavior-y: none; text-rendering: optimizeLegibility; }
/* lighter, GPU-friendly nav (no gradient overdraw on the whole strip) */
.nav { background: transparent; }
.nav-inner { backdrop-filter: none; }
.nav a { transition: color .15s, background .15s; }
.nav a.active { box-shadow: inset 0 0 0 1px rgba(232,182,75,.22); }
.nav a:active { transform: scale(.94); }

/* refined cards/items — crisper depth, snappier hover, contain paint for speed */
.card { contain: paint; }
.card, .item, .btn, .agent-chip, .pill-link { transition: border-color .15s ease, transform .15s ease, background .15s ease; }
.item { transition: border-color .15s ease, background .15s ease; }
.item:hover { background: rgba(232,182,75,.045); }

/* long lists scroll inside their own panel (no more whole-page scroll), smooth on iOS */
.list.scroll { max-height: 64vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-right: 2px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.list.scroll::-webkit-scrollbar { width: 6px; }
.list.scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }

/* tasteful one-time entrance — staggered rise of the page's cards (delight, ~0 cost) */
@media (prefers-reduced-motion: no-preference) {
  .app > .page-title { animation: rise .45s cubic-bezier(.2,.7,.3,1) both; }
  .card { animation: rise .5s cubic-bezier(.2,.7,.3,1) both; will-change: transform, opacity; }
  .grid .card:nth-child(2) { animation-delay: .06s; }
  .grid .card:nth-child(3) { animation-delay: .12s; }
  .grid .card:nth-child(4) { animation-delay: .18s; }
  .grid .card:nth-child(n+5) { animation-delay: .22s; }
  /* clear will-change after the entrance so it doesn't pin layers */
  .card { animation-fill-mode: both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* compact 2-col tile grid for menus/shortcuts (replaces long full-width stacks) */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: linear-gradient(160deg, var(--panel), var(--panel-2)); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 13px; display: flex; flex-direction: column; gap: 1px;
  position: relative; overflow: hidden; min-height: 86px;
  transition: border-color .15s ease, transform .12s ease; }
.tile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232,182,75,.4), transparent); }
.tile:hover { border-color: var(--gold-deep); }
.tile:active { transform: scale(.97); }
.tile .ti { font-size: 22px; line-height: 1; margin-bottom: 7px; }
.tile b { font-size: 14px; font-weight: 600; }
.tile i { font-style: normal; font-size: 11.5px; color: var(--ink-dim); margin-top: 1px; }

/* headings: a touch more optical refinement */
.page-title { line-height: 1.08; }
h3 { line-height: 1.2; }
::selection { background: rgba(232,182,75,.28); color: #fff; }

/* ---- Wallet ---- */
.wallet-balance { text-align: center; padding: 22px 16px; }
.wallet-balance .bal { font-size: 34px; font-weight: 700; color: var(--gold); letter-spacing: .5px; }
.wallet-balance .held { font-size: 12px; }
#txns .item .amt { font-weight: 600; }
#txns .item .s { font-size: 12px; }

/* ---- Media (in-chat streaming) cards ---- */
.mcard { width: 300px; }
.mcard-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000;
  border-radius: 12px 12px 0 0; overflow: hidden; cursor: pointer; }
.mcard-stage img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .85; }
.mcard-stage iframe { width: 100%; height: 100%; border: 0; display: block; }
.mcard-play { position: absolute; inset: 0; margin: auto; width: 58px; height: 58px;
  border-radius: 50%; border: 1px solid var(--gold-deep); cursor: pointer;
  background: rgba(12,12,18,.72); color: var(--gold); font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center; padding-left: 4px;
  transition: transform .15s ease, background .15s ease; }
.mcard-stage:hover .mcard-play { transform: scale(1.08); background: rgba(12,12,18,.9); }
.mcard-stage.playing { cursor: default; }

/* ---- Mini-player (docked music bar above the nav) ---- */
.mini-player { position: fixed; left: 12px; right: 12px; z-index: 29;
  bottom: calc(92px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto; display: none; flex-direction: column;
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid var(--gold-deep); border-radius: 16px; overflow: hidden;
  box-shadow: 0 14px 38px rgba(0,0,0,.55); }
.mini-player.show { display: flex; }
.mini-player .mp-stage { width: 100%; height: 252px; background: #000;
  transition: height .25s ease; }
.mini-player .mp-stage iframe { width: 100%; height: 100%; border: 0; display: block; }
.mini-player .mp-yt, .mini-player .mp-yt iframe { width: 100%; height: 100%; display: block; }
.mini-player.collapsed .mp-stage { height: 92px; }   /* player stays visible, just tucked */
.mini-player .mp-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.mini-player .mp-thumb { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; }
.mini-player .mp-title { flex: 1; font-size: 13px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-player .mp-btn { background: transparent; border: 1px solid var(--line); color: var(--gold);
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center; }
.mini-player .mp-btn:hover { border-color: var(--gold-deep); }
.mcard-stage.docked .mcard-play { opacity: .45; }
body.chat-active .composer-dock { transition: bottom .2s ease; }
