:root {
  --red: #ED3237; --red-soft: #FDE8E8; --red-mid: #F6B9BA; --red-deep: #8E1B1E;
  --ink: #1C1917; --ink-2: #57534E; --ink-3: #A8A29E;
  --bg: #F7F5F3; --card: #FFFFFF; --line: #ECE8E4; --hover: #FAF8F6;
  --ok: #10B981; --warn: #F59E0B; --radius: 9px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #F5F5F4; --ink-2: #C7C2BD; --ink-3: #78716C;
    --bg: #12100F; --card: #1C1917; --line: #2C2724; --hover: #24201D;
    --red-soft: #3A1517; --red-mid: #6B2427;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Poppins, system-ui, sans-serif; background: var(--bg); color: var(--ink); display: flex; min-height: 100vh; font-size: 14px; }
button, input, textarea, select { font: inherit; color: inherit; }
small { color: var(--ink-3); display: block; font-size: 12px; }

/* Sidebar */
.sidebar { width: 240px; flex-shrink: 0; background: var(--card); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; }
.brand-mark { width: 36px; height: 36px; border-radius: var(--radius); background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 700; }
nav { display: flex; flex-direction: column; gap: 2px; }
nav a { padding: 9px 12px; border-radius: var(--radius); color: var(--ink-2); text-decoration: none; }
nav a:hover { background: var(--hover); }
nav a.active { background: var(--red-soft); color: var(--red); font-weight: 600; }
.squad-title { margin: 18px 12px 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.squad-item { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: var(--radius); cursor: pointer; }
.squad-item:hover { background: var(--hover); }
.squad-item .av { position: relative; }
.squad-item b { font-weight: 500; font-size: 13px; }
.me { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 12px 10px 0; border-top: 1px solid var(--line); }
.me-dot { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-weight: 600; }

.av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; flex-shrink: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--card); position: absolute; right: -1px; bottom: -1px; background: var(--ink-3); }
.dot.working { background: var(--ok); }
.dot.blocked { background: var(--red); }
.dot.idle { background: var(--warn); }

/* Main */
main { flex: 1; min-width: 0; padding: 22px 28px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; }
.topbar h1 { margin: 0; font-size: 20px; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.btn { border: 1px solid var(--line); background: var(--card); padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 500; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { filter: brightness(.95); }
.btn.sm { padding: 5px 12px; font-size: 12px; }
.chip { font-size: 11px; font-weight: 600; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; background: var(--red-soft); color: var(--red); text-transform: uppercase; }
.chip.ok { background: #DCFCE7; color: #15803D; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.muted { color: var(--ink-3); }

/* Overview */
.grid { display: grid; gap: 14px; }
.brief { display: grid; grid-template-columns: 1fr 280px; gap: 14px; }
.brief h2, .card h3 { margin: 0 0 8px; font-size: 15px; }
.brief-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 14px; }
.brief-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.brief-item .tag { color: var(--red); font-size: 12px; }
.brief-item p { margin: 6px 0 10px; color: var(--ink-2); font-size: 12px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.kpi .val { font-size: 24px; font-weight: 600; margin: 4px 0; }
.kpi .delta { float: right; font-size: 12px; color: var(--ok); }
.two { grid-template-columns: 1.4fr 1fr; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 70px; gap: 10px; align-items: center; margin: 8px 0; font-size: 12px; }
.bar { height: 12px; background: var(--hover); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--red-mid); }
.bar i.hot { background: var(--red); }
.cols { display: flex; align-items: flex-end; gap: 12px; height: 150px; padding-top: 10px; }
.cols div { flex: 1; text-align: center; font-size: 11px; color: var(--ink-3); }
.cols span { display: block; background: var(--red-mid); border-radius: 3px 3px 0 0; margin-bottom: 6px; }
.cols div:last-child span { background: var(--red); }
.call { display: grid; grid-template-columns: 48px 1fr; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.call em { color: var(--red); font-style: normal; font-size: 12px; }

/* Kanban */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.col { background: var(--hover); border: 1px solid var(--line); border-radius: var(--radius); width: 270px; flex-shrink: 0; padding: 10px; min-height: 300px; }
.col.over { outline: 2px dashed var(--red); }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 10px; font-weight: 600; font-size: 13px; }
.col-head .count { color: var(--ink-3); font-weight: 500; }
.tcard { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 8px; cursor: grab; }
.tcard.p-urgent, .tcard.p-high { border-left-color: var(--red); }
.tcard.p-medium { border-left-color: var(--warn); }
.tcard:hover { box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.tcard .t { font-weight: 500; margin: 0 0 8px; display: flex; justify-content: space-between; gap: 8px; }
.tcard .t .av { width: 24px; height: 24px; font-size: 12px; }
.tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 8px; }
.tag-pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #FEF3C7; color: #B45309; }
.prio { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--red-soft); color: var(--red); }
.meta { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--ink-3); }

/* Drawer */
.drawer { position: fixed; inset: 0; background: rgba(0,0,0,.3); display: flex; justify-content: flex-end; z-index: 10; }
.drawer[hidden] { display: none; }
.panel { width: min(520px, 100%); background: var(--card); height: 100%; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.panel h2 { margin: 0; font-size: 18px; }
.panel label { font-size: 12px; color: var(--ink-3); display: flex; flex-direction: column; gap: 4px; }
.panel input, .panel textarea, .panel select { border: 1px solid var(--line); background: var(--bg); border-radius: var(--radius); padding: 9px 11px; }
.panel textarea { min-height: 110px; resize: vertical; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }
.result { white-space: pre-wrap; background: var(--hover); border-radius: var(--radius); padding: 12px; font-size: 13px; max-height: 320px; overflow-y: auto; }
.panel-actions { display: flex; gap: 8px; justify-content: space-between; margin-top: 4px; }
.btn.danger { color: var(--red); }

@media (max-width: 900px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  main { padding: 16px; }
  .brief, .two { grid-template-columns: 1fr; }
}

/* Auth screen */
.auth { position: fixed; inset: 0; z-index: 20; background: var(--bg); display: grid; place-items: center; padding: 16px; }
.auth[hidden] { display: none; }
.auth form { width: min(380px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.auth h2 { margin: 0; font-size: 20px; }
.auth label { font-size: 12px; color: var(--ink-3); display: flex; flex-direction: column; gap: 4px; }
.auth input { border: 1px solid var(--line); background: var(--bg); border-radius: var(--radius); padding: 10px 12px; }
.auth .btn { margin-top: 6px; padding: 10px; }
.err { color: var(--red); font-size: 13px; min-height: 18px; margin: 0; }
.icon-btn { border: 0; background: none; cursor: pointer; font-size: 18px; color: var(--ink-3); padding: 4px 8px; border-radius: var(--radius); }
.icon-btn:hover { background: var(--hover); }
body:not(.is-admin) .admin-only { display: none !important; }

/* Tables (Team, MCP) */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl code { font-size: 12px; background: var(--hover); padding: 2px 6px; border-radius: 4px; word-break: break-all; }
.role { font-size: 11px; padding: 2px 9px; border-radius: 999px; background: var(--hover); }
.role.admin { background: var(--red-soft); color: var(--red); }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; }
.section-head p { margin: 4px 0 0; }
.checks { display: flex; flex-direction: column; gap: 6px; }
.checks label { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; }
.kv { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; }
.table-wrap { overflow-x: auto; }

/* ================= Pixel office ================= */
:root { --px-ink: #2a2530; --px-cream: #fbf6ea; --px-paper: #fffdf7; --px-line: #2a2530; --px-mute: #8a8076; --px-hi: #FACC15; }
@media (prefers-color-scheme: dark) { :root { --px-cream: #221e1b; --px-paper: #1a1714; --px-line: #4a423c; --px-mute: #a39a90; } }
.pf { font-family: 'Silkscreen', monospace; letter-spacing: .02em; }
body.in-office main { padding: 16px 18px; }
body.in-office .topbar { margin-bottom: 12px; }
.oc { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 14px; height: calc(100vh - 92px); min-height: 560px; }
.oc-left { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
.map-wrap { position: relative; flex: 1; min-height: 0; background: #2a2530; border: 3px solid var(--px-line); box-shadow: 4px 4px 0 rgba(0,0,0,.18); display: grid; place-items: center; overflow: hidden; }
#map { width: 100%; height: 100%; image-rendering: pixelated; }
.map-chip { position: absolute; left: 12px; bottom: 12px; background: var(--px-paper); border: 2px solid var(--px-line); padding: 4px 10px; font: 12px 'Silkscreen', monospace; display: flex; gap: 8px; align-items: center; color: var(--ink); }
.map-chip i { width: 8px; height: 8px; background: #22c55e; display: inline-block; animation: blink 1.2s steps(2) infinite; }
#labels-layer text { font: 5px 'Silkscreen', monospace; }
.sprite, .label { transition: transform 2.6s linear; cursor: pointer; }
.sprite.working .body { animation: bob .55s steps(2) infinite; }
.sprite.blocked .body { animation: shake .3s steps(2) infinite; }
.label { pointer-events: all; }
@keyframes bob { 50% { transform: translateY(-1px); } }
@keyframes shake { 50% { transform: translateX(1px); } }
.screen.on { fill: #6ee7b7; animation: glow 1s steps(2) infinite; }
.screen.err { fill: #ED3237; }
@keyframes glow { 50% { fill: #34d399; } }

/* Roster */
.roster { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; flex-shrink: 0; }
.rcard { flex-shrink: 0; display: flex; gap: 10px; align-items: center; background: var(--px-paper); border: 2px solid var(--px-line); padding: 8px 12px 8px 8px; cursor: pointer; text-align: left; box-shadow: 3px 3px 0 rgba(0,0,0,.15); color: var(--ink); min-width: 190px; }
.rcard:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 rgba(0,0,0,.18); }
.rcard.sel { border-color: var(--ac); box-shadow: 3px 3px 0 var(--ac); background: color-mix(in srgb, var(--ac) 8%, var(--px-paper)); }
.rav { width: 44px; height: 52px; background: color-mix(in srgb, var(--ac) 16%, transparent); border: 2px solid var(--px-line); display: grid; place-items: center; }
.pix { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.rav .pix { width: 30px; height: 40px; }
.rmeta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rmeta b { font: 13px 'Silkscreen', monospace; }
.rmeta small { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcard.add { justify-content: center; font: 14px 'Silkscreen', monospace; min-width: 150px; border-style: dashed; }
.rcard.add span { font-size: 22px; }
.ppill { display: inline-flex; align-items: center; gap: 5px; font: 11px 'Silkscreen', monospace; padding: 1px 7px; border: 1.5px solid var(--px-line); background: var(--px-cream); width: fit-content; text-transform: lowercase; }
.ppill i { width: 7px; height: 7px; background: var(--ink-3); }
.ppill.working i { background: #22c55e; animation: blink 1s steps(2) infinite; }
.ppill.idle i { background: #f59e0b; }
.ppill.blocked { background: var(--red); color: #fff; border-color: var(--red); } .ppill.blocked i { background: #fff; }

/* Command Center */
.cc { background: var(--px-cream); border: 3px solid var(--px-line); box-shadow: 4px 4px 0 rgba(0,0,0,.18); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.cc-head { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 2px solid var(--px-line); }
.cc-av { width: 52px; height: 60px; border: 2px solid var(--px-line); background: var(--px-paper); display: grid; place-items: center; flex-shrink: 0; }
.cc-av .pix { width: 36px; height: 48px; }
.cc-title { flex: 1; min-width: 0; }
.cc-title b { font: 16px 'Silkscreen', monospace; display: block; margin-bottom: 4px; }
.cc-title small { display: inline; margin-left: 6px; }
.pbtn { font: 13px 'Silkscreen', monospace; background: var(--px-paper); border: 2px solid var(--px-line); padding: 5px 12px; cursor: pointer; color: var(--ink); box-shadow: 2px 2px 0 rgba(0,0,0,.18); }
.pbtn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 rgba(0,0,0,.2); }
.pbtn:active { transform: translate(1px, 1px); box-shadow: none; }
.pbtn.primary { background: #fde68a; color: #1f1a17; }
.pbtn.dark { background: #1f1a17; color: #fff; border-color: #1f1a17; }
.pbtn.danger { color: var(--red); }
.cc-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px 14px; border-bottom: 2px solid var(--px-line); }
.cc-tabs button { font: 12px 'Silkscreen', monospace; background: var(--px-paper); border: 2px solid var(--px-line); padding: 6px 4px; cursor: pointer; color: var(--ink); }
.cc-tabs button.on { background: #fbbf24; color: #1f1a17; }
.cc-body { flex: 1; overflow-y: auto; min-height: 120px; }
.pad { padding: 16px; }
.ctask { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.ctask:hover { background: var(--px-paper); }
.ctask small { grid-column: 1 / -1; }
.cstat { font: 10px 'Silkscreen', monospace; padding: 1px 6px; border: 1.5px solid var(--px-line); height: fit-content; text-transform: lowercase; }
.cstat.review { background: #fde68a; } .cstat.done { background: #bbf7d0; } .cstat.blocked { background: var(--red); color: #fff; } .cstat.in_progress { background: #bfdbfe; }
.out { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.out-head { display: flex; justify-content: space-between; gap: 8px; }
.out pre, .train pre { white-space: pre-wrap; font: 12px/1.55 'JetBrains Mono', monospace; background: var(--px-paper); border: 2px solid var(--px-line); padding: 10px; margin: 0; max-height: 46vh; overflow-y: auto; }
.out-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.train { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.train dl { display: grid; grid-template-columns: 70px 1fr; gap: 6px 10px; margin: 0; font-size: 13px; }
.train dt { font: 11px 'Silkscreen', monospace; color: var(--px-mute); padding-top: 2px; }
.train dd { margin: 0; }
.train h4 { font: 12px 'Silkscreen', monospace; margin: 4px 0 0; }
.cc-mem { border-top: 2px solid var(--px-line); padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.mem-list { max-height: 170px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.mem { display: grid; grid-template-columns: 22px 1fr auto; gap: 6px; align-items: start; background: var(--px-paper); border: 2px solid var(--px-line); padding: 6px 8px; font-size: 13px; }
.mem.agent { border-color: #8b5cf6; }
.mem p { margin: 0; word-break: break-word; }
.mem small { display: block; margin-top: 2px; }
.mem button { border: 0; background: none; cursor: pointer; font-size: 16px; color: var(--px-mute); line-height: 1; }
.mem-empty { font-size: 12px; margin: 0; }
.mem-add { display: flex; gap: 6px; }
.mem-add input { flex: 1; min-width: 0; font: 13px Poppins, sans-serif; background: var(--px-paper); border: 2px solid var(--px-line); padding: 6px 10px; color: var(--ink); }
.cc-queue { border-top: 2px solid var(--px-line); padding: 10px 14px 4px; max-height: 150px; overflow-y: auto; }
.q-head { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.q-head b { font: 13px 'Silkscreen', monospace; }
.qn { font: 11px 'Silkscreen', monospace; border: 1.5px solid var(--px-line); padding: 0 6px; background: var(--px-paper); }
.qi { display: grid; grid-template-columns: 22px 1fr auto; gap: 6px; align-items: start; background: var(--px-paper); border: 2px solid var(--px-line); padding: 6px 8px; margin-bottom: 6px; font-size: 13px; }
.qi p { margin: 0; cursor: pointer; }
.qi.in_progress { border-color: #22c55e; }
.qi button { border: 0; background: none; cursor: pointer; font-size: 16px; color: var(--px-mute); line-height: 1; }
.cc-send { padding: 8px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.cc-send textarea { font: 13px 'JetBrains Mono', monospace; background: var(--px-paper); border: 2px solid var(--px-line); padding: 10px; resize: vertical; color: var(--ink); }
.cc-send-row { display: flex; justify-content: space-between; align-items: center; }

/* Wizard */
.drawer.modal-wrap { justify-content: center; align-items: center; padding: 16px; }
.wiz { width: min(980px, 100%); height: min(640px, calc(100vh - 32px)); background: var(--px-paper); border: 3px solid var(--px-line); box-shadow: 6px 6px 0 rgba(0,0,0,.25); display: flex; flex-direction: column; color: var(--ink); }
.wiz-title { font: 700 20px 'Silkscreen', monospace; background: #f5ecd3; color: #1f1a17; border-bottom: 3px solid var(--px-line); padding: 12px 18px; letter-spacing: .06em; }
.wiz-main { flex: 1; display: grid; grid-template-columns: 220px 1fr; gap: 18px; padding: 18px; overflow-y: auto; min-height: 0; align-content: start; }
.wiz-steps { display: flex; flex-direction: column; gap: 8px; }
.wstep { text-align: left; background: var(--px-cream); border: 2px solid var(--px-line); padding: 8px 12px; cursor: pointer; color: var(--ink); }
.wstep b { font: 14px 'Silkscreen', monospace; display: block; }
.wstep.on { background: #cfe8ef; color: #1f1a17; }
.wiz-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.wl { font: 12px 'Silkscreen', monospace; display: flex; flex-direction: column; gap: 6px; color: var(--ink); }
.wl input, .wl textarea { font: 14px Poppins, sans-serif; background: var(--px-cream); border: 2px solid var(--px-line); padding: 9px 12px; color: var(--ink); }
.char-row { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: start; }
.char-preview { border: 2px solid var(--px-line); background: var(--px-cream); height: 150px; display: grid; place-items: center; }
.pix.big { width: 84px; height: 112px; }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.preset { background: var(--px-cream); border: 2px solid var(--px-line); padding: 6px 4px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink); }
.preset .pix { width: 36px; height: 48px; }
.preset span { font-size: 12px; }
.preset.on { background: #cfe8ef; outline: 2px solid #0ea5e9; }
.custom { border: 2px dashed var(--px-line); padding: 8px 12px; }
.custom summary { font: 12px 'Silkscreen', monospace; cursor: pointer; }
.crow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.crow > span { font-size: 12px; color: var(--px-mute); width: 84px; }
.sw { width: 26px; height: 26px; border: 2px solid var(--px-line); cursor: pointer; padding: 0; }
.sw.lg { width: 44px; height: 44px; }
.sw.on { outline: 3px solid var(--px-hi); outline-offset: 1px; }
.chip-btn { font: 12px 'Silkscreen', monospace; background: var(--px-cream); border: 2px solid var(--px-line); padding: 3px 10px; cursor: pointer; color: var(--ink); }
.chip-btn.on { background: #fbbf24; color: #1f1a17; }
.templates, .models { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.tpl, .model { text-align: left; background: var(--px-cream); border: 2px solid var(--px-line); padding: 8px 10px; cursor: pointer; color: var(--ink); }
.tpl b, .model b { font: 13px 'Silkscreen', monospace; display: block; }
.model.on { background: #cfe8ef; color: #1f1a17; outline: 2px solid #0ea5e9; }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.tool { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; align-items: center; background: var(--px-cream); border: 2px solid var(--px-line); padding: 8px 10px; cursor: pointer; }
.tool input { grid-row: span 2; }
.tool b { font: 13px 'Silkscreen', monospace; }
.summary { display: flex; gap: 12px; align-items: center; border: 2px solid var(--px-line); padding: 10px; background: var(--px-cream); margin-top: 8px; }
.summary .pix { width: 36px; height: 48px; }
.summary b { font: 14px 'Silkscreen', monospace; }
.wiz-foot { display: flex; justify-content: space-between; padding: 14px 18px; border-top: 3px solid var(--px-line); }
.wiz-foot span { display: flex; gap: 8px; }
.wiz-foot .pbtn { padding: 8px 18px; }
.av .pix { width: 18px; height: 24px; }

@media (max-width: 1100px) {
  .oc { grid-template-columns: 1fr; height: auto; }
  .map-wrap { aspect-ratio: 400 / 252; flex: none; }
  .cc { min-height: 520px; }
}
@media (max-width: 700px) {
  .wiz-main { grid-template-columns: 1fr; }
  .wiz-steps { flex-direction: row; overflow-x: auto; }
  .wstep { flex-shrink: 0; }
  .char-row { grid-template-columns: 1fr; }
}

/* Memory tabs, model select, MCP tool picker */
.mem-tabs { display: flex; gap: 4px; margin-left: auto; }
.mem-tabs button { font: 11px 'Silkscreen', monospace; background: var(--px-paper); border: 1.5px solid var(--px-line); padding: 2px 8px; cursor: pointer; color: var(--ink); }
.mem-tabs button.on { background: #fbbf24; color: #1f1a17; }
.cc-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.psel { font: 12px 'Silkscreen', monospace; background: var(--px-paper); border: 2px solid var(--px-line); padding: 4px 6px; color: var(--ink); cursor: pointer; }
.mcpbox { border: 2px solid var(--px-line); background: var(--px-cream); padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.mcpbox .tool { border: 0; padding: 2px; background: none; }
.tool-q { font: 13px Poppins, sans-serif; background: var(--px-paper); border: 2px solid var(--px-line); padding: 6px 10px; color: var(--ink); }
.toollist { max-height: 240px; overflow-y: auto; border: 2px solid var(--px-line); background: var(--px-paper); }
.toollist label { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; padding: 6px 8px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 12px; }
.toollist label[hidden] { display: none; }
.toollist input { grid-row: span 2; }
.toollist b { font: 12px 'JetBrains Mono', monospace; word-break: break-all; }
.toollist label.warn { background: color-mix(in srgb, var(--red) 10%, transparent); }
.warnline { color: var(--red); display: block; }
.steps { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }
.steps code { font-size: 11px; word-break: break-all; }

.boss-tag { font: 9px 'Silkscreen', monospace; font-style: normal; background: #8B5CF6; color: #fff; padding: 1px 5px; vertical-align: middle; margin-left: 4px; }
