:root {
  --bg: #0a0d12;
  --panel: #10151c;
  --panel-2: #151b24;
  --panel-3: #1b2330;
  --line: #212a36;
  --line-2: #2c3746;
  --text: #dbe2ea;
  --muted: #8a96a6;
  --faint: #5c6878;
  --a: #3ec7f5;
  --a-dim: rgba(62, 199, 245, .12);
  --b: #ff9a3c;
  --b-dim: rgba(255, 154, 60, .12);
  --ok: #4ade80;
  --err: #ff6b6b;
  --warn: #f5c542;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  --radius: 8px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--sans);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
code { font-family: var(--mono); font-size: .92em; background: var(--panel-3); padding: 1px 5px; border-radius: 4px; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #0f141b, #0b0f15);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--a); }
.brand svg { width: 26px; height: 26px; }
.wordmark { font-weight: 800; letter-spacing: .14em; color: var(--text); font-size: 15px; }
.wordmark b { color: var(--a); font-weight: 800; }
.tagline { color: var(--faint); font-size: 12px; padding-left: 10px; border-left: 1px solid var(--line-2); }
.top-actions { display: flex; gap: 8px; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px;
  border-radius: 7px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  font-size: 13px; font-weight: 500;
  white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--panel-3); border-color: #3a4757; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--a); border-color: var(--a); color: #05222d; font-weight: 650; }
.btn.primary:hover { background: #6bd6fa; }
.btn.accent { border-color: rgba(255, 154, 60, .55); color: var(--b); background: var(--b-dim); }
.btn.accent:hover { background: rgba(255, 154, 60, .2); }
.btn.danger { color: var(--err); border-color: rgba(255, 107, 107, .35); background: transparent; }
.btn.danger:hover { background: rgba(255, 107, 107, .1); }
.btn.danger.solid { background: var(--err); color: #2a0606; border-color: var(--err); font-weight: 650; }
.btn.block { flex: 1; justify-content: center; }
.btn.select { appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; max-width: 200px; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: 12px; }

/* ---- layout ---- */
.layout { flex: 1; display: grid; grid-template-columns: 300px 1fr; min-height: 0; }
.sidebar { border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
main { overflow-y: auto; padding: 24px 32px 80px; min-width: 0; }

/* ---- sidebar ---- */
.side-search { padding: 12px; border-bottom: 1px solid var(--line); }
.side-search input, .search {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 7px;
  padding: 7px 10px;
  outline: none;
}
.side-search input:focus, .search:focus { border-color: var(--a); }
.library { flex: 1; overflow-y: auto; padding: 6px 0 12px; }
.lib-empty { color: var(--faint); padding: 32px 20px; text-align: center; font-size: 13px; }
.craft h2 {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 14px 16px 4px;
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.craft h2 span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.craft h2 em { font-style: normal; color: var(--faint); font-weight: 500; }
.bk-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px 7px 12px; margin: 1px 8px;
  border-radius: 7px;
  cursor: pointer;
  border: 1px solid transparent;
}
.bk-row:hover { background: var(--panel-2); }
.bk-row.active { background: var(--panel-3); border-color: var(--line-2); }
.bk-main { min-width: 0; }
.bk-date { font-weight: 550; font-size: 13px; }
.bk-date span { color: var(--muted); font-weight: 400; margin-left: 4px; }
.bk-sub { color: var(--faint); font-size: 12px; font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick {
  flex: none; width: 22px; height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--line-2);
  background: transparent;
  font-size: 11px; font-weight: 800; padding: 0;
  display: grid; place-items: center;
}
.pick:hover { border-color: var(--muted); }
.pick.on { background: var(--panel-3); border-color: var(--text); }
.pick.a { background: var(--a); border-color: var(--a); color: #05222d; }
.pick.b { background: var(--b); border-color: var(--b); color: #2d1300; }
.compare-bar { border-top: 1px solid var(--line); padding: 12px; display: flex; align-items: center; gap: 10px; min-height: 58px; }
.compare-bar .hint { color: var(--faint); font-size: 12px; text-align: center; width: 100%; }

/* ---- home ---- */
.home { max-width: 880px; margin: 40px auto 0; }
.home-hero h1 { font-size: 34px; letter-spacing: -.02em; margin: 0 0 10px; line-height: 1.15; }
.home-hero p { color: var(--muted); font-size: 16px; max-width: 620px; margin: 0; }
.home-stats { display: flex; gap: 28px; margin-top: 22px; color: var(--muted); }
.home-stats b { color: var(--text); font-size: 22px; margin-right: 4px; }
.home-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 36px; }
.home-card {
  text-align: left; display: flex; flex-direction: column; gap: 8px;
  padding: 18px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line);
  transition: border-color .15s, transform .15s;
}
.home-card:hover { border-color: var(--a); transform: translateY(-2px); }
.home-card .num { font-family: var(--mono); color: var(--a); font-size: 12px; }
.home-card b { font-size: 16px; }
.home-card span:last-child { color: var(--muted); font-size: 13px; }

/* ---- notices ---- */
.notice { padding: 11px 14px; border-radius: var(--radius); margin: 14px 0; font-size: 13px; border: 1px solid; }
.notice.warn { border-color: rgba(245, 197, 66, .35); background: rgba(245, 197, 66, .07); color: #f0dca0; }
.notice.err { border-color: rgba(255, 107, 107, .35); background: rgba(255, 107, 107, .07); color: #ffc2c2; }

/* ---- view head ---- */
.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--a); font-weight: 700; }
.view-head h1 { margin: 2px 0 2px; font-size: 28px; letter-spacing: -.01em; }
.view-head .sub { color: var(--muted); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 6px 11px; font-family: var(--mono); font-size: 12.5px; }
.chip span { display: block; font-family: var(--sans); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }

/* ---- toolbar / segmented ---- */
.toolbar, .cmp-summary { display: flex; gap: 12px; align-items: center; margin: 8px 0 14px; flex-wrap: wrap; }
.toolbar .search, .cmp-summary .search { max-width: 280px; flex: 1; min-width: 180px; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { background: none; border: 0; padding: 6px 12px; border-radius: 6px; color: var(--muted); font-size: 13px; font-weight: 500; display: inline-flex; gap: 7px; align-items: center; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.seg em { font-style: normal; font-family: var(--mono); font-size: 11.5px; padding: 0 6px; border-radius: 9px; background: var(--bg); color: var(--muted); }
.seg .m-onlyA.on em { background: var(--a-dim); color: var(--a); }
.seg .m-onlyB.on em { background: var(--b-dim); color: var(--b); }
.seg .m-changed.on em, .seg .m-diff.on em { background: rgba(255,255,255,.08); color: var(--text); }

/* ---- groups & rows ---- */
.group-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 18px; }
.group-nav button { background: transparent; border: 1px solid var(--line); border-radius: 20px; padding: 3px 10px; font-size: 12px; color: var(--muted); }
.group-nav button:hover { color: var(--text); border-color: var(--line-2); }
.group-nav em { font-style: normal; color: var(--faint); margin-left: 6px; font-family: var(--mono); font-size: 11px; }

.group { margin-bottom: 18px; scroll-margin-top: 8px; }
.group h3 {
  display: flex; align-items: center; gap: 8px;
  margin: 0; padding: 8px 4px;
  font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700;
  cursor: pointer; user-select: none;
  border-bottom: 1px solid var(--line);
}
.group h3 em { font-style: normal; font-family: var(--mono); color: var(--faint); font-weight: 500; letter-spacing: 0; }
.group h3 .chev { transition: transform .15s; font-size: 10px; color: var(--faint); }
.group.collapsed h3 .chev { transform: rotate(-90deg); }
.group.collapsed .rows { display: none; }

.row {
  display: grid; grid-template-columns: minmax(180px, 1.15fr) 1fr 1fr; gap: 16px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  position: relative;
  align-items: baseline;
  font-family: var(--mono); font-size: 13px;
}
.row:hover { background: var(--panel); }
.row.single { grid-template-columns: minmax(200px, 1fr) 2fr; }
.row.head {
  position: sticky; top: -24px; z-index: 2;
  background: var(--bg);
  font-family: var(--sans); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
  color: var(--faint); border-bottom-color: var(--line-2);
}
.row.head:hover { background: var(--bg); }
.row.head .v.a { color: var(--a); }
.row.head .v.b { color: var(--b); }
.row .k { overflow-wrap: anywhere; color: var(--text); }
.row .v { overflow-wrap: anywhere; }
.row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.row.changed::before { background: linear-gradient(var(--a), var(--b)); }
.row.onlyA::before { background: var(--a); }
.row.onlyB::before { background: var(--b); }
.row.changed .v.a .val, .row.onlyA .v.a .val { color: var(--a); }
.row.changed .v.b .val, .row.onlyB .v.b .val { color: var(--b); }
.row.same .val { color: var(--muted); }
.val.on { color: var(--ok) !important; }
.val.off { color: var(--err) !important; }
.dflt { color: var(--faint); font-style: italic; font-family: var(--sans); font-size: 12px; }
.delta { margin-left: 10px; font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--panel-3); color: var(--muted); }
.cat { margin-left: 8px; font-family: var(--sans); font-size: 9.5px; font-weight: 700; letter-spacing: .06em; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--faint); vertical-align: 1px; }
.empty-rows { color: var(--faint); padding: 30px; text-align: center; }
.identical { margin-top: 20px; padding: 28px; text-align: center; border: 1px dashed var(--line-2); border-radius: 10px; color: var(--muted); }
.identical b { color: var(--ok); }
.raw { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; font: 12.5px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; color: #c3ccd7; }

/* ---- compare head ---- */
.cmp-head { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; margin-bottom: 18px; }
.cmp-card { display: flex; gap: 14px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; border-top: 3px solid; }
.cmp-card.a { border-top-color: var(--a); }
.cmp-card.b { border-top-color: var(--b); }
.cmp-card .tag { font-weight: 800; font-size: 18px; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.cmp-card.a .tag { background: var(--a-dim); color: var(--a); }
.cmp-card.b .tag { background: var(--b-dim); color: var(--b); }
.cmp-craft { font-weight: 700; font-size: 17px; cursor: pointer; }
.cmp-craft:hover { text-decoration: underline; }
.cmp-date { color: var(--muted); font-size: 13px; }
.cmp-fw { color: var(--faint); font-family: var(--mono); font-size: 12px; margin-top: 2px; }
.swap { align-self: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel-2); font-size: 17px; }
.swap:hover { border-color: var(--text); }

.fc-filter { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.fc-note { flex-basis: 100%; color: var(--warn); font-size: 12.5px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 13px; }
.switch input { display: none; }
.switch .track { width: 34px; height: 20px; border-radius: 10px; background: var(--line-2); position: relative; transition: background .15s; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text); transition: transform .15s; }
.switch input:checked + .track { background: var(--a); }
.switch input:checked + .track::after { transform: translateX(14px); background: #05222d; }
.cat-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-chip { border: 1px solid var(--line-2); background: transparent; border-radius: 20px; padding: 4px 11px; font-size: 12px; color: var(--muted); }
.cat-chip:hover { color: var(--text); }
.cat-chip.on { background: var(--panel-3); color: var(--text); text-decoration: line-through; text-decoration-color: var(--faint); }
.cat-chip em { font-style: normal; font-family: var(--mono); margin-left: 6px; color: var(--faint); }
.explain { color: var(--faint); font-size: 12px; margin: 10px 0 14px; }

/* ---- modal ---- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(3, 5, 8, .7); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .12s; }
.modal { width: min(520px, 100%); max-height: 90vh; overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-head .x { background: none; border: 0; font-size: 22px; color: var(--muted); line-height: 1; }
.modal-body { padding: 18px 20px 20px; }
.modal-body p { color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 18px; }
.modal-actions .muted { margin-right: auto; font-size: 13px; }
@keyframes fade { from { opacity: 0; } }

.prep { color: var(--muted); padding-left: 20px; margin: 0 0 12px; }
.prep li { margin: 4px 0; }
.steps { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; font-size: 13px; }
.step { padding-left: 22px; position: relative; }
.step::before { position: absolute; left: 0; font-family: var(--mono); }
.step.run { color: var(--text); }
.step.run::before { content: '◌'; color: var(--a); animation: spin 1s linear infinite; display: inline-block; }
.step.ok { color: var(--muted); }
.step.ok::before { content: '✓'; color: var(--ok); }
.step.err { color: #ffc2c2; }
.step.err::before { content: '✕'; color: var(--err); }
@keyframes spin { to { transform: rotate(360deg); } }

.paste { width: 100%; height: 300px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; padding: 12px; font: 12px/1.5 var(--mono); resize: vertical; outline: none; }
.paste:focus, .form-row input:focus { border-color: var(--a); }
.form-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 12px; }
.form-row label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.form-row input { background: var(--bg); border: 1px solid var(--line-2); border-radius: 7px; padding: 7px 10px; outline: none; width: 240px; }
.paste-info { font-size: 12px; color: var(--ok); font-family: var(--mono); }
.paste-info.bad { color: var(--warn); }

.restore-src, .restore-fc { padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; }
.restore-src .muted { font-family: var(--mono); font-size: 12px; margin-top: 2px; }
.lbl { display: inline-block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); font-weight: 700; margin-right: 10px; }
.restore-fc b { font-family: var(--mono); color: var(--a); }
.check { display: flex; gap: 9px; align-items: center; margin: 14px 0; cursor: pointer; }
.check input { accent-color: var(--a); width: 16px; height: 16px; }
.skip-box { display: flex; flex-direction: column; gap: 8px; }
.progress { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progress .bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--a), var(--b)); transition: width .1s; }
.cur { font-family: var(--mono); font-size: 11.5px; color: var(--faint); margin-top: 6px; min-height: 1.4em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.err-list { max-height: 220px; overflow: auto; border: 1px solid rgba(255,107,107,.3); border-radius: 8px; margin-top: 12px; }
.err-list div { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 12px; }
.err-list span { color: #ffc2c2; font-family: var(--mono); white-space: pre-wrap; }

/* ---- toast & drop ---- */
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--panel-3); border: 1px solid var(--line-2); border-left: 3px solid var(--a); padding: 10px 14px; border-radius: 8px; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.4); transition: opacity .3s, transform .3s; }
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
.toast.out { opacity: 0; transform: translateY(6px); }
#drop-overlay { display: none; position: fixed; inset: 0; z-index: 70; background: rgba(10, 13, 18, .85); place-items: center; pointer-events: none; }
#drop-overlay div { border: 2px dashed var(--a); border-radius: 16px; padding: 60px 90px; font-size: 20px; font-weight: 700; color: var(--a); }
body.dragging #drop-overlay { display: grid; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { max-height: 40vh; border-right: 0; border-bottom: 1px solid var(--line); }
  main { padding: 16px; }
  .home-cards { grid-template-columns: 1fr; }
  .tagline { display: none; }
  .row { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
}

/* ---- FC identify panel ---- */
.fc-panel { padding: 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.fc-panel:empty { display: none; }
.mini-check { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); cursor: pointer; }
.mini-check input { accent-color: var(--ok); margin: 0; }
.fc-status { font-size: 13px; color: var(--muted); padding: 6px 2px; }
.fc-status .spin { display: inline-block; color: var(--ok); animation: spin 1s linear infinite; margin-right: 6px; }
.fc-err { font-size: 12px; color: #ffc2c2; }
.fc-found { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(74, 222, 128, .35); background: rgba(74, 222, 128, .06); }
.fc-found-head { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 13px; color: var(--ok); }
.fc-found-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.fc-found-head .x { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 2px; }
.fc-found.gone { border-color: var(--line-2); background: var(--panel-2); }
.fc-found.gone .fc-found-head { color: var(--muted); }
.fc-found.gone .dot { background: var(--faint); box-shadow: none; }
.fc-id { font-size: 11px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-id code { font-size: 11px; background: none; padding: 0; color: var(--muted); }
.fc-count { font-size: 13px; }
.fc-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.small.on { border-color: var(--ok); color: var(--ok); }
.bk-row.match { background: rgba(74, 222, 128, .07); border-color: rgba(74, 222, 128, .4); }
.bk-row.match.active { background: rgba(74, 222, 128, .13); }
.bk-match { font-size: 11px; color: var(--ok); font-weight: 600; margin-top: 1px; }

/* ---- defaults ---- */
.val.dv { color: var(--muted) !important; }
.dtag { display: inline-block; margin-left: 8px; font-family: var(--sans); font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 1px 5px; border-radius: 4px; background: var(--panel-3); color: var(--faint); vertical-align: 1px; }
.notice.info { border-color: rgba(62, 199, 245, .3); background: rgba(62, 199, 245, .06); color: #bfe9f8; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.notice.ok { border-color: rgba(74, 222, 128, .35); background: rgba(74, 222, 128, .07); color: #c4f5d4; }

/* ---- selection & write ---- */
.row.cmp { grid-template-columns: 22px minmax(170px, 1.15fr) 1fr 1fr; }
.ck { display: flex; align-items: center; justify-content: center; cursor: pointer; align-self: center; }
.ck input { accent-color: var(--b); width: 15px; height: 15px; margin: 0; cursor: pointer; }
.row.selected { background: rgba(255, 255, 255, .035); }
.row.selected .k { color: #fff; }
.sel-bar {
  position: sticky; bottom: -80px; margin: 24px -32px -80px; padding: 12px 32px 14px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: rgba(10, 13, 18, .92); backdrop-filter: blur(6px);
  border-top: 1px solid var(--line-2); font-size: 13px; z-index: 3;
}
.sel-bar > span:first-child { margin-right: 6px; }
.btn.write-a { border-color: rgba(62, 199, 245, .5); color: var(--a); background: var(--a-dim); }
.btn.write-b { border-color: rgba(255, 154, 60, .5); color: var(--b); background: var(--b-dim); }
.btn.write-a:hover { background: rgba(62, 199, 245, .2); }
.btn.write-b:hover { background: rgba(255, 154, 60, .2); }
.plan { border: 1px solid var(--line); border-radius: 8px; max-height: 300px; overflow: auto; margin: 12px 0 8px; }
.plan-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 12px; padding: 7px 12px; border-bottom: 1px solid var(--line); font: 12.5px var(--mono); }
.plan-row:last-child { border-bottom: 0; }
.plan-row.head { position: sticky; top: 0; background: var(--panel); font: 700 10.5px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.plan-row .from { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.plan-row .to { color: var(--text); }
.plan-row .scope { margin-left: 8px; font: 10.5px var(--sans); color: var(--faint); }
.cmds summary { cursor: pointer; color: var(--muted); font-size: 13px; margin: 8px 0; }
.cmds .raw { max-height: 200px; overflow: auto; font-size: 12px; }
.muted.small { font-size: 12.5px; margin: 6px 0; }

/* ---- fleet view ---- */
.bar-stack { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.qn { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 5px; background: var(--panel-3); border: 1px solid var(--line-2); font: 700 10.5px var(--mono); color: var(--muted); flex: none; }
.odd-board { margin: 18px 0 14px; }
.ob-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ob-title b { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--text); }
.ob-title span { color: var(--faint); font-size: 12.5px; }
.ob-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.ob-card { position: relative; text-align: left; padding: 12px 14px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: border-color .12s, background .12s; }
.ob-card:hover { border-color: var(--line-2); background: var(--panel-2); }
.ob-card.on { border-color: #ff6b9d; background: rgba(255, 107, 157, .07); }
.ob-card.on .qn { background: #ff6b9d; border-color: #ff6b9d; color: #2b0613; }
.ob-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ob-head b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-x { margin-left: auto; background: none; border: 0; color: var(--faint); font-size: 16px; line-height: 1; padding: 0 2px; visibility: hidden; }
.ob-card:hover .ob-x { visibility: visible; }
.ob-x:hover { color: var(--err); }
.ob-sub { font: 11.5px var(--mono); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-num { font-size: 13px; color: var(--muted); margin-top: 4px; }
.ob-num b { font-size: 22px; color: var(--text); margin-right: 3px; font-variant-numeric: tabular-nums; }
.ob-card.top .ob-num b { color: #ff6b9d; }
.ob-num span { font-size: 12px; color: var(--faint); }
.ob-bar { height: 4px; border-radius: 2px; background: var(--bg); overflow: hidden; margin-top: 4px; }
.ob-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff6b9d, #ffd166); border-radius: 2px; }

.focus-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin: 0 0 14px; border-radius: 10px; border: 1px solid rgba(255, 107, 157, .4); background: rgba(255, 107, 157, .06); font-size: 13px; }
.focus-banner .qn { background: #ff6b9d; border-color: #ff6b9d; color: #2b0613; }
.focus-banner > div { flex: 1; min-width: 220px; }

.frow { display: grid; gap: 10px; padding: 6px 12px; border-bottom: 1px solid var(--line); align-items: center; font: 13px var(--mono); position: relative; }
.frow:hover { background: var(--panel); }
.frow .k { overflow-wrap: anywhere; }
.frow.head { position: sticky; top: -24px; z-index: 2; background: var(--bg); border-bottom-color: var(--line-2); padding-top: 8px; padding-bottom: 8px; font: 700 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.frow.head:hover { background: var(--bg); }
.qh { display: flex; align-items: center; gap: 6px; min-width: 0; background: none; border: 0; padding: 0; text-align: left; font: 600 12px var(--sans); color: var(--muted); letter-spacing: 0; text-transform: none; }
.qh .qname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qh:hover { color: var(--text); }
.qh.on { color: #ff6b9d; }
.qh.on .qn { background: #ff6b9d; border-color: #ff6b9d; color: #2b0613; }
.spread { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; }
.spread i { background: var(--line-2); min-width: 4px; }
.fv { min-width: 0; overflow-wrap: anywhere; padding: 3px 7px; margin: -3px -7px; border-radius: 5px; color: var(--faint); }
.fv.hot { background: color-mix(in srgb, var(--c) 13%, transparent); box-shadow: inset 2px 0 0 var(--c); color: var(--c); }
.fv.hot .fval { color: var(--c); }
.fv.focus { outline: 1px dashed rgba(255, 107, 157, .45); outline-offset: 1px; }
.frow.same .fv { color: var(--muted); }
.frow.odd::before, .frow.mostly::before, .frow.split::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.frow.odd::before { background: #ff6b9d; }
.frow.mostly::before { background: #ffd166; }
.frow.split::before { background: #9d8cff; }
.seg .m-odd.on em { background: rgba(255, 107, 157, .15); color: #ff6b9d; }
.seg .m-mostly.on em { background: rgba(255, 209, 102, .15); color: #ffd166; }
.seg .m-split.on em { background: rgba(157, 140, 255, .15); color: #9d8cff; }

/* ---- fleet write ---- */
.frow.selected { background: rgba(255, 255, 255, .035); }
.fv.pickable { cursor: pointer; }
.fv.pickable:hover { outline: 1px solid var(--c, var(--muted)); outline-offset: 1px; }
.fv.src { outline: 2px solid var(--c, var(--text)) !important; outline-offset: 1px; }
.fv.src::after { content: ' ⇢'; color: var(--c, var(--text)); font-weight: 700; }
.fv.target { background: rgba(62, 199, 245, .07); box-shadow: inset 0 0 0 1px rgba(62, 199, 245, .25); }
.fv.target.hot { background: color-mix(in srgb, var(--c) 13%, rgba(62, 199, 245, .07)); box-shadow: inset 2px 0 0 var(--c), inset 0 0 0 1px rgba(62, 199, 245, .25); }
.fv .old { text-decoration: line-through; opacity: .55; }
.fv .old .dtag { display: none; }
.fv .arrow { margin: 0 6px; color: var(--a); font-weight: 700; }
.frow.selected .fv.target { background: rgba(62, 199, 245, .14); color: var(--a); }
.frow.selected .fv.target > .fval { color: var(--a); }
.qh { flex-wrap: wrap; row-gap: 2px; }
.qh.target .qname { color: var(--a); }
.qh .tgt { flex-basis: 100%; font: 600 10px var(--sans); letter-spacing: .04em; color: var(--a); padding-left: 24px; }
.plan-lbl { display: block; margin: 12px 0 0; }
.btn.select.small { padding: 4px 26px 4px 9px; font-size: 12px; max-width: 260px; }
.switch.small { font-size: 12.5px; font-weight: 550; gap: 8px; white-space: nowrap; }

/* ---- tuning sliders panel ---- */
.tuning-card { margin: 10px 0 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.tc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tuning-card.closed .tc-head { border-bottom: 0; }
.tuning-card.closed .tc-body { display: none; }
.tuning-card.closed .chev { transform: rotate(-90deg); }
.tc-title { background: none; border: 0; padding: 0; display: flex; align-items: baseline; gap: 8px; font: 700 12px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--text); text-align: left; }
.tc-title .chev { font-size: 10px; color: var(--faint); transition: transform .15s; }
.tc-title span:not(.chev) { font: 400 12px var(--sans); letter-spacing: 0; text-transform: none; color: var(--faint); }
.tc-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg.small button { padding: 4px 9px; font-size: 12px; }
.tc-body { padding: 8px 14px 14px; }
.tc-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); margin: 4px 0 6px; }
.tc-legend em { font-style: normal; color: var(--faint); font-size: 11.5px; }
.tc-legend b, .tc-cell b { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; margin-right: 6px; border-radius: 9px; background: var(--c); color: #0a0d12; font: 700 10.5px var(--mono); }
.tc-legend-preset { display: inline-flex; align-items: center; gap: 6px; }
.tc-legend-preset i { width: 0; height: 0; border: 5px solid transparent; border-top: 0; border-bottom: 8px solid var(--text); }
.tc-row { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; min-height: 46px; }
.tc-row.tc-scale { min-height: 0; }
.tc-row.tc-sep { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.tc-label { text-align: right; font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.tc-label small { display: block; font-weight: 400; font-style: italic; color: var(--faint); font-size: 11px; }
.tc-scale-labels { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.tc-cells { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.tc-cell { display: inline-flex; align-items: center; font-size: 12.5px; }
.tc-mode { font: 600 12px var(--mono); color: var(--muted); }
.tc-track { position: relative; height: 58px; margin: 0 18px; } /* side margin keeps edge markers off the labels */
.tc-scale-labels { margin: 0 18px; }
.tc-rail { position: absolute; left: 0; right: 0; top: 22px; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--line-2); }
.tc-zone { position: absolute; top: 22px; height: 4px; margin-top: -2px; background: rgba(62, 199, 245, .22); border-radius: 2px; }
.tc-default { position: absolute; top: 22px; width: 2px; height: 14px; margin: -7px 0 0 -1px; background: var(--muted); border-radius: 1px; }
.tc-preset { position: absolute; bottom: 0; width: 0; height: 0; margin-left: -6px; border: 6px solid transparent; border-top: 0; border-bottom: 9px solid var(--text); z-index: 3; filter: drop-shadow(0 0 2px rgba(0, 0, 0, .6)); }
.tc-preset-line { position: absolute; top: 22px; bottom: 9px; width: 0; border-left: 1px dashed rgba(219, 226, 234, .45); z-index: 1; }
.tc-mark { position: absolute; top: 22px; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; z-index: 2; }
.tc-dot { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--c); color: #0a0d12; font: 700 10.5px var(--mono); display: grid; place-items: center; white-space: nowrap; box-shadow: 0 0 0 2px var(--panel); }
.tc-mark.off .tc-dot { background: var(--panel); color: var(--c); box-shadow: inset 0 0 0 1.5px var(--c); }
.tc-val { position: absolute; bottom: 100%; margin-bottom: 1px; padding: 0 2px; border-radius: 3px; background: var(--panel); font: 10.5px var(--mono); color: var(--muted); white-space: nowrap; }
.tc-mark.below .tc-val { bottom: auto; top: 100%; margin: 1px 0 0; }
.kb { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.kb em { font-style: normal; font-weight: 400; opacity: .75; }
.kb.exact { color: var(--ok); background: rgba(74, 222, 128, .09); border-color: rgba(74, 222, 128, .3); }
.kb.sliders { color: #a7f3c0; background: rgba(74, 222, 128, .05); border-color: rgba(74, 222, 128, .2); }
.kb.near { color: var(--warn); background: rgba(245, 197, 66, .07); border-color: rgba(245, 197, 66, .3); }
.kb.warn { color: #ffb4a8; background: rgba(255, 107, 107, .07); border-color: rgba(255, 107, 107, .3); }
.kb.none { color: var(--faint); font-weight: 400; }
.ob-karate { margin-top: 2px; }
.ob-karate .kb { font-size: 11px; padding: 1px 6px; }

/* ---- slider editing ---- */
.edit-mode .tc-row { grid-template-columns: 150px 1fr 64px; }
.tc-editbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; margin: 2px 0 8px; border-radius: 8px; background: rgba(255, 154, 60, .07); border: 1px solid rgba(255, 154, 60, .3); font-size: 12.5px; }
.tc-edit-title { font-weight: 700; color: var(--b); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.tc-new-head { font: 700 10.5px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--b); text-align: center; }
.tc-new { font: 600 13px var(--mono); color: var(--muted); text-align: center; }
.tc-new.changed { color: var(--b); }
.tc-mode-sel { padding-top: 3px; padding-bottom: 3px; }
.tc-legend-new { display: inline-flex; align-items: center; gap: 6px; color: var(--b); }
.tc-legend-new i { width: 10px; height: 10px; border-radius: 50%; border: 2.5px solid var(--b); }
.tc-mark.copyable { cursor: copy; }
.tc-track.editing .tc-mark { opacity: .6; }
.tc-track.editing .tc-mark:hover { opacity: 1; }
/* Range input laid over the rail; only its thumb takes the pointer so markers stay clickable */
.tc-edit { position: absolute; left: -11px; width: calc(100% + 22px); top: 22px; height: 26px; margin: -13px 0 0; background: transparent; -webkit-appearance: none; appearance: none; pointer-events: none; z-index: 4; }
.tc-edit:focus { outline: none; }
.tc-edit::-webkit-slider-runnable-track { height: 26px; background: transparent; }
.tc-edit::-moz-range-track { height: 26px; background: transparent; }
.tc-edit::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%; background: rgba(255, 154, 60, .18); border: 3px solid var(--b); box-shadow: 0 0 0 2px var(--panel), 0 0 12px rgba(255, 154, 60, .6); cursor: grab; }
.tc-edit::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: rgba(255, 154, 60, .18); border: 3px solid var(--b); box-shadow: 0 0 0 2px var(--panel), 0 0 12px rgba(255, 154, 60, .6); cursor: grab; }
.tc-edit:active::-webkit-slider-thumb { cursor: grabbing; }
.tc-preview { margin: 10px 0 4px; padding: 10px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.tc-preview > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.tc-preview .lbl { min-width: 54px; }
.tc-preview .chg { font-family: var(--mono); font-size: 12px; }
.tc-preview .chg s { color: var(--faint); }
.tc-preview .chg b { color: var(--b); }
.tc-preview-actions { justify-content: space-between; margin-top: 4px; }

/* ---- presets section ---- */
.presets-card .tc-body { padding-top: 4px; }
.ps-cat { font: 700 10.5px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin: 10px 0 4px; }
.ps-row { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; background: var(--bg); }
.ps-row summary { list-style: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; cursor: pointer; font-size: 13px; }
.ps-row summary::-webkit-details-marker { display: none; }
.ps-row.part { opacity: .85; }
.ps-opts { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.ps-opts span { font-size: 11.5px; padding: 1px 7px; border-radius: 10px; background: var(--panel-3); color: var(--muted); }
.ps-meta { margin-left: auto; font-size: 12px; color: var(--faint); }
.ps-settings { padding: 4px 12px 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2px 18px; }
.ps-set { display: grid; grid-template-columns: 14px minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; font: 12px var(--mono); padding: 2px 0; align-items: baseline; }
.ps-set code { background: none; padding: 0; overflow-wrap: anywhere; }
.ps-set.ok > span:first-child { color: var(--ok); }
.ps-set.bad > span:first-child, .ps-set.bad .have { color: var(--err); }
.ps-set.unk { color: var(--faint); }
.ps-set .want { color: var(--muted); }
.ps-set .have { color: var(--faint); }
.pm { display: inline-flex; align-items: baseline; gap: 6px; font: 600 12.5px var(--mono); white-space: nowrap; }
.pm em { font: 400 11.5px var(--sans); font-style: normal; color: var(--muted); white-space: normal; }
.pm.full { color: var(--ok); }
.pm.part { color: var(--warn); }
.pm.none { color: var(--faint); font-weight: 400; }
.pm-grid { margin-top: 4px; }
.pm-row { display: grid; gap: 12px; padding: 6px 4px; border-bottom: 1px solid var(--line); align-items: center; font-size: 13px; }
.pm-row.head { font: 700 11px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--faint); border-bottom-color: var(--line-2); }
.pm-row.head > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-tag { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; margin-right: 6px; border-radius: 9px; background: var(--c); color: #0a0d12; font: 700 10.5px var(--mono); }
.pm-title { overflow-wrap: anywhere; }
.ps-set.head { font: 700 10px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--faint); border-bottom: 1px solid var(--line); padding-bottom: 3px; margin-bottom: 2px; }
@media (max-width: 1100px) { .ps-head2 { display: none; } }

/* ---- preset details ---- */
.ps-bad { color: var(--err); }
.ps-detail { padding: 2px 12px 10px; display: flex; flex-direction: column; gap: 8px; }
.ps-sec-title { font: 700 11px var(--sans); text-transform: uppercase; letter-spacing: .06em; margin: 6px 0 4px; cursor: default; }
.ps-sec-title em { font-style: normal; font-family: var(--mono); margin-left: 4px; }
.ps-sec.bad .ps-sec-title { color: var(--err); }
.ps-sec.ok .ps-sec-title, .ps-sec.okl .ps-sec-title { color: var(--ok); }
.ps-sec.unk .ps-sec-title { color: var(--muted); }
.ps-sec.unk .ps-sec-title .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
details.ps-sec summary { cursor: pointer; list-style: none; }
details.ps-sec summary::before { content: '▸ '; }
details.ps-sec[open] summary::before { content: '▾ '; }
.ps-detail .ps-set { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); max-width: 760px; }
.ps-detail .ps-set.bad .have { color: var(--err); font-weight: 600; }
.ps-detail .ps-set.ok .have { color: var(--muted); }
.ps-detail .ps-set .have em { font-style: normal; font-size: 10.5px; color: var(--faint); }
.ps-detail .ps-set.unk .have { color: var(--faint); font-style: italic; }
.pm-row.clickable { cursor: pointer; }
.pm-row.clickable:hover { background: var(--panel-2); }
.pm-row .chev { display: inline-block; width: 14px; color: var(--faint); font-size: 10px; transition: transform .12s; }
.pm-row.open { background: var(--panel-2); border-bottom-color: transparent; }
.pm-row.open .chev { transform: rotate(90deg); }
.pm-detail { display: grid; gap: 12px; padding: 8px 4px 12px; background: var(--panel-2); border-bottom: 1px solid var(--line); align-items: start; }
.pm-detail-label { display: flex; flex-direction: column; gap: 6px; padding-left: 18px; }
.pm-dl { font: 700 11px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pm-detail code { background: none; padding: 0; font-size: 11px; overflow-wrap: anywhere; }
.pm-dcell { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 12px; }
.pm-dhead { margin-bottom: 3px; }
.pm.low { color: var(--err); }
.pm-dopts { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 3px; }
.pm-dopts span { font-size: 10.5px; padding: 0 6px; border-radius: 8px; background: var(--panel-3); color: var(--muted); }
.pm-dline { display: flex; flex-direction: column; font: 11.5px var(--mono); padding: 2px 0; border-top: 1px solid var(--line); }
.pm-dline code { color: var(--text); font-size: 11.5px; }
.pm-dline b { color: var(--err); }
.pm-dline.unk { color: var(--faint); }
.tc-cell-preset { color: var(--muted); }
.tc-cell-preset i { width: 0; height: 0; margin-right: 6px; border: 5px solid transparent; border-top: 0; border-bottom: 8px solid var(--text); }

/* ---- filter editing ---- */
.filter-card.edit-mode .tc-row { grid-template-columns: 150px 1fr 120px; }
.tc-newmark { position: absolute; top: 22px; transform: translate(-50%, -50%); z-index: 4; width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--b); background: rgba(255, 154, 60, .18); box-shadow: 0 0 0 2px var(--panel), 0 0 10px rgba(255, 154, 60, .55); pointer-events: none; }
.tc-newmark span { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 3px; font: 600 10.5px var(--mono); color: var(--b); white-space: nowrap; background: var(--panel); padding: 0 2px; border-radius: 3px; }
.fe-on { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font: 600 13px var(--mono); color: var(--b); }
.fe-on input { accent-color: var(--b); width: 15px; height: 15px; margin: 0; }
.tc-edit.off::-webkit-slider-thumb { border-style: dashed; opacity: .6; }
.tc-new .small { font-size: 11px; font-weight: 400; }
.filter-card .tc-new { text-align: left; color: var(--b); }

/* ---- sidebar: one group per FC ---- */
.fc-group { margin: 2px 8px; border-radius: 8px; border: 1px solid transparent; }
.fc-group.open { background: rgba(255, 255, 255, .015); border-color: var(--line); margin-bottom: 6px; }
.fc-group.active > .fc-head .fc-name b { color: var(--a); }
.fc-group.match { border-color: rgba(74, 222, 128, .35); }
.fc-head { display: flex; align-items: stretch; gap: 2px; }
.fc-chev { flex: none; width: 24px; background: none; border: 0; color: var(--muted); border-radius: 6px; display: grid; place-items: center; transition: transform .12s; }
.fc-chev svg { width: 11px; height: 11px; }
.fc-chev:hover { color: var(--text); background: var(--panel-2); }
.fc-group.open .fc-chev { transform: rotate(90deg); }
.fc-name { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 7px 8px 7px 2px; border-radius: 6px; display: flex; flex-direction: column; gap: 1px; }
.fc-name:hover { background: var(--panel-2); }
.fc-name b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-meta { font-size: 11.5px; color: var(--faint); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-meta i { font-style: normal; color: var(--ok); }
.fc-aka { font-size: 11px; color: var(--muted); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-items { padding: 0 0 6px; }
.fc-items .bk-row { margin: 1px 4px 1px 10px; padding: 5px 8px; }
.bk-craft { color: var(--b); }
.bk-chg { margin-left: auto; flex: none; font: 600 10.5px var(--mono); padding: 1px 6px; border-radius: 8px; }
.bk-chg.some { color: var(--b); background: var(--b-dim); }
.bk-chg.none { color: var(--faint); }
.bk-chg.first { color: var(--faint); font-weight: 400; font-family: var(--sans); }

/* ---- FC history: settings-over-time grid ---- */
.hm-card .tc-head .search { max-width: 240px; }
.hm-scroll { overflow-x: auto; padding: 0 0 6px; }
.hm-grid { display: grid; min-width: max-content; font: 12.5px var(--mono); }
.hm-grid > * { padding: 5px 10px; border-bottom: 1px solid var(--line); }
.hm-corner, .hm-label { position: sticky; left: 0; z-index: 1; background: var(--panel); }
.hm-corner { font: 700 10.5px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); align-self: end; }
.hm-col { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; background: none; border: 0; border-bottom: 1px solid var(--line-2) !important; text-align: left; border-radius: 0; cursor: pointer; }
.hm-col:hover { background: var(--panel-2); }
.hm-date { font: 600 12px var(--sans); color: var(--text); }
.hm-time { font: 11px var(--mono); color: var(--muted); }
.hm-time em { font-style: normal; color: var(--faint); }
.hm-tag { font: 600 10px var(--mono); color: var(--b); }
.hm-col:first-of-type .hm-tag { color: var(--faint); }
.hm-renamed { font: 600 10.5px var(--sans); color: var(--a); }
.hm-group { position: sticky; left: 0; font: 700 10.5px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding-top: 12px !important; background: var(--panel); }
.hm-label { color: var(--text); overflow-wrap: anywhere; }
.hm-cell { color: var(--muted); overflow-wrap: anywhere; }
.hm-cell.def { color: var(--faint); font-style: italic; }
.hm-cell.chg { color: var(--b); background: var(--b-dim); font-weight: 600; font-style: normal; box-shadow: inset 2px 0 0 var(--b); }

/* ---- FC history: timeline ---- */
.tl-title { margin: 22px 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.tl-title span { text-transform: none; letter-spacing: 0; color: var(--faint); font-weight: 400; margin-left: 6px; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line-2); }
.tl-item { position: relative; margin-bottom: 12px; }
.tl-dot { position: absolute; left: -21px; top: 12px; width: 12px; height: 12px; border-radius: 50%; background: var(--b); box-shadow: 0 0 0 3px var(--bg); }
.tl-item.first .tl-dot { background: var(--faint); }
.tl-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.tl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.tl-badge { font: 600 11px var(--mono); padding: 1px 8px; border-radius: 9px; background: var(--panel-3); color: var(--muted); }
.tl-badge.chg { background: var(--b-dim); color: var(--b); }
.tl-actions { margin-left: auto; display: flex; gap: 6px; }
.tl-group { margin-top: 8px; }
.tl-group-name { font: 700 10.5px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: 2px; }
.tl-change { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font: 12.5px var(--mono); padding: 2px 0; }
.tl-change code { background: none; padding: 0; color: var(--text); min-width: 220px; }
.tl-old { color: var(--faint); text-decoration: line-through; }
.tl-arrow { color: var(--faint); }
.tl-new { color: var(--b); font-weight: 600; }
.tl-fold { margin-top: 6px; font-size: 12px; color: var(--faint); }
