/* Omicron Hub — "control panel" design: slate steel surfaces, amber indicator lamps for action, teal for live AI. */
:root {
  --bg: #0c1520; --bg2: #101b28; --panel: #132131; --panel2: #182a3d; --line: #22364b; --line2: #2d4660;
  --ink: #e7eef5; --ink2: #b9c7d5; --muted: #7f95ab;
  --amber: #f2a93b; --amber-ink: #1d1304; --amber-soft: rgba(242, 169, 59, .14);
  --teal: #3fd0c9; --teal-soft: rgba(63, 208, 201, .13);
  --red: #ff6b6b; --red-soft: rgba(255, 107, 107, .13); --green: #5ad68a; --green-soft: rgba(90, 214, 138, .13);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -18px rgba(0, 0, 0, .8);
  --r1: 6px; --r2: 10px; --r3: 16px;
  --side: 264px; --top: 56px; --tab: 64px;
  --f: 'Noto Sans Gujarati', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #edf1f5; --bg2: #e4eaf0; --panel: #ffffff; --panel2: #f4f7fa; --line: #d6dee7; --line2: #c3cfdb;
  --ink: #122130; --ink2: #33475b; --muted: #627589;
  --amber: #b86a00; --amber-ink: #fff; --amber-soft: rgba(184, 106, 0, .1);
  --teal: #0b827c; --teal-soft: rgba(11, 130, 124, .09);
  --red: #c62f2f; --red-soft: rgba(198, 47, 47, .08); --green: #1d8a4a; --green-soft: rgba(29, 138, 74, .09);
  --shadow: 0 1px 2px rgba(18, 33, 48, .06), 0 8px 24px -16px rgba(18, 33, 48, .25);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.6 var(--f); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow-x: hidden; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.3; margin: 0; }
h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: .4em 0; }
small, .muted { color: var(--muted); }
.hide { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- boot ---------- */
.boot { display: grid; place-items: center; height: 100vh; }
.boot-mark { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, var(--amber), #e0731c); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; transform: scale(.92); } }

/* ---------- buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 40px; padding: 0 16px; border-radius: var(--r1); border: 1px solid var(--line2); background: var(--panel2); color: var(--ink); font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; text-decoration: none !important; }
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel2); }
.btn.danger { color: var(--red); }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: .88rem; }
.btn.icon { width: 40px; padding: 0; }
.btn.sm.icon { width: 32px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
label.f { display: block; margin: 0 0 14px; }
label.f > span { display: block; font-size: .86rem; font-weight: 600; color: var(--ink2); margin-bottom: 5px; }
.in, select.in, textarea.in { width: 100%; min-height: 42px; padding: 9px 12px; border-radius: var(--r1); border: 1px solid var(--line2); background: var(--bg2); color: var(--ink); outline: none; }
textarea.in { min-height: 90px; resize: vertical; line-height: 1.55; }
.in:focus { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: center; cursor: pointer; padding: 6px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--amber); }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: var(--r1); overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 7px 14px; cursor: pointer; font-weight: 600; color: var(--ink2); }
.seg button[aria-pressed="true"] { background: var(--amber); color: var(--amber-ink); }

/* ---------- auth screens ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 0% 100%, rgba(242, 169, 59, .18), transparent 60%), linear-gradient(160deg, #0f1d2c, #0a121b); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; color: #e7eef5; }
.auth-art::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px); background-size: 32px 32px; mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); }
.auth-art > * { position: relative; }
.auth-art .big { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 800; line-height: 1.12; letter-spacing: -.02em; max-width: 12ch; }
.auth-art .lamps { display: flex; gap: 10px; margin-bottom: 18px; }
.auth-art p { color: #9fb2c5; max-width: 42ch; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); margin-bottom: 26px; }
.err { background: var(--red-soft); color: var(--red); border-radius: var(--r1); padding: 10px 12px; margin-bottom: 14px; font-size: .92rem; }
.okmsg { background: var(--green-soft); color: var(--green); border-radius: var(--r1); padding: 10px 12px; margin-bottom: 14px; font-size: .92rem; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }

/* indicator lamps (the signature motif) */
.lamp { width: 10px; height: 10px; border-radius: 50%; background: var(--line2); flex: none; display: inline-block; }
.lamp.amber { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft), 0 0 12px var(--amber); }
.lamp.teal { background: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft), 0 0 12px var(--teal); }
.lamp.green { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.lamp.red { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.lamp.run { background: var(--teal); animation: blink 1s ease-in-out infinite; box-shadow: 0 0 0 3px var(--teal-soft), 0 0 10px var(--teal); }
@keyframes blink { 50% { opacity: .3; } }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.shell.collapsed { --side: 72px; }
.side { position: sticky; top: 0; height: 100vh; background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 30; }
.side-head { display: flex; align-items: center; gap: 10px; height: var(--top); padding: 0 14px; border-bottom: 1px solid var(--line); }
.side-head .brand span { white-space: nowrap; }
.nav { flex: 1; overflow-y: auto; padding: 10px 8px 16px; scrollbar-width: thin; }
.nav-group { margin: 12px 10px 4px; font-size: .78rem; color: var(--muted); font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 0 10px; margin: 1px 0; border-radius: var(--r1); color: var(--ink2); text-decoration: none; font-weight: 500; position: relative; }
.nav a:hover { background: var(--panel); color: var(--ink); }
.nav a.on { background: var(--panel2); color: var(--ink); font-weight: 700; }
.nav a.on::before { content: ""; position: absolute; left: -8px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--amber); }
.nav .ico { width: 24px; text-align: center; font-size: 1.05rem; flex: none; }
.nav .lbl { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav .sub a { min-height: 34px; padding-left: 45px; font-size: .9rem; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--amber); color: var(--amber-ink); font-size: .74rem; font-weight: 800; display: inline-grid; place-items: center; }
.collapsed .nav .lbl, .collapsed .nav-group, .collapsed .side-head .brand span, .collapsed .nav .sub, .collapsed .side-foot .txt { display: none; }
.collapsed .nav a { justify-content: center; padding: 0; }
.collapsed .nav .badge { position: absolute; top: 2px; right: 6px; min-width: 16px; height: 16px; font-size: .66rem; }
.side-foot { border-top: 1px solid var(--line); padding: 10px 14px; font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 8px; padding: 0 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .title { font-weight: 700; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page { padding: 24px; max-width: 1180px; width: 100%; margin: 0 auto; flex: 1; }
.page.wide { max-width: none; }
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .lead { color: var(--muted); margin-top: 4px; max-width: 70ch; }
.foot { padding: 14px 24px 22px; color: var(--muted); font-size: .8rem; display: flex; gap: 14px; flex-wrap: wrap; }
.tabbar, .scrim { display: none; }

/* ---------- surfaces ---------- */
.grid > * { min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r2); padding: 18px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }
.grid > .panel + .panel { margin-top: 0; }
.panel h2 { margin-bottom: 10px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r2); padding: 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card .meta { font-size: .82rem; color: var(--muted); word-break: break-all; }
.card .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--panel2); color: var(--ink2); border: 1px solid var(--line); white-space: nowrap; }
.chip.amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.chip.teal { background: var(--teal-soft); color: var(--teal); border-color: transparent; }
.chip.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.chip.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); border: 1px dashed var(--line2); border-radius: var(--r2); }
.empty b { display: block; color: var(--ink); font-size: 1.02rem; margin-bottom: 4px; }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.t th, table.t td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { color: var(--muted); font-weight: 600; font-size: .82rem; }
.tablewrap { overflow-x: auto; }
.bar { height: 8px; background: var(--bg2); border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; background: var(--teal); border-radius: 4px; transition: width .4s; }
.bar.warn > i { background: var(--amber); }
.bar.over > i { background: var(--red); }
details.dx { border: 1px solid var(--line); border-radius: var(--r1); background: var(--bg2); }
details.dx > summary { cursor: pointer; padding: 9px 12px; font-weight: 600; font-size: .9rem; list-style: none; display: flex; gap: 8px; align-items: center; }
details.dx > summary::-webkit-details-marker { display: none; }
details.dx > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .2s; }
details.dx[open] > summary::after { transform: rotate(180deg); }
details.dx > .dx-body { padding: 4px 12px 12px; }

/* ---------- dashboard ---------- */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 18px; }
.hero-ask { background: linear-gradient(150deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: var(--r3); padding: 22px; position: relative; overflow: hidden; }
.hero-ask::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 1px solid var(--line2); box-shadow: 0 0 0 30px var(--panel2), 0 0 0 31px var(--line); opacity: .5; pointer-events: none; }
.hero-ask h1 { font-size: 1.55rem; margin-bottom: 4px; }
.hero-ask form { display: flex; gap: 8px; margin-top: 16px; position: relative; z-index: 1; }
.hero-ask .in { min-height: 48px; font-size: 1rem; }
.hero-ask .btn { min-height: 48px; }
.today { display: flex; flex-direction: column; gap: 10px; }
.today .stat { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r2); }
.today .stat b { font-size: 1.35rem; font-weight: 800; min-width: 2ch; }
.today .stat span { color: var(--ink2); font-size: .9rem; line-height: 1.35; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: var(--r2); background: var(--panel); border: 1px solid var(--line); color: var(--ink); text-decoration: none !important; min-height: 92px; }
.tile:hover { border-color: var(--line2); background: var(--panel2); }
.tile .ico { font-size: 1.4rem; }
.tile b { font-weight: 600; font-size: .93rem; line-height: 1.35; }
.sec-h { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.sec-h h2 { font-size: 1.05rem; }
.list { display: flex; flex-direction: column; }
.list a.li, .list .li { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none !important; min-width: 0; }
.list .li:last-child { border-bottom: 0; }
.list a.li:hover { background: var(--panel2); }
.li .t1 { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .t2 { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .grow { flex: 1; min-width: 0; }
.cost-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; font-size: .9rem; }

/* ---------- chat ---------- */
.chat { display: grid; grid-template-columns: 260px 1fr; height: calc(100vh - var(--top)); min-height: 0; }
.chat.solo { grid-template-columns: 1fr; }
.convs { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--bg2); }
.convs .head { padding: 12px; display: flex; gap: 8px; }
.convs .scroll { flex: 1; overflow-y: auto; padding: 0 8px 12px; }
.conv { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: var(--r1); cursor: pointer; color: var(--ink2); font-size: .9rem; }
.conv:hover { background: var(--panel); }
.conv.on { background: var(--panel2); color: var(--ink); font-weight: 600; }
.conv .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .x { opacity: 0; }
.conv:hover .x, .conv.on .x { opacity: 1; }
.thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.msgs { flex: 1; overflow-y: auto; padding: 20px 20px 8px; scroll-behavior: smooth; }
.msgs-in { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.m { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.m.u { align-items: flex-end; }
.m.u .bubble { background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r3) var(--r3) 4px var(--r3); padding: 10px 14px; max-width: min(90%, 640px); white-space: pre-wrap; word-wrap: break-word; }
.m.u .vraw { font-size: .78rem; color: var(--muted); max-width: 90%; }
.m.a .who { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); }
.m.a .who b { color: var(--ink); font-weight: 700; }
.m.a .body { min-width: 0; overflow-wrap: anywhere; }
.m.a.err .body { color: var(--red); background: var(--red-soft); padding: 10px 14px; border-radius: var(--r2); white-space: pre-wrap; }
.m .tools-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.m .acts { display: flex; gap: 2px; flex-wrap: wrap; opacity: .75; }
.m:hover .acts { opacity: 1; }
.m .acts .btn { min-height: 30px; padding: 0 8px; font-size: .82rem; font-weight: 500; }
.m .acts .btn[aria-pressed="true"] { color: var(--amber); }
.sources { display: flex; flex-wrap: wrap; gap: 6px; }
.sources a { font-size: .8rem; padding: 3px 10px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.learned { font-size: .8rem; color: var(--green); }
.think { border-left: 2px solid var(--line2); margin: 2px 0 0 4px; padding: 2px 0 2px 14px; display: flex; flex-direction: column; gap: 8px; }
.think .st { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; }
.think .st .lamp { margin-top: 7px; }
.think .st .lb { color: var(--ink2); }
.think .st .nt { color: var(--muted); font-size: .8rem; }
.think ul { margin: 4px 0 0; padding-left: 18px; font-size: .82rem; color: var(--ink2); }
.live { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--r2); }
.live .st { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--ink2); }
.live .st.done { color: var(--muted); }
.composer { border-top: 1px solid var(--line); padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--bg); }
.composer-in { max-width: 820px; margin: 0 auto; }
.modes { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; align-items: center; }
.toggle { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--ink2); }
.toggle[aria-pressed="true"] { background: var(--teal-soft); border-color: var(--teal); color: var(--teal); }
.box { display: flex; align-items: flex-end; gap: 6px; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r3); padding: 6px; }
.box:focus-within { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.box textarea { flex: 1; border: 0; background: transparent; resize: none; outline: none; padding: 8px 8px; min-height: 40px; max-height: 200px; line-height: 1.5; }
.box .btn { border-radius: 12px; }
.mic.rec { background: var(--red); border-color: var(--red); color: #fff; }
.recbar { display: flex; align-items: center; gap: 10px; padding: 6px 10px; margin-bottom: 8px; border-radius: var(--r2); background: var(--red-soft); color: var(--red); font-size: .88rem; }
.recbar canvas { flex: 1; height: 28px; min-width: 60px; }
.recbar .live-text { color: var(--ink2); font-size: .82rem; flex: 2; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chat-empty { text-align: center; padding: 8vh 12px 20px; }
.chat-empty .mark { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--amber-soft); font-size: 1.7rem; }
.chat-empty h2 { font-size: 1.3rem; }
.chat-empty p { color: var(--muted); max-width: 46ch; margin: 6px auto 18px; }
.sugg { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 640px; margin: 0 auto; }
.sugg button { border: 1px solid var(--line2); background: var(--panel); border-radius: var(--r2); padding: 9px 14px; cursor: pointer; text-align: left; color: var(--ink2); font-size: .9rem; }
.sugg button:hover { border-color: var(--amber); color: var(--ink); }

/* markdown */
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 1em 0 .4em; }
.md h1 { font-size: 1.25rem; } .md h2 { font-size: 1.12rem; } .md h3, .md h4 { font-size: 1rem; }
.md p { margin: .5em 0; }
.md ul, .md ol { margin: .4em 0; padding-left: 1.4em; }
.md li { margin: .2em 0; }
.md code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88em; background: var(--bg2); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); }
.md pre { background: var(--bg2); border: 1px solid var(--line); padding: 12px; border-radius: var(--r1); overflow-x: auto; }
.md pre code { background: none; border: 0; padding: 0; }
.md blockquote { margin: .6em 0; padding: 2px 14px; border-left: 3px solid var(--amber); color: var(--ink2); }
.md table { border-collapse: collapse; margin: .6em 0; font-size: .9rem; display: block; overflow-x: auto; max-width: 100%; }
.md th, .md td { border: 1px solid var(--line2); padding: 6px 10px; text-align: left; }
.md th { background: var(--panel2); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1em 0; }

/* linked app frame */
.frame-wrap { border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; background: var(--panel); height: 68vh; position: relative; }
.frame-wrap iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.note { display: flex; gap: 10px; padding: 12px 14px; background: var(--amber-soft); border-radius: var(--r2); color: var(--ink2); font-size: .9rem; margin-bottom: 14px; align-items: flex-start; }
.note.teal { background: var(--teal-soft); }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(4, 9, 14, .6); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r3); padding: 20px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); }
.modal h2 { margin-bottom: 14px; }
@keyframes fade { from { opacity: 0; } }

/* toasts */
#toasts { position: fixed; z-index: 200; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--panel2); border: 1px solid var(--line2); border-left: 3px solid var(--teal); padding: 11px 14px; border-radius: var(--r1); box-shadow: var(--shadow); font-size: .9rem; animation: fade .2s; }
.toast.err { border-left-color: var(--red); }
.toast.amber { border-left-color: var(--amber); }

/* goals */
.task { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.task input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--teal); flex: none; }
.task.done .tx { text-decoration: line-through; color: var(--muted); }
.task .tx { flex: 1; }
.timeline { display: flex; flex-direction: column; gap: 6px; }
.timeline .ms { display: flex; gap: 12px; align-items: center; font-size: .92rem; }
pre.code { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r1); padding: 12px; font-size: .8rem; overflow: auto; max-height: 300px; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; }
  .chat { grid-template-columns: 1fr; }
  .convs { display: none; }
  .convs.open { display: flex; position: fixed; z-index: 60; inset: var(--top) 0 0 auto; width: min(320px, 86vw); box-shadow: -20px 0 40px rgba(0, 0, 0, .4); }
}
@media (max-width: 860px) {
  .shell, .shell.collapsed { grid-template-columns: 1fr; --side: 284px; }
  .side { z-index: 50; position: fixed; left: 0; top: 0; bottom: 0; width: var(--side); transform: translateX(-102%); transition: transform .22s ease; box-shadow: 20px 0 60px rgba(0, 0, 0, .5); }
  .shell.drawer .side { transform: none; }
  .shell.collapsed .nav .lbl, .shell.collapsed .nav-group, .shell.collapsed .side-head .brand span, .shell.collapsed .nav .sub, .shell.collapsed .side-foot .txt { display: revert; }
  .shell.collapsed .nav a { justify-content: flex-start; padding: 0 10px; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 45; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .shell.drawer .scrim { opacity: 1; pointer-events: auto; }
  .page { padding: 16px 16px calc(var(--tab) + 24px); }
  .foot { padding-bottom: calc(var(--tab) + 20px); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--tab) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--bg2) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: .7rem; font-weight: 600; text-decoration: none; border: 0; background: none; cursor: pointer; position: relative; }
  .tabbar .ico { font-size: 1.25rem; line-height: 1; }
  .tabbar .on { color: var(--amber); }
  .tabbar .badge { position: absolute; top: 6px; right: calc(50% - 22px); min-width: 16px; height: 16px; font-size: .64rem; }
  .chat { height: calc(100vh - var(--top) - var(--tab) - env(safe-area-inset-bottom)); height: calc(100dvh - var(--top) - var(--tab) - env(safe-area-inset-bottom)); }
  .composer { padding-bottom: 10px; }
  .modes { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -4px; padding-left: 4px; }
  .modes::-webkit-scrollbar { display: none; }
  .modes > * { flex: none; }
  .modes .spacer { display: none; }
  .msgs { padding: 14px 12px 6px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 20px 26px; min-height: auto; }
  .auth-art .big { font-size: 2rem; }
  .auth-art .foot-note { display: none; }
  .hero-ask { padding: 18px; }
  .hero-ask form { flex-direction: column; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  #toasts { bottom: calc(var(--tab) + 14px); right: 16px; left: 16px; max-width: none; }
  h1 { font-size: 1.35rem; }
  .grid, .grid.two { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 861px) { .only-m { display: none !important; } }
@media (max-width: 860px) { .only-d { display: none !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .side, .top, .tabbar, .composer, .convs { display: none !important; } .shell { display: block; } }
