/* QuickShare — assistant-style home, Messenger-style chat. Light + dark follow the device. */
:root {
  --bg: #ffffff; --surface: #f7f7f8; --surface2: #f0f0f2; --border: rgba(0,0,0,.09); --border-hover: rgba(0,0,0,.2);
  --text: #0d0d0f; --text-muted: #6a6a73; --text-dim: #a3a3ad;
  --accent: #0084ff; --accent2: #4aa3ff; --accent-glow: rgba(0,132,255,.14);
  --green: #1fa855; --red: #e5484d; --yellow: #f5a524; --on-accent: #fff;
  --serif: 'Newsreader', Georgia, serif; --body: 'Instrument Sans', system-ui, sans-serif;
  --transition: all .2s ease;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #212121; --surface: #2a2a2a; --surface2: #303030; --border: rgba(255,255,255,.1); --border-hover: rgba(255,255,255,.22);
  --text: #ececec; --text-muted: #a1a1aa; --text-dim: #6e6e78; --accent: #2b8cff; --accent2: #6db1ff; --accent-glow: rgba(43,140,255,.2);
  --green: #4ade80; --red: #f87171; } }
:root[data-theme="dark"] {
  --bg: #212121; --surface: #2a2a2a; --surface2: #303030; --border: rgba(255,255,255,.1); --border-hover: rgba(255,255,255,.22);
  --text: #ececec; --text-muted: #a1a1aa; --text-dim: #6e6e78; --accent: #2b8cff; --accent2: #6db1ff; --accent-glow: rgba(43,140,255,.2);
  --green: #4ade80; --red: #f87171; }
*, *::before, *::after { box-sizing: border-box; }
html body { font-family: var(--body); background: var(--bg); color: var(--text); line-height: 1.55; -webkit-font-smoothing: antialiased; }
body::before, body::after { display: none; }
button, input, textarea, select { font-family: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-glow); }
[hidden] { display: none !important; }

/* nav */
html body nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); height: 58px; }
.nav-logo { font-weight: 700; font-size: 17px; letter-spacing: -.01em; background: none !important; -webkit-text-fill-color: var(--text) !important; color: var(--text); }
.nav-links a { color: var(--text-muted); font-weight: 500; font-size: 14px; border-radius: 8px; padding: 6px 10px; }
.nav-links a:hover, .nav-links a.nav-active { color: var(--text); background: var(--surface2); }
.nav-links a.nav-chat { color: var(--accent); font-weight: 600; }
.nav-links { margin-left: 18px; gap: 4px; }
.nav-badge { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); font-weight: 600; border-radius: 999px; }
.nav-links a::after { display: none; }

/* HOME: assistant-style hero box */
.stage { max-width: 760px; margin: 0 auto; padding: 12vh 20px 40px; }
.greet { font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.02em; line-height: 1.1; text-align: center; margin-bottom: 28px; }
.composer { background: var(--surface2); border: 1px solid var(--border); border-radius: 28px; padding: 16px 16px 10px; box-shadow: 0 2px 12px rgba(0,0,0,.05); transition: box-shadow .2s, border-color .2s; }
.composer:focus-within { border-color: var(--border-hover); box-shadow: 0 6px 24px rgba(0,0,0,.09); }
.composer.dragover { border-color: var(--accent); background: var(--accent-glow); }
#editor { display: block; width: 100%; min-height: 120px; max-height: 46vh; resize: none; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 1.05rem; line-height: 1.6; padding: 4px 8px; }
.composer-bar { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 500; transition: var(--transition); }
.pill:hover { background: var(--surface); border-color: var(--border-hover); }
.pill.primary { background: var(--text); color: var(--bg); border-color: transparent; }
.grow { flex: 1; }
.save-state { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-muted); padding-right: 6px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); }
.status-dot.synced { background: var(--green); } .status-dot.saving { background: var(--yellow); } .status-dot.error { background: var(--red); }
.chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 999px; padding: 9px 16px; font-size: 14px; color: var(--text); text-decoration: none; background: var(--bg); transition: var(--transition); }
.chip:hover { background: var(--surface); border-color: var(--border-hover); }
.meta { text-align: center; color: var(--text-muted); font-size: 13px; margin-top: 18px; }
.meta b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.files { margin-top: 56px; }
.files h2 { font-family: var(--serif); font-weight: 500; font-size: 1.6rem; letter-spacing: -.01em; }
.files > p { color: var(--text-muted); font-size: 14px; margin: 4px 0 16px; }
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.files-empty { grid-column: 1/-1; border: 1px dashed var(--border-hover); border-radius: 16px; text-align: center; color: var(--text-muted); font-size: 14px; padding: 28px 16px; }
.file-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 10px; text-align: left; overflow: hidden; }
.file-thumb { height: 104px; border-radius: 10px; background: var(--surface2); display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 10px; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-icon { font-size: 30px; }
.file-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 12px; color: var(--text-muted); margin: 2px 0 8px; }
.file-actions { display: flex; gap: 6px; }
.file-actions .btn { flex: 1; padding: 6px 8px; font-size: 12px; border-radius: 8px; }
.file-progress { height: 5px; border-radius: 5px; background: var(--surface2); overflow: hidden; margin: 10px 0 4px; }
.file-progress span { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 10px; padding: 8px 14px; font-size: 13.5px; font-weight: 500; transition: var(--transition); }
.btn:hover { background: var(--surface); }
#dropOverlay { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(6px); font-family: var(--serif); font-size: 2rem; }
#dropOverlay.on { display: flex; }
footer { color: var(--text-muted); font-size: 13px; text-align: center; padding: 28px 16px; }
footer a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 3px; }
#toast { background: var(--text); color: var(--bg); border-radius: 12px; font-size: 14px; font-weight: 500; }

/* STATIC PAGES */
.page-title { font-family: var(--serif); font-weight: 500; letter-spacing: -.02em; line-height: 1.05; background: none !important; -webkit-text-fill-color: var(--text) !important; color: var(--text); }
.page-label { display: none; }
.page-sub { color: var(--text-muted); }
.stat-strip { background: none; border: 0; }
.stat-item, .value-card, .info-card, .form-card, .summary-card, .highlight-box { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: none; }
.stat-num { color: var(--text); font-family: var(--serif); }
.prose h2 { font-family: var(--serif); font-weight: 500; }
.prose a { color: var(--accent); }
.btn-submit { background: var(--text) !important; color: var(--bg) !important; border-radius: 12px; border: 0; }
input, textarea, select { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 12px; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px var(--accent-glow); }
::placeholder { color: var(--text-dim); }

/* CHAT: Messenger-style */
.sidebar { background: var(--bg); border-right: 1px solid var(--border); }
.group-avatar, .chat-topbar-avatar { border-radius: 50% !important; background: linear-gradient(135deg, var(--accent), #a033ff) !important; color: #fff; }
.chat-topbar { background: var(--bg); border-bottom: 1px solid var(--border); }
.chat-messages { background: var(--bg); display: flex; flex-direction: column; gap: 3px; }
.msg-bubble { border-radius: 20px; padding: 9px 14px; max-width: 72%; background: var(--surface2); color: var(--text); }
.msg.own { align-items: flex-end; }
.msg.own .msg-bubble { background: linear-gradient(135deg, #0084ff, #5b6bff) !important; color: #fff !important; border-bottom-right-radius: 6px; }
.msg.other .msg-bubble { border-bottom-left-radius: 6px; }
.msg-author, .msg-time { color: var(--text-muted); font-size: 11px; }
.chat-inputbar { background: var(--bg); border-top: 1px solid var(--border); }
.chat-inputbar textarea { background: var(--surface2); border: 0; border-radius: 22px; padding: 10px 16px; }
.send-btn { width: 40px; height: 40px; border-radius: 50% !important; background: var(--accent) !important; color: #fff !important; border: 0; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; background: transparent; border: 0; color: var(--accent); }
.icon-btn:hover { background: var(--accent-glow); }
.btn-primary, .tab-btn.active { background: var(--accent) !important; color: #fff !important; border-color: transparent; }

/* CALL OVERLAY */
.cm { position: fixed; inset: 0; z-index: 100; background: #0b0b0d; color: #fff; display: flex; flex-direction: column; }
.cm-stage { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cm-stage > video#callRemoteVideo { width: 100%; height: 100%; object-fit: cover; background: #0b0b0d; }
.cm-self { position: absolute; right: 16px; bottom: 16px; width: clamp(96px, 22vw, 200px); aspect-ratio: 3/4; object-fit: cover; border-radius: 14px; border: 2px solid rgba(255,255,255,.25); background: #222; }
.cm.audio video { opacity: 0; }
.cm-info { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; pointer-events: none; text-align: center; }
.cm.live:not(.audio) .cm-info { display: none; }
.cm-avatar { width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 40px; background: linear-gradient(135deg, #0084ff, #a033ff); }
.cm-info h3 { font-size: 1.4rem; margin-top: 8px; } .cm-info p { color: rgba(255,255,255,.7); font-size: 14px; }
.cm-bar { display: flex; justify-content: center; gap: 18px; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); background: rgba(0,0,0,.4); }
.cm-btn { width: 56px; height: 56px; border-radius: 50%; border: 0; font-size: 22px; background: rgba(255,255,255,.16); color: #fff; }
.cm-btn.off { background: #fff; color: #000; }
.cm-end { background: #e5484d; } .cm-ok { background: #1fa855; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* fixes */
html, html body { margin: 0; }
.nav-links a, .nav-logo, .chip, .stage a { text-decoration: none; }
.nav-logo, .nav-logo span { font-family: var(--body); }
.field-label, .msg-time, .msg-author, #connLabel, .conn-badge, .btn-label { font-family: var(--body); text-transform: none; letter-spacing: 0; }
.msg { display: flex; flex-direction: column; width: 100%; align-items: flex-start; }
.msg.own { align-items: flex-end; }
.msg-bubble { width: fit-content; max-width: min(520px, 80%); }
.cm.incoming .cm-self { display: none; }

/* unified chrome (same on every page) */
html body nav { display: flex; align-items: center; justify-content: space-between; padding: 0 24px; gap: 12px; }
.nav-left, .nav-right { display: flex; align-items: center; gap: 12px; }
.nav-logo { display: flex; align-items: center; gap: 9px; }
.nav-logo img { height: 26px; width: 26px; border-radius: 7px; box-shadow: none; }
@media (max-width: 640px) { html body nav { padding: 0 12px; } .nav-links a:not(.nav-active):not(.nav-chat) { display: none; } }

/* calls section (home) */
.calls { margin-top: 56px; }
.calls h2 { font-family: var(--serif); font-weight: 500; font-size: 1.6rem; letter-spacing: -.01em; }
.calls > p { color: var(--text-muted); font-size: 14px; margin: 4px 0 16px; }
.call-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.call-box { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.call-box h3 { font-size: 15px; font-weight: 600; }
.call-box p { color: var(--text-muted); font-size: 13px; flex: 1; }
.call-box .row { display: flex; gap: 8px; flex-wrap: wrap; }
.call-box input { flex: 1; min-width: 0; padding: 8px 12px; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.pill.primary { background: var(--text); color: var(--bg); }

/* consistency polish */
.nav-badge { font-size: 11px; padding: 3px 10px; }
.calls h2, .files h2, .call-box h3 { margin: 0; }
.calls > p, .files > p { margin: 6px 0 18px; }
.btn-primary, .tab-btn.active { background: var(--text) !important; color: var(--bg) !important; box-shadow: none !important; border-radius: 10px; }

/* ===== COLOUR ===== */
:root { --c-blue: #2f80ff; --c-violet: #8b5cf6; --c-pink: #ec4899; --c-green: #10b981; --c-amber: #f59e0b; --c-red: #ef4444; --c-cyan: #06b6d4; }
body::before { display: block; content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(45% 38% at 12% 0%, color-mix(in srgb, var(--c-blue) 16%, transparent), transparent 70%),
              radial-gradient(40% 34% at 92% 4%, color-mix(in srgb, var(--c-pink) 13%, transparent), transparent 70%),
              radial-gradient(50% 40% at 70% 100%, color-mix(in srgb, var(--c-violet) 11%, transparent), transparent 70%); }
.stage, .page-wrap, main, .layout, .chat-layout { position: relative; z-index: 1; }
.grad { background: linear-gradient(100deg, var(--c-blue), var(--c-violet) 55%, var(--c-pink)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-style: italic; }
.composer { border: 1px solid transparent; background: linear-gradient(var(--surface2), var(--surface2)) padding-box, linear-gradient(135deg, color-mix(in srgb, var(--c-blue) 45%, transparent), color-mix(in srgb, var(--c-violet) 40%, transparent), color-mix(in srgb, var(--c-pink) 45%, transparent)) border-box; }
.composer:focus-within { box-shadow: 0 8px 30px color-mix(in srgb, var(--c-violet) 22%, transparent); }
.composer.pulse { animation: pulse 1.1s ease-out; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-green) 55%, transparent); } 100% { box-shadow: 0 0 0 16px transparent; } }
.pill-blue { background: color-mix(in srgb, var(--c-blue) 14%, var(--bg)); color: var(--c-blue); border-color: color-mix(in srgb, var(--c-blue) 35%, transparent); font-weight: 600; }
.chip.c-violet { background: color-mix(in srgb, var(--c-violet) 11%, var(--bg)); border-color: color-mix(in srgb, var(--c-violet) 32%, transparent); }
.chip.c-green { background: color-mix(in srgb, var(--c-green) 11%, var(--bg)); border-color: color-mix(in srgb, var(--c-green) 32%, transparent); }
.call-box { position: relative; overflow: hidden; border-top: 3px solid var(--tone); background: linear-gradient(180deg, color-mix(in srgb, var(--tone) 9%, var(--surface)), var(--surface) 60%); }
.call-box.b-blue { --tone: var(--c-blue); } .call-box.b-violet { --tone: var(--c-violet); } .call-box.b-amber { --tone: var(--c-amber); }
.call-box .ico { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 19px; background: color-mix(in srgb, var(--tone) 18%, transparent); }
.pill.voice { background: var(--c-green); color: #fff; border-color: transparent; }
.pill.video { background: var(--c-blue); color: #fff; border-color: transparent; }
.pill.voice:hover, .pill.video:hover { filter: brightness(1.08); }
.call-box.b-violet .pill { background: var(--c-violet); color: #fff; border-color: transparent; }
.call-box.b-amber .pill.primary { background: var(--c-amber); color: #1a1200; }
.file-card[data-kind] .file-thumb { background: color-mix(in srgb, var(--k, var(--c-blue)) 15%, var(--surface2)); }
.file-card[data-kind=pdf] { --k: var(--c-red); } .file-card[data-kind=zip] { --k: var(--c-amber); } .file-card[data-kind=doc] { --k: var(--c-blue); }
.file-card[data-kind=sheet] { --k: var(--c-green); } .file-card[data-kind=video] { --k: var(--c-pink); } .file-card[data-kind=audio] { --k: var(--c-violet); } .file-card[data-kind=image] { --k: var(--c-cyan); }
.files h2, .calls h2 { display: flex; align-items: center; gap: 10px; }
.calls h2::before, .files h2::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--c-pink); }
.files h2::before { background: var(--c-cyan); } .calls h2::before { background: var(--c-green); }
.status-dot.synced { box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); }
/* static pages */
.value-card { border-top: 3px solid var(--c-blue); } .value-card:nth-child(2) { border-top-color: var(--c-violet); } .value-card:nth-child(3) { border-top-color: var(--c-green); }
.value-card:nth-child(4) { border-top-color: var(--c-amber); } .value-card:nth-child(5) { border-top-color: var(--c-pink); } .value-card:nth-child(6) { border-top-color: var(--c-cyan); }
.stat-item:nth-child(1) .stat-num { color: var(--c-blue); } .stat-item:nth-child(2) .stat-num { color: var(--c-violet); } .stat-item:nth-child(3) .stat-num { color: var(--c-pink); }
.summary-card:nth-child(3n+1) { border-top: 3px solid var(--c-blue); } .summary-card:nth-child(3n+2) { border-top: 3px solid var(--c-green); } .summary-card:nth-child(3n) { border-top: 3px solid var(--c-amber); }
.section-num { color: var(--c-violet); }
/* chat */
.msg.own .msg-bubble { background: linear-gradient(135deg, var(--c-blue), var(--c-violet)) !important; }
.group-avatar { background: linear-gradient(135deg, var(--c-violet), var(--c-pink)) !important; }
.nav-links a.nav-chat { color: var(--c-violet); }
.send-btn { background: linear-gradient(135deg, var(--c-blue), var(--c-violet)) !important; }
#editor:focus, #editor:focus-visible { outline: none !important; box-shadow: none !important; }

/* ===== UI/UX PRO MAX PASS: accessible contrast, SVG icons, touch targets ===== */
:root { --accent: #0b63e5; --accent-glow: rgba(11,99,229,.14); --c-blue: #0b63e5; --c-violet: #7c3aed; --c-green: #047857; --c-red: #dc2626; --red: #dc2626; --placeholder: #6a6a73; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --accent: #1f6feb; --accent-glow: rgba(31,111,235,.22); --placeholder: #9a9aa4; --red: #f87171; } }
:root[data-theme="dark"] { --accent: #1f6feb; --accent-glow: rgba(31,111,235,.22); --placeholder: #9a9aa4; --red: #f87171; }
::placeholder { color: var(--placeholder); opacity: 1; }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 3px; border-radius: 6px; }
.skip-link { position: absolute; left: 12px; top: -64px; z-index: 300; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; text-decoration: none; transition: top .15s; }
.skip-link:focus { top: 10px; }

/* one icon family: Lucide stroke icons, sized by context */
.ic { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.2em; }
.btn, .pill, .chip { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.btn .ic, .pill .ic, .chip .ic { width: 18px; height: 18px; }
.chip.c-violet .ic { color: var(--c-violet); } .chip.c-green .ic { color: var(--c-green); }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn .ic { width: 22px; height: 22px; }
.send-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.send-btn .ic { width: 20px; height: 20px; }
.call-box .ico .ic { color: var(--tone); }
.file-icon .ic { width: 34px; height: 34px; color: var(--k, var(--accent)); }
.cm-btn { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.cm-btn .ic { width: 24px; height: 24px; } .cm-avatar .ic { width: 44px; height: 44px; stroke: #fff; }
.cm-ok { background: #15803d; } .cm-end { background: #dc2626; }
.value-icon, .summary-icon { color: var(--accent); } .value-icon .ic, .summary-icon .ic { width: 26px; height: 26px; }
.info-icon .ic { width: 18px; height: 18px; color: var(--accent); } .check .ic { width: 26px; height: 26px; }
#welcomeScreen .ic { width: 48px; height: 48px; color: var(--text-muted); }
.nav-logo { cursor: pointer; } .nav-logo picture { display: inline-flex; } .nav-logo img.logo-mark { height: 22px; width: auto; border-radius: 0; box-shadow: none; }

/* touch: >=44px targets with >=8px gaps on touch devices */
.composer-bar, .file-actions, .call-box .row, .chips { gap: 8px; }
.tab-btn { min-height: 40px; cursor: pointer; }
@media (pointer: coarse) { .pill, .chip, .btn, .tab-btn, .nav-links a { min-height: 44px; } .file-actions .btn { min-height: 44px; } }
.pill:active, .btn:active, .chip:active { opacity: .85; }

/* micro-interaction: messages ease in (respects reduced motion) */
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }
.msg { animation: msgIn .18s ease-out; }

/* readable coloured text in both themes: fills stay dark enough for white text, text/icons use lighter tones on dark */
:root { --t-blue: #0b63e5; --t-violet: #7c3aed; --t-green: #047857; --t-amber: #b45309; --t-pink: #be185d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --t-blue: #7db8ff; --t-violet: #b69cff; --t-green: #4ade80; --t-amber: #fbbf24; --t-pink: #f472b6; } }
:root[data-theme="dark"] { --t-blue: #7db8ff; --t-violet: #b69cff; --t-green: #4ade80; --t-amber: #fbbf24; --t-pink: #f472b6; }
.pill-blue { color: var(--t-blue); }
.nav-links a.nav-chat { color: var(--t-violet); }
.chip.c-violet .ic { color: var(--t-violet); } .chip.c-green .ic { color: var(--t-green); }
.call-box.b-blue { --tone-t: var(--t-blue); } .call-box.b-violet { --tone-t: var(--t-violet); } .call-box.b-amber { --tone-t: var(--t-amber); }
.call-box .ico .ic { color: var(--tone-t); }
.grad { background-image: linear-gradient(100deg, var(--t-blue), var(--t-violet) 55%, var(--t-pink)); }
.calls h2::before { background: var(--t-green); }
.stat-item:nth-child(1) .stat-num { color: var(--t-blue); } .stat-item:nth-child(2) .stat-num { color: var(--t-violet); } .stat-item:nth-child(3) .stat-num { color: var(--t-pink); }
.section-num { color: var(--t-violet); }
.prose a, .info-icon .ic, .value-icon, .summary-icon { color: var(--t-blue); }
.icon-btn { color: var(--t-blue); } .icon-btn:hover { background: var(--accent-glow); }
.cm-btn:focus-visible, .icon-btn:focus-visible, .send-btn:focus-visible { border-radius: 50%; } .cm-info h2 { margin: 8px 0 0; font-size: 1.4rem; }

/* ===== THEME SWITCHER ===== */
:root { color-scheme: light dark; } :root[data-theme="light"] { color-scheme: light; } :root[data-theme="dark"] { color-scheme: dark; }
.logo-d { display: none; }
:root[data-theme="dark"] .logo-l { display: none; } :root[data-theme="dark"] .logo-d { display: inline; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-l { display: none; } :root:not([data-theme="light"]) .logo-d { display: inline; } }
.nav-right { position: relative; }
.theme-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); }
.theme-btn:hover, .theme-btn[aria-expanded="true"] { background: var(--surface2); border-color: var(--border-hover); }
.theme-pop { position: absolute; right: 0; top: calc(100% + 10px); width: min(320px, 92vw); z-index: 120; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 16px; padding: 16px; box-shadow: 0 16px 48px rgba(0,0,0,.22); }
.theme-pop h2 { font-size: 12px; font-weight: 600; color: var(--text-muted); margin: 0 0 8px; text-transform: none; letter-spacing: .02em; }
.theme-pop .grp + .grp { margin-top: 16px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--surface2); border-radius: 12px; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--bg); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.14); }
.seg .ic { width: 16px; height: 16px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 2px solid transparent; background: linear-gradient(135deg, var(--p), var(--s)); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.swatch .ic { width: 20px; height: 20px; stroke-width: 2.5; opacity: 0; }
.swatch[aria-checked="true"] { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg) inset; } .swatch[aria-checked="true"] .ic { opacity: 1; }
.swatch-name { font-size: 12px; color: var(--text-muted); margin-top: 8px; min-height: 16px; }

/* ===== ACCENT COLOUR THEMES (blue is the default) ===== */
:root[data-accent="violet"] { --accent: #6d3df0; --c-blue: #6d3df0; --c-violet: #a21caf; --t-blue: #6d3df0; --t-violet: #a21caf; --accent2: #b9a4ff; --accent-glow: rgba(109,61,240,.14); }
:root[data-theme="dark"][data-accent="violet"] { --t-blue: #b9a4ff; --t-violet: #f0abfc; --accent-glow: rgba(109,61,240,.24); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"])[data-accent="violet"] { --t-blue: #b9a4ff; --t-violet: #f0abfc; --accent-glow: rgba(109,61,240,.24); } }
:root[data-accent="green"] { --accent: #047857; --c-blue: #047857; --c-violet: #0e7490; --t-blue: #047857; --t-violet: #0e7490; --accent2: #4ade80; --accent-glow: rgba(4,120,87,.14); }
:root[data-theme="dark"][data-accent="green"] { --t-blue: #4ade80; --t-violet: #67e8f9; --accent-glow: rgba(4,120,87,.24); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"])[data-accent="green"] { --t-blue: #4ade80; --t-violet: #67e8f9; --accent-glow: rgba(4,120,87,.24); } }
:root[data-accent="orange"] { --accent: #c2410c; --c-blue: #c2410c; --c-violet: #b45309; --t-blue: #c2410c; --t-violet: #b45309; --accent2: #fdba74; --accent-glow: rgba(194,65,12,.14); }
:root[data-theme="dark"][data-accent="orange"] { --t-blue: #fdba74; --t-violet: #fcd34d; --accent-glow: rgba(194,65,12,.24); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"])[data-accent="orange"] { --t-blue: #fdba74; --t-violet: #fcd34d; --accent-glow: rgba(194,65,12,.24); } }
:root[data-accent="rose"] { --accent: #be123c; --c-blue: #be123c; --c-violet: #7c3aed; --t-blue: #be123c; --t-violet: #7c3aed; --accent2: #fda4af; --accent-glow: rgba(190,18,60,.14); }
:root[data-theme="dark"][data-accent="rose"] { --t-blue: #fda4af; --t-violet: #c4b5fd; --accent-glow: rgba(190,18,60,.24); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"])[data-accent="rose"] { --t-blue: #fda4af; --t-violet: #c4b5fd; --accent-glow: rgba(190,18,60,.24); } }

/* ===== ADS ===== */
.ad-slot { max-width: 760px; margin: 40px auto; padding: 0 20px; text-align: center; clear: both; }
.ad-slot[hidden] { display: none !important; }
.ad-label { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.ad-box { min-height: 100px; border-radius: 12px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); }
.ad-slot ins.adsbygoogle { display: block; min-height: 100px; }
.ad-slot[data-ad="chat-sidebar"] { margin: 12px 0 0; padding: 12px; border-top: 1px solid var(--border); max-width: none; }
@media (max-width: 860px) { .ad-slot[data-ad="chat-sidebar"] { display: none !important; } }

/* ===== UNSLOP PASS (delete from here to the end to roll back) =====
   Direction: calm, plain, quick. Quiet neutral chrome, one accent (Attach, selection, own chat bubbles).
   Signature: the live sync dot. Based on the unslop skill by Damir Sokolovsky (@heydamir), CC BY 4.0. */
body::before { display: none; }
.grad { background: none !important; -webkit-text-fill-color: currentColor !important; color: inherit; font-style: normal; }
.composer { border: 1px solid var(--border); background: var(--surface2); box-shadow: none; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--accent-glow); } 100% { box-shadow: 0 0 0 12px transparent; } }
.pill-blue { background: var(--accent); color: #fff; border-color: transparent; font-weight: 500; }
.pill-blue:hover { background: var(--accent); filter: brightness(1.08); }
.status-dot.synced { box-shadow: none; }
.chip.c-violet, .chip.c-green { background: var(--surface); border-color: var(--border); }
.chip.c-violet .ic, .chip.c-green .ic { color: var(--text-muted); }
.call-box, .call-box.b-blue, .call-box.b-violet, .call-box.b-amber { border-top: 1px solid var(--border); background: var(--surface); }
.call-box .ico { background: var(--surface2); }
.call-box .ico .ic { color: var(--text-muted); }
.pill.voice, .pill.video, .call-box.b-violet .pill { background: var(--bg); color: var(--text); border-color: var(--border); }
.pill.voice:hover, .pill.video:hover, .call-box.b-violet .pill:hover { background: var(--surface); border-color: var(--border-hover); filter: none; }
.call-box.b-amber .pill.primary { background: var(--text); color: var(--bg); }
.file-card[data-kind] .file-thumb { background: var(--surface2); }
.file-icon .ic { color: var(--text-muted); }
.calls h2::before, .files h2::before { display: none; }
.value-card, .summary-card:nth-child(n) { border-top: 1px solid var(--border); }
.stat-item:nth-child(n) .stat-num, .section-num { color: var(--text); }
.nav-links a.nav-chat { color: var(--text); font-weight: 500; }
.nav-links a.nav-chat:hover { background: var(--surface2); }
.msg.own .msg-bubble { background: var(--accent) !important; }
.send-btn { background: var(--accent) !important; }
.group-avatar, .chat-topbar-avatar { background: var(--surface2) !important; color: var(--text) !important; }
.cm-avatar { background: #2a2a2e; }
.icon-btn { color: var(--text-muted); }
.icon-btn:hover { color: var(--text); background: var(--surface2); }
/* ===== END UNSLOP PASS ===== */

/* ===== COOL PASS (delete from here to the end to roll back) ===== */
body::before { display: block; background-image: radial-gradient(color-mix(in srgb, var(--text) 16%, transparent) 1px, transparent 1.2px); background-size: 24px 24px; -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 22%, #000, transparent 75%); mask-image: radial-gradient(ellipse 70% 55% at 50% 22%, #000, transparent 75%); }
.hero-art { max-width: 460px; margin: 0 auto 8px; color: var(--text-muted); }
.hero-art svg { width: 100%; height: auto; display: block; }
.hero-art .dev rect, .hero-art .dev path { stroke: currentColor; stroke-width: 1.6; fill: var(--bg); stroke-linecap: round; }
.hero-art .dev path { fill: none; }
.hero-art .dev circle { fill: currentColor; }
.hero-art .note rect { stroke: var(--accent); fill: var(--accent-glow); }
.hero-art .note path { stroke: var(--accent); }
.hero-art .flow { stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 4 7; opacity: .7; animation: flow 1.2s linear infinite; }
.hero-art .pk { fill: var(--accent); }
@keyframes flow { to { stroke-dashoffset: -22; } }
.greet { font-size: clamp(2.4rem, 6.4vw, 3.8rem); letter-spacing: -.03em; }
.grad { color: var(--accent) !important; -webkit-text-fill-color: var(--accent) !important; font-style: italic; position: relative; }
.grad::after { content: ''; position: absolute; left: 0; right: 0; bottom: .02em; height: 3px; border-radius: 2px; background: var(--accent); opacity: .35; }
.composer { border-radius: 24px; padding: 20px 20px 12px; background: var(--surface); box-shadow: 0 1px 0 color-mix(in srgb, var(--text) 6%, transparent) inset, 0 24px 48px -24px rgba(0,0,0,.28); }
.composer:focus-within { box-shadow: 0 0 0 3px var(--accent-glow), 0 28px 56px -24px color-mix(in srgb, var(--accent) 45%, transparent); }
.chip, .call-box, .file-card { transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.chip:hover, .call-box:hover, .file-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); box-shadow: 0 14px 28px -16px rgba(0,0,0,.35); }
.call-box .ico { background: var(--accent-glow); } .call-box .ico .ic { color: var(--t-blue); }
.chip .ic { color: var(--t-blue) !important; }
.pill.video { background: var(--accent); color: #fff; border-color: transparent; } .pill.video:hover { background: var(--accent); filter: brightness(1.1); }
.calls h2::before, .files h2::before { display: block; width: 4px; height: 22px; border-radius: 2px; background: var(--accent); }
.nav-links a.nav-chat { color: var(--t-blue); }
.msg.own .msg-bubble { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #000)) !important; }
/* ===== END COOL PASS ===== */

/* group call grid (2-6 people) */
.cm-grid { position: absolute; inset: 0; display: grid; gap: 4px; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); grid-auto-rows: 1fr; background: #0b0b0d; }
.cm-grid video { width: 100%; height: 100%; min-height: 0; object-fit: cover; background: #16161a; }
.cm.audio .cm-grid { opacity: 0; pointer-events: none; }

/* ===== SYNC CODE + NOTICE ===== */
.linkbtn { background: none; border: 0; padding: 0; color: var(--t-blue); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.sync-pop { margin: 14px auto 0; max-width: 560px; padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); text-align: left; }
.sync-pop p { color: var(--text-muted); font-size: 13.5px; margin: 0 0 12px; }
.sync-pop .row { display: flex; gap: 8px; flex-wrap: wrap; } .sync-pop input { flex: 1; min-width: 140px; padding: 9px 12px; letter-spacing: .08em; text-transform: uppercase; }
.sync-pop .linkbtn { margin-top: 12px; display: inline-block; }
.notice { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--c-red) 45%, transparent); background: color-mix(in srgb, var(--c-red) 10%, var(--bg)); font-size: 14px; }
.notice[hidden] { display: none; } .notice-x { background: none; border: 0; color: var(--text-muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; }
.seg2 { grid-template-columns: repeat(2, 1fr); } .theme-pop .grp[hidden] { display: none; }

/* ===== NEON STYLE (the original look, kept as an option) ===== */
:root[data-style="neon"] { color-scheme: dark; --bg: #0a0a0f; --surface: #13131a; --surface2: #1a1a24; --border: rgba(255,255,255,.08); --border-hover: rgba(124,106,255,.5);
  --text: #f0f0f8; --text-muted: #a0a0b8; --text-dim: #6f6f88; --placeholder: #8c8ca6; --accent: #6b58f0; --accent2: #a78bfa; --accent-glow: rgba(124,106,255,.3);
  --c-blue: #6b58f0; --c-violet: #8b5cf6; --c-pink: #ec4899; --t-blue: #b4a7ff; --t-violet: #c4b5fd; --t-green: #4ade80; --t-pink: #f472b6; --t-amber: #fbbf24;
  --green: #4ade80; --red: #f87171; --c-red: #ef4444;
  --serif: 'Plus Jakarta Sans', 'Instrument Sans', system-ui, sans-serif; --body: 'Plus Jakarta Sans', 'Instrument Sans', system-ui, sans-serif; }
:root[data-style="neon"] body::before { background: radial-gradient(circle at 0 0, rgba(124,106,255,.24), transparent 55%), radial-gradient(circle at 100% 100%, rgba(56,189,248,.14), transparent 55%), radial-gradient(circle at 100% 0, rgba(236,72,153,.1), transparent 45%); }
:root[data-style="neon"] .nav-logo span { font-family: 'Space Mono', monospace; font-weight: 700; background: linear-gradient(135deg, #7c6aff, #a78bfa, #38bdf8) !important; -webkit-background-clip: text !important; background-clip: text !important; -webkit-text-fill-color: transparent !important; }
:root[data-style="neon"] .greet, :root[data-style="neon"] .page-title { font-family: var(--serif); font-weight: 800; letter-spacing: -.035em; background: linear-gradient(135deg, #fff 25%, #a78bfa) !important; -webkit-background-clip: text !important; background-clip: text !important; -webkit-text-fill-color: transparent !important; }
:root[data-style="neon"] .greet .grad { font-style: normal; background: linear-gradient(100deg, #7c6aff, #38bdf8); -webkit-background-clip: text; background-clip: text; }
:root[data-style="neon"] .calls h2, :root[data-style="neon"] .files h2, :root[data-style="neon"] .prose h2 { font-family: var(--serif); font-weight: 700; letter-spacing: -.02em; }
:root[data-style="neon"] .composer { background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, #7c6aff, #38bdf8 55%, #ec4899) border-box; box-shadow: 0 0 0 1px rgba(124,106,255,.15), 0 0 44px -10px rgba(124,106,255,.55); }
:root[data-style="neon"] .composer:focus-within { box-shadow: 0 0 0 1px rgba(124,106,255,.4), 0 0 60px -8px rgba(124,106,255,.75); }
:root[data-style="neon"] .call-box, :root[data-style="neon"] .file-card, :root[data-style="neon"] .sync-pop, :root[data-style="neon"] .value-card, :root[data-style="neon"] .stat-item { background: var(--surface); border-color: var(--border); transition: border-color .2s, box-shadow .2s; }
:root[data-style="neon"] .call-box:hover, :root[data-style="neon"] .file-card:hover, :root[data-style="neon"] .value-card:hover { border-color: rgba(124,106,255,.5); box-shadow: 0 0 28px -8px rgba(124,106,255,.55); }
:root[data-style="neon"] .pill.primary, :root[data-style="neon"] .btn-primary, :root[data-style="neon"] .btn-submit { background: linear-gradient(135deg, #6b58f0, #8b5cf6) !important; color: #fff !important; box-shadow: 0 0 22px -4px rgba(124,106,255,.7); }
:root[data-style="neon"] .pill-blue { box-shadow: 0 0 16px -6px rgba(124,106,255,.8); }
:root[data-style="neon"] .nav-badge { background: rgba(124,106,255,.16); border-color: rgba(124,106,255,.4); color: #c4b5fd; }
:root[data-style="neon"] .nav-links a.nav-active { box-shadow: 0 2px 0 #7c6aff; background: transparent; }
:root[data-style="neon"] .msg.own .msg-bubble, :root[data-style="neon"] .send-btn { box-shadow: 0 0 20px -6px rgba(124,106,255,.8); }
:root[data-style="neon"] #themePop { box-shadow: 0 0 40px -10px rgba(124,106,255,.5), 0 16px 48px rgba(0,0,0,.5); }
