/* SkillTree Config — dark, industrial, built to sit next to the in-game UI it edits. */

:root {
    /* Palette taken from the SkillTree icon: teal-black outlines, crystal cyan, trunk tan, progression orange. */
    --ground: #0a1315;
    --panel: #0f1b1e;
    --panel2: #132428;
    --panel3: #1a2e33;
    --line: #213a3f;
    --line2: #2f4e54;
    --ink: #e3f0f1;
    --ink2: #9db5b8;
    --ink3: #6c878b;
    --accent: #1fd3e0;
    --accent-hover: #55e2ec;
    --accent-dim: #0d5961;
    --accent-ink: #032a2e;
    --accent-tint: rgba(31, 211, 224, .1);
    --orange: #ec6a24;
    --gold: #efb229;
    --gold-dim: #6b5216;
    --gold-tint: #1f2210;
    --requires: #c9a36a;
    --red: #e5484d;
    --green: #6fcf7a;
    --violet: #a58bea;
    --icon-well: #0b1719;
    --r: 3px;
    --f-disp: 'Archivo', -apple-system, 'Segoe UI', sans-serif;
    --f-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
    --topbar-h: 52px;
    color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font-family: var(--f-disp);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.2; text-wrap: balance; }
p { margin: 0; }
a { color: var(--accent); }
code, .mono { font-family: var(--f-mono); }
code { font-size: .88em; color: var(--gold); background: rgba(239,178,41,.09); padding: 1px 4px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.eyebrow {
    font-family: var(--f-mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ink3);
}

/* ---------- boot ---------- */
.boot { height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; }
.boot-mark { width: 40px; height: 40px; animation: boot 1.2s ease-in-out infinite; }
.boot-text { font-family: var(--f-mono); font-size: 12px; color: var(--ink3); letter-spacing: .08em; }
@keyframes boot { 50% { opacity: .35; } }

/* ---------- buttons & inputs ---------- */
.btn {
    font-family: var(--f-disp);
    font-size: 13px;
    font-weight: 500;
    color: var(--ink2);
    background: var(--panel3);
    border: 1px solid var(--line2);
    border-radius: var(--r);
    padding: 5px 12px;
    cursor: pointer;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.btn:hover:not(:disabled) { color: var(--ink); border-color: var(--ink3); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn.ghost { background: transparent; }
.btn.danger { color: #f0a9a3; border-color: rgba(217,72,63,.5); background: rgba(217,72,63,.08); }
.btn.danger:hover:not(:disabled) { color: #fff; border-color: var(--red); background: rgba(217,72,63,.25); }
.btn.small { font-size: 12px; padding: 2px 8px; }
.btn.icon { padding: 4px 7px; }
.btn[aria-pressed="true"] { background: var(--accent-dim); border-color: var(--accent); color: #fff; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

input[type=text], input[type=number], input[type=search], select, textarea {
    font-family: var(--f-mono);
    font-size: 12.5px;
    color: var(--ink);
    background: var(--panel3);
    border: 1px solid var(--line2);
    border-radius: var(--r);
    padding: 5px 8px;
    width: 100%;
    min-width: 0;
}
input:hover, select:hover, textarea:hover { border-color: var(--ink3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input.bad, textarea.bad { border-color: var(--red); background: rgba(217,72,63,.1); }
input:disabled, select:disabled { opacity: .5; }
textarea { resize: vertical; min-height: 60px; line-height: 1.45; }
input[type=number] { font-variant-numeric: tabular-nums; }

.switch {
    width: 36px; height: 20px; border-radius: 10px; background: var(--line2);
    position: relative; cursor: pointer; border: 0; flex: none; padding: 0;
}
.switch::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px;
    border-radius: 50%; background: var(--ink3); transition: left .15s, background .15s;
}
.switch[aria-checked="true"] { background: var(--accent-dim); }
.switch[aria-checked="true"]::after { left: 19px; background: var(--accent); }

.chip {
    font-family: var(--f-mono); font-size: 11.5px; padding: 2px 8px; border-radius: 11px;
    border: 1px solid var(--line2); color: var(--ink2); display: inline-flex; gap: 6px;
    align-items: center; background: var(--panel3); max-width: 100%;
}
.chip button { background: none; border: 0; color: inherit; cursor: pointer; padding: 0; font-size: 12px; line-height: 1; opacity: .7; }
.chip button:hover { opacity: 1; }

.badge {
    font-family: var(--f-mono); font-size: 10px; padding: 1px 6px; border-radius: 8px;
    background: var(--accent-dim); color: #c9f6fa; font-variant-numeric: tabular-nums;
}
.badge.gold { background: rgba(239,178,41,.16); color: var(--gold); }
.badge.red { background: rgba(217,72,63,.18); color: #f0a9a3; }
.badge.muted { background: var(--panel3); color: var(--ink3); }

.note {
    border: 1px solid var(--line2); border-left: 2px solid var(--ink3); background: var(--panel);
    padding: 9px 12px; border-radius: var(--r); font-size: 13px; color: var(--ink2);
}
.note.warn { border-left-color: var(--gold); }
.note.error { border-left-color: var(--red); background: rgba(217,72,63,.06); color: #f0c5c1; }
.note.info { border-left-color: var(--accent); }
.note b { color: var(--ink); font-weight: 600; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-rows: var(--topbar-h) 1fr; grid-template-columns: 236px minmax(0, 1fr); height: 100vh; }

.topbar {
    grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 0 16px;
    border-bottom: 1px solid var(--line); background: var(--panel);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-weight: 700; letter-spacing: -.01em; font-size: 15px; }
.brand img { width: 26px; height: 26px; image-rendering: auto; }
.topbar .file { display: flex; align-items: baseline; gap: 10px; min-width: 0; color: var(--ink2); font-size: 13px; }
.topbar .file .name { font-family: var(--f-mono); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.topbar .sep { width: 1px; align-self: stretch; margin: 12px 0; background: var(--line); }
.unexported { font-family: var(--f-mono); font-size: 11.5px; color: var(--gold); white-space: nowrap; }
.unexported.clean { color: var(--ink3); }

.shell.nav-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.shell.nav-collapsed .sidenav { visibility: hidden; overflow: hidden; border: 0; padding: 0; }

.sidenav { border-right: 1px solid var(--line); background: var(--panel2); overflow-y: auto; padding: 10px 0 24px; }
.sidenav .group { padding: 14px 16px 5px; }
.nav-search { position: relative; padding: 4px 12px 4px; }
.nav-search input { height: 32px; font-size: 12.5px; }
.search-results {
    position: absolute; left: 12px; top: 40px; z-index: 30; width: min(420px, calc(100vw - 40px));
    background: var(--panel3); border: 1px solid var(--line2); border-radius: 4px; box-shadow: 0 18px 40px -12px #000;
    max-height: 60vh; overflow-y: auto; padding: 4px;
}
.search-hit { display: grid; gap: 1px; width: 100%; text-align: left; background: none; border: 0; border-radius: 3px; padding: 7px 10px; cursor: pointer; color: var(--ink); font-family: var(--f-disp); }
.search-hit.active, .search-hit:hover { background: var(--panel2); }
.search-hit .hit-label { font-size: 13px; }
.search-hit .hit-path { font-size: 11px; color: var(--ink3); font-family: var(--f-mono); }
.search-empty { padding: 10px; color: var(--ink3); font-size: 12.5px; }
.sidenav a {
    display: flex; align-items: center; gap: 8px; padding: 5px 16px; color: var(--ink2);
    text-decoration: none; font-size: 13.5px; border-left: 2px solid transparent;
}
.sidenav a:hover { background: var(--panel3); color: var(--ink); }
.sidenav a.active { background: var(--panel3); border-left-color: var(--accent); color: var(--ink); font-weight: 600; }
.sidenav a .badge { margin-left: auto; }

.main { overflow-y: auto; position: relative; }
.page { max-width: 1060px; padding: 26px 32px 80px; }
.page.wide { max-width: none; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; letter-spacing: -.02em; }
.page-head .sub { color: var(--ink2); max-width: 70ch; margin-top: 6px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------- landing ---------- */
.landing { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.landing-copy {
    padding: 64px 56px; display: flex; flex-direction: column; gap: 26px; justify-content: center;
    background: radial-gradient(120% 120% at 0% 0%, rgba(31,211,224,.12), transparent 60%), var(--panel);
    border-right: 1px solid var(--line);
}
.landing-logo img { width: 168px; height: 168px; display: block; margin: -12px 0 -6px -14px; }
.landing-kicker { color: var(--orange); }
.landing-copy h1 { font-size: clamp(34px, 4.4vw, 52px); letter-spacing: -.03em; font-weight: 700; }
.landing-copy .lede { font-size: 17px; color: var(--ink2); max-width: 52ch; }
.landing-copy ul { margin: 0; padding-left: 18px; color: var(--ink2); display: grid; gap: 6px; max-width: 56ch; }
.landing-copy li::marker { color: var(--accent); }
.landing-action { padding: 64px 56px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.dropzone {
    border: 1.5px dashed var(--line2); border-radius: 6px; padding: 42px 28px; text-align: center;
    display: grid; gap: 10px; justify-items: center; background: var(--panel); position: relative;
    transition: border-color .15s, background .15s;
}
.dropzone.over { border-color: var(--accent); background: var(--accent-tint); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone h2 { font-size: 19px; }
.dropzone p { color: var(--ink2); font-size: 13px; }
.privacy { font-size: 12.5px; color: var(--ink3); display: flex; gap: 8px; align-items: baseline; }

/* ---------- settings ---------- */
.search-box { position: relative; margin-bottom: 20px; }
.search-box input { padding-left: 30px; font-size: 13px; height: 34px; }
.search-box .glass { position: absolute; left: 10px; top: 8px; color: var(--ink3); font-size: 14px; pointer-events: none; }

.fields { display: flex; flex-direction: column; }
.field {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 340px); gap: 22px;
    padding: 13px 0; border-bottom: 1px solid var(--line); align-items: start;
}
.field:last-child { border-bottom: 0; }
.field.block { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.field .label { font-size: 14px; color: var(--ink); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.field .hints { font-size: 12px; color: var(--ink2); margin-top: 3px; display: grid; gap: 2px; }
.field .key { font-family: var(--f-mono); font-size: 10.5px; color: var(--ink3); margin-top: 4px; word-break: break-word; }
.field .meta { display: flex; gap: 8px; align-items: center; margin-top: 5px; flex-wrap: wrap; }
.field .control { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.missing .label { color: var(--ink2); }
.linkish { background: none; border: 0; padding: 0; color: var(--ink3); font-size: 11.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-family: var(--f-disp); }
.linkish:hover { color: var(--ink); }

.group-box { border: 1px solid var(--line); border-radius: 4px; background: var(--panel); margin: 4px 0; }
.group-box > summary {
    list-style: none; cursor: pointer; padding: 10px 14px; display: flex; gap: 10px; align-items: baseline;
    font-weight: 600; font-size: 14px;
}
.group-box > summary::-webkit-details-marker { display: none; }
.group-box > summary::before { content: "▸"; color: var(--ink3); font-size: 11px; transition: transform .12s; display: inline-block; }
.group-box[open] > summary::before { transform: rotate(90deg); }
.group-box > summary .hint { font-weight: 400; color: var(--ink3); font-size: 12px; }
.group-box > .group-body { padding: 0 14px 6px; border-top: 1px solid var(--line); }

.valrow { display: flex; gap: 8px; align-items: center; min-width: 0; }
.valrow > input, .valrow > select { flex: 1; }
.unit { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink2); white-space: nowrap; }
.err { font-size: 11.5px; color: #f0a9a3; }

.colorpick { width: 34px; height: 30px; padding: 0; border: 1px solid var(--line2); border-radius: var(--r); background: none; cursor: pointer; flex: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.add-row { display: flex; gap: 6px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.grid th {
    text-align: left; font-family: var(--f-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
    color: var(--ink3); font-weight: 500; padding: 7px 8px; border-bottom: 1px solid var(--line); background: var(--panel2);
    white-space: nowrap;
}
table.grid td { padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid td input, table.grid td select { padding: 4px 6px; }
table.grid td.fit { width: 1%; white-space: nowrap; }

.unrecognised { margin-top: 18px; border: 1px dashed var(--line2); border-radius: 4px; padding: 12px 14px; display: grid; gap: 8px; }
.unrecognised pre { margin: 0; font-family: var(--f-mono); font-size: 11.5px; color: var(--ink2); white-space: pre-wrap; max-height: 160px; overflow: auto; }

/* ---------- toast ---------- */
.toast {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 50;
    background: var(--panel3); border: 1px solid var(--line2); border-left: 3px solid var(--green);
    padding: 9px 16px; border-radius: 4px; font-size: 13px; box-shadow: 0 12px 30px -10px #000;
}

/* ---------- dialog ---------- */
.dialog-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 40; }
.dialog {
    background: var(--panel); border: 1px solid var(--line2); border-radius: 6px; width: min(520px, calc(100vw - 32px));
    box-shadow: 0 30px 80px -20px #000; display: flex; flex-direction: column; max-height: calc(100vh - 60px);
}
.dialog header { padding: 16px 20px 10px; }
.dialog header h2 { font-size: 18px; }
.dialog .body { padding: 6px 20px 16px; display: grid; gap: 14px; overflow: auto; }
.dialog footer { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.form-row { display: grid; gap: 5px; }
.form-row > label { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }
.form-row .hint { font-size: 12px; color: var(--ink3); }

#blazor-error-ui {
    background: #3a1517; color: #f5d2d3; bottom: 0; left: 0; right: 0; display: none; position: fixed;
    padding: 10px 44px 10px 18px; z-index: 1000; border-top: 1px solid var(--red); font-size: 13.5px;
}
#blazor-error-ui a { color: #fff; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 14px; top: 9px; }

/* ---------- tree manager ---------- */
.tm { display: grid; grid-template-columns: 196px minmax(0, 1fr) 360px; height: calc(100vh - var(--topbar-h)); }
.tm > * { min-height: 0; }
.tm-rail { border-right: 1px solid var(--line); background: var(--panel2); overflow-y: auto; padding: 10px 0 16px; display: flex; flex-direction: column; }
.tm-rail .eyebrow { padding: 4px 14px 8px; }
.tm-rail button.tree {
    display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 0;
    border-left: 2px solid transparent; color: var(--ink2); font-family: var(--f-disp); font-size: 13.5px;
    padding: 6px 14px; cursor: pointer;
}
.tm-rail button.tree:hover { background: var(--panel3); color: var(--ink); }
.tm-rail button.tree[aria-current="true"] { background: var(--panel3); border-left-color: var(--accent); color: var(--ink); font-weight: 600; }
.tm-rail button.tree.off { opacity: .5; }
.tm-rail .count { margin-left: auto; font-family: var(--f-mono); font-size: 10.5px; color: var(--ink3); font-variant-numeric: tabular-nums; }
.tm-rail .dot-err { width: 7px; height: 7px; border-radius: 50%; background: var(--red); flex: none; }
.tm-rail .rail-foot { margin-top: 10px; padding: 0 14px; }

.tm-center { display: flex; flex-direction: column; min-width: 0; }
.tm-toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: var(--panel); }
.tm-toolbar h1 { font-size: 19px; letter-spacing: -.01em; }
.tm-toolbar .spacer { flex: 1; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; }
.legend span { font-family: var(--f-mono); font-size: 10px; letter-spacing: .06em; color: var(--ink3); display: flex; align-items: center; gap: 6px; text-transform: uppercase; }
.legend i { width: 16px; height: 0; border-top: 2px solid; display: block; }

.tm-canvas {
    position: relative; overflow: auto; flex: 1; padding: 22px 22px 60px;
    background-image: radial-gradient(circle at 1px 1px, #1a2c30 1px, transparent 0); background-size: 22px 22px;
}
.tm-canvas.linking { cursor: crosshair; }
.tm-grid { position: relative; display: flex; flex-direction: column; gap: 30px; min-width: max-content; }
svg.tm-edges { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; z-index: 2; }
svg.tm-edges .edge { fill: none; stroke-width: 1.8; opacity: .5; }
svg.tm-edges .edge.focus { opacity: 1; stroke-width: 2.2; }
svg.tm-edges .edge.requires { stroke: var(--requires); }
svg.tm-edges .edge.blocks { stroke: var(--red); stroke-dasharray: 6 4; }

.tm-row { display: grid; grid-template-columns: 92px auto; gap: 16px; align-items: start; }
.tm-tier { padding-top: 10px; text-align: right; }
.tm-tier .t { font-family: var(--f-mono); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); }
.tm-tier .p { font-family: var(--f-mono); font-size: 10.5px; color: var(--ink3); font-variant-numeric: tabular-nums; }
.tm-tier .p.auto { font-style: italic; }
.tm-row.ult .tm-tier .t { color: var(--gold); }
.tm-cards { display: flex; gap: 12px; align-items: stretch; min-height: 124px; }

.tm-drop-end {
    width: 44px; border: 1.5px dashed transparent; border-radius: 4px; display: grid; place-items: center;
    color: var(--ink3); font-size: 18px;
}
.tm-canvas.dragging .tm-drop-end { border-color: var(--line2); }
.tm-drop-end.over, .tm-new-tier.over { border-color: var(--accent) !important; background: var(--accent-tint); }
.tm-new-tier {
    border: 1.5px dashed var(--line); border-radius: 4px; padding: 14px 18px; color: var(--ink3); font-size: 12.5px;
    display: none; margin-left: 108px; width: max-content;
}
.tm-canvas.dragging .tm-new-tier { display: block; }

.node {
    position: relative; width: 112px; background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r);
    padding: 9px 7px 8px; cursor: pointer; text-align: center; display: flex; flex-direction: column; align-items: center;
    gap: 6px; color: var(--ink2); font-family: var(--f-disp); user-select: none; z-index: 3;
    transition: border-color .12s, background .12s, box-shadow .12s;
}
.node:hover { border-color: var(--ink3); background: var(--panel3); }
.node.selected { border-color: var(--accent); background: #0f3136; color: var(--ink); box-shadow: 0 0 0 1px var(--accent); }
.node.ult { border-color: var(--gold-dim); background: var(--gold-tint); }
.node.ult.selected { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.node.off { opacity: .45; }
.node.drop-before { box-shadow: -6px 0 0 -2px var(--accent); }
.node.dragged { opacity: .35; }
.tm-canvas.linking .node:not(.selected) { border-style: dashed; border-color: var(--gold); }
.node .icon { width: 58px; height: 58px; border: 1px solid var(--line2); border-radius: 2px; background: var(--icon-well); display: grid; place-items: center; overflow: hidden; }
.node.ult .icon { border-color: var(--gold-dim); }
.node .icon img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.node .nm { font-size: 12px; line-height: 1.25; font-weight: 500; color: inherit; overflow-wrap: anywhere; }
.node .lv { font-family: var(--f-mono); font-size: 9.5px; color: var(--ink3); letter-spacing: .03em; }
.node.ult .lv { color: var(--gold); }
.pins { position: absolute; top: -8px; right: -8px; display: flex; gap: 2px; }
.pin {
    width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-mono);
    font-size: 9.5px; font-weight: 600; border: 1.5px solid var(--ground);
}
.pin.req { background: var(--requires); color: #2a1d08; }
.pin.blk { background: var(--red); color: #fff; }
.pin.xt { background: var(--violet); color: #1a1030; }
.pin.err { background: var(--red); color: #fff; }
.pin.warn { background: var(--gold); color: #2a1e00; }

.tm-empty { color: var(--ink2); max-width: 46ch; display: grid; gap: 10px; padding: 30px 10px; }

.tm-status { border-top: 1px solid var(--line); padding: 7px 16px; font-family: var(--f-mono); font-size: 11.5px; color: var(--ink3); display: flex; gap: 16px; background: var(--panel); flex-wrap: wrap; }
.tm-status .ok { color: var(--green); }
.tm-status .bad { color: #f0a9a3; }
.tm-status .warn { color: var(--gold); }

.tm-inspector { border-left: 1px solid var(--line); background: var(--panel2); overflow-y: auto; display: flex; flex-direction: column; }
.insp-head { padding: 16px 18px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.insp-head h2 { font-size: 19px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.insp-head .crumb { font-family: var(--f-mono); font-size: 10.5px; color: var(--ink3); }
.insp-head .buffname { font-family: var(--f-mono); font-size: 11.5px; color: var(--accent); }
.insp-body { padding: 14px 18px 40px; display: flex; flex-direction: column; gap: 18px; }
.insp-section { display: grid; gap: 10px; }
.insp-section > .eyebrow { display: flex; align-items: center; gap: 8px; }
.insp-section > .eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.ifield { display: grid; gap: 5px; }
.ifield > label, .ifield > .lbl { font-size: 12.5px; color: var(--ink2); display: flex; justify-content: space-between; gap: 8px; }
.ifield .hint { font-size: 11.5px; color: var(--ink3); line-height: 1.45; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tooltip-preview {
    background: var(--icon-well); border: 1px solid var(--line); border-left: 2px solid var(--accent); padding: 10px 12px;
    font-size: 13px; line-height: 1.5; color: var(--ink);
}
.tooltip-preview .approx { display: block; margin-top: 6px; font-size: 11px; color: var(--ink3); }
.icon-field { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; align-items: start; }
.icon-preview { width: 76px; height: 76px; border: 1px solid var(--line2); background: var(--icon-well); display: grid; place-items: center; position: relative; overflow: hidden; }
.icon-preview img { width: 100%; height: 100%; object-fit: cover; }
.icon-preview .src { position: absolute; bottom: 0; left: 0; right: 0; font-family: var(--f-mono); font-size: 9px; text-align: center; background: var(--accent); color: var(--accent-ink); letter-spacing: .08em; text-transform: uppercase; }
.icon-preview .src.url { background: rgba(155,122,224,.9); color: #1a1030; }
.icon-note { font-size: 11.5px; color: var(--ink3); line-height: 1.45; }
.icon-note .ok { color: var(--green); }
.icon-note .bad { color: #f0a9a3; }
.dead input { text-decoration: line-through; opacity: .55; }
.issue-list { display: grid; gap: 6px; }
.issue { border-radius: var(--r); padding: 8px 10px; font-size: 12.5px; border: 1px solid; display: grid; gap: 2px; }
.issue b { font-weight: 600; }
.issue.error { border-color: rgba(217,72,63,.45); background: rgba(217,72,63,.08); color: #f0c5c1; }
.issue.warning { border-color: rgba(239,178,41,.35); background: rgba(239,178,41,.06); color: #ecd9a8; }
.issue.info { border-color: var(--line2); background: var(--panel); color: var(--ink2); }
.link-row { display: flex; gap: 6px; align-items: center; }
.link-row select { flex: 1; }
.chip.req { border-color: rgba(201,163,106,.45); color: var(--requires); }
.chip.blk { border-color: rgba(217,72,63,.45); color: #e88078; }
.linkbanner {
    background: rgba(239,178,41,.1); border: 1px solid rgba(239,178,41,.4); color: #f2d78d; border-radius: var(--r);
    padding: 9px 12px; font-size: 12.5px; display: flex; gap: 10px; align-items: center;
}
.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0% { background: rgba(239,178,41,.25); } 100% { background: transparent; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- analytics ---------- */
.analytics { max-width: 1180px; }
.stat-strip { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 30px; }
.stat { flex: 1 1 150px; background: var(--panel); padding: 14px 16px; }
.stat .n { font-family: var(--f-mono); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .l { font-family: var(--f-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); margin-top: 4px; }
.a-section { display: grid; gap: 10px; margin-bottom: 36px; }
.a-section h2 { font-size: 18px; }
.a-section .sub, .a-section .foot { color: var(--ink2); font-size: 13px; max-width: 80ch; }
.a-section .foot { color: var(--ink3); font-size: 12px; }
table.grid td.num, table.grid th.num { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.grid td.strong { color: var(--ink); font-weight: 600; }
table.grid td a { color: var(--ink); text-decoration: none; border-bottom: 1px dotted var(--ink3); }
table.grid td a:hover { color: var(--accent); border-bottom-color: var(--accent); }
table.grid td a.chip { border-bottom: 0; }
table.grid tr.muted-row td { opacity: .5; }
table.grid td { padding: 6px 8px; }
table.grid tbody tr:hover td { background: rgba(255,255,255,.02); }
.barcell { display: flex; align-items: center; gap: 10px; }
.bartrack { position: relative; flex: 1; height: 12px; }
.bar { position: absolute; left: 0; top: 2px; height: 8px; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar.over { background: var(--gold); }
.refline { position: absolute; top: -3px; bottom: -3px; border-left: 1.5px dashed var(--ink2); }
.barval { font-family: var(--f-mono); font-size: 12px; color: var(--ink); min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.tier-chips { gap: 4px; }
.tier-chips .chip { font-size: 10.5px; padding: 1px 6px; white-space: nowrap; }
.a-filter { display: flex; gap: 12px; align-items: center; max-width: 480px; }
button.sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
button.sort:hover { color: var(--ink); }

/* ---------- levelling curve ---------- */
.level-curve { display: grid; gap: 22px; }
.curve-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.curve-figure { margin: 0; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); padding: 14px 16px 8px; }
.curve-figure figcaption { font-size: 13px; color: var(--ink2); margin-bottom: 6px; }
.curve-figure svg { width: 100%; height: auto; display: block; }
.curve-figure .grid-line { stroke: var(--line); stroke-width: 1; }
.curve-figure .axis-label { fill: var(--ink3); font-family: var(--f-mono); font-size: 11px; }
.curve-figure .curve-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.curve-figure .curve-end { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.curve-figure .curve-hover { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.curve-figure .crosshair { stroke: var(--ink3); stroke-width: 1; stroke-dasharray: 3 3; }
.curve-figure .tip-box { fill: var(--panel3); stroke: var(--line2); }
.curve-figure .tip-title { fill: var(--ink2); font-family: var(--f-mono); font-size: 11px; }
.curve-figure .tip-value { fill: var(--ink); font-family: var(--f-mono); font-size: 12px; font-weight: 600; }
.curve-figure .hit { fill: transparent; }
.level-curve .foot { color: var(--ink3); font-size: 12px; }

/* ---------- review ---------- */
.export-panel {
    display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap;
    border: 1px solid var(--line2); border-left: 3px solid var(--green); background: var(--panel);
    padding: 16px 20px; border-radius: 4px; margin-bottom: 32px;
}
.export-panel.has-problems { border-left-color: var(--red); }
.export-panel h2 { font-size: 18px; margin-bottom: 4px; }
.export-panel p { color: var(--ink2); font-size: 13px; max-width: 70ch; }
.export-actions { display: flex; gap: 8px; }
.change-list { list-style: none; margin: 0; padding: 8px 0; display: grid; gap: 6px; font-size: 13px; }
.change-list li { display: grid; gap: 1px; }
.change-list a { font-family: var(--f-mono); font-size: 12px; color: var(--ink); text-decoration: none; border-bottom: 1px dotted var(--ink3); justify-self: start; }
.change-list span { color: var(--ink2); }
td.before { color: #e88078; font-size: 12px; word-break: break-word; }
td.after { color: var(--green); font-size: 12px; word-break: break-word; }
td .path { font-size: 12px; margin-left: 6px; word-break: break-word; }

/* ---------- review lists ---------- */
.lint { display: grid; gap: 16px; }
.lint-group { display: grid; gap: 6px; }
.lint-group ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; color: var(--ink2); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
