:root {
  --bg: #f6f6f9; --panel: #ffffff; --panel-2: #f1f1f6; --border: #e4e4ec; --border-strong: #d2d2de;
  --text: #1b1b25; --muted: #6b6b80; --faint: #9a9aad;
  --accent: #5b5bd6; --accent-2: #4a4ac4; --accent-soft: #ececfd; --accent-text: #4040b0;
  --green: #18a058; --green-soft: #e3f6ec; --amber: #c27c0e; --amber-soft: #fdf3e1; --red: #d93a3a; --red-soft: #fde8e8; --blue: #2b7de9; --blue-soft: #e5f0fd;
  --shadow: 0 1px 2px rgba(20, 20, 40, .05), 0 2px 8px rgba(20, 20, 40, .04);
  --shadow-lg: 0 12px 40px rgba(20, 20, 40, .16);
  --radius: 10px; --radius-sm: 7px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #111117; --panel: #18181f; --panel-2: #20202a; --border: #2a2a36; --border-strong: #3a3a48;
  --text: #ececf3; --muted: #9a9ab0; --faint: #6c6c80;
  --accent: #7c7cf0; --accent-2: #8f8ff5; --accent-soft: #25254a; --accent-text: #b4b4ff;
  --green: #3ccf7e; --green-soft: #15301f; --amber: #f0b44c; --amber-soft: #332712; --red: #f26b6b; --red-soft: #3a1919; --blue: #5aa2ff; --blue-soft: #15263d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111117; --panel: #18181f; --panel-2: #20202a; --border: #2a2a36; --border-strong: #3a3a48;
    --text: #ececf3; --muted: #9a9ab0; --faint: #6c6c80;
    --accent: #7c7cf0; --accent-2: #8f8ff5; --accent-soft: #25254a; --accent-text: #b4b4ff;
    --green: #3ccf7e; --green-soft: #15301f; --amber: #f0b44c; --amber-soft: #332712; --red: #f26b6b; --red-soft: #3a1919; --blue: #5aa2ff; --blue-soft: #15263d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 12px 40px 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: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); }
button, input, select, textarea { font: inherit; color: inherit; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------ layout */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.shell > div { min-width: 0; }
.side { background: var(--panel); border-right: 1px solid var(--border); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 700; font-size: 16px; }
.logo { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; color: #fff; }
.logo svg { width: 18px; height: 18px; stroke-width: 2.6; }
.brand small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.on { background: var(--accent-soft); color: var(--accent-text); }
.nav .count { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 0 6px; min-width: 18px; text-align: center; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: 8px; font-size: 12px; color: var(--muted); }
.side-foot .row { display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.dot.warn { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.dot.bad { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.main { min-width: 0; padding: 24px 28px 60px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; margin: 0; letter-spacing: -.01em; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
.page-head .grow { flex: 1; }
.mobile-bar { display: none; }

/* ------------------------------------------------ primitives */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card h2 { font-size: 14.5px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.card h2 .grow { flex: 1; }
.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: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.hide { display: none !important; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--border-strong); background: var(--panel); padding: 7px 13px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 550; white-space: nowrap; transition: background .12s, border-color .12s; text-decoration: none; color: var(--text); }
.btn:hover { background: var(--panel-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
.btn.icon { padding: 6px; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

label.f { display: flex; flex-direction: column; gap: 5px; font-weight: 550; font-size: 13px; }
label.f .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--border-strong); background: var(--panel); border-radius: var(--radius-sm); padding: 8px 10px; outline: none; transition: border-color .12s, box-shadow .12s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 80px; line-height: 1.45; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); }
.check b { display: block; font-weight: 550; }
.check span { color: var(--muted); font-size: 12.5px; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.badge.bug { background: var(--red-soft); color: var(--red); }
.badge.feature { background: var(--blue-soft); color: var(--blue); }
.badge.change { background: var(--accent-soft); color: var(--accent-text); }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.bad { background: var(--red-soft); color: var(--red); }
.pri { font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.pri::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--faint); }
.pri.urgent::before { background: var(--red); } .pri.high::before { background: var(--amber); } .pri.medium::before { background: var(--blue); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs button { background: none; border: 0; padding: 9px 14px; cursor: pointer; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty svg.i { width: 30px; height: 30px; stroke-width: 1.6; color: var(--faint); margin-bottom: 8px; }
.callout { border: 1px solid var(--border); background: var(--panel-2); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px; }
.callout.info { background: var(--blue-soft); border-color: transparent; }
.callout.warn { background: var(--amber-soft); border-color: transparent; }
.callout.bad { background: var(--red-soft); border-color: transparent; }
.callout.ok { background: var(--green-soft); border-color: transparent; }

table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }

/* ------------------------------------------------ overview */
.stat { padding: 16px 18px; }
.stat .k { color: var(--muted); font-size: 12.5px; font-weight: 550; display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.stat .s { font-size: 12px; color: var(--muted); }
.health { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; }
.health .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--panel-2); color: var(--muted); flex: none; }
.health.ok .ic { background: var(--green-soft); color: var(--green); }
.health.warn .ic { background: var(--amber-soft); color: var(--amber); }
.health b { display: block; }
.feed { display: flex; flex-direction: column; }
.feed .ev { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.feed .ev:last-child { border-bottom: 0; }
.feed .ev .when { color: var(--faint); font-size: 12px; white-space: nowrap; width: 64px; flex: none; }
.feed .ev .what { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.feed .ev.error .what { color: var(--red); } .feed .ev.success .what { color: var(--green); } .feed .ev.warn .what { color: var(--amber); }
.chart { width: 100%; height: 140px; }
.chart .bar { fill: var(--accent); } .chart .bar2 { fill: var(--blue); opacity: .45; }
.chart text { fill: var(--faint); font-size: 10px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.steps { display: flex; flex-direction: column; gap: 2px; }
.steps a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text); }
.steps a:hover { background: var(--panel-2); }
.steps .n { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); flex: none; }
.steps .done .n { background: var(--green); border-color: var(--green); color: #fff; }
.steps .done b { text-decoration: line-through; color: var(--muted); }

/* ------------------------------------------------ board */
.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--panel-2); border-radius: var(--radius); padding: 10px; min-height: 200px; border: 1px solid transparent; }
.col.over { border-color: var(--accent); background: var(--accent-soft); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; font-weight: 650; font-size: 13px; }
.col-head .n { color: var(--muted); font-weight: 500; }
.col-head .sw { width: 8px; height: 8px; border-radius: 50%; }
.tcard { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 11px; margin-bottom: 8px; cursor: pointer; box-shadow: var(--shadow); transition: border-color .12s, transform .12s; position: relative; }
.tcard:hover { border-color: var(--border-strong); }
.tcard.dragging { opacity: .5; }
.tcard .key { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.tcard .title { font-weight: 600; margin: 3px 0 8px; line-height: 1.35; overflow-wrap: anywhere; }
.tcard .meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.tcard .unread { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.clarity { height: 4px; border-radius: 4px; background: var(--border); overflow: hidden; margin-top: 8px; }
.clarity > i { display: block; height: 100%; background: var(--amber); }
.clarity.hi > i { background: var(--green); }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(10, 10, 20, .35); z-index: 40; animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--panel); z-index: 41; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }
.drawer-head { padding: 16px 20px 0; border-bottom: 1px solid var(--border); }
.drawer-head .title-in { font-size: 18px; font-weight: 700; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; margin-left: -7px; width: 100%; background: transparent; }
.drawer-head .title-in:hover, .drawer-head .title-in:focus { border-color: var(--border-strong); outline: none; }
.drawer-head .tabs { margin: 12px 0 0; border: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.drawer-foot { border-top: 1px solid var(--border); padding: 12px 20px; }
.props { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.props label { font-size: 11.5px; color: var(--muted); font-weight: 600; display: flex; flex-direction: column; gap: 3px; }
.props select { padding: 5px 8px; }

.timeline { display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 10px; }
.av { width: 30px; height: 30px; border-radius: 50%; background: var(--panel-2); display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--muted); flex: none; }
.av.bot { background: var(--accent); color: #fff; }
.av.me { background: var(--green-soft); color: var(--green); }
.msg .bubble { flex: 1; min-width: 0; }
.msg .who { font-size: 12.5px; font-weight: 650; display: flex; gap: 8px; align-items: baseline; }
.msg .who span { font-weight: 400; color: var(--faint); font-size: 11.5px; }
.msg.note .body { background: var(--amber-soft); border-radius: 8px; padding: 8px 10px; }
.msg.system { color: var(--muted); font-size: 12.5px; padding-left: 40px; }
.body { overflow-wrap: anywhere; }

/* markdown */
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 8px; } .md ul, .md ol { margin: 0 0 8px; padding-left: 20px; } .md li { margin: 2px 0; }
.md h1, .md h2, .md h3, .md h4 { font-size: 14px; margin: 12px 0 6px; }
.md code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }
.md pre { background: var(--panel-2); padding: 10px 12px; border-radius: 8px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: 0 0 8px; padding: 2px 10px; border-left: 3px solid var(--border-strong); color: var(--muted); }
.md table { border-collapse: collapse; margin: 0 0 8px; font-size: 13px; } .md td, .md th { border: 1px solid var(--border); padding: 4px 8px; }

.prompt-box { position: relative; }
.prompt-box textarea { font-family: var(--mono); font-size: 12.5px; min-height: 420px; background: var(--panel-2); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.spec h3 { font-size: 13px; margin: 16px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.spec ul { margin: 0; padding-left: 20px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs img { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); cursor: zoom-in; }

/* ------------------------------------------------ playground */
.pg { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
.channel { display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 480px; }
.channel-head { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.channel-head b { font-size: 14px; }
.channel-feed { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.post { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.post .root { padding: 12px 14px; display: flex; gap: 10px; }
.post .replies { border-top: 1px solid var(--border); padding: 10px 14px 10px 54px; display: flex; flex-direction: column; gap: 12px; background: var(--panel-2); border-radius: 0 0 var(--radius) var(--radius); }
.post .replies .msg .av { width: 26px; height: 26px; font-size: 11px; }
.reply-in { display: flex; gap: 8px; }
.reply-in input { flex: 1; }
.typing { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
.composer { border-top: 1px solid var(--border); padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.composer textarea { min-height: 64px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border-strong); background: var(--panel); border-radius: 99px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; font-family: var(--mono); }
.chip:hover { border-color: var(--accent); color: var(--accent-text); }
.attach-preview { display: flex; gap: 6px; }
.attach-preview img { height: 48px; border-radius: 6px; border: 1px solid var(--border); }

/* ------------------------------------------------ tests */
.checks { display: flex; flex-direction: column; }
.chk { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.chk:last-child { border-bottom: 0; }
.chk .st { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: 1px; }
.chk .st svg { width: 13px; height: 13px; stroke-width: 3; }
.chk.ok .st { background: var(--green-soft); color: var(--green); }
.chk.fail .st { background: var(--red-soft); color: var(--red); }
.chk.opt .st { background: var(--amber-soft); color: var(--amber); }
.chk.skip .st { background: var(--panel-2); color: var(--faint); }
.chk .lbl { font-weight: 600; }
.chk .det { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.chk .ms { margin-left: auto; color: var(--faint); font-size: 12px; white-space: nowrap; }
.device { text-align: center; padding: 20px; border: 2px dashed var(--accent); border-radius: var(--radius); background: var(--accent-soft); }
.device .code { font-family: var(--mono); font-size: 28px; font-weight: 700; letter-spacing: .12em; margin: 8px 0; color: var(--accent-text); }
.guide ol { padding-left: 20px; margin: 6px 0; } .guide li { margin: 5px 0; }
.copyline { display: flex; gap: 6px; align-items: center; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 6px 6px 10px; font-family: var(--mono); font-size: 12.5px; }
.copyline span { flex: 1; overflow-x: auto; white-space: nowrap; }
.repo { padding: 16px 18px; }
.repo + .repo { border-top: 1px solid var(--border); }
.progress { height: 4px; background: var(--border); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; width: 40%; background: var(--accent); animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { margin-left: -40%; } to { margin-left: 100%; } }
.hit { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-top: 8px; overflow: hidden; }
.hit .hp { background: var(--panel-2); padding: 6px 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.hit pre { margin: 0; padding: 8px 10px; max-height: 180px; overflow: auto; font-size: 12px; }

/* ------------------------------------------------ login, toasts */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth .card { width: min(380px, 100%); padding: 28px; }
.auth .logo { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 14px; }
.auth .logo svg { width: 24px; height: 24px; }
.auth h1 { margin: 0 0 4px; font-size: 20px; }
#toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); max-width: 380px; font-size: 13px; animation: fade .15s; }
.toast.bad { background: var(--red); color: #fff; }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .8); display: grid; place-items: center; z-index: 70; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }

/* ------------------------------------------------ responsive */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pg { grid-template-columns: 1fr; } .pg .side-help { display: none; } }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; left: 0; width: 240px; transform: translateX(-100%); transition: transform .18s; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .mobile-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
  .main { padding: 16px 16px 60px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .props { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv { grid-template-columns: 1fr; }
  .channel { height: calc(100vh - 170px); }
}
.split { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

/* files */
.pop-wrap { position: relative; }
.pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; width: 270px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; }
.pop-row { display: flex; align-items: center; gap: 2px; padding: 2px 4px 2px 8px; border-radius: var(--radius-sm); font-size: 13px; }
.pop-row:hover { background: var(--panel-2); }
.file-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); color: var(--text); text-decoration: none; font-size: 12.5px; max-width: 100%; }
.file-chip:hover { border-color: var(--accent); }
.file-chip span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip small { color: var(--muted); }
.btn.disabled { opacity: .5; cursor: not-allowed; }

/* code explorer */
.answer a { word-break: break-word; }
.trace { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2); font-size: 12.5px; }
.trace summary { cursor: pointer; padding: 8px 10px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.trace ol { list-style: none; margin: 0; padding: 0 10px 10px; display: grid; gap: 6px; }
.trace li { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.trace li > span { min-width: 0; overflow-wrap: anywhere; }
.trace li .i { flex: none; margin-top: 2px; color: var(--accent-text); }
.qa { border-top: 1px solid var(--border); padding: 10px 0; }
.qa:first-child { border-top: 0; padding-top: 0; }
.qa summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; font-weight: 600; font-size: 13.5px; }
.qa summary .tiny { font-weight: 400; white-space: nowrap; }
.qa .answer { margin-top: 8px; font-size: 13.5px; }
@media (max-width: 600px) { .qa summary { flex-direction: column; gap: 2px; } }

/* Teams app */
.app-icon { border-radius: 22px; box-shadow: var(--shadow); }
.outline-prev { background: #464775; border-radius: 8px; padding: 10px; line-height: 0; }
.code-pre { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; font: 12px/1.5 var(--mono); overflow: auto; max-height: 320px; margin: 8px 0 0; }

/* inside a Teams tab: Teams already provides the navigation */
.embed .shell { grid-template-columns: minmax(0, 1fr); }
.embed .side, .embed .mobile-bar { display: none; }
