:root {
  color-scheme: dark;
  --bg: #111; --bg-subtle: #191919; --bg-strong: #222; --bg-hover: rgba(255,255,255,.05); --bg-active: rgba(123,104,238,.16); --tooltip: #2a2a2a;
  --line-low: #222; --line: #2a2a2a; --line-high: #484848;
  --text: #eee; --text-2: #b4b4b4; --text-3: #7b7b7b; --text-ph: #6e6e6e;
  --brand: #7b68ee; --brand-dark: #5f48ea; --brand-light: #d3cdf9;
  --danger: #e5484d; --success: #30a46c; --warning: #ffc53d;
  --top: 40px; --rail: 64px; --side: 244px; --r: 6px;
  --t: .15s;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI Variable Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; border-radius: 4px; }
h1, h2, h3 { margin: 0; font-weight: 600; }
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #333; border-radius: 8px; border: 2px solid var(--bg); } ::-webkit-scrollbar-track { background: transparent; }

/* Shell */
.topbar { height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 10px; position: relative; border-bottom: 1px solid var(--line-low); }
.ws { display: flex; align-items: center; gap: 8px; font-weight: 600; padding: 3px 6px; border-radius: var(--r); }
.ws img { width: 20px; height: 20px; }
.search-btn { position: absolute; left: 50%; transform: translateX(-50%); width: min(380px, 40vw); height: 28px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 14px; background: var(--bg-strong); color: var(--text-3); }
.search-btn kbd { font: inherit; font-size: 11px; margin-right: auto; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.layout { display: flex; height: calc(100vh - var(--top)); }
.rail { width: var(--rail); flex: none; display: flex; flex-direction: column; align-items: center; padding: 8px 0; gap: 2px; border-right: 1px solid var(--line-low); overflow-y: auto; scrollbar-width: none; }
.rail a { width: 56px; padding: 6px 0 5px; display: flex; flex-direction: column; align-items: center; gap: 3px; border-radius: 8px; color: var(--text-3); font-size: 10.5px; font-weight: 500; transition: background var(--t), color var(--t); position: relative; }
.rail a:hover { background: var(--bg-hover); color: var(--text); }
.rail a.on { color: var(--text); }
.rail a.on .ic { background: linear-gradient(135deg, var(--brand), #c04de0); color: #fff; }
.rail .ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; }
.rail .ic svg.i { width: 18px; height: 18px; }
.rail .dot { position: absolute; top: 2px; right: 6px; min-width: 15px; height: 15px; padding: 0 3px; font-size: 10px; line-height: 15px; text-align: center; border-radius: 8px; background: var(--danger); color: #fff; }
.btn .dot { position: absolute; top: -2px; right: -4px; min-width: 15px; height: 15px; padding: 0 3px; font-size: 10px; line-height: 15px; text-align: center; border-radius: 8px; background: var(--danger); color: #fff; }
.rail .spacer { flex: 1; }
.side { width: var(--side); flex: none; border-right: 1px solid var(--line-low); background: var(--bg); display: flex; flex-direction: column; overflow: hidden; }
.side-head { height: 44px; padding: 0 10px 0 14px; display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; flex: none; }
.side-body { flex: 1; overflow-y: auto; padding: 0 8px 16px; }
.side-label { display: flex; justify-content: space-between; align-items: center; padding: 12px 6px 4px; color: var(--text-3); font-size: 12px; font-weight: 500; }
.nav-item { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border-radius: var(--r); color: var(--text-2); width: 100%; text-align: left; white-space: nowrap; overflow: hidden; }
.nav-item span.t { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.on { background: var(--bg-active); color: var(--text); font-weight: 500; }
.nav-item .count { color: var(--text-3); font-size: 11px; }
.nav-item.sub { padding-left: 28px; }
.space-tile { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.loc { height: 40px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 16px; }
.loc h1 { font-size: 14px; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc .right { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.crumb { color: var(--text-3); font-weight: 400; }
.tabs { display: flex; align-items: center; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--line-low); flex: none; overflow-x: auto; scrollbar-width: none; }
.tab { height: 34px; padding: 0 10px; display: flex; align-items: center; gap: 6px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); border-color: var(--brand); }
.toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 16px; flex: none; flex-wrap: wrap; }
.toolbar .right { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.content { flex: 1; overflow: auto; padding: 0 16px 32px; }
.content.pad { padding: 20px 24px 40px; }

/* Controls */
.btn { height: 28px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: var(--r); border: 1px solid var(--line); background: transparent; color: var(--text-2); font-weight: 500; white-space: nowrap; transition: background var(--t), color var(--t); }
.btn:hover { background: var(--bg-hover); color: var(--text); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.white { background: #eee; border-color: #eee; color: #111; }
.btn.white:hover { background: #fff; color: #111; }
.btn.danger:hover { background: rgba(229,72,77,.15); color: var(--danger); border-color: var(--danger); }
.btn.ghost { border-color: transparent; }
.btn.icon { width: 28px; padding: 0; }
.btn:disabled { opacity: .5; cursor: default; }
.chip { height: 24px; padding: 0 8px; display: inline-flex; align-items: center; gap: 5px; border-radius: var(--r); border: 1px solid var(--line); color: var(--text-2); font-size: 12px; background: transparent; }
.chip.on { background: var(--bg-active); border-color: transparent; color: var(--brand-light); }
input.f, select.f, textarea.f { width: 100%; height: 32px; padding: 0 10px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); outline: 0; transition: border-color var(--t); }
textarea.f { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
input.f:focus, select.f:focus, textarea.f:focus { border-color: var(--brand); }
input.f::placeholder, textarea.f::placeholder { color: var(--text-ph); }
input.f.small, select.f.small { height: 28px; width: auto; }
select.plain, input.plain { background: transparent; border: 1px solid transparent; border-radius: var(--r); height: 26px; padding: 0 4px; outline: 0; max-width: 100%; min-width: 0; }
select.plain:hover, input.plain:hover { background: var(--bg-hover); }
select.plain:focus, input.plain:focus { border-color: var(--brand); }
select option { background: #222; color: var(--text); }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { color: var(--text-2); font-size: 12px; font-weight: 500; }
.field small { color: var(--text-3); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid .wide { grid-column: 1 / -1; }

/* Task list */
.group { margin-bottom: 18px; }
.group-head { display: flex; align-items: center; gap: 8px; height: 36px; position: sticky; left: 0; }
.group .grid-table { table-layout: fixed; min-width: 720px; }
.group .grid-table th:first-child { width: 42%; }
.group .grid-table td.title { max-width: none; overflow: hidden; text-overflow: ellipsis; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 5px; color: #fff; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; }
.status-pill .ring { width: 9px; height: 9px; border-radius: 50%; border: 2px solid rgba(255,255,255,.9); }
.grid-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.grid-table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--text-3); padding: 6px 8px; border-bottom: 1px solid var(--line-low); white-space: nowrap; position: sticky; top: 0; background: var(--bg); z-index: 1; }
.grid-table td { padding: 0 8px; height: 36px; border-bottom: 1px solid var(--line-low); white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.grid-table tr.row { cursor: pointer; }
.grid-table tr.row:hover td { background: var(--bg-hover); }
.grid-table td.title { font-weight: 500; max-width: 420px; }
.grid-table td.num, .grid-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.add-row { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 8px; color: var(--text-3); width: 100%; text-align: left; border-radius: var(--r); }
.add-row:hover { background: var(--bg-hover); color: var(--text); }
.add-row input { flex: 1; background: transparent; border: 0; outline: 0; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid currentColor; flex: none; display: inline-block; }
.flag { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); }
.avatars { display: inline-flex; }
.avatar { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 600; color: #fff; margin-left: -4px; border: 2px solid var(--bg); flex: none; }
.avatars .avatar:first-child { margin-left: 0; }
.avatar.lg { width: 28px; height: 28px; font-size: 11px; margin: 0; border: 0; }
.tag { display: inline-block; padding: 1px 6px; border-radius: 4px; background: var(--bg-strong); color: var(--text-2); font-size: 11px; margin-right: 3px; }
.muted { color: var(--text-3); }
.overdue { color: var(--danger); }
.pos { color: var(--success); }
.neg { color: var(--danger); }

/* Board */
.board { display: flex; gap: 10px; align-items: flex-start; min-height: 100%; padding-bottom: 8px; }
.column { width: 268px; flex: none; border-radius: 10px; padding: 8px; background: color-mix(in srgb, var(--c) 11%, var(--bg)); transition: outline var(--t); }
.column.over { outline: 2px solid var(--c); }
.column-head { display: flex; align-items: center; gap: 8px; height: 28px; margin-bottom: 8px; font-weight: 600; }
.card { background: var(--bg-subtle); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 6px; cursor: pointer; transition: border-color var(--t); }
.card:hover { border-color: var(--line-high); }
.card.dragging { opacity: .4; }
.card-title { font-weight: 600; margin-bottom: 8px; overflow-wrap: anywhere; }
.card-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--text-2); font-size: 12px; }
.card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.card-meta svg.i { width: 13px; height: 13px; }

/* Calendar */
.cal-head { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); color: var(--text-3); font-size: 12px; font-weight: 500; }
.cal-head div { padding: 6px 8px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); border-top: 1px solid var(--line-low); border-left: 1px solid var(--line-low); }
.cal-cell { min-height: 112px; padding: 6px; border-right: 1px solid var(--line-low); border-bottom: 1px solid var(--line-low); overflow: hidden; }
.cal-cell.other { background: rgba(255,255,255,.012); color: var(--text-3); }
.cal-cell.today .num { background: var(--brand); color: #fff; border-radius: 50%; }
.cal-cell .num { width: 22px; height: 22px; display: grid; place-items: center; font-size: 12px; margin-bottom: 4px; }
.cal-item { display: block; width: 100%; text-align: left; padding: 2px 6px; border-radius: 4px; margin-bottom: 2px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }

/* Timeline */
.timeline { min-width: 900px; }
.tl-head, .tl-row { display: grid; grid-template-columns: 240px 1fr; border-bottom: 1px solid var(--line-low); align-items: center; }
.tl-row { height: 34px; cursor: pointer; }
.tl-row:hover { background: var(--bg-hover); }
.tl-name { padding: 0 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 500; }
.tl-track { position: relative; height: 100%; }
.tl-days { display: flex; }
.tl-days div { flex: 1; font-size: 10px; color: var(--text-3); padding: 6px 0; text-align: center; border-left: 1px solid var(--line-low); }
.tl-bar { position: absolute; top: 7px; bottom: 7px; border-radius: 5px; min-width: 8px; }
.tl-today { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--danger); }

/* Overlay + modal */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade var(--t); }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--bg-subtle); border: 1px solid var(--line); border-radius: 12px; width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 16px 48px rgba(0,0,0,.5); }
.modal.wide { width: min(780px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; font-size: 15px; font-weight: 600; flex: none; }
.modal-body { padding: 2px 18px 8px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 12px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line-low); flex: none; }
.task-page { position: fixed; inset: 14px; background: var(--bg-subtle); border: 1px solid var(--line); border-radius: 12px; z-index: 50; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 16px 48px rgba(0,0,0,.6); }
.task-top { height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--line-low); flex: none; }
.task-split { flex: 1; display: flex; min-height: 0; }
.task-left { flex: 1; min-width: 0; overflow-y: auto; padding: 22px 36px 40px; }
.task-right { width: 380px; flex: none; border-left: 1px solid var(--line-low); display: flex; flex-direction: column; min-height: 0; }
.task-title { width: 100%; font-size: 24px; font-weight: 700; background: transparent; border: 0; outline: 0; padding: 4px 0; margin-bottom: 14px; }
.props { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 28px; margin-bottom: 18px; }
.prop { display: flex; align-items: center; min-height: 32px; gap: 8px; min-width: 0; }
.prop > label { width: 90px; flex: none; color: var(--text-3); display: flex; align-items: center; gap: 7px; }
.prop > .v { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.section-h { font-size: 13px; font-weight: 600; margin: 22px 0 8px; display: flex; justify-content: space-between; align-items: center; }
.feed { flex: 1; overflow-y: auto; padding: 14px; }
.comment { display: flex; gap: 8px; margin-bottom: 14px; }
.comment .b { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment .who { font-weight: 600; margin-right: 6px; }
.composer { padding: 10px; border-top: 1px solid var(--line-low); display: flex; flex-direction: column; gap: 6px; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 56px 20px; color: var(--text-2); }
.empty h3 { color: var(--text); font-size: 15px; }
.empty .tile { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--brand); }
.empty p { margin: 0; max-width: 360px; }

/* Palette */
.palette { width: min(600px, 100%); align-self: flex-start; margin-top: 8vh; background: var(--bg-subtle); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.palette input { width: 100%; height: 46px; padding: 0 16px; background: transparent; border: 0; border-bottom: 1px solid var(--line); outline: 0; font-size: 14px; }
.palette .res { max-height: 50vh; overflow-y: auto; padding: 6px; }
.res-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r); text-align: left; }
.res-item:hover, .res-item.sel { background: var(--bg-hover); }
.res-item .type { margin-left: auto; color: var(--text-3); font-size: 11px; text-transform: capitalize; }
.pop { position: fixed; z-index: 70; background: var(--bg-subtle); border: 1px solid var(--line); border-radius: 8px; padding: 6px; min-width: 200px; max-height: 320px; overflow-y: auto; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.pop-item { display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; padding: 0 8px; border-radius: 5px; text-align: left; color: var(--text-2); }
.pop-item:hover { background: var(--bg-hover); color: var(--text); }

/* Cards and stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--bg-subtle); border: 1px solid var(--line-low); border-radius: 10px; padding: 14px; display: block; }
a.stat:hover { border-color: var(--line-high); }
.stat .l { color: var(--text-2); font-size: 12px; }
.stat .n { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 10px; }
.panel { background: var(--bg-subtle); border: 1px solid var(--line-low); border-radius: 10px; padding: 14px; min-width: 0; }
.panel h3 { font-size: 13px; margin-bottom: 12px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; }
.bar { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; font-size: 10px; color: var(--text-3); }
.bar i { display: block; width: 100%; max-width: 34px; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 2px; }
.hbar { display: grid; grid-template-columns: 120px 1fr 90px; align-items: center; gap: 8px; height: 28px; }
.hbar .track { background: var(--bg-strong); height: 8px; border-radius: 4px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--brand); }
.hbar .name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hbar .val { text-align: right; font-variant-numeric: tabular-nums; }
.line-row { display: flex; align-items: center; gap: 8px; height: 32px; border-bottom: 1px solid var(--line-low); width: 100%; text-align: left; }
.line-row:last-child { border: 0; }
.line-row .end { margin-left: auto; color: var(--text-2); flex: none; }
.line-row .t { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; margin-bottom: 20px; }
.app-card { background: var(--bg-subtle); border: 1px solid var(--line-low); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 8px; text-align: left; transition: border-color var(--t); }
.app-card:hover { border-color: var(--line-high); }
.app-card .top { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.app-card p { margin: 0; color: var(--text-2); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.app-logo { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; border: 1px solid rgba(255,255,255,.08); }
.state { margin-left: auto; font-size: 11px; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; color: var(--text-3); }
.state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.state.connected { color: var(--success); } .state.error { color: var(--danger); } .state.configured { color: var(--warning); }
.code { font: 12px ui-monospace, Consolas, monospace; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; overflow-wrap: anywhere; white-space: pre-wrap; display: block; }
.note { padding: 10px 12px; border-radius: 8px; background: var(--bg-strong); color: var(--text-2); margin-bottom: 12px; }
.note.warn { background: rgba(255,197,61,.1); color: var(--warning); }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Chat */
.chat { display: flex; height: 100%; min-height: 0; }
.chat-list { width: 300px; flex: none; border-right: 1px solid var(--line-low); overflow-y: auto; }
.chat-item { display: flex; gap: 10px; padding: 10px 12px; width: 100%; text-align: left; border-bottom: 1px solid var(--line-low); }
.chat-item:hover { background: var(--bg-hover); } .chat-item.on { background: var(--bg-active); }
.chat-item .m { min-width: 0; flex: 1; } .chat-item .n { font-weight: 600; display: flex; gap: 6px; } .chat-item .x { color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 72%; padding: 8px 12px; border-radius: 10px; background: var(--bg-strong); white-space: pre-wrap; overflow-wrap: anywhere; align-self: flex-start; }
.msg.out { align-self: flex-end; background: var(--brand-dark); color: #fff; }
.msg small { display: block; opacity: .6; font-size: 11px; margin-top: 3px; }
.badge { background: var(--brand); color: #fff; border-radius: 9px; font-size: 10px; padding: 0 5px; line-height: 16px; height: 16px; }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(600px 400px at 50% 0, rgba(123,104,238,.16), transparent), var(--bg); }
.auth-card { width: min(390px, 100%); background: var(--bg-subtle); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.auth-card img { width: 38px; height: 38px; margin-bottom: 14px; }
.auth-card h1 { font-size: 19px; margin-bottom: 4px; }
.auth-card p { color: var(--text-2); margin: 0 0 18px; }
.auth-card .btn { width: 100%; height: 36px; }
.err { color: var(--danger); min-height: 18px; margin-bottom: 8px; }
.doc-title { width: 100%; background: transparent; border: 0; outline: 0; font-size: 28px; font-weight: 700; margin-bottom: 12px; }
.doc-body { width: 100%; min-height: 60vh; background: transparent; border: 0; outline: 0; resize: none; font-size: 15px; line-height: 1.7; }

#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.toast { background: var(--tooltip); border: 1px solid var(--line-high); padding: 8px 14px; border-radius: 8px; max-width: min(520px, 90vw); box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.toast.bad { border-color: var(--danger); }
.menu-toggle { display: none; }

@media (max-width: 860px) {
  .side { position: fixed; top: var(--top); bottom: 56px; left: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 8px 0 24px rgba(0,0,0,.5); }
  .menu-toggle { display: inline-flex; }
  .layout { flex-direction: column-reverse; }
  .rail { width: 100%; height: 56px; flex-direction: row; padding: 0 4px; border-right: 0; border-top: 1px solid var(--line-low); overflow-x: auto; flex: none; }
  .rail a { flex: none; } .rail .spacer { display: none; }
  .main { min-height: 0; }
  .search-btn { position: static; transform: none; flex: 1; width: auto; }
  .top-right .hide-sm, .ws span { display: none; }
  .content.pad { padding: 14px 16px 32px; }
  .task-page { inset: 0; border-radius: 0; }
  .task-split { flex-direction: column; overflow-y: auto; }
  .task-left { overflow: visible; padding: 16px; flex: none; }
  .task-right { width: 100%; border-left: 0; border-top: 1px solid var(--line-low); min-height: 420px; }
  .props, .form-grid { grid-template-columns: 1fr; }
  .chat-list { width: 100%; } .chat.has-conv .chat-list { display: none; } .chat:not(.has-conv) .chat-main { display: none; }
  .msg { max-width: 88%; }
  .panels { grid-template-columns: 1fr; }
}
