/* ---------- tokens ---------- */
:root {
  --bg: #f3f1ea;
  --surface: #ffffff;
  --surface-2: #f8f7f2;
  --surface-3: #efece4;
  --ink: #16161b;
  --muted: #6d6b73;
  --line: #e4e0d6;
  --accent: #c8f53c;
  --accent-ink: #16161b;
  --accent-text: #4d6b00;
  --danger: #cf3f25;
  --ok: #1d8f4e;
  --warn: #c98a0c;
  --info: #2f6fdf;
  --shadow: 0 1px 2px rgba(20, 20, 30, .05), 0 6px 20px rgba(20, 20, 30, .06);
  --shadow-lg: 0 10px 40px rgba(20, 20, 30, .18);
  --radius: 14px;

  --z-white: #ffffff;
  --z-ink: #16161b;
  --z-muzzle: #3b3b42;
  --z-pink: #f5b5c4;
  --z-shadow: rgba(0, 0, 0, .08);
  --desk: #dcc5a0;
  --desk-edge: #c2a77d;
  --laptop: #c9cdd4;
  --laptop-logo: #a2a7af;
  --paper: #ffffff;
  --wall: #ebe7dc;
  --wall-2: #e4dfd2;
  --floor: #ddd6c6;
  --gold: #f5c518;
  --gold-dark: #9a7300;
  --brick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='28'%3E%3Crect width='56' height='28' fill='%23e3c8b4'/%3E%3Cpath d='M0 1H56M0 15H56M28 1V15M1 15V28M55 15V28' stroke='%23efe2d6' stroke-width='2.4'/%3E%3C/svg%3E");

  --st-backlog: #8b8a93;
  --st-ready: #2f6fdf;
  --st-in_progress: #e2a20f;
  --st-feedback: #d9452b;
  --st-done: #1d8f4e;

  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e11;
    --surface: #17171c;
    --surface-2: #1c1c22;
    --surface-3: #24242b;
    --ink: #f1f0ec;
    --muted: #9b99a3;
    --line: #2b2b33;
    --accent-text: #c8f53c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .6);
    --z-white: #f2f2ef;
    --z-ink: #111114;
    --z-muzzle: #34343b;
    --z-shadow: rgba(0, 0, 0, .35);
    --desk: #5b4a36;
    --desk-edge: #47392a;
    --laptop: #5c6069;
    --laptop-logo: #3d4047;
    --paper: #2b2b32;
    --wall: #1a1a20;
    --wall-2: #202027;
    --floor: #131317;
    --gold: #f5c518;
    --gold-dark: #8a6700;
    --brick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='28'%3E%3Crect width='56' height='28' fill='%232a1f1c'/%3E%3Cpath d='M0 1H56M0 15H56M28 1V15M1 15V28M55 15V28' stroke='%23161112' stroke-width='2.4'/%3E%3C/svg%3E");
    --st-backlog: #8f8e98;
    --st-ready: #5b92f0;
    --st-in_progress: #f0b429;
    --st-feedback: #ff6a4d;
    --st-done: #3ccf7d;
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.muted { color: var(--muted); }
code, pre { font-family: var(--mono); font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }

/* ---------- buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { background: var(--ink); opacity: .88; }
.btn-accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-accent:hover { background: var(--accent); filter: brightness(.95); }
.btn-danger { color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-icon { width: 36px; padding: 0; font-size: 16px; }
.btn-block { width: 100%; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.field input, .field select, .field textarea, .input {
  width: 100%; padding: 9px 11px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2);
}
.field textarea, textarea.input { resize: vertical; min-height: 80px; line-height: 1.5; }
.field-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 14px; cursor: pointer; }
.check input { margin-top: 3px; }
.form-error { color: var(--danger); min-height: 1em; margin: 0 0 10px; font-size: 13px; }

/* ---------- login ---------- */
.login {
  min-height: 100dvh; display: grid; place-items: center; padding: 16px;
  background:
    repeating-linear-gradient(115deg, transparent 0 46px, rgba(0, 0, 0, .035) 46px 70px),
    var(--bg);
}
.login-card {
  width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 28px; box-shadow: var(--shadow-lg); text-align: center;
}
.login-card h1 { font-size: 26px; letter-spacing: -.02em; margin-top: 8px; }
.login-card p { margin: 6px 0 20px; }
.login-card .field { text-align: left; }
.login-zebra { display: flex; justify-content: center; }

/* ---------- app shell ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px;
  background: repeating-linear-gradient(115deg, var(--ink) 0 10px, transparent 10px 20px);
  opacity: .9; pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { display: flex; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.topbar-actions { margin-left: auto; display: flex; gap: 6px; }

.runner-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2);
  font-size: 12.5px; font-weight: 600; cursor: default; max-width: 46vw; overflow: hidden;
}
.runner-pill span.txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--danger); }

.layout {
  flex: 1; display: grid; gap: 16px; padding: 18px 16px 16px;
  grid-template-columns: minmax(0, 1fr) 390px;
  grid-template-rows: auto minmax(0, 1fr);
  height: calc(100dvh - 57px); min-height: 640px;
}
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.office-panel { grid-column: 1; grid-row: 1; overflow: hidden; }
.board-panel { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; min-height: 0; }
.chat-panel { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; min-height: 0; position: relative; }
.search { margin-left: auto; }
.search input { height: 32px; width: 220px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); }

.mobile-tabs { display: none; }

/* ---------- office ---------- */
.room { position: relative; background: linear-gradient(var(--wall-2) 0 0) 0 46% / 100% 2% no-repeat, linear-gradient(transparent 48%, var(--floor) 48%), var(--brick) 0 0 / 56px 28px; }
.room-wall { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 14px 18px 0; }
.neon {
  font-weight: 900; font-size: 13px; letter-spacing: .28em; padding: 6px 10px; border-radius: 6px;
  color: var(--accent-text); border: 2px solid currentColor; white-space: nowrap;
  text-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent);
  transform: rotate(-2deg); background: color-mix(in srgb, var(--surface) 70%, transparent);
}
@media (prefers-color-scheme: dark) { .neon { box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 35%, transparent), inset 0 0 10px color-mix(in srgb, var(--accent) 25%, transparent); } }
.whiteboard {
  background: var(--paper); border: 2px solid var(--line); border-radius: 10px; padding: 8px 12px;
  min-width: 0; box-shadow: 0 2px 0 var(--wall-2);
}
.wb-title { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-title .key { font-family: var(--mono); color: var(--muted); font-weight: 600; margin-right: 6px; }
.wb-title .mission { font-size: 10px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; background: var(--ink); color: var(--gold); border-radius: 4px; padding: 2px 6px; margin-right: 8px; vertical-align: 1px; }
.wb-title .proj { color: var(--muted); font-weight: 500; }
.wb-idle { color: var(--muted); font-size: 13px; }
.pipeline { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.pipe-step {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-3); color: var(--muted); display: inline-flex; align-items: center; gap: 4px;
}
.pipe-step.done { color: var(--ok); }
.pipe-step.now { background: var(--c, var(--ink)); color: #fff; }
.clock { font-family: var(--mono); font-weight: 700; font-size: 13px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }

.floor { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; padding: 54px 12px 12px; }
.station { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.station .z-station { width: 100%; max-width: 168px; height: auto; display: block; overflow: visible; }
.nameplate { text-align: center; margin-top: 2px; line-height: 1.15; }
.nameplate b { font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.nameplate span { font-size: 11px; color: var(--muted); }
.nameplate .dot { width: 7px; height: 7px; }
.station[data-state="working"] .nameplate .dot { background: var(--ok); }
.station[data-state="waiting"] .nameplate .dot { background: var(--st-feedback); }
.station[data-state="paused"] .nameplate .dot { background: var(--warn); }

.activity {
  position: absolute; bottom: calc(100% - 22px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: min(190px, 100%); padding: 5px 9px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: 11.5px; line-height: 1.3; text-align: center;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: opacity .25s;
}
.activity.idle { color: var(--muted); font-style: italic; background: var(--surface-2); }
.activity:empty { opacity: 0; }
.station[data-state="working"] .activity { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }

.speech {
  position: absolute; z-index: 5; bottom: calc(100% + 10px); left: 50%;
  width: 230px; max-width: 70vw; transform: translateX(-50%) scale(.9); opacity: 0;
  background: var(--surface); border: 2px solid var(--c); border-radius: 14px; padding: 8px 11px;
  box-shadow: var(--shadow-lg); font-size: 12.5px; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.speech.show { opacity: 1; transform: translateX(-50%) scale(1); }
.speech::after {
  content: ""; position: absolute; top: 100%; left: 50%; margin-left: -8px;
  border: 8px solid transparent; border-top-color: var(--c);
}
.speech .to { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: block; }
.station:first-child .speech { left: 0; transform: none; }
.station:first-child .speech::after { left: 40px; }
.station:last-child .speech { left: auto; right: 0; transform: none; }
.station:last-child .speech::after { left: auto; right: 32px; }

.flying-doc {
  position: absolute; z-index: 6; width: 22px; height: 28px; border-radius: 3px;
  background: var(--paper); border: 2px solid var(--c); box-shadow: var(--shadow);
  transition: left .9s cubic-bezier(.5, 0, .3, 1), top .9s cubic-bezier(.5, -.6, .3, 1), opacity .3s;
}
.flying-doc::before { content: ""; position: absolute; inset: 6px 4px auto; height: 2px; background: var(--c); box-shadow: 0 5px 0 var(--c), 0 10px 0 var(--c); }

/* station states */
.z-bubble-q, .z-zzz, .z-steam { opacity: 0; transition: opacity .3s; }
.z-eyes, .z-body { transform-box: fill-box; transform-origin: 50% 100%; }
.z-eyes { transform-origin: center; animation: blink 6s infinite; }
.station[data-state="idle"] .z-steam { opacity: 1; animation: steam 2.4s ease-in-out infinite; }
.station[data-state="working"] .z-body { animation: bob .8s ease-in-out infinite; }
.station[data-state="working"] .z-logo circle { fill: var(--accent); filter: drop-shadow(0 0 4px var(--accent)); animation: pulse 1.4s ease-in-out infinite; }
.station[data-state="waiting"] .z-bubble-q { opacity: 1; animation: hop 1.2s ease-in-out infinite; }
.station[data-state="waiting"] .z-body { transform: rotate(-6deg); transition: transform .4s; }
.station[data-state="paused"] .z-zzz,
.room.offline .z-zzz { opacity: 1; animation: float 2.5s ease-in-out infinite; }
.station[data-state="paused"] .z-eyes,
.room.offline .z-eyes { animation: none; transform: scaleY(.12); }
.room.offline .station { filter: grayscale(.85); opacity: .55; }
.room.offline .station .z-steam { opacity: 0; }

.station[data-state="working"] .g-glow { animation: pulse 1s ease-in-out infinite; }
.station[data-state="working"] .z-speaker { animation: thump .45s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.station[data-state="working"] .g-chain { animation: bling 2.4s linear infinite; }
@keyframes thump { 50% { transform: scale(1.18); } }
@keyframes bling { to { stroke-dashoffset: -18; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.5px); } }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes steam { 0% { transform: translateY(2px); opacity: .2; } 50% { opacity: .8; } 100% { transform: translateY(-3px); opacity: .2; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

.offline-veil {
  position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  border-radius: 12px; padding: 10px 16px; font-weight: 600; text-align: center; max-width: 90%;
}
.offline-veil small { display: block; font-weight: 400; color: var(--muted); margin-top: 2px; }

/* ---------- board ---------- */
.board { flex: 1; min-height: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: 10px; padding: 12px; overflow-x: auto; }
.column { display: flex; flex-direction: column; min-height: 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.column.drag-over { border-color: var(--info); background: color-mix(in srgb, var(--info) 6%, var(--surface-2)); }
.column-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px; font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; }
.column-head .count { margin-left: auto; font-family: var(--mono); color: var(--muted); font-weight: 600; }
.column-head .dot { background: var(--sc); }
.column-head .hint { font-size: 10.5px; text-transform: none; letter-spacing: 0; font-weight: 700; color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 1px 7px; }
.cards { flex: 1; min-height: 60px; overflow-y: auto; padding: 4px 8px 10px; display: flex; flex-direction: column; gap: 8px; }
.empty-col { color: var(--muted); font-size: 12.5px; text-align: center; padding: 18px 8px; border: 1.5px dashed var(--line); border-radius: 10px; }

.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; cursor: pointer; box-shadow: 0 1px 1px rgba(0, 0, 0, .03);
  transition: transform .12s, box-shadow .12s, border-color .12s; overflow: hidden;
}
.card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.card.dragging { opacity: .4; }
.card.feedback { border-left: 4px solid var(--st-feedback); }
.card.in_progress::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: repeating-linear-gradient(115deg, var(--ink) 0 8px, var(--accent) 8px 16px);
  background-size: 37px 4px; animation: stripes 1s linear infinite;
}
@keyframes stripes { to { background-position: 37px 0; } }
.card-top { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.card-key { font-family: var(--mono); font-weight: 600; }
.prio { margin-left: auto; font-weight: 700; font-size: 11px; }
.prio.urgent { color: var(--danger); }
.prio.high { color: var(--warn); }
.prio.low { color: var(--muted); opacity: .8; }
.card-title { font-weight: 600; margin: 4px 0 8px; line-height: 1.35; word-break: break-word; }
.card-foot { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 6px; background: var(--surface-3); color: var(--muted); font-size: 11.5px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type-ico { font-size: 12px; }
.card-who { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.card-who .z-head { flex: none; }
.needs-you { color: var(--st-feedback); font-weight: 700; }

/* ---------- chat ---------- */
.chat-controls { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.chat-controls select { height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); padding: 0 6px; max-width: 150px; font-size: 12.5px; }
.toggle { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.chat { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 12px 18px; display: flex; flex-direction: column; gap: 10px; }
.chat.hide-thoughts .msg.thought { display: none; }
.msg { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; }
.msg-body { min-width: 0; }
.msg-meta { display: flex; align-items: baseline; gap: 6px; font-size: 12px; flex-wrap: wrap; }
.msg-meta b { font-size: 13px; }
.msg-meta .arrow { color: var(--muted); }
.msg-meta time { margin-left: auto; color: var(--muted); font-size: 11px; }
.msg-meta .tk { font-family: var(--mono); font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; cursor: pointer; }
.msg-text { margin-top: 3px; padding: 8px 11px; border-radius: 4px 12px 12px 12px; background: var(--surface-2); border: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; }
.msg.to-user .msg-text { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.msg.thought .msg-text { background: transparent; border-style: dashed; color: var(--muted); font-size: 12.5px; max-height: 5.6em; overflow: hidden; cursor: pointer; }
.msg.thought .msg-text.open { max-height: none; }
.msg.thought .msg-meta b::after { content: " tænker"; font-weight: 400; color: var(--muted); }
.msg.system { display: block; text-align: center; font-size: 12px; color: var(--muted); padding: 2px 10px; }
.msg.system time { margin-left: 6px; font-size: 10.5px; }
.chat-empty { margin: auto; text-align: center; color: var(--muted); padding: 24px; max-width: 260px; }
.chat-jump { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); border-radius: 999px; border: 0; background: var(--ink); color: var(--bg); padding: 6px 14px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-lg); }

/* ---------- drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(10, 10, 14, .35); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(680px, 100vw);
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg);
  transform: translateX(105%); transition: transform .22s ease; display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.dr-head { padding: 14px 18px 10px; border-bottom: 1px solid var(--line); }
.dr-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.dr-top .card-key { font-size: 13px; }
.dr-top .btn-icon { margin-left: auto; }
.dr-title { width: 100%; font-size: 20px; font-weight: 750; letter-spacing: -.01em; border: 1px solid transparent; border-radius: 8px; padding: 4px 6px; margin: 4px -7px 6px; background: transparent; }
.dr-title:hover, .dr-title:focus { border-color: var(--line); background: var(--surface-2); }
.dr-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dr-meta select { height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); padding: 0 6px; font-size: 12.5px; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--sc) 14%, var(--surface)); color: var(--sc); }
.status-badge .dot { background: var(--sc); }
.dr-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.dr-links code { background: var(--surface-3); padding: 1px 6px; border-radius: 5px; }
.dr-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); align-items: center; }
.dr-actions .note { font-size: 12.5px; color: var(--muted); margin-right: auto; }
.dr-scroll { flex: 1; overflow-y: auto; }
.dr-section { padding: 14px 18px; }
.dr-section h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.dr-desc { width: 100%; min-height: 110px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); resize: vertical; line-height: 1.5; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 18px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.tab { border: 0; background: none; padding: 10px 10px 9px; font-weight: 650; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--ink); border-bottom-color: var(--ink); }
.tab .n { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-left: 3px; }

.timeline { display: flex; flex-direction: column; gap: 12px; }
.cm { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
.cm-avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-weight: 800; font-size: 13px; }
.cm-head { font-size: 12.5px; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.cm-head time { color: var(--muted); font-size: 11.5px; }
.cm-tag { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 1px 6px; border-radius: 4px; }
.cm-tag.question { background: var(--st-feedback); color: #fff; }
.cm-tag.delivery { background: var(--accent); color: var(--accent-ink); }
.cm-body { margin-top: 4px; padding: 9px 12px; border-radius: 4px 12px 12px 12px; background: var(--surface-2); border: 1px solid var(--line); word-break: break-word; }
.cm.question .cm-body { border-color: var(--st-feedback); }
.cm.delivery .cm-body { border-color: color-mix(in srgb, var(--accent) 70%, var(--line)); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.cm.user .cm-body { background: var(--surface); }
.cm-sys { font-size: 12px; color: var(--muted); padding-left: 40px; }
.cm-sys time { margin-left: 6px; font-size: 11px; }

.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p, .prose ul, .prose ol, .prose pre { margin: 0 0 .6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose h3, .prose h4, .prose h5, .prose h6 { margin: .8em 0 .35em; font-size: 14px; }
.prose code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
.prose pre { background: var(--surface-3); padding: 10px 12px; border-radius: 8px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose a { color: var(--info); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.chk.on { color: var(--ok); }

.composer { border-top: 1px solid var(--line); padding: 12px 18px; background: var(--surface); }
.composer textarea { width: 100%; min-height: 70px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); resize: vertical; }
.composer-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.composer-row .hint { font-size: 12px; color: var(--muted); margin-right: auto; }

.docs-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.doc-pill { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.doc-pill.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.doc-pill:disabled { opacity: .45; cursor: default; }
.doc { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--surface-2); }

/* ---------- modal ---------- */
.modal { border: 0; padding: 0; border-radius: 18px; width: min(620px, calc(100vw - 24px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(10, 10, 14, .45); }
.modal-body { padding: 18px 20px; }
.modal-head { display: flex; align-items: center; margin-bottom: 14px; }
.modal-head h2 { font-size: 18px; }
.modal-head .btn { margin-left: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 600; max-width: 360px; animation: toast-in .2s ease; }
.toast.err { background: var(--danger); color: #fff; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .layout { grid-template-columns: minmax(0, 1fr) 330px; }
}
@media (max-width: 980px) {
  .layout { display: block; height: auto; min-height: 0; padding: 12px 16px 24px; }
  .layout > .panel { display: none; }
  .layout[data-view="office"] .office-panel,
  .layout[data-view="board"] .board-panel,
  .layout[data-view="chat"] .chat-panel { display: flex; flex-direction: column; }
  .layout[data-view="office"] .office-panel { display: block; }
  .board-panel { height: calc(100dvh - 140px); }
  .chat-panel { height: calc(100dvh - 140px); }
  .mobile-tabs {
    display: flex; gap: 4px; padding: 10px 16px 0; position: sticky; top: 57px; z-index: 15; background: var(--bg);
  }
  .mobile-tabs button { flex: 1; height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; font-weight: 650; color: var(--muted); }
  .mobile-tabs button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
  .tab-badge { display: inline-block; min-width: 8px; height: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; margin-left: 4px; }
}
@media (max-width: 760px) {
  .floor { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 54px; }
  .room-wall { grid-template-columns: 1fr; gap: 8px; }
  .neon, .clock { display: none; }
  .room { background: linear-gradient(var(--wall-2) 0 0) 0 22% / 100% 1% no-repeat, linear-gradient(transparent 23%, var(--floor) 23%), var(--brick) 0 0 / 56px 28px; }
  .station:nth-child(3) .speech { left: auto; right: 0; transform: none; }
  .station:nth-child(3) .speech::after { left: auto; right: 32px; }
  .station:nth-child(4) .speech { left: 0; transform: none; }
  .station:nth-child(4) .speech::after { left: 40px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .brand-name { display: none; }
  .topbar { gap: 8px; }
  .runner-pill { max-width: 52vw; }
  #new-task-btn { padding: 0 10px; }
  .search input { width: 140px; }
  .chat-panel .panel-head { flex-wrap: wrap; row-gap: 8px; }
  .chat-controls { margin-left: 0; width: 100%; }
  .chat-controls select { flex: 1; max-width: none; }
  .board { grid-auto-columns: minmax(78vw, 1fr); }
  .drawer { width: 100vw; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
