:root {
  color-scheme: light;
  --ink: #172638;
  --ink-soft: #33475e;
  --muted: #718197;
  --muted-strong: #53677e;
  --surface: #f2f5f8;
  --paper: #fff;
  --paper-soft: #f8fafc;
  --line: #dfe6ed;
  --line-strong: #cbd6e1;
  --nav: #13243a;
  --nav-muted: #a7b7ca;
  --blue: #3268dc;
  --blue-dark: #2352bd;
  --blue-pale: #eaf0ff;
  --green: #18805c;
  --green-pale: #e6f4ed;
  --amber: #9a6416;
  --amber-pale: #fbf1df;
  --red: #a64145;
  --red-pale: #fae9e9;
  --shadow: 0 8px 24px rgb(20 42 68 / 5%);
  --ok: #18805c; --busy: #3268dc; --warn: #b26a12; --down: #b23b40; --idle: #7c94b2;
  --panel: #fff; --panel-2: #f8fafc; --line-soft: #edf1f5; --faint: #91a0b1; --accent: #3268dc;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font: 15px/1.5 "DM Sans", Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--surface);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--surface); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .68; }
a { color: var(--blue); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid #77a4ff; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { font-family: Manrope, "DM Sans", sans-serif; letter-spacing: -.035em; }

.signin-shell { width: min(100% - 40px, 480px); min-height: 100vh; margin: auto; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.signin-mark { display: flex; align-items: end; gap: 5px; height: 42px; margin-bottom: 45px; }
.signin-mark span { display: block; width: 8px; border-radius: 5px; background: var(--blue); }
.signin-mark span:nth-child(1) { height: 20px; opacity: .55; }
.signin-mark span:nth-child(2) { height: 34px; }
.signin-mark span:nth-child(3) { height: 26px; opacity: .75; }
.signin-shell .overline { margin-bottom: 14px; }
.signin-shell h1 { max-width: 450px; font-size: clamp(36px, 7vw, 54px); line-height: 1.06; }
.signin-copy { max-width: 400px; margin: 20px 0 28px; color: var(--muted-strong); font-size: 17px; }
.signin-foot { margin-top: 22px; color: var(--muted); font-size: 12px; }
.form-error { margin-top: 14px; color: var(--red); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 5; inset: 0 auto 0 0; width: 244px; display: flex; flex-direction: column; padding: 27px 18px 20px; background: var(--nav); color: white; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; color: white; text-decoration: none; }
.brand-glyph { display: flex; height: 29px; align-items: end; gap: 3px; padding: 3px; }
.brand-glyph i { width: 5px; border-radius: 3px; background: #83a8ff; }
.brand-glyph i:nth-child(1) { height: 14px; opacity: .55; }
.brand-glyph i:nth-child(2) { height: 23px; }
.brand-glyph i:nth-child(3) { height: 18px; opacity: .75; }
.brand strong { display: block; font: 800 18px/1.15 Manrope, sans-serif; letter-spacing: -.035em; }
.brand small { display: block; margin-top: 3px; color: var(--nav-muted); font-size: 10px; letter-spacing: .095em; text-transform: uppercase; }
.nav-label { margin: 48px 12px 12px; color: #72859d; font: 500 10px/1.2 "DM Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.side-nav { display: grid; gap: 6px; }
.side-nav a { display: flex; min-height: 45px; align-items: center; gap: 12px; padding: 0 12px; border-radius: 7px; color: #c0ccda; text-decoration: none; font-size: 14px; transition: background .16s ease, color .16s ease; }
.side-nav a:hover { background: rgb(255 255 255 / 7%); color: white; }
.side-nav a.active { background: #243c5a; color: white; box-shadow: inset 2px 0 #83a8ff; }
.nav-icon { width: 19px; color: #8fa8c7; text-align: center; font-size: 17px; }
.side-nav a.active .nav-icon { color: #a9c2ff; }
.nav-count { margin-left: auto; color: #91a5bd; font: 11px "DM Mono", monospace; }
.sidebar-spacer { flex: 1; }
.rail-note { display: flex; align-items: center; gap: 11px; margin: 0 5px 16px; padding: 14px 11px; border-top: 1px solid rgb(255 255 255 / 11%); border-bottom: 1px solid rgb(255 255 255 / 11%); color: #94a7bd; font-size: 11px; line-height: 1.55; }
.rail-note b { color: #d8e2ee; font-weight: 500; }
.rail-note-dot { width: 7px; height: 7px; border-radius: 50%; background: #4db188; box-shadow: 0 0 0 4px rgb(77 177 136 / 12%); }
.signout-button { min-height: 40px; border: 0; border-radius: 6px; background: transparent; color: #b4c1d1; text-align: left; padding: 0 11px; }
.signout-button:hover { background: rgb(255 255 255 / 7%); color: white; }
.main-shell { margin-left: 244px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; z-index: 4; top: 0; display: flex; height: 66px; align-items: center; justify-content: space-between; padding: 0 clamp(24px, 4vw, 60px); border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 94%); backdrop-filter: blur(12px); }
.breadcrumbs { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 13px; }
.breadcrumbs strong { color: var(--ink); font-weight: 600; }
.crumb-slash { color: #b2bdc9; }
.topbar-right { display: flex; align-items: center; gap: 17px; }
.connection-pill { display: flex; align-items: center; gap: 8px; color: var(--muted-strong); font-size: 12px; white-space: nowrap; }
.connection-dot { width: 7px; height: 7px; border-radius: 50%; background: #e2a340; }
.connection-pill[data-state="live"] .connection-dot { background: #31a877; box-shadow: 0 0 0 4px #e5f4ec; animation: beat 2.4s ease-in-out infinite; }
.connection-pill[data-state="parked"] .connection-dot { background: #31a877; box-shadow: 0 0 0 4px #e5f4ec; }
.connection-pill[data-state="disconnected"] .connection-dot { background: #d39139; box-shadow: 0 0 0 4px #fbf0de; }
@keyframes beat { 0%, 100% { opacity: 1; } 60% { opacity: .45; } }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink-soft); font-size: 21px; line-height: 1; }
.icon-button:hover { border-color: #aebdd0; background: var(--paper-soft); }
.mobile-signout { display: none; }
.page { flex: 1; width: min(100%, 1500px); margin: 0 auto; padding: 43px clamp(24px, 4vw, 60px) 50px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.overline { color: var(--muted); font: 500 10px/1.5 "DM Mono", monospace; letter-spacing: .105em; text-transform: uppercase; }
.page-heading .overline { margin-bottom: 9px; }
.page-heading h1 { font-size: clamp(32px, 4vw, 42px); line-height: 1.15; }
.page-description { margin-top: 8px; color: var(--muted-strong); font-size: 14px; }
.snapshot { display: flex; align-items: center; gap: 8px; padding-bottom: 7px; color: var(--muted); font: 11px "DM Mono", monospace; white-space: nowrap; }
.snapshot-mark { width: 6px; height: 6px; border-radius: 50%; background: #3aaa7b; }
#freshness[data-stale="true"] { color: var(--amber); }
#freshness[data-stale="true"] + .snapshot-mark, .snapshot:has(#freshness[data-stale="true"]) .snapshot-mark { background: #d2953e; }
.global-error { margin: -10px 0 22px; padding: 12px 15px; border: 1px solid #eccbcb; border-radius: 6px; background: var(--red-pale); color: #883b3e; font-size: 13px; }
.head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.head-link { font-size: 12px; font-weight: 600; text-decoration: none; }
.head-link:hover { text-decoration: underline; }
code { font: 11px var(--mono); padding: 1px 5px; border-radius: 3px; background: #edf1f5; color: #43576d; }

/* Summary tiles. Big number, one word, tone colour: the row an operator reads
   from across the room. */
.tiles { list-style: none; padding: 0; margin: 0 0 34px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; box-shadow: var(--shadow); border-left: 3px solid var(--idle); }
.tile b { display: block; font: 700 30px/1.1 Manrope, sans-serif; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--idle); }
.tile span { font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
.tile[data-tone=warn] { border-left-color: var(--warn); } .tile[data-tone=warn] b { color: var(--warn); }
.tile[data-tone=busy] { border-left-color: var(--busy); } .tile[data-tone=busy] b { color: var(--busy); }
.tile[data-tone=ok] { border-left-color: var(--ok); } .tile[data-tone=ok] b { color: var(--ok); }
.tile[data-tone=down] { border-left-color: var(--down); } .tile[data-tone=down] b { color: var(--down); }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 0 15px; }
.section-heading + .section-heading, .bot-grid + .section-heading, .node-list + .section-heading, .empty-state + .section-heading { margin-top: 38px; }
.section-heading h2 { font-size: 19px; }
.section-heading p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; }
.dot-running { background: var(--busy); } .dot-ready { background: var(--ok); } .dot-attention { background: var(--warn); } .dot-offline { background: var(--down); }

/* Bot cards. The left edge carries the tone so a grid of cards reads as a
   status column; everything else stays neutral and dense. */
.bot-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.bot { position: relative; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--idle); border-radius: 8px; padding: 14px 16px 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 90px; }
.bot[data-tone=ok] { border-left-color: var(--ok); } .bot[data-tone=busy] { border-left-color: var(--busy); }
.bot[data-tone=warn] { border-left-color: var(--warn); } .bot[data-tone=down] { border-left-color: var(--down); }
.bot-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bot-top h3 { font-size: 15px; font-weight: 700; }
.bot-top .who { font-size: 11px; color: var(--faint); font-family: var(--mono); }
.state { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--idle); white-space: nowrap; }
.state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
[data-tone=ok] > .bot-top .state, .node[data-tone=ok] .state { color: var(--ok); }
[data-tone=busy] > .bot-top .state, .node[data-tone=busy] .state { color: var(--busy); }
[data-tone=busy] > .bot-top .state::before { animation: signal 1.8s ease-out infinite; }
[data-tone=warn] > .bot-top .state, .node[data-tone=warn] .state { color: var(--warn); }
[data-tone=down] > .bot-top .state, .node[data-tone=down] .state { color: var(--down); }
@keyframes signal { 0%, 100% { box-shadow: 0 0 0 0 rgb(50 104 220 / 25%); } 50% { box-shadow: 0 0 0 4px rgb(50 104 220 / 0%); } }
.task { font-size: 14px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.task.none { font-weight: 500; color: var(--faint); }
.detail { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px 14px; border-top: 1px solid var(--line-soft); padding-top: 10px; margin: 0; }
.fact { min-width: 0; }
.fact dt { font: 500 9px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.fact dd { margin: 1px 0 0; font-size: 12.5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; color: var(--ink-soft); }
.notes { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.note { display: flex; gap: 7px; align-items: baseline; }
.note::before { content: ''; margin-top: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); flex: none; }
.note[data-tone=warn] { color: var(--warn); } .note[data-tone=warn]::before { background: var(--warn); }
.note[data-tone=ok]::before { background: var(--ok); }
.links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.links a, .links span { font-size: 11.5px; font-weight: 600; text-decoration: none; border: 1px solid var(--line-strong); border-radius: 5px; padding: 6px 10px; color: var(--blue-dark); background: white; }
.links a:hover { border-color: var(--blue); background: var(--blue-pale); }
.links a.primary { background: var(--blue); border-color: var(--blue); color: white; }
.links a.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.links span { color: var(--faint); border-style: dashed; }

/* Nodes. One panel each: the header line, then configuration, host and tool
   facts in equal columns that collapse on a phone. */
.node-list { display: flex; flex-direction: column; gap: 14px; }
.node { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.node-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.node-head h3 { font-size: 16px; font-weight: 700; }
.node-head .who { font-size: 12px; color: var(--faint); }
.node-head .state { margin-left: auto; }
.node-body { display: grid; gap: 18px; padding: 16px 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.group h4 { font: 500 9px var(--mono); text-transform: uppercase; letter-spacing: .11em; color: var(--faint); margin-bottom: 8px; }
.rows { display: flex; flex-direction: column; gap: 5px; margin: 0; }
.row { display: flex; gap: 12px; justify-content: space-between; font-size: 12.5px; border-bottom: 1px dashed var(--line-soft); padding-bottom: 4px; }
.row:last-child { border-bottom: 0; }
.row dt { color: var(--muted); flex: none; }
.row dd { margin: 0; flex: 1 1 auto; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; color: var(--ink-soft); }
.row dd.warn { color: var(--warn); } .row dd.ok { color: var(--ok); } .row dd.down { color: var(--down); }
.meter { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: 3px; }
.meter i { display: block; height: 100%; background: var(--busy); }
.meter[data-tone=warn] i { background: var(--warn); } .meter[data-tone=down] i { background: var(--down); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 9px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }

/* Routing procedure. Reads as prose, because it is prose an operator wrote. */
.procedure { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.procedure p.body { font-size: 14.5px; line-height: 1.6; color: var(--ink); white-space: pre-wrap; max-width: 78ch; }
.procedure .meta { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line-soft); padding-top: 10px; }
.procedure .meta a { text-decoration: none; font-weight: 600; }
.procedure .meta a:hover { text-decoration: underline; }
.empty-state { display: grid; gap: 5px; padding: 38px; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--paper); color: var(--muted); text-align: center; }
.empty-state strong { color: var(--ink-soft); }

.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; border: 1px solid transparent; border-radius: 5px; font-size: 12px; font-weight: 650; text-decoration: none; transition: background .15s ease, border .15s ease, transform .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { border-color: var(--blue); background: var(--blue); color: white; }
.button-primary:hover { border-color: var(--blue-dark); background: var(--blue-dark); color: white; }
.button-subtle { border-color: var(--line-strong); background: white; color: #53677e; }
.button-subtle:hover { border-color: #aab9ca; background: var(--paper-soft); }
.button-outline { border-color: #adc0dc; background: white; color: var(--blue-dark); }
.button-outline:hover { border-color: var(--blue); background: var(--blue-pale); }

.skills-heading { align-items: center; margin-bottom: 27px; }
.registry-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid #d3deeb; border-radius: 5px; background: white; color: #60758d; font: 10px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.registry-mark { width: 7px; height: 7px; border-radius: 2px; background: var(--blue); }
.skills-layout { display: grid; grid-template-columns: 255px minmax(0, 1fr); min-height: 640px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-shadow: var(--shadow); }
.skill-index { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #f8fafc; border-radius: 8px 0 0 8px; }
.skill-index-head { display: flex; min-height: 53px; align-items: center; justify-content: space-between; padding: 0 17px; border-bottom: 1px solid var(--line); color: #52667c; font-size: 12px; font-weight: 650; }
.skill-index-head #skills-total { margin-left: auto; margin-right: 10px; color: #9aa8b7; font: 11px "DM Mono", monospace; }
.button-small { min-height: 28px; padding: 0 10px; font-size: 11px; }
.create-form input[name="id"] { width: 100%; box-sizing: border-box; padding: 9px 10px; border: 1px solid #adc0dc; border-radius: 5px; font: 12px "DM Mono", monospace; }
.skill-list { padding: 8px; }
.skill-row { display: block; width: 100%; margin-bottom: 4px; padding: 11px 10px 10px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--ink); text-align: left; }
.skill-row:hover { background: #f0f4f8; }
.skill-row.selected { border-color: #d5e0f2; background: white; box-shadow: 0 2px 6px rgb(26 52 84 / 5%); }
.skill-row-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.skill-row-title strong { overflow: hidden; font: 600 12px "DM Mono", monospace; text-overflow: ellipsis; }
.skill-version { flex: 0 0 auto; color: #8797a9; font: 9px "DM Mono", monospace; }
.skill-row-description { display: -webkit-box; overflow: hidden; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.skill-status { display: inline-flex; align-items: center; gap: 5px; margin-top: 7px; font-size: 9px; }
.skill-status i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-active { color: var(--green); }
.status-paused { color: #8c99a8; }
.inline-state { padding: 20px 12px; color: #8a99aa; font-size: 11px; }
.skill-workspace { min-width: 0; padding: 27px clamp(20px, 3vw, 40px) 36px; }
.skill-welcome { display: grid; min-height: 510px; align-content: center; justify-items: center; text-align: center; }
.welcome-glyph { display: grid; width: 45px; height: 45px; place-items: center; margin-bottom: 15px; border-radius: 10px; background: var(--blue-pale); color: var(--blue); font-size: 22px; }
.skill-welcome h2 { font-size: 19px; }
.skill-welcome p { margin-top: 6px; color: var(--muted); font-size: 12px; }
.editor-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.editor-heading .overline { margin-bottom: 6px; }
.editor-heading h2 { font: 700 20px/1.3 "DM Mono", monospace; letter-spacing: -.04em; overflow-wrap: anywhere; }
.editor-description { max-width: 720px; margin-top: 5px; color: var(--muted-strong); font-size: 12px; }
.current-version { flex: 0 0 auto; padding: 5px 8px; border: 1px solid #d9e3f3; border-radius: 4px; background: #f3f6fc; color: #5b73a1; font: 10px "DM Mono", monospace; }
.inline-alert { margin: -5px 0 17px; padding: 10px 12px; border: 1px solid #d6e1f2; border-radius: 5px; background: #f1f5fc; color: #435c86; font-size: 11px; }
.editor-form { padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfd; }
.description-field { display: grid; gap: 7px; margin-bottom: 17px; }
.field-heading { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.field-heading .field-label, .description-field .field-label { color: #465c73; font: 600 11px "DM Sans", sans-serif; letter-spacing: 0; text-transform: none; }
.field-hint { color: #96a4b3; font: 10px "DM Mono", monospace; }
textarea, select, input:not([type="checkbox"]) { max-width: 100%; border: 1px solid var(--line-strong); border-radius: 4px; background: white; color: var(--ink); }
textarea { display: block; width: 100%; min-height: 49px; resize: vertical; padding: 10px 11px; font: 11px/1.6 "DM Mono", monospace; }
textarea[name="instructions"] { min-height: 300px; }
textarea:read-only { background: #f6f8fa; color: #607389; }
input:not([type="checkbox"]), select { min-height: 38px; padding: 0 10px; }
select { width: 100%; }
.form-actions, .settings-actions { display: flex; justify-content: flex-end; align-items: center; gap: 9px; margin-top: 12px; }
.form-actions input { width: min(100%, 340px); margin-right: auto; }
.field-note { margin: 7px 0 0; color: #8797a8; font-size: 10px; line-height: 1.45; }
.settings-section, .history-section { margin-top: 25px; padding-top: 23px; border-top: 1px solid var(--line); }
.settings-heading, .history-heading { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.settings-title h3 { font-size: 15px; }
.settings-title p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.settings-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { min-width: 0; margin: 0 0 12px; padding: 13px; border: 1px solid var(--line); border-radius: 5px; }
.form-group legend { padding: 0 4px; color: #50647c; font-size: 10px; font-weight: 650; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.check-option { display: flex; min-width: 0; align-items: flex-start; gap: 8px; padding: 9px; border: 1px solid #e8edf2; border-radius: 4px; background: white; cursor: pointer; }
.check-option:has(input:checked) { border-color: #d1dcf2; background: #f7f9fe; }
.check-option input { flex: 0 0 auto; width: 14px; height: 14px; margin: 2px 0 0; accent-color: var(--blue); }
.check-option input:disabled { cursor: not-allowed; }
.check-copy { display: grid; min-width: 0; gap: 2px; }
.check-copy strong { color: #4e6279; font-size: 10px; font-weight: 600; }
.check-copy small { color: #91a0af; font-size: 9px; line-height: 1.4; }
.bot-check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-height: 190px; overflow: auto; margin-top: 10px; }
.protected-note { padding: 10px 12px; border-left: 2px solid #9db1ca; background: #f4f7fa; }
.settings-actions input { width: min(100%, 340px); margin-right: auto; }
.history-current { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; border: 1px solid #e5ebf1; border-radius: 5px; background: #fafbfd; }
.history-label { color: #8090a2; font: 10px "DM Mono", monospace; }
.history-current > strong { color: #4c6179; font: 600 11px "DM Mono", monospace; }
.history-meta { color: #98a6b5; font-size: 10px; }
.history-select { width: auto; min-width: 210px; min-height: 34px; margin-left: auto; font-size: 10px; }
.comparison-panel { margin-top: 12px; padding: 12px; border: 1px solid #d9e3f0; border-radius: 5px; background: #f8fafd; }
.comparison-header { display: flex; justify-content: space-between; gap: 10px; color: #52677e; font-size: 11px; }
.text-button { border: 0; background: transparent; color: var(--blue); font-size: 10px; }
.comparison-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }
.comparison-column { min-width: 0; padding: 10px; border: 1px solid #e5eaf0; border-radius: 4px; background: white; }
.comparison-text { max-height: 230px; overflow: auto; margin-top: 8px; color: #53677e; font: 10px/1.55 "DM Mono", monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.event-heading { margin-top: 18px; color: #66798f; font-size: 10px; font-weight: 650; }
.event-list { display: grid; gap: 0; margin: 8px 0 0; padding: 0; list-style: none; }
.event-list li { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(160px, 1fr); gap: 4px 10px; padding: 9px 0; border-top: 1px solid #edf1f5; }
.event-kind { color: #53677e; font-size: 10px; font-weight: 600; }
.event-meta { color: #97a4b2; font: 9px "DM Mono", monospace; text-align: right; }
.event-list p { grid-column: 1 / -1; color: #8696a8; font-size: 10px; }
.app-footer { display: flex; justify-content: space-between; gap: 15px; padding: 17px clamp(24px, 4vw, 60px); border-top: 1px solid var(--line); color: #95a2b1; font-size: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-width: 1050px) {
  .sidebar { width: 214px; }
  .main-shell { margin-left: 214px; }
  .skills-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .bot-check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sidebar { position: sticky; inset: 0 0 auto; width: auto; height: auto; padding: 11px 16px; flex-direction: row; align-items: center; gap: 13px; }
  .brand { padding: 0; }
  .brand-glyph { transform: scale(.83); transform-origin: left center; margin-right: -3px; }
  .brand strong { font-size: 15px; }
  .brand small { font-size: 8px; }
  .nav-label, .sidebar-spacer, .rail-note, #signout { display: none !important; }
  .side-nav { display: flex; gap: 3px; margin-left: auto; }
  .side-nav a { min-height: 37px; gap: 6px; padding: 0 9px; font-size: 11px; }
  .nav-icon { width: 15px; font-size: 14px; }
  .nav-count { display: none; }
  .main-shell { margin-left: 0; }
  .topbar { height: 51px; padding: 0 17px; }
  .topbar-right { gap: 10px; }
  .connection-pill { font-size: 10px; }
  .icon-button { width: 32px; height: 32px; }
  .mobile-signout { display: block; border: 0; background: transparent; color: #5b6e84; font-size: 10px; }
  .page { padding: 28px 17px 35px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 22px; }
  .snapshot { padding: 0; }
    .section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .legend { gap: 10px; }
  .head-side { align-items: flex-start; }
  .bot-grid { grid-template-columns: 1fr; }
  .row { flex-direction: column; gap: 0; }
  .row dd { text-align: left; }
  .tiles { grid-template-columns: 1fr 1fr; margin-bottom: 26px; }
    .skills-heading { align-items: flex-start; }
  .registry-chip { padding: 6px 8px; font-size: 8px; }
  .skills-layout { display: block; min-height: 0; }
  .skill-index { border-right: 0; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; }
  .skill-index-head { min-height: 43px; }
  .skill-list { display: flex; overflow-x: auto; gap: 6px; padding: 8px; }
  .skill-row { flex: 0 0 190px; margin: 0; border-color: #e7edf3; background: white; }
  .skill-workspace { padding: 19px 14px 25px; }
  .skill-welcome { min-height: 240px; }
  .settings-pair { grid-template-columns: 1fr; gap: 0; }
  .check-grid { grid-template-columns: 1fr; }
  .bot-check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comparison-columns { grid-template-columns: 1fr; }
  .history-select { width: 100%; margin: 0; }
  .history-current { align-items: flex-start; }
  .event-list li { grid-template-columns: 1fr; }
  .event-meta { text-align: left; }
  .app-footer { padding: 13px 17px; font-size: 9px; }
}
@media (max-width: 420px) {
  .side-nav a { padding: 0 6px; }
  .side-nav a .nav-icon { display: none; }
  .breadcrumbs { font-size: 11px; }
  .connection-pill { gap: 5px; }
    .form-actions, .settings-actions { align-items: stretch; flex-direction: column; }
  .form-actions input, .settings-actions input { width: 100%; margin: 0; }
  .form-actions .button, .settings-actions .button { width: 100%; }
}
