:root {
  --bg: #07070c;
  --panel: rgba(20, 20, 32, .62);
  --panel-solid: #12121c;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --ink: #f3f2f8;
  --ink-2: #b4b2c6;
  --ink-3: #7d7b92;
  --violet: #9b8cff;
  --teal: #5ee7df;
  --gold: #ffd27a;
  --ok: #4ade9a;
  --warn: #fbbf5a;
  --bad: #ff6b81;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --r: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
.muted { color: var(--ink-3); }

/* ---------- ambient background ---------- */
.aurora { position: fixed; inset: -20vmax; z-index: 0; filter: blur(80px) saturate(140%); pointer-events: none; }
.aurora span { position: absolute; border-radius: 50%; opacity: .55; mix-blend-mode: screen; animation: drift 26s ease-in-out infinite alternate; }
.aurora span:nth-child(1) { width: 55vmax; height: 55vmax; left: 8%; top: 4%; background: radial-gradient(circle, #5b3df5 0%, transparent 65%); }
.aurora span:nth-child(2) { width: 48vmax; height: 48vmax; right: 2%; top: 22%; background: radial-gradient(circle, #13b8a6 0%, transparent 65%); animation-duration: 32s; animation-delay: -8s; }
.aurora span:nth-child(3) { width: 40vmax; height: 40vmax; left: 32%; bottom: 0; background: radial-gradient(circle, #e8925a 0%, transparent 65%); opacity: .35; animation-duration: 38s; animation-delay: -16s; }
.aurora.dim { opacity: .35; }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(6vmax, -4vmax) scale(1.12); } 100% { transform: translate(-5vmax, 5vmax) scale(.94); } }
.grain { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .09; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@media (prefers-reduced-motion: reduce) { .aurora span { animation: none; } }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -.01em; font-size: 17px; }
.mark { width: 30px; height: 30px; }

/* ---------- login ---------- */
.is-login { display: grid; place-items: center; min-height: 100vh; padding: 32px 16px; }
.login { position: relative; z-index: 2; width: min(520px, 100%); text-align: center; animation: rise .9s cubic-bezier(.2, .8, .2, 1) both; }
.login .brand { margin-bottom: 44px; font-size: 18px; }
.login h1 { font: 400 clamp(46px, 9vw, 76px)/.98 var(--serif); letter-spacing: -.02em; margin: 0 0 20px; }
.login h1 em { font-style: italic; background: linear-gradient(100deg, var(--violet), var(--teal) 55%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .08em; }
.login .lede { color: var(--ink-2); font-size: 16px; max-width: 400px; margin: 0 auto 40px; }
.card { position: relative; padding: 26px; border-radius: 24px; background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.025)); border: 1px solid var(--line-2); backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%); box-shadow: 0 30px 80px -20px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.08); }
.card::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(140deg, rgba(155,140,255,.6), transparent 35%, transparent 65%, rgba(94,231,223,.5)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.google { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 15px 20px; border-radius: 14px; background: #fff; color: #1f1f2b; font-weight: 600; font-size: 15.5px; text-decoration: none; transition: transform .2s, box-shadow .2s; box-shadow: 0 8px 30px -8px rgba(155,140,255,.55); }
.google:hover { transform: translateY(-1px); box-shadow: 0 14px 40px -8px rgba(155,140,255,.75); }
.google:active { transform: translateY(0); }
.google .arrow { width: 16px; height: 16px; margin-left: auto; opacity: .45; transition: transform .2s, opacity .2s; }
.google span { margin-right: auto; }
.google:hover .arrow { transform: translateX(3px); opacity: .8; }
.fine { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 18px 0 0; font-size: 13px; color: var(--ink-3); }
.fine svg { width: 14px; height: 14px; }
.fine strong { color: var(--ink-2); font-weight: 500; }
.auth-error { margin: 0 0 18px; padding: 11px 14px; border-radius: 12px; background: rgba(255,107,129,.12); border: 1px solid rgba(255,107,129,.3); color: #ffc2cc; font-size: 14px; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- app shell ---------- */
.shell { position: relative; z-index: 2; display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px; padding: 24px 18px; border-right: 1px solid var(--line); background: rgba(8,8,14,.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-label { margin: 0 10px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-size: 14px; transition: background .15s, color .15s; }
.side nav a:hover { background: rgba(255,255,255,.04); color: var(--ink); }
.side nav a.on { background: rgba(155,140,255,.12); color: var(--ink); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); flex: none; }
.side nav a.on .dot { background: var(--violet); box-shadow: 0 0 10px var(--violet); }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.025); }
.av { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center; background: linear-gradient(135deg, var(--violet), var(--teal)); font-weight: 600; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.me-text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.me-text strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.out { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--ink-3); }
.out:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.out svg { width: 16px; height: 16px; }
.main { padding: 44px clamp(16px, 4vw, 56px) 80px; max-width: 1180px; width: 100%; animation: rise .6s cubic-bezier(.2,.8,.2,1) both; }

/* ---------- page bits ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 34px; }
.eyebrow { margin: 0 0 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--teal); font-weight: 500; }
.page-head h1 { font: 400 clamp(36px, 5vw, 52px)/1.02 var(--serif); letter-spacing: -.015em; margin: 0 0 10px; }
.page-head .lede { margin: 0; color: var(--ink-2); max-width: 560px; }
.head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.mode { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .1em; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; border: 1px solid; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill-ok { color: var(--ok); background: rgba(74,222,154,.1); border-color: rgba(74,222,154,.28); }
.pill-ok i { animation: pulse 2s ease-out infinite; }
.pill-warn { color: var(--warn); background: rgba(251,191,90,.1); border-color: rgba(251,191,90,.28); }
.pill-bad { color: var(--bad); background: rgba(255,107,129,.1); border-color: rgba(255,107,129,.3); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(74,222,154,.6); } 100% { box-shadow: 0 0 0 9px rgba(74,222,154,0); } }
.alert { margin: -10px 0 26px; padding: 14px 18px; border-radius: 14px; background: rgba(255,107,129,.1); border: 1px solid rgba(255,107,129,.3); color: #ffc2cc; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.tile { padding: 20px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.tile-hero { background: linear-gradient(150deg, rgba(155,140,255,.18), rgba(94,231,223,.06) 70%), var(--panel); border-color: rgba(155,140,255,.25); }
.tile h2 { margin: 0 0 14px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.big { margin: 0; font: 400 32px/1.05 var(--serif); letter-spacing: -.01em; }
.big.num { font-size: 44px; }
.sub { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-3); }

.panel { border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); margin-bottom: 22px; overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.count { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: rgba(255,255,255,.07); color: var(--ink-2); }
.count-warn { background: rgba(251,191,90,.12); color: var(--warn); }

.replies { list-style: none; margin: 0; padding: 0; }
.reply { display: grid; grid-template-columns: 42px 1fr auto; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); transition: background .15s; }
.reply:last-child { border-bottom: 0; }
.reply:hover { background: rgba(255,255,255,.02); }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; text-decoration: none; font-weight: 600; font-size: 16px; background: conic-gradient(from 210deg, #f9ce34, #ee2a7b, #6228d7, #f9ce34); position: relative; }
.avatar::after { content: ''; position: absolute; inset: 2px; border-radius: 50%; background: var(--panel-solid); z-index: 0; }
.avatar { isolation: isolate; }
.avatar { color: var(--ink); }
.avatar::after { z-index: -1; }
.who { min-width: 0; }
.handle { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; text-decoration: none; }
.handle svg { width: 11px; height: 11px; opacity: .45; transition: opacity .15s, transform .15s; }
.handle:hover { color: var(--teal); }
.handle:hover svg { opacity: 1; transform: translate(1px, -1px); }
.name { margin-left: 8px; color: var(--ink-3); font-size: 13.5px; }
.tag { margin-left: 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; padding: 2px 7px; border-radius: 6px; background: rgba(251,191,90,.12); color: var(--warn); }
.msg { margin: 6px 0 4px; color: var(--ink-2); font-style: italic; overflow-wrap: anywhere; }
details summary { cursor: pointer; font-size: 12.5px; color: var(--ink-3); list-style: none; display: inline-flex; align-items: center; gap: 4px; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: '▸'; transition: transform .15s; display: inline-block; }
details[open] summary::before { transform: rotate(90deg); }
details p { margin: 8px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(155,140,255,.08); border: 1px solid rgba(155,140,255,.16); font-size: 13.5px; color: var(--ink-2); }
.when { text-align: right; white-space: nowrap; font-size: 14px; }
.when small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 3px; }
.empty { padding: 34px 22px; color: var(--ink-3); text-align: center; }
.log { margin: 0; padding: 18px 22px; font: 12.5px/1.7 ui-monospace, 'SF Mono', Menlo, monospace; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow-y: auto; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.dash-card { display: block; padding: 22px; border-radius: 20px; text-decoration: none; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); transition: transform .2s, border-color .2s, box-shadow .2s; }
a.dash-card:hover { transform: translateY(-3px); border-color: rgba(155,140,255,.35); box-shadow: 0 24px 60px -24px rgba(91,61,245,.55); }
.dc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.dc-top .eyebrow { margin: 0; }
.dash-card h2 { margin: 0 0 6px; font: 400 28px/1.1 var(--serif); }
.dash-card p { margin: 0 0 20px; color: var(--ink-2); font-size: 14px; }
.dash-card dl { display: flex; gap: 28px; margin: 0; padding-top: 16px; border-top: 1px solid var(--line); }
.dash-card dt { font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .1em; }
.dash-card dd { margin: 4px 0 0; font-weight: 500; }
.dash-card.ghost { border-style: dashed; background: transparent; backdrop-filter: none; display: flex; flex-direction: column; justify-content: center; }
.dash-card.ghost h2 { color: var(--ink-3); }
.dash-card.ghost p { margin: 0; color: var(--ink-3); }

@media (max-width: 1000px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 16px; }
  .side nav { flex-direction: row; order: 3; width: 100%; overflow-x: auto; }
  .nav-label { display: none; }
  .side nav a { white-space: nowrap; }
  .me { margin-left: auto; padding: 6px; border: 0; background: none; }
  .me-text { display: none; }
  .main { padding: 28px 16px 60px; }
}
@media (max-width: 560px) {
  .tiles { grid-template-columns: 1fr; }
  .reply { grid-template-columns: 38px 1fr; }
  .avatar { width: 38px; height: 38px; }
  .when { grid-column: 2; text-align: left; }
  .when small { display: inline; margin-left: 6px; }
  .head-side { align-items: flex-start; }
}
