/* Depo SS AI Service. Desain A "Ruang Kendali": rel charcoal di kiri, percakapan sebagai pusat, plat pegawai AI di kanan.
   Kisi 60 px pada bidang charcoal meniru nat ubin 60 x 60. Huruf disajikan dari server sendiri (folder fonts/). */
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-style: normal; font-display: swap; src: url(fonts/barlow-condensed-700.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 800; font-style: normal; font-display: swap; src: url(fonts/barlow-condensed-800.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-weight: 400 700; font-style: normal; font-display: swap; src: url(fonts/instrument-sans.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-style: normal; font-display: swap; src: url(fonts/ibm-plex-mono-500.woff2) format('woff2'); }

:root {
  --bg: #ECE5D6; --surface: #FAF6EC; --surface-2: #F2EBDB; --fg: #1F1D1A; --muted: #5E574C; --line: #D8CEBA; --line-strong: #B4A88F;
  --rail: #23211E; --rail-2: #34302B; --rail-fg: #F4EFE4; --rail-muted: #BDB4A4; --rail-line: #4A443D; --rail-accent: #EB9A60; --rail-on-accent: #1E140C;
  --rail-warn: #F1CD70; --rail-fail: #F3A195; --rail-human: #AFC6EC;
  --accent: #B4531B; --accent-strong: #8F3F10; --accent-soft: #F2DAC4; --on-accent: #FFF7EC;
  --bot-bg: #2A2723; --bot-fg: #F6F0E3;
  --warn: #6A4300; --warn-soft: #F3DDA0; --fail: #96261B; --fail-soft: #F4D3CC; --human: #27456F; --human-soft: #D8E2F2;
  --shadow: 0 1px 0 rgba(31, 29, 26, .05), 0 16px 30px -22px rgba(31, 29, 26, .45);
  --f-display: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', 'Helvetica Neue', sans-serif;
  --f-body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513; --surface: #211F1C; --surface-2: #292622; --fg: #F1EBDD; --muted: #B6AD9C; --line: #3A3631; --line-strong: #5A534A;
    --rail: #0F0E0D; --rail-2: #24211D; --rail-fg: #F4EFE4; --rail-muted: #B3AA9A; --rail-line: #35312C;
    --accent: #E48F55; --accent-strong: #F2AE7C; --accent-soft: #472C1A; --on-accent: #1E140C;
    --bot-bg: #EDE6D6; --bot-fg: #1F1D1A;
    --warn: #F1CD70; --warn-soft: #42360F; --fail: #F3A195; --fail-soft: #47201B; --human: #AFC6EC; --human-soft: #1E2C45;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 18px 34px -22px rgba(0, 0, 0, .9);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.5 var(--f-body); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.rail :focus-visible, .plate-card :focus-visible, .gate-plate :focus-visible { outline-color: var(--rail-accent); }
.ic { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.muted { color: var(--muted); } .small { font-size: 13.5px; } .tiny { font-size: 12.5px; }
.row { display: flex; gap: 10px; align-items: center; } .wrap { flex-wrap: wrap; } .grow { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.right { margin-left: auto; }
.mt { margin-top: 8px; } .mb { margin-bottom: 14px; } .padtop { padding-top: 8px; }

.display { font-family: var(--f-display); font-weight: 800; text-transform: uppercase; line-height: .92; letter-spacing: .008em; text-wrap: balance; }
.eyebrow { font: 500 11.5px/1.3 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-strong); }
.dark-h { font: 500 11px/1.2 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--rail-muted); margin-bottom: 10px; }

/* ---------- kerangka ---------- */
.shell { max-width: 1500px; margin-inline: auto; padding-inline: clamp(16px, 2.2vw, 28px); padding-block: 18px 44px; }
.A { display: grid; grid-template-columns: 236px minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.A.wide { grid-template-columns: 236px minmax(0, 1fr); }
.A.wide .side { display: none; }
.center { display: grid; gap: 16px; min-width: 0; }
.side { display: grid; gap: 18px; align-content: start; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 28px; padding: 4px 2px 0; }
.page-head h1 { font-size: clamp(40px, 4.6vw, 62px); margin-top: 6px; }
.page-head .lead { max-width: 44ch; font-size: 14.5px; color: var(--muted); }

/* bidang charcoal */
.rail, .plate-card, .gate-plate { position: relative; background: var(--rail); color: var(--rail-fg); overflow: hidden; }
.rail::before, .plate-card::before, .gate-plate::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(var(--rail-line) 1px, transparent 1px), linear-gradient(90deg, var(--rail-line) 1px, transparent 1px); background-size: 60px 60px;
  -webkit-mask-image: linear-gradient(160deg, #000 0, transparent 62%); mask-image: linear-gradient(160deg, #000 0, transparent 62%); }
.rail > *, .plate-card > *, .gate-plate > * { position: relative; }
.rail { border-radius: 20px; padding: 22px 16px 18px; display: flex; flex-direction: column; gap: 24px; }
.rail-top, .rail-more { display: flex; flex-direction: column; gap: 24px; }
.brand { display: flex; flex-direction: column; gap: 4px; }
.brand b { font: 800 32px/.9 var(--f-display); letter-spacing: .02em; text-transform: uppercase; }
.brand span { font: 500 11px/1.2 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--rail-accent); }

.tabs { display: flex; flex-direction: column; gap: 4px; }
.tab { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; color: var(--rail-fg); padding: 9px 10px; min-height: 44px; border-radius: 10px; font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.tab:hover { background: var(--rail-2); }
.tab[aria-selected="true"] { background: var(--rail-2); }
.tab[aria-selected="true"] .ic { color: var(--rail-accent); }
.tab .badge { margin-left: auto; }
.badge { display: inline-block; min-width: 22px; text-align: center; border-radius: 6px; background: var(--rail-accent); color: var(--rail-on-accent); font: 500 12px/1 var(--f-mono); padding: 5px 6px; }

/* status jujur di rel */
.status-grid { display: grid; gap: 0; }
.status { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--rail-line); justify-items: start; }
.status:first-child { border-top: 0; padding-top: 0; }
.status .k { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.status .s { font-size: 12.5px; line-height: 1.4; color: var(--rail-muted); }
.status .tiny { color: var(--rail-muted); font: 500 10.5px/1.3 var(--f-mono); }
.chan { display: grid; gap: 10px; }
.chan li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1px 10px; align-items: center; }
.chan .mk { grid-row: span 2; width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font: 500 11px/1 var(--f-mono); border: 1px solid var(--rail-line); color: var(--rail-fg); }
.chan li.main .mk { background: var(--rail-accent); border-color: var(--rail-accent); color: var(--rail-on-accent); }
.chan b { font-weight: 600; font-size: 14px; }
.chan small { font-size: 12.5px; color: var(--rail-muted); }
.plans { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.plans span { font: 500 10px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--rail-line); padding: 5px 6px; border-radius: 5px; color: var(--rail-muted); white-space: nowrap; }
.who-am { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; justify-content: space-between; border-top: 1px solid var(--rail-line); padding-top: 14px; font-size: 13px; color: var(--rail-muted); }
.who-am b { color: var(--rail-fg); font-weight: 600; display: block; }
.rail .btn { background: transparent; border-color: var(--rail-line); color: var(--rail-fg); }
.rail .btn:hover:not(:disabled) { border-color: var(--rail-fg); }

/* ---------- tombol, pil, chip ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 14px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: 14px; line-height: 1.1; }
.btn:hover:not(:disabled) { border-color: var(--fg); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.danger { border-color: var(--fail); color: var(--fail); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 38px; padding: 7px 12px; font-size: 13.5px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.pill { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 4px 10px 4px 8px; font-size: 12.5px; font-weight: 600; line-height: 1.1; white-space: nowrap; border: 1px solid; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: currentColor; flex: none; }
.pill.ok { color: var(--fg); border-color: var(--fg); }
.pill.perhatian { color: var(--warn); background: var(--warn-soft); border-color: var(--warn); }
.pill.masalah { color: var(--fail); background: var(--fail-soft); border-color: var(--fail); }
.pill.simulasi { color: var(--accent-strong); background: var(--accent-soft); border-color: var(--accent); border-style: dashed; }
.pill.belum, .pill.nonaktif { color: var(--muted); border-color: var(--line-strong); }
.pill.belum_teruji { color: var(--human); background: var(--human-soft); border-color: var(--human); }
.rail .pill { background: transparent; }
.rail .pill.ok { color: var(--rail-fg); border-color: var(--rail-fg); }
.rail .pill.perhatian { color: var(--rail-warn); border-color: var(--rail-warn); }
.rail .pill.masalah { color: var(--rail-fail); border-color: var(--rail-fail); }
.rail .pill.simulasi { color: var(--rail-accent); border-color: var(--rail-accent); }
.rail .pill.belum, .rail .pill.nonaktif { color: var(--rail-muted); border-color: var(--rail-line); }
.rail .pill.belum_teruji { color: var(--rail-human); border-color: var(--rail-human); }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; line-height: 1.1; padding: 5px 9px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.chip.need { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.chip.human { background: var(--human-soft); color: var(--human); border-color: var(--human); }
.chip.ai { color: var(--fg); border-color: var(--fg); }
.chip.sim { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent); border-style: dashed; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }

/* saklar */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; min-height: 32px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 48px; height: 28px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-strong); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(20px); background: var(--on-accent); }
.switch input:focus-visible + .track { outline: 3px solid var(--accent); outline-offset: 2px; }
.rail .switch .track { background: var(--rail-2); border-color: var(--rail-line); }
.rail .switch .track::after { background: var(--rail-muted); }
.rail .switch input:checked + .track { background: var(--rail-accent); border-color: var(--rail-accent); }
.rail .switch input:checked + .track::after { background: var(--rail-on-accent); }
.rail .switch input:focus-visible + .track { outline-color: var(--rail-accent); }
.master .switch { font: 800 26px/1 var(--f-display); letter-spacing: .04em; }

/* ---------- kartu, spanduk, isian, tabel ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; min-width: 0; }
.pad { padding: 16px; }
.card h2, .panel > h2 { font: 700 21px/1 var(--f-display); text-transform: uppercase; letter-spacing: .03em; }
.card h3 { font: 500 11.5px/1.3 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.section > h2 { margin-bottom: 10px; }

.banner { border-radius: 12px; padding: 10px 13px; font-size: 14px; line-height: 1.45; border: 1px solid var(--line-strong); }
.banner.sim { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent); border-style: dashed; }
.banner.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.banner.bad { background: var(--fail-soft); color: var(--fail); border-color: var(--fail); }
.banner.info { background: var(--human-soft); color: var(--human); border-color: var(--human); }

input[type="text"], input[type="password"], input[type="number"], textarea, select {
  width: 100%; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 12px; background: var(--surface); }
textarea { min-height: 78px; line-height: 1.5; }
.card input[type="text"], .card input[type="password"], .card input[type="number"], .card textarea, .card select { background: var(--bg); }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; font-weight: 600; }
label.f .hint { font-weight: 400; color: var(--muted); }
label.check { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; cursor: pointer; min-height: 32px; }
label.check input { margin: 3px 0 0; width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
details > summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.chanrow { padding: 12px 0; border-bottom: 1px solid var(--line); gap: 10px 22px; }

.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
th { font: 500 10.5px/1.3 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.wide { min-width: 240px; }
tr.inactive td { opacity: .55; }
pre.raw { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; overflow: auto; max-height: 340px; font: 500 12.5px/1.5 var(--f-mono); }

/* ---------- kotak masuk ---------- */
.chat { display: grid; grid-template-columns: minmax(230px, 288px) minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); height: calc(100vh - 176px); min-height: 520px; }
.chat .card { background: transparent; border: 0; border-radius: 0; }
.list { display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid var(--line) !important; background: var(--surface-2) !important; }
.list-head { padding: 12px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.list-head input[type="text"] { background: var(--surface); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter { border: 1px solid var(--line-strong); background: transparent; border-radius: 999px; padding: 6px 11px; font-size: 13px; font-weight: 600; color: var(--muted); min-height: 32px; }
.filter[aria-pressed="true"] { background: var(--rail); color: var(--rail-fg); border-color: var(--rail); }
.items { overflow-y: auto; flex: 1; padding: 10px 8px; display: flex; flex-direction: column; gap: 6px; }
.grp { font: 500 11px/1.2 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 6px 6px 2px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.grp.q { color: var(--warn); }
.grp .n { border: 1px solid currentColor; border-radius: 5px; padding: 2px 6px; }
.item { display: grid; gap: 6px; width: 100%; text-align: left; border: 1px solid transparent; border-radius: 12px; background: transparent; padding: 10px; min-height: 44px; }
.item:hover { border-color: var(--line); }
.item[aria-current="true"] { background: var(--surface); border-color: var(--line-strong); }
.item .name { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .prev { color: var(--muted); font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .tiny { font: 500 11px/1.3 var(--f-mono); }
.chips { gap: 6px; flex-wrap: wrap; }

.thread { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.thread-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; }
.thread-head h2 { font: 700 28px/1 var(--f-display); text-transform: uppercase; letter-spacing: .02em; overflow-wrap: anywhere; }
.thread-head .tiny { margin-top: 4px; }
.flow { flex: 1 0 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 6px; }
.flow li { position: relative; display: grid; justify-items: start; align-content: start; gap: 4px; padding-right: 10px; }
.flow li::before { content: ""; position: absolute; left: 30px; right: 0; top: 14px; height: 2px; background: var(--line); }
.flow li:last-child::before { display: none; }
.flow .dot { position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--muted); font: 500 11px/1 var(--f-mono); }
.flow .lab { font-size: 13px; font-weight: 600; line-height: 1.25; margin-top: 2px; }
.flow .sub { font: 500 10.5px/1.3 var(--f-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.flow li.done .dot { background: var(--fg); border-color: var(--fg); color: var(--surface); }
.flow li.done::before { background: var(--fg); }
.flow li.now .dot { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); animation: pulse 1.3s ease-in-out infinite; }
.flow li.now .sub { color: var(--accent-strong); }
.flow li.warn .dot { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.flow li.warn .sub { color: var(--warn); }
.flow li.bad .dot { background: var(--fail-soft); border-color: var(--fail); color: var(--fail); }
.flow li.bad .sub { color: var(--fail); }
.flow li.human .dot { background: var(--human-soft); border-color: var(--human); color: var(--human); }
.flow li.human .sub { color: var(--human); }
.flow li.todo .lab { color: var(--muted); }

.msgs { flex: 1; overflow-y: auto; padding: 20px 18px; display: flex; flex-direction: column; gap: 12px; }
.msg { align-self: flex-start; max-width: min(62ch, 86%); padding: 11px 15px; border-radius: 16px; border-top-left-radius: 4px; font-size: 15.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--line); }
.msg.out { align-self: flex-end; background: var(--bot-bg); color: var(--bot-fg); border-color: var(--bot-bg); border-radius: 16px; border-top-right-radius: 4px; }
.msg.admin { background: var(--human-soft); color: var(--fg); border-color: var(--human); }
.msg .who { font: 500 10.5px/1.3 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.msg .meta { font-size: 12px; color: var(--muted); margin-top: 5px; }
.msg.out .who, .msg.out .meta { color: inherit; opacity: .72; }
.msg.admin .who, .msg.admin .meta { color: var(--human); opacity: 1; }
.msg.failed { border-color: var(--fail); box-shadow: 0 0 0 2px var(--fail-soft); }
.msgs .banner { align-self: stretch; }
.card .msg.out { align-self: flex-start; max-width: 100%; }
.composer { border-top: 1px solid var(--line); background: var(--surface-2); padding: 12px 14px; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; resize: vertical; min-height: 44px; max-height: 160px; background: var(--surface); }
.thread-head:empty, .composer:empty { display: none; }
.empty { margin: auto; text-align: center; color: var(--muted); padding: 40px 20px; font-size: 14px; max-width: 38ch; }
.back { display: none; }

/* ---------- kolom kanan ---------- */
.plate-card { border-radius: 20px; padding: 20px 18px; display: grid; gap: 16px; }
.plate-card .eyebrow { color: var(--rail-accent); }
.plate-card h2 { font: 800 34px/.92 var(--f-display); text-transform: uppercase; letter-spacing: .008em; text-wrap: balance; margin-top: 8px; }
.kv { display: grid; gap: 10px; }
.kv dt { font: 500 10.5px/1.3 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--rail-muted); }
.kv dd { font-size: 14px; line-height: 1.4; }
.state-line { font-size: 13px; line-height: 1.4; color: var(--rail-muted); border-top: 1px solid var(--rail-line); padding-top: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: grid; gap: 12px; min-width: 0; }
.panel > h2 { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 10px; align-items: baseline; }
.panel > h2 small { font: 500 10.5px/1.2 var(--f-mono); letter-spacing: .06em; color: var(--muted); }
.tally li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.tally li:first-child { border-top: 0; padding-top: 0; }
.tally b { font: 700 26px/1 var(--f-display); }
.tally li.q b { color: var(--warn); }

/* ---------- halaman masuk ---------- */
.gate { max-width: 440px; padding-top: 7vh; display: grid; gap: 14px; }
.gate-plate { border-radius: 20px; padding: 22px 20px; display: grid; gap: 14px; }
.gate-plate p { font-size: 13.5px; color: var(--rail-muted); }
.gate .card h1 { font: 700 26px/1 var(--f-display); text-transform: uppercase; letter-spacing: .02em; }

.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--rail); color: var(--rail-fg); padding: 11px 16px; border-radius: 11px; box-shadow: var(--shadow); z-index: 20; max-width: 92vw; font-size: 14px; }
.toast.bad { background: var(--fail); color: #fff; }

@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); } 50% { box-shadow: 0 0 0 6px var(--accent-soft); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- lebar sedang ---------- */
@media (max-width: 1439px) {
  .A, .A.wide { grid-template-columns: 220px minmax(0, 1fr); }
  .side { grid-column: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) { .grid2 { grid-template-columns: 1fr; } }
/* ---------- ponsel ---------- */
@media (max-width: 859px) {
  .A, .A.wide { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .rail { display: contents; }
  .rail-top, .rail-more { position: relative; background: var(--rail); color: var(--rail-fg); border-radius: 18px; padding: 16px; gap: 14px; min-width: 0; }
  .rail-top { order: 0; } .center { order: 1; } .side { order: 2; grid-column: auto; grid-template-columns: minmax(0, 1fr); } .rail-more { order: 3; gap: 20px; }
  .tabs { flex-direction: row; gap: 4px 6px; overflow-x: auto; margin-inline: -6px; padding-inline: 6px; }
  .tab { width: auto; flex: none; }
  .page-head h1 { font-size: 40px; }
  .chat { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
  .list { border-right: 0 !important; }
  .chat .items { max-height: 62vh; }
  .chat.open .list { display: none; } .chat:not(.open) .thread { display: none; }
  .thread { height: 78vh; } .back { display: inline-flex; }
  .thread-head { padding: 12px 14px; }
  .msgs { padding: 16px 14px; }
  .msg { max-width: 92%; }
  .flow .lab { font-size: 12px; }
}
