/* PF018 Drago — tokens from design/README.md (light / dark, every text pair measured ≥ 4.5 : 1) */
:root {
  --bg: #F6F6F3; --surface: #FFFFFF; --surface-2: #F1F1EC; --line: #E4E4DE; --text: #17191E; --muted: #596170;
  --action: #2448D8; --on-action: #FFFFFF; --action-soft: #E8EDFD;
  --drago: #0E7A5C; --drago-soft: #E3F2EC; --ok: #13724F; --ok-soft: #E2F1EA; --warn: #9A4A07; --warn-soft: #FBEEDD;
  --danger: #B42318; --danger-soft: #FCE8E6;
  --shadow: 0 1px 2px rgba(20, 22, 30, .05), 0 1px 1px rgba(20, 22, 30, .03);
  --shadow-lg: 0 12px 32px rgba(20, 22, 30, .12);
  --radius: 16px; --radius-sm: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1115; --surface: #171A20; --surface-2: #1E222A; --line: #2A2F38; --text: #ECEEF2; --muted: #A3AAB8;
    --action: #7D9BFF; --on-action: #0F1115; --action-soft: #1F2840;
    --drago: #4CC79E; --drago-soft: #15302A; --ok: #4CC79E; --ok-soft: #15302A; --warn: #F0A24B; --warn-soft: #33260F;
    --danger: #FF7A6E; --danger-soft: #3A1B19; --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1115; --surface: #171A20; --surface-2: #1E222A; --line: #2A2F38; --text: #ECEEF2; --muted: #A3AAB8;
  --action: #7D9BFF; --on-action: #0F1115; --action-soft: #1F2840;
  --drago: #4CC79E; --drago-soft: #15302A; --ok: #4CC79E; --ok-soft: #15302A; --warn: #F0A24B; --warn-soft: #33260F;
  --danger: #FF7A6E; --danger-soft: #3A1B19; --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--action); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.2; margin: 0; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 650; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.sr { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* a scroll box holds its own hidden labels, or they stretch the page on a phone (B-22) */
.board, .table-wrap, .ilist ul, .cal { position: relative; }
:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; border-radius: 6px; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--line); background: var(--surface);
  display: flex; flex-direction: column; padding: 16px 12px; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 14px; text-decoration: none; color: var(--text); font-weight: 750; font-size: 19px; letter-spacing: -.02em; }
.mark { width: 32px; height: 32px; border-radius: 10px; background: var(--drago); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: none; }
:root[data-theme="dark"] .mark { color: #0F1115; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mark { color: #0F1115; } }
.mark.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 14px; }
.mark.agent { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.nav-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 10px 4px; font-weight: 650; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 15px; }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--action-soft); color: var(--action); font-weight: 650; }
.nav .count { margin-left: auto; font-size: 12px; background: var(--drago); color: #fff; border-radius: 999px; padding: 1px 7px; font-weight: 700; }
:root[data-theme="dark"] .nav .count { color: #0F1115; }
.rail-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 6px 0; display: grid; gap: 8px; }
.credits { display: flex; justify-content: space-between; align-items: center; font-size: 14px; text-decoration: none; color: var(--text); padding: 8px 6px; border-radius: 10px; }
.credits:hover { background: var(--surface-2); }
.meter { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--drago); border-radius: 99px; }
.meter.warn > i { background: var(--warn); }
.who { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.who .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: 13px; border: 1px solid var(--line); }
.who .btn-ghost { margin-left: auto; }

main.main { min-width: 0; padding: 28px 32px 140px; }
.page { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.page.wide { max-width: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grid { display: grid; gap: 16px; }
.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)); }
.stack { display: grid; gap: 12px; }
.demo-band { background: var(--warn-soft); color: var(--warn); font-size: 14px; padding: 8px 14px; border-radius: 10px; display: flex; gap: 8px; align-items: center; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card.flat { box-shadow: none; }
.card.pad-0 { padding: 0; }
.card h2 + * { margin-top: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.tile { display: grid; gap: 4px; }
.tile .k { font-size: 14px; color: var(--muted); }
.tile .v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.delta { font-size: 13px; font-weight: 600; }
.delta.up { color: var(--ok); } .delta.down { color: var(--danger); }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.empty svg.i { width: 32px; height: 32px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; font-weight: 600; font-size: 15px; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--action); border-color: var(--action); color: var(--on-action); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.drago { background: var(--drago); border-color: var(--drago); color: #fff; }
:root[data-theme="dark"] .btn.drago { color: #0F1115; }
.btn.danger { color: var(--danger); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 14px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-ghost { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; display: inline-flex; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.cost { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, .22); }
.btn:not(.primary):not(.drago) .cost { background: var(--surface-2); color: var(--muted); }
label.f { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
label.f .hint { font-weight: 400; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: 16px; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus { outline: 2px solid var(--action); outline-offset: 0; border-color: transparent; }
.err { color: var(--danger); font-size: 14px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 14px; }
.chip[aria-pressed="true"] { border-color: var(--action); background: var(--action-soft); color: var(--action); font-weight: 600; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; position: absolute; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; transition: background .15s; }
.switch span::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: var(--shadow); }
.switch input:checked + span { background: var(--drago); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid var(--action); outline-offset: 2px; }

/* ---------- tags ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 650; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.drago { background: var(--drago-soft); color: var(--drago); }
.tag.action { background: var(--action-soft); color: var(--action); }
.ch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.ch b { width: 18px; height: 18px; border-radius: 5px; display: inline-grid; place-items: center; font-size: 10px; color: #fff; font-weight: 800; }
.ch-instagram b { background: #B1306E; } .ch-whatsapp b { background: #137A43; } .ch-email b { background: #4A5568; }
.ch-messenger b { background: #1D5FD1; } .ch-google b { background: #B3261E; } .ch-telegram b { background: #1C7AB8; } .ch-tiktok b { background: #111; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--action); display: inline-block; flex: none; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--drago); display: inline-block; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; transform: scale(.8); } }

/* ---------- tables ---------- */
table.t { width: 100%; border-collapse: collapse; font-size: 15px; }
table.t th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }

/* ---------- Drago: messages ---------- */
.msgs { display: grid; gap: 14px; }
.bubble { max-width: 74%; padding: 12px 16px; border-radius: 18px; line-height: 1.55; overflow-wrap: anywhere; }
.bubble.me { justify-self: end; background: var(--action); color: var(--on-action); border-bottom-right-radius: 6px; }
.bubble.them { justify-self: start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble.drago { justify-self: start; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--drago); border-bottom-left-radius: 6px; }
.bubble.out { justify-self: end; background: var(--surface-2); border-bottom-right-radius: 6px; }
.bubble.out.auto { background: var(--drago-soft); }
.bubble .meta { font-size: 12.5px; color: var(--muted); margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bubble.me .meta { color: inherit; opacity: .85; }
.bubble ul { margin: 6px 0; padding-left: 18px; }
.bubble p + p { margin-top: 8px; }
.links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.links a { font-size: 13.5px; padding: 4px 10px; border-radius: 999px; background: var(--action-soft); color: var(--action); text-decoration: none; font-weight: 600; }
.proposal { margin-top: 10px; padding: 12px; border-radius: 12px; background: var(--drago-soft); display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.proposal b { font-weight: 650; }
.who-line { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 4px; }

/* Drago's bar on every page */
.dbar { position: fixed; left: calc(236px + 50%); transform: translateX(calc(-50% - 118px)); bottom: 20px; width: min(720px, calc(100vw - 300px)); z-index: 30; }
.dbar form { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); border-radius: 999px; padding: 6px 6px 6px 8px; }
.dbar input { flex: 1; border: 0; background: none; padding: 10px 4px; font-size: 16px; min-width: 0; }
.dbar input:focus { outline: none; }
.dbar form:focus-within { outline: 3px solid var(--action); outline-offset: 2px; }
.dbar .ctx { font-size: 12.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.dbar .send { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--drago); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.drawer { position: fixed; right: 16px; top: 16px; bottom: 96px; width: min(440px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: var(--shadow-lg); z-index: 40; display: flex; flex-direction: column; animation: slide .18s ease-out; }
.drawer header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer .body { flex: 1; overflow-y: auto; padding: 16px; }
.drawer .bubble { max-width: 92%; }
@keyframes slide { from { transform: translateX(16px); opacity: 0; } }

/* ---------- inbox ---------- */
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr) 280px; height: calc(100vh - 262px); min-height: 440px; overflow: hidden; }
.inbox > * { min-height: 0; }
.ilist { border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.ilist .tools { padding: 12px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.ilist ul { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.ilist li a { display: grid; gap: 3px; padding: 12px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.ilist li a:hover { background: var(--surface-2); }
.ilist li a[aria-current="true"] { background: var(--action-soft); }
.ilist .name { font-weight: 650; display: flex; gap: 8px; align-items: center; }
.ilist .name time { margin-left: auto; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.ilist .prev { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ilist .unread .prev { color: var(--text); }
.ithread { display: flex; flex-direction: column; min-width: 0; }
.ithread .th-head { padding: 12px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ithread .th-body { flex: 1; overflow-y: auto; padding: 18px; display: grid; gap: 12px; align-content: start; background: var(--bg); }
.ithread .composer { border-top: 1px solid var(--line); padding: 12px 16px; display: grid; gap: 10px; }
.ithread .composer textarea { min-height: 84px; }
.sugg { border: 1px solid var(--drago); background: var(--drago-soft); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; }
.sugg .sources { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.sugg .src { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
.iside { border-left: 1px solid var(--line); padding: 16px; overflow-y: auto; display: grid; gap: 14px; align-content: start; }
.back-link { display: none; }

/* ---------- marketing ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal .dow { font-size: 12.5px; color: var(--muted); font-weight: 650; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal .day { min-height: 112px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; display: grid; align-content: start; gap: 4px; background: var(--surface); }
.cal .day.out { background: var(--surface-2); }
.cal .day .d { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.cal .day.today .d { color: var(--action); }
.cal .pchip { font-size: 12.5px; text-align: left; border: 0; border-left: 3px solid var(--muted); background: var(--surface-2); border-radius: 6px; padding: 4px 6px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.pchip.s-review { border-left-color: var(--warn); } .pchip.s-scheduled, .pchip.s-approved { border-left-color: var(--action); } .pchip.s-published { border-left-color: var(--ok); } .pchip.s-rejected { opacity: .55; text-decoration: line-through; }
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; align-items: start; }
.col { background: var(--surface-2); border-radius: var(--radius); padding: 10px; display: grid; gap: 10px; }
.col h3 { font-size: 14px; display: flex; justify-content: space-between; padding: 4px 4px 0; }
.post { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: grid; }
.post .img { aspect-ratio: 1; background: var(--surface-2); display: grid; }
.post .img svg, .post .img img { width: 100%; height: 100%; display: block; object-fit: cover; }
.post .body { padding: 12px; display: grid; gap: 8px; font-size: 14px; }
.post .cap { white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.flag { background: var(--warn-soft); color: var(--warn); font-size: 13px; padding: 6px 10px; border-radius: 8px; font-weight: 600; }
.editor { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; }
.preview-img { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 1; }
.preview-img svg, .preview-img img { width: 100%; height: 100%; display: block; object-fit: cover; }
.ready-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; }
.ready-list li { display: flex; gap: 8px; align-items: center; }

/* ---------- site factory ---------- */
.stages { display: grid; gap: 10px; }
.stage { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.stage.running { border-color: var(--drago); box-shadow: 0 0 0 3px var(--drago-soft); }
.stage.failed { border-color: var(--danger); }
.stage .doc { grid-column: 2 / 4; font-size: 14px; color: var(--text); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.stage .doc p + p { margin-top: 4px; }
.frame { width: 100%; height: 620px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.frame.phone { width: 390px; max-width: 100%; height: 720px; margin: 0 auto; display: block; }

/* ---------- overlay, toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 17, 21, .45); z-index: 50; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 20px; width: min(760px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal > header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal > .body { padding: 20px; display: grid; gap: 16px; }
.modal > footer { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--surface); }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 15px; animation: fade .15s; max-width: 90vw; }
.toast.err { background: var(--danger); color: #fff; }
.skel { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; min-height: 18px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- auth & onboarding ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.auth .pitch { background: var(--text); color: var(--bg); padding: 56px; display: grid; align-content: center; gap: 22px; }
.auth .pitch h1 { font-size: clamp(34px, 4vw, 52px); letter-spacing: -.03em; line-height: 1.05; }
.auth .pitch .lead { font-size: 19px; opacity: .85; max-width: 46ch; }
.auth .pitch ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.auth .pitch li { display: flex; gap: 12px; align-items: flex-start; }
.auth .pitch li svg { color: var(--drago); margin-top: 2px; }
.auth .formside { display: grid; place-items: center; padding: 32px 20px; }
.auth form { width: min(400px, 100%); display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.auth .btn { white-space: normal; text-align: center; line-height: 1.3; padding-top: 8px; padding-bottom: 8px; min-height: 44px; }
.auth .pitch, .auth .formside { min-width: 0; }
.onb { max-width: 680px; margin: 0 auto; padding: 40px 20px 80px; display: grid; gap: 22px; }
.steps { display: flex; gap: 6px; }
.steps i { height: 5px; flex: 1; border-radius: 99px; background: var(--line); }
.steps i.on { background: var(--drago); }
.kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kinds button { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 14px; text-align: left; cursor: pointer; font-weight: 600; }
.kinds button[aria-pressed="true"] { border-color: var(--action); background: var(--action-soft); color: var(--action); }

/* ---------- mobile ---------- */
.bottom-nav { display: none; }
@media (max-width: 1100px) {
  .inbox { grid-template-columns: 300px minmax(0, 1fr); }
  .iside { display: none; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .rail { display: none; }
  main.main { padding: 16px 16px 160px; }
  .g2, .g3, .g4, .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .grid > * { min-width: 0; }
  .g4.keep { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 35; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a { flex: 1; display: grid; justify-items: center; gap: 2px; font-size: 11.5px; color: var(--muted); text-decoration: none; padding: 6px 2px; min-height: 44px; }
  .bottom-nav a[aria-current="page"] { color: var(--action); font-weight: 650; }
  .dbar { left: 12px; right: 12px; transform: none; width: auto; bottom: calc(68px + env(safe-area-inset-bottom)); }
  .dbar .ctx { display: none; }
  .drawer { left: 8px; right: 8px; width: auto; top: 8px; bottom: 140px; }
  .inbox { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .inbox.has-thread .ilist { display: none; }
  .inbox:not(.has-thread) .ithread { display: none; }
  .ithread .th-body { max-height: 52vh; }
  .back-link { display: inline-flex; }
  .board { grid-template-columns: repeat(4, 82vw); }
  .cal .day { min-height: 74px; }
  .cal .pchip { font-size: 0; height: 8px; padding: 0; }
  .auth { grid-template-columns: 1fr; }
  .auth .pitch { padding: 32px 20px; }
  .kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bubble { max-width: 88%; }
  .frame { height: 520px; }
  h1 { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
