/* Iris: night lapis, herald gold, one iridescent accent. Type: Source Serif 4 800 + Inter. */
:root {
  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  --text-xl: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem);
  --text-2xl: clamp(2.5rem, 1.8rem + 2.6vw, 4rem);
  --text-num: clamp(2.5rem, 2rem + 2vw, 3.75rem);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --radius: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --bg: #0a0f24;
  --bg-2: #0f1634;
  --surface: rgba(20, 28, 64, 0.66);
  --surface-solid: #141c40;
  --surface-hi: #1a2350;
  --surface-2: rgba(255, 255, 255, 0.05);
  --border: rgba(206, 200, 255, 0.10);
  --border-strong: rgba(206, 200, 255, 0.2);
  --text: #f5f1e6;
  --text-2: #d5d3e3;
  --muted: #9da3c2;
  --gold: #f2cf7a;
  --gold-hi: #f9e2a6;
  --gold-ink: #1c1505;
  --gold-soft: rgba(242, 207, 122, 0.12);
  --iris: linear-gradient(90deg, #ff6b6b, #ffb35c, #ffe27a, #7be3a0, #6cc4ff, #8f8bff, #d58bff);
  --c-dm: #6cc4ff;
  --c-comment: #d58bff;
  --c-review: #ffb35c;
  --ok: #7be3a0;
  --ok-soft: rgba(123, 227, 160, 0.13);
  --warn: #ffc56b;
  --warn-soft: rgba(255, 197, 107, 0.13);
  --err: #ff8f8a;
  --err-soft: rgba(255, 143, 138, 0.13);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 50px rgba(2, 4, 16, 0.4);

  --font-display: 'Source Serif 4', Charter, 'Iowan Old Style', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, 'SF Pro Text', 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100dvh; color: var(--text);
  background: radial-gradient(1100px 620px at 90% -10%, rgba(143, 139, 255, 0.16), transparent 60%),
              radial-gradient(900px 520px at 10% 0%, rgba(108, 196, 255, 0.09), transparent 60%),
              linear-gradient(180deg, var(--bg-2), var(--bg) 560px);
  font: 400 var(--text-base)/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
.sky { position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .9;
  background-image: radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.5), transparent 60%), radial-gradient(1px 1px at 68% 8%, rgba(255,255,255,.4), transparent 60%),
    radial-gradient(1.5px 1.5px at 82% 32%, rgba(255,255,255,.35), transparent 60%), radial-gradient(1px 1px at 34% 46%, rgba(255,255,255,.25), transparent 60%),
    radial-gradient(1px 1px at 52% 72%, rgba(255,255,255,.22), transparent 60%), radial-gradient(1.5px 1.5px at 92% 84%, rgba(255,255,255,.28), transparent 60%),
    radial-gradient(1px 1px at 6% 78%, rgba(255,255,255,.25), transparent 60%), radial-gradient(1px 1px at 44% 92%, rgba(255,255,255,.2), transparent 60%); }
a { color: var(--gold); text-underline-offset: 3px; text-decoration-color: rgba(242, 207, 122, 0.4); }
a:hover { color: var(--gold-hi); text-decoration-color: currentColor; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }
code { font-family: var(--font-mono); font-size: 0.84em; background: var(--surface-2); border: 1px solid var(--border); padding: 2px 7px; border-radius: 7px; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: var(--text-xs); }
.err-text { color: var(--err); }
.warn-text { color: var(--warn); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
.view:focus { outline: none; }
::selection { background: rgba(242, 207, 122, 0.3); }

/* Display type, digital.spot-style: heavy serif, tight tracking */
.display { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; }
.h1 { font-family: var(--font-display); font-weight: 800; font-size: var(--text-2xl); letter-spacing: -0.04em; line-height: 1; }
.h2 { font-family: var(--font-display); font-weight: 800; font-size: var(--text-xl); letter-spacing: -0.03em; line-height: 1.05; }
.h3 { font-weight: 800; font-size: var(--text-lg); letter-spacing: -0.015em; line-height: 1.2; }
.eyebrow { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.02em; color: var(--gold); }
.lede { font-size: 1.125rem; color: var(--text-2); max-width: 60ch; line-height: 1.55; }

/* ---------- buttons, inputs ---------- */
.btn {
  appearance: none; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font: 700 var(--text-sm)/1 var(--font-body); padding: 12px 20px; border-radius: 999px; cursor: pointer; text-decoration: none;
  min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); white-space: nowrap;
  transition: background .18s, border-color .18s, color .18s, transform .12s, box-shadow .18s;
}
.btn:hover { background: rgba(255,255,255,.09); border-color: rgba(206,200,255,.34); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.primary { background: linear-gradient(180deg, var(--gold-hi), #e8c060); border-color: transparent; color: var(--gold-ink); box-shadow: 0 10px 30px rgba(242, 207, 122, .22); }
.btn.primary:hover { box-shadow: 0 12px 36px rgba(242, 207, 122, .32); filter: brightness(1.03); color: var(--gold-ink); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { min-height: 38px; padding: 8px 15px; font-size: var(--text-xs); }
.btn.danger { color: var(--err); }
.btn[data-armed] { background: var(--err-soft); color: var(--err); border-color: var(--err); }
.btn .arrow { transition: transform .18s; }
.btn:hover .arrow { transform: translateX(3px); }

input[type=email], input[type=password], input[type=text], input[type=number], input[type=search], input:not([type]), input[inputmode], select, textarea {
  width: 100%; font: 500 var(--text-base)/1.3 var(--font-body); color: var(--text); background: rgba(4, 7, 22, .5);
  border: 1px solid var(--border-strong); border-radius: 14px; padding: 13px 16px; min-height: 50px;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
input::placeholder, textarea::placeholder { color: rgba(157, 163, 194, .6); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(242, 207, 122, .16); }
label, .label { font-weight: 700; font-size: var(--text-sm); }
.stack { display: grid; gap: var(--s2); }
.row { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.spacer { flex: 1; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--text-sm); font-weight: 600; }
.switch input { appearance: none; width: 46px; height: 26px; border-radius: 999px; background: rgba(255,255,255,.14); position: relative; cursor: pointer; margin: 0; transition: background .18s; flex: none; border: 0; min-height: 0; padding: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(20px); }
.switch input:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); font-weight: 700; padding: 5px 12px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; border: 1px solid var(--border); }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.err { background: var(--err-soft); color: var(--err); border-color: transparent; }
.pill.gold { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.pill.k-dm { color: var(--c-dm); } .pill.k-comment { color: var(--c-comment); } .pill.k-review { color: var(--c-review); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.25); flex: none; display: inline-block; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.dot.err { background: var(--err); box-shadow: 0 0 0 4px var(--err-soft); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: var(--s6); padding: var(--s6) var(--s5); border-right: 1px solid var(--border); background: rgba(8, 12, 30, .55); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: var(--s3); text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-avatar { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px rgba(242, 207, 122, .55), 0 8px 26px rgba(143, 139, 255, .35); }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.9rem; letter-spacing: -0.04em; line-height: 1; }
.nav { display: grid; gap: 4px; }
.nav a { display: flex; align-items: center; gap: var(--s3); padding: 12px 14px; border-radius: 14px; color: var(--text-2); font-weight: 700; font-size: 1.0625rem; text-decoration: none; transition: background .15s, color .15s; position: relative; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current=page] { background: var(--surface-hi); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.nav a[aria-current=page]::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--iris); }
.nav-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; opacity: .9; }
.count { margin-left: auto; background: var(--gold); color: var(--gold-ink); font-size: 12px; font-weight: 800; border-radius: 999px; padding: 1px 8px; }
.side-foot { margin-top: auto; display: grid; gap: var(--s4); }
.health { display: grid; gap: 8px; padding: var(--s4); border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--border); font-size: var(--text-xs); }
.health div { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-weight: 600; }
.health span.muted { margin-left: auto; font-weight: 500; }
.me { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-width: 0; }
.me #me { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.view { padding: var(--s7) clamp(20px, 4vw, 64px) var(--s8); max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s5); margin-bottom: var(--s7); flex-wrap: wrap; }
.page-head > div { display: grid; gap: var(--s3); }
.section { margin-top: var(--s7); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s4); flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s6); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.card.tight { padding: var(--s5); }
.grid { display: grid; gap: var(--s4); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-chart { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.shell > * { min-width: 0; }

/* ---------- overview ---------- */
.stat { display: grid; gap: var(--s2); align-content: start; }
.stat .num { font-family: var(--font-display); font-weight: 800; font-size: var(--text-num); letter-spacing: -0.045em; line-height: 1; }
.stat .label { color: var(--muted); font-weight: 600; }
.stat .sub { font-size: var(--text-xs); color: var(--muted); }
.chart { width: 100%; height: 220px; display: block; }
.chart .bar-dm { fill: var(--c-dm); } .chart .bar-comment { fill: var(--c-comment); } .chart .bar-review { fill: var(--c-review); }
.chart text { fill: var(--muted); font: 600 11px var(--font-body); }
.chart .grid-line { stroke: rgba(255,255,255,.06); }
.legend { display: flex; gap: var(--s4); flex-wrap: wrap; font-size: var(--text-xs); color: var(--text-2); font-weight: 600; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bars { display: grid; gap: var(--s3); }
.bars .b { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: var(--s3); align-items: center; font-weight: 700; }
.bars .track { height: 10px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.bars .fill { height: 100%; border-radius: 999px; background: var(--iris); }
.health-list { display: grid; gap: var(--s3); }
.health-list .h { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.health-list .h:last-child { border-bottom: 0; }
.health-list .h b { font-weight: 700; }
.health-list .h .muted { margin-left: auto; text-align: right; font-size: var(--text-xs); }

.welcome { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: var(--s7); align-items: center; position: relative; overflow: hidden; padding: 0; }
.welcome .copy { padding: var(--s7); display: grid; gap: var(--s4); }
.welcome .art { height: 100%; min-height: 420px; background: url('/assets/iris-hero.webp') 50% 12% / cover no-repeat; position: relative; }
.welcome .art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--surface-solid), transparent 40%); }
.welcome::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--iris); z-index: 1; }
.steps { list-style: none; margin: var(--s2) 0 var(--s3); padding: 0; display: grid; gap: var(--s3); counter-reset: s; }
.steps li { display: flex; align-items: center; gap: var(--s3); font-weight: 700; font-size: 1.0625rem; counter-increment: s; }
.steps li::before { content: counter(s); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; background: var(--surface-2); border: 1px solid var(--border-strong); flex: none; }
.steps li.done { color: var(--muted); }
.steps li.done::before { content: '✓'; background: var(--ok-soft); color: var(--ok); border-color: transparent; }

/* ---------- platform icon ---------- */
.picon { flex: none; display: inline-grid; place-items: center; border-radius: 14px; background: var(--brand); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.picon img { width: 56%; height: 56%; filter: invert(1); }
.picon b { color: #fff; font-weight: 800; }
.picon.all { background: var(--iris); }

/* ---------- rules ---------- */
.rules { display: grid; gap: var(--s4); }
.rule { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s4) var(--s5); align-items: center; }
.rule.off { opacity: .6; }
.rule-name { font-size: var(--text-lg); font-weight: 800; letter-spacing: -0.015em; }
.flow { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s3); }
.flow .arrow-big { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--gold); }
.icons { display: flex; align-items: center; }
.icons .picon { margin-left: -8px; box-shadow: 0 0 0 3px var(--surface-solid); }
.icons .picon:first-child { margin-left: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-static { font-size: var(--text-xs); font-weight: 700; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); display: inline-flex; gap: 6px; align-items: center; }
.rule-meta { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); }
.rule-actions { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* editor */
.editor { display: grid; gap: var(--s5); }
.step-card { display: grid; gap: var(--s4); }
.step-head { display: flex; align-items: baseline; gap: var(--s3); }
.step-num { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; color: var(--gold); letter-spacing: -0.03em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s3); }
.tile { position: relative; display: flex; align-items: center; gap: var(--s3); padding: var(--s4); border-radius: var(--radius-md); background: var(--surface-2); border: 1.5px solid var(--border); cursor: pointer; transition: border-color .15s, background .15s, transform .12s; min-width: 0; }
.tile:hover { border-color: var(--border-strong); background: rgba(255,255,255,.07); }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.tile:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 3px; }
.tile .t-body { min-width: 0; display: grid; }
.tile .t-body b { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .t-body span { font-size: var(--text-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .check { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--border-strong); flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 900; color: transparent; }
.tile:has(input:checked) .check { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.tile.disabled { opacity: .45; cursor: not-allowed; }
.kind-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.kind-tiles .tile { flex-direction: column; align-items: flex-start; gap: 4px; padding: var(--s5); }
.kind-tiles .tile .check { position: absolute; top: 16px; right: 16px; }
.kind-tiles .k-name { font-size: 1.25rem; font-weight: 800; }
.save-bar { position: sticky; bottom: 16px; display: flex; gap: var(--s3); align-items: center; padding: var(--s4) var(--s5); border-radius: 999px; background: rgba(16, 22, 52, .92); border: 1px solid var(--border-strong); box-shadow: var(--shadow); backdrop-filter: blur(12px); z-index: 5; }

/* ---------- channels / destinations ---------- */
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s4); }
.ch { display: grid; gap: var(--s4); }
.ch.off { opacity: .6; }
.ch-head { display: flex; gap: var(--s4); align-items: center; min-width: 0; }
.ch-head > div { min-width: 0; }
.ch-name { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; padding-top: var(--s4); border-top: 1px solid var(--border); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px var(--s5); margin: 0; font-size: var(--text-sm); }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.howto { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.howto .card { display: grid; gap: var(--s2); }
.howto .big { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; letter-spacing: -0.03em; }
.list { display: grid; gap: var(--s3); }
.dest { display: flex; align-items: center; gap: var(--s4); justify-content: space-between; flex-wrap: wrap; padding: var(--s4) var(--s5); }
.dest.off { opacity: .6; }
.dest-main { display: flex; align-items: center; gap: var(--s4); min-width: 0; flex: 1; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; background: var(--surface-hi); border: 1px solid var(--border-strong); flex: none; }
.avatar.group { border-radius: 14px; }
.dest-title { font-weight: 800; font-size: 1.125rem; overflow-wrap: anywhere; }

/* ---------- logs ---------- */
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); gap: 2px; }
.seg button { appearance: none; border: 0; background: none; color: var(--muted); font: 700 var(--text-xs) var(--font-body); padding: 9px 15px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed=true] { background: var(--surface-hi); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }
.feed { display: grid; gap: 0; }
.feed-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: var(--s4); align-items: center; padding: var(--s4) 0; border-bottom: 1px solid var(--border); }
.feed-item:last-child { border-bottom: 0; }
.feed-body { min-width: 0; }
.feed-body .who { font-weight: 800; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; color: var(--text-2); }
.log { list-style: none; margin: 0; padding: 0; font-size: var(--text-sm); font-family: var(--font-body); }
.log li { display: grid; grid-template-columns: 150px 64px minmax(0, 1fr); gap: var(--s3); padding: 10px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.log time { color: var(--muted); font-variant-numeric: tabular-nums; }
.lv { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.lv-info { color: var(--c-dm); } .lv-warn { color: var(--warn); } .lv-error { color: var(--err); }
.search { max-width: 320px; min-height: 42px !important; padding: 9px 16px !important; border-radius: 999px !important; font-size: var(--text-sm) !important; }

/* ---------- settings ---------- */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s5); padding: var(--s4) 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: 0; }
.set-row > div:first-child { display: grid; gap: 2px; max-width: 60ch; }
.set-row b { font-weight: 700; }
.set-row select, .set-row input[type=number] { width: auto; min-width: 160px; }

.empty { text-align: center; padding: var(--s8) var(--s5); display: grid; gap: var(--s4); justify-items: center; }
.empty .h2 { max-width: 22ch; }
.notice { border: 1px solid rgba(242,207,122,.25); background: var(--gold-soft); border-radius: var(--radius-md); padding: var(--s4) var(--s5); font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--s5); }
.notice.warn { border-color: rgba(255,197,107,.3); background: var(--warn-soft); color: var(--warn); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--surface-hi); color: var(--text); border: 1px solid var(--border-strong); box-shadow: var(--shadow); padding: 14px 22px; border-radius: 999px; font-weight: 700; font-size: var(--text-sm); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: min(560px, calc(100% - 32px)); z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: var(--err); color: var(--err); }

.skeleton { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), rgba(255,255,255,.08), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- login ---------- */
body.login { background: var(--bg); }
.login-split { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login-art { position: relative; margin: 0; overflow: hidden; background: #0a1030; }
.login-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; animation: drift 24s ease-in-out infinite alternate; }
.login-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(10, 15, 36, .88) 90%), linear-gradient(90deg, transparent 70%, var(--bg)); }
.login-art figcaption { position: absolute; left: clamp(24px, 5vw, 64px); bottom: clamp(28px, 7vh, 72px); z-index: 1; display: grid; gap: var(--s3); max-width: 15ch; }
.art-quote { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.25rem, 1.4rem + 2.6vw, 4rem); letter-spacing: -0.04em; line-height: 1; }
@keyframes drift { from { transform: scale(1.04); } to { transform: scale(1.09) translateY(-1.5%); } }
.login-panel { display: grid; place-items: center; padding: var(--s7) var(--s5); }
.login-card { width: min(420px, 100%); display: grid; gap: var(--s3); }
.login-avatar { width: 76px; height: 76px; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(242, 207, 122, .5), 0 12px 40px rgba(143, 139, 255, .35); margin-bottom: var(--s3); }
.login-card .wordmark { font-family: var(--font-display); font-weight: 800; font-size: clamp(3.5rem, 3rem + 2vw, 4.75rem); letter-spacing: -0.05em; line-height: .95; }
.login-card .wordmark::after { content: ''; display: block; width: 84px; height: 3px; margin-top: var(--s4); background: var(--iris); border-radius: 3px; }
.login-card .lede { margin-top: var(--s2); }
.login-card form { margin-top: var(--s5); }
.code-input { font-family: var(--font-mono) !important; font-size: 1.6rem !important; letter-spacing: .5em; text-align: center; }
.form-msg { min-height: 1.4em; color: var(--err); font-size: var(--text-sm); font-weight: 600; }
.login-foot { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--border); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .g-chart { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-right: 0; border-bottom: 1px solid var(--border); background: rgba(8, 12, 30, .9); }
  .brand-avatar { width: 34px; height: 34px; }
  .brand-name { font-size: 1.5rem; }
  .nav { order: 3; width: calc(100% + var(--s4) * 2); display: flex; overflow-x: auto; scrollbar-width: none; gap: 4px; margin: 0 calc(var(--s4) * -1); padding: 0 var(--s4); }
  .nav a { padding: 9px 13px; font-size: var(--text-sm); white-space: nowrap; }
  .nav a[aria-current=page]::before { left: 12px; right: 12px; top: auto; bottom: 2px; width: auto; height: 2px; }
  .nav-ico { display: none; }
  .side-foot { margin: 0 0 0 auto; display: flex; gap: var(--s3); align-items: center; }
  .health { display: flex; padding: 0; background: none; border: 0; gap: 6px; }
  .health div { gap: 0; } .health div > :not(.dot) { display: none; }
  .me #me { display: none; }
  .view { padding: var(--s6) var(--s4) var(--s8); }
  .page-head { margin-bottom: var(--s6); }
  .welcome { grid-template-columns: 1fr; }
  .welcome .art { min-height: 260px; order: -1; }
  .welcome .art::after { background: linear-gradient(0deg, var(--surface-solid), transparent 50%); }
  .welcome .copy { padding: var(--s5); }
  .login-split { grid-template-columns: 1fr; grid-template-rows: 40vh auto; }
  .login-art::after { background: linear-gradient(180deg, transparent 40%, var(--bg)); }
  .login-art figcaption { display: none; }
  .login-panel { place-items: start center; padding-top: 0; margin-top: -40px; position: relative; }
}
@media (max-width: 640px) {
  .g2, .g3, .g4, .g-chart, .howto, .kind-tiles { grid-template-columns: 1fr; }
  .g4.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: var(--s5); border-radius: 18px; }
  .rule { grid-template-columns: 1fr; }
  .rule-actions { justify-content: flex-start; }
  .log li { grid-template-columns: 1fr; gap: 2px; }
  .set-row { flex-direction: column; align-items: flex-start; }
  .save-bar { border-radius: 20px; flex-wrap: wrap; }
  .ch-grid { grid-template-columns: 1fr; }
  .feed-item { grid-template-columns: 36px minmax(0, 1fr); }
  .feed-item > .pill { grid-column: 2; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
