/* VK-ZFA10M demo — styles. Colours follow the SPD spec sheet (navy / SPD red). */

:root {
  --bg: #F2F5F8;
  --surface: #FFFFFF;
  --surface-2: #F6F8FB;
  --surface-3: #EDF2F7;
  --border: #DCE3EA;
  --border-strong: #C5D0DB;
  --text: #14202E;
  --muted: #5D6E80;
  --faint: #8A99A8;
  --navy: #0F3052;
  --brand: #1A56A8;
  --primary: #1A56A8;
  --primary-hover: #154A92;
  --primary-ink: #FFFFFF;
  --primary-soft: #E7EFFA;
  --accent: #C8102E;
  --ok: #1E7F46;
  --ok-soft: #E3F4EA;
  --warn: #9A5B00;
  --warn-soft: #FFF3D9;
  --bad-soft: #FDE7EA;
  --demo: #B26A00;
  --study: #6B47C9;
  --study-soft: #EFEAFB;

  --c1: #1A63C7;
  --c2: #D9480F;
  --c3: #2B8A3E;
  --c4: #7048E8;
  --plot-grid: #E7ECF1;
  --plot-grid-minor: #F1F4F7;
  --plot-frame: #B9C4CF;
  --plot-text: #5D6E80;
  --plot-noise: #AAB6C2;
  --plot-muted: #8A99A8;
  --icon-bg: #F5F8FB;
  --lcd-bg: #0F2A47;
  --lcd-ink: #E8F1FB;
  --lcd-dim: #8FB0D3;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 48, 82, .06), 0 2px 10px rgba(15, 48, 82, .05);
  --shadow-hover: 0 4px 10px rgba(15, 48, 82, .08), 0 14px 32px rgba(15, 48, 82, .12);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D141D; --surface: #141E2A; --surface-2: #182434; --surface-3: #1D2B3D;
    --border: #253447; --border-strong: #33465D; --text: #E4EBF3; --muted: #9AABBD; --faint: #6F8296;
    --navy: #C9DCF2; --brand: #6EA6F5; --primary: #3D7FE0; --primary-hover: #4C8DF0; --primary-ink: #FFFFFF; --primary-soft: #1A2E4A;
    --ok: #4CC17C; --ok-soft: #13301F; --warn: #F2B65A; --warn-soft: #33270F; --bad-soft: #3A1820; --demo: #F2A93B; --study: #A48BF0; --study-soft: #241D3D;
    --c1: #5AA2FF; --c2: #FF8A4C; --c3: #51CF66; --c4: #A48BF0;
    --plot-grid: #213044; --plot-grid-minor: #19263A; --plot-frame: #3A4D63; --plot-text: #9AABBD; --plot-noise: #4C5E73; --plot-muted: #6F8296;
    --icon-bg: #111A26; --lcd-bg: #0A1828; --lcd-ink: #E8F1FB; --lcd-dim: #7FA2C8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-hover: 0 8px 26px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D141D; --surface: #141E2A; --surface-2: #182434; --surface-3: #1D2B3D;
  --border: #253447; --border-strong: #33465D; --text: #E4EBF3; --muted: #9AABBD; --faint: #6F8296;
  --navy: #C9DCF2; --brand: #6EA6F5; --primary: #3D7FE0; --primary-hover: #4C8DF0; --primary-ink: #FFFFFF; --primary-soft: #1A2E4A;
  --ok: #4CC17C; --ok-soft: #13301F; --warn: #F2B65A; --warn-soft: #33270F; --bad-soft: #3A1820; --demo: #F2A93B; --study: #A48BF0; --study-soft: #241D3D;
  --c1: #5AA2FF; --c2: #FF8A4C; --c3: #51CF66; --c4: #A48BF0;
  --plot-grid: #213044; --plot-grid-minor: #19263A; --plot-frame: #3A4D63; --plot-text: #9AABBD; --plot-noise: #4C5E73; --plot-muted: #6F8296;
  --icon-bg: #111A26; --lcd-bg: #0A1828; --lcd-ink: #E8F1FB; --lcd-dim: #7FA2C8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-hover: 0 8px 26px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, "Yu Gothic UI", "Meiryo", "Noto Sans JP", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------------- app bar ---------------- */
.appbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; text-decoration: none; }
/* VZSol wordmark: navy version on light, white version on dark */
.brand-logo { display: block; height: 32px; width: auto; flex: none; }
.brand-logo.for-dark { display: none; }
:root[data-theme="dark"] .brand-logo.for-light { display: none; }
:root[data-theme="dark"] .brand-logo.for-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo.for-light { display: none; }
  :root:not([data-theme="light"]) .brand-logo.for-dark { display: block; }
}
.brand-text { display: flex; flex-direction: column; min-width: 0; padding-left: 14px; border-left: 1px solid var(--border); }
.brand-model { font-weight: 700; font-size: 14px; letter-spacing: .02em; color: var(--navy); line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-right { display: flex; align-items: center; gap: 10px; }
/* research-field selector: only that field's tabs are shown */
.field-pick {
  display: flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 430px;
  height: 38px; padding: 0 4px 0 12px; border-radius: 999px; cursor: pointer;
  background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
}
.field-pick:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.field-pick svg { width: 17px; height: 17px; flex: none; fill: none; stroke: var(--primary); stroke-width: 2.4; stroke-linecap: round; }
.fp-lbl { font-size: 12px; font-weight: 700; color: var(--primary); white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; }
.field-pick select {
  flex: 1; min-width: 0; height: 30px; border: 0; outline: 0; border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; padding: 0 10px;
  text-overflow: ellipsis;
}
.field-pick select option { color: var(--text); background: var(--surface); }
/* language switch: a sliding knob behind the active label */
.lang-switch {
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; align-items: center;
  width: 128px; height: 36px; padding: 3px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface-3);
}
.ls-knob {
  position: absolute; top: 3px; left: 3px; width: calc(50% - 3px); height: calc(100% - 6px);
  border-radius: 999px; background: var(--primary); box-shadow: 0 1px 3px rgba(15, 48, 82, .3);
  transition: transform .25s cubic-bezier(.3, .7, .3, 1);
}
.lang-switch.is-ja .ls-knob { transform: translateX(100%); }
.ls-opt { position: relative; z-index: 1; text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); transition: color .25s; white-space: nowrap; }
.lang-switch:not(.is-ja) .ls-en, .lang-switch.is-ja .ls-ja { color: var(--primary-ink); }
.lang-switch:hover .ls-opt { color: var(--text); }
.lang-switch:not(.is-ja):hover .ls-en, .lang-switch.is-ja:hover .ls-ja { color: var(--primary-ink); }
body.ja { line-height: 1.55; }
body.ja .hero h1 { letter-spacing: 0; }

.conn-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--warn-soft); color: var(--demo);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.conn-pill .dot, .sb-demo .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--demo); box-shadow: 0 0 0 3px color-mix(in srgb, var(--demo) 22%, transparent); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linejoin: round; }

/* ---------------- tab bar ---------------- */
.tabbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border);
}
.tabs {
  display: flex; align-items: stretch; gap: 2px;
  padding: 0 12px;
  overflow-x: auto; scrollbar-width: thin;
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 74px; padding: 8px 10px 7px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap;
  border-bottom: 3px solid transparent; border-radius: 0;
  cursor: pointer; flex: none;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--primary-soft); }
.tab-glyph { width: 30px; height: 18px; }
.tab-glyph svg { width: 100%; height: 100%; }
.tab-home-ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tab-sep { width: 1px; margin: 10px 6px; background: var(--border); flex: none; }

/* ---------------- layout ---------------- */
main { flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; padding: 24px 24px 40px; }
.page { animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------------- home ---------------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px;
  padding: 28px 30px 24px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}
.hero h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.2; color: var(--navy); letter-spacing: -.01em; }
.hero p { margin: 0; color: var(--muted); max-width: 760px; }
.search { position: relative; max-width: 880px; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: 14px;
  padding: 6px 6px 6px 14px;
  transition: border-color .15s, box-shadow .15s;
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.search-ico { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--faint); stroke-width: 2.2; stroke-linecap: round; }
.search-box input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 16px; padding: 10px 4px;
}
.search-box input::-webkit-search-cancel-button { cursor: pointer; }
.lang-btn {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
  font-size: 12px; font-weight: 600; border-radius: 8px; padding: 6px 9px; cursor: pointer; white-space: nowrap;
}
.lang-btn:hover { color: var(--text); }
.mic-btn {
  width: 44px; height: 44px; border-radius: 11px; border: 0; cursor: pointer; flex: none;
  background: var(--primary); display: grid; place-items: center;
}
.mic-btn:hover { background: var(--primary-hover); }
.mic-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--primary-ink); stroke-width: 2; stroke-linecap: round; }
.mic-btn.unsupported { background: var(--surface-3); }
.mic-btn.unsupported svg { stroke: var(--faint); }
.mic-btn.listening { background: var(--accent); animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }

.examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.ex-lbl { font-size: 12.5px; color: var(--faint); margin-right: 2px; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 4px 11px; font-size: 12.5px; cursor: pointer;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }

.sres {
  position: absolute; left: 0; right: 0; top: 64px; z-index: 30;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: var(--shadow-hover); padding: 6px; max-height: 70vh; overflow: auto;
}
.sres-item {
  display: grid; grid-template-columns: 92px 1fr 80px auto; align-items: center; gap: 14px;
  padding: 8px 10px; border-radius: 10px; cursor: pointer;
}
.sres-item.active, .sres-item:hover { background: var(--primary-soft); }
.sres-ico { width: 92px; height: 49px; background: var(--icon-bg); border-radius: 8px; overflow: hidden; }
.sres-ico svg { width: 100%; height: 100%; }
.sres-main { display: flex; flex-direction: column; min-width: 0; }
.sres-name { font-weight: 650; font-size: 15px; }
.sres-field { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--warn); background: var(--warn-soft); padding: 1px 7px; border-radius: 999px; vertical-align: 1px; }
.best { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--ok); background: var(--ok-soft); padding: 1px 7px; border-radius: 999px; vertical-align: 1px; }
.sres-why { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.sres-why b { color: var(--text); font-weight: 600; }
.sres-bar { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.sres-bar span { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.sres-go { font-size: 13px; font-weight: 600; color: var(--primary); padding: 0 6px; }
.sres-warn {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 2px 2px 6px; padding: 10px 12px; border-radius: 10px;
  background: var(--warn-soft); color: var(--warn); font-size: 13px;
}
.sres-warn svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; margin-top: 1px; }
.sres-empty { padding: 14px; color: var(--muted); font-size: 13.5px; }
.sres-foot { padding: 6px 10px 2px; font-size: 11.5px; color: var(--faint); border-top: 1px solid var(--border); margin-top: 4px; }

.cat { margin-bottom: 30px; transition: opacity .2s; }
.cat.dim { opacity: .45; }
.cat-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 0 2px 12px; }
.cat-head h2 { margin: 0; font-size: 17px; color: var(--navy); }
.cat-head p { margin: 0; font-size: 13px; color: var(--faint); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 16px; }

.mcard {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s, opacity .2s;
}
.mcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--primary); }
.mcard.dim { opacity: .4; }
.mcard.hit { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent), var(--shadow-hover); }
.mcard-plot { background: var(--icon-bg); border-bottom: 1px solid var(--border); padding: 8px 10px; }
.mcard-plot svg { width: 100%; height: auto; aspect-ratio: 280 / 150; }
.mcard-body { padding: 14px 16px 8px; flex: 1; }
.mcard-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mcard-title h3 { margin: 0; font-size: 16px; line-height: 1.25; }
.abbr {
  font-size: 11.5px; font-weight: 700; letter-spacing: .03em; white-space: nowrap;
  color: var(--primary); background: var(--primary-soft); border-radius: 6px; padding: 2px 7px;
}
.mcard-desc { margin: 6px 0 10px; color: var(--muted); font-size: 13.5px; }
.mcard-out { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.out-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin-right: 4px; }
.out { font-size: 12px; padding: 1px 7px; border-radius: 5px; background: var(--surface-3); color: var(--text); }
.mcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px 14px; }
.hws { display: flex; flex-wrap: wrap; gap: 5px; }
.hw { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.hw.base { background: var(--ok-soft); color: var(--ok); }
.hw.opt { background: var(--warn-soft); color: var(--warn); }
.hw.optional { background: var(--surface-3); color: var(--muted); }
.hw.study { background: var(--study-soft); color: var(--study); }
.go { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.mcard:hover .go svg { transform: translateX(3px); }
.home-note { color: var(--faint); font-size: 12.5px; text-align: center; margin: 10px 0 0; }

/* ---------------- plots ---------------- */
.plot-svg { width: 100%; height: auto; font-family: "Segoe UI", system-ui, sans-serif; }
.plot-svg .grid { stroke: var(--plot-grid); stroke-width: 1; }
.plot-svg .grid-minor { stroke: var(--plot-grid-minor); stroke-width: 1; }
.plot-svg.mini .grid { stroke: var(--plot-grid); }
.plot-svg .frame { fill: none; stroke: var(--plot-frame); stroke-width: 1; }
.plot-svg .tick { fill: var(--plot-text); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.plot-svg .axis-label { fill: var(--text); font-size: 14.5px; font-weight: 600; }
.plot-svg .legend { fill: var(--text); font-size: 14px; }
.plot-svg .zero-line { stroke: var(--plot-frame); stroke-width: 1.2; }
.plot-svg.mini .zero-line { stroke-width: 1.6; }
.plot-svg .ann-line { stroke: var(--accent); stroke-width: 1.3; stroke-dasharray: 5 4; opacity: .8; }
.plot-svg .ann-band { fill: var(--accent); opacity: .1; }
.plot-svg .ann-hband { fill: var(--ok); opacity: .1; }
.plot-svg .ann-text { fill: var(--muted); font-size: 14px; }
.plot-svg .ann-text.strong { fill: var(--text); font-weight: 600; }
.plot-svg .ann-point { fill: var(--surface); stroke: var(--accent); stroke-width: 2.4; }
.plot-svg .ann-arrow { stroke: var(--accent); stroke-width: 1.6; }
.plot-svg .ann-head { fill: var(--accent); }
.plot-svg.mini .ann-line { stroke-width: 2; }
/* LCR readout icon */
.lcd { fill: var(--lcd-bg); }
.lcd-tag { fill: var(--lcd-dim); font: 600 12px "Segoe UI", sans-serif; }
.lcd-k { fill: var(--lcd-dim); font: 700 22px "Segoe UI", sans-serif; }
.lcd-v { fill: var(--lcd-ink); font: 700 34px Consolas, "Cascadia Mono", monospace; }
.lcd-u { fill: var(--lcd-dim); font: 600 18px "Segoe UI", sans-serif; }
.lcd-k2 { fill: var(--lcd-dim); font: 700 17px "Segoe UI", sans-serif; }
.lcd-v2 { fill: var(--lcd-ink); font: 600 22px Consolas, "Cascadia Mono", monospace; }
/* calibration icon */
.cal-box { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.5; }
.cal-sym { fill: none; stroke: var(--c1); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.cal-dot { fill: var(--c1); }
.cal-ok { fill: var(--ok); }
.cal-tick { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cal-label { fill: var(--text); font: 700 12.5px "Segoe UI", sans-serif; letter-spacing: .06em; }

/* ---------------- measurement page ---------------- */
.page-head {
  display: grid; grid-template-columns: 150px 1fr auto; gap: 20px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 18px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.ph-icon { background: var(--icon-bg); border-radius: 10px; padding: 4px 6px; border: 1px solid var(--border); }
.ph-text h1 { margin: 0 0 4px; font-size: 21px; color: var(--navy); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ph-text p { margin: 0 0 8px; color: var(--muted); font-size: 13.5px; max-width: 900px; }
.ph-actions { display: flex; gap: 8px; }
.ph-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.art-link { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--primary); text-decoration: none; padding: 4px 11px 4px 9px;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent); border-radius: 999px; background: var(--primary-soft); }
.art-link:hover { border-color: var(--primary); }
.art-link b { font-weight: 700; }
.art-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; flex: none; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  border-radius: 10px; padding: 9px 16px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); padding: 10px 22px; font-size: 15px; }
.btn.primary svg { fill: currentColor; stroke: none; }
.btn.primary:hover { background: var(--primary-hover); }
.btn:disabled { opacity: .7; cursor: progress; }
.btn.sm { padding: 4px 12px; font-size: 12.5px; border-radius: 8px; }

.page-body { display: grid; grid-template-columns: 300px minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.col-left, .col-right { display: grid; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.card-h h2 { margin: 0; font-size: 14px; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: .05em; }
.tag { font-size: 11px; font-weight: 600; color: var(--faint); background: var(--surface-3); padding: 2px 8px; border-radius: 999px; }
.tag.sim { color: var(--demo); background: var(--warn-soft); }

.ctls { display: grid; gap: 10px; }
.ctl { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 8px; }
.ctl-lbl { font-size: 13px; color: var(--muted); }
.ctl.stack { grid-template-columns: 1fr; gap: 5px; }
.ctl input, .ctl select {
  width: 100%; min-width: 0; padding: 6px 9px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface);
}
.ctl select { padding: 6px 6px; }
.num { display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.num input { border: 0; border-radius: 0; text-align: right; font-variant-numeric: tabular-nums; }
.num input:focus { outline: none; }
.num:focus-within { border-color: var(--primary); }
.unit { padding: 0 9px; color: var(--muted); font-size: 12.5px; background: var(--surface-2); align-self: stretch; display: flex; align-items: center; border-left: 1px solid var(--border); min-width: 40px; justify-content: center; }
.seg { display: flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.seg button { flex: 1 1 auto; border: 0; background: var(--surface); padding: 6px 3px; font-size: 12px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--primary); color: var(--primary-ink); font-weight: 600; }

.panel-svg { width: 100%; height: auto; }
.panel-body { fill: var(--surface-2); stroke: var(--border-strong); }
.panel-model { fill: var(--faint); font: 700 9px "Segoe UI", sans-serif; letter-spacing: .08em; }
.bnc-lbl { font: 700 13px "Segoe UI", sans-serif; fill: var(--muted); }
.bnc-ring { fill: #C9D2DB; stroke: #9AA7B4; stroke-width: 1.5; }
.bnc-in { fill: #E9EEF2; stroke: #A9B5C1; }
.bnc-pin { fill: #C79A3B; }
.bnc.on .bnc-ring { fill: var(--primary); stroke: var(--primary); }
.bnc.on .bnc-lbl { fill: var(--primary); }
.bnc.opt .bnc-ring { fill: var(--surface); stroke: var(--primary); stroke-dasharray: 4 3; stroke-width: 2; }
.bnc.opt .bnc-lbl { fill: var(--primary); }
.bnc.off { opacity: .38; }
.legend-row { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin: 8px 0 6px; }
.lg { width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-left: 8px; }
.lg:first-child { margin-left: 0; }
.lg.on { background: var(--primary); }
.lg.opt { border: 2px dashed var(--primary); }
.lg.off { background: #C9D2DB; opacity: .6; }
.conn-note { margin: 0; font-size: 13px; color: var(--muted); }

.col-main { position: relative; min-height: 300px; }
.plot-area { min-height: 240px; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; overflow: hidden; border-radius: 0 0 var(--radius) var(--radius); }
.progress span { display: block; height: 100%; width: 0; background: var(--primary); }
.progress.on span { animation: prog 1.25s linear forwards; }
@keyframes prog { from { width: 0; } to { width: 100%; } }

.results { display: grid; gap: 2px; }
.res { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--border); }
.res:last-child { border-bottom: 0; }
.res-k { color: var(--muted); font-size: 13px; flex: 0 1 auto; min-width: 4.5em; }
.res-v { font-weight: 650; font-size: 15px; font-variant-numeric: tabular-nums; text-align: right; }
.res-u { color: var(--muted); font-weight: 500; font-size: 12.5px; margin-left: 4px; }
.res.primary .res-v { font-size: 22px; color: var(--navy); }
.res.ok .res-v { color: var(--ok); font-size: 14px; }
.apps { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; display: grid; gap: 4px; }
.stage-note { text-align: center; color: var(--faint); font-size: 12.5px; margin: 18px 0 0; }

/* LCR main view */
.lcr-view { display: grid; gap: 14px; }
.lcd-big { background: var(--lcd-bg); color: var(--lcd-ink); border-radius: 12px; padding: 18px 26px 20px; }
.lcd-cond { color: var(--lcd-dim); font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.lcd-row { display: grid; grid-template-columns: 70px 1fr 60px; align-items: baseline; gap: 10px; }
.lcd-row .k { color: var(--lcd-dim); font-size: 22px; font-weight: 700; }
.lcd-row .v { font-family: Consolas, "Cascadia Mono", monospace; font-size: 34px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.lcd-row .u { color: var(--lcd-dim); font-size: 20px; }
.lcd-row.main .k { font-size: 30px; }
.lcd-row.main .v { font-size: 64px; font-weight: 700; letter-spacing: -.01em; }
.lcd-row.main .u { font-size: 28px; }

/* Calibration main view */
.cal-view { display: grid; gap: 14px; }
.cal-view > svg { max-width: 420px; margin: 0 auto; }
.cal-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cal-steps li { display: grid; grid-template-columns: 34px 1fr auto auto; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.cal-steps .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.cal-steps .t { display: flex; flex-direction: column; }
.cal-steps small { color: var(--muted); }
.cal-steps .st { color: var(--ok); font-weight: 600; font-size: 13px; }

/* ---------------- status bar & toast ---------------- */
.statusbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 7px 20px; font-size: 12px; color: var(--muted);
  background: var(--surface); border-top: 1px solid var(--border);
  position: sticky; bottom: 0; z-index: 15;
}
.sb-demo { display: inline-flex; align-items: center; gap: 8px; color: var(--demo); font-weight: 600; white-space: nowrap; }
.sb-msg { flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-ver { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.sb-logo { width: 16px; height: 16px; flex: none; }
.toast {
  position: fixed; left: 50%; bottom: 52px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--navy); color: var(--surface); padding: 10px 18px; border-radius: 10px; font-size: 13.5px;
  box-shadow: var(--shadow-hover); transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100vw - 32px);
}
:root[data-theme="dark"] .toast { background: #E4EBF3; color: #0D141D; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- responsive ---------------- */
@media (max-width: 1240px) {
  .page-body { grid-template-columns: 290px minmax(0, 1fr); }
  .col-right { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .page-body { grid-template-columns: 1fr; }
  .col-right { grid-template-columns: 1fr; }
  .page-head { grid-template-columns: 1fr; }
  .ph-icon { display: none; }
  .sres-item { grid-template-columns: 70px 1fr auto; }
  .sres-ico { width: 70px; height: 38px; }
  .sres-bar { display: none; }
  .lcd-row.main .v { font-size: 44px; }
}
@media (max-width: 640px) {
  main { padding: 16px 16px 32px; }
  .appbar { padding: 8px 16px; }
  .brand-sub, .conn-text { display: none; }
  .hero { padding: 20px 16px; }
  .hero h1 { font-size: 21px; }
  .grid { grid-template-columns: 1fr; }
  .sb-msg, .sb-ver { display: none; }
  .lang-btn { padding: 6px 6px; }
}
@media (max-width: 1180px) {
  .fp-lbl { display: none; }
}
@media (max-width: 760px) {
  .appbar { flex-wrap: wrap; row-gap: 8px; }
  .field-pick { order: 3; flex: 1 1 100%; }
}
@media (max-width: 480px) {
  .brand-text { display: none; }
  .brand-logo { height: 26px; }
}

/* ---------------- EIS workspace ---------------- */
.eis-wrap { display: grid; gap: 12px; }
.eis-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.eis-step {
  display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer; position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px;
  box-shadow: var(--shadow); color: var(--text); min-width: 0;
}
.eis-step:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface-2); }
.eis-step:disabled { opacity: .55; cursor: not-allowed; }
.eis-step .n {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); color: var(--muted); font-weight: 700;
}
.eis-step .n svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.eis-step.ok .n { background: var(--ok-soft); color: var(--ok); }
.eis-step.bad .n { background: var(--bad-soft); color: var(--accent); }
.eis-step .tx { display: flex; flex-direction: column; min-width: 0; }
.eis-step b { font-size: 14.5px; }
.eis-step small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eis-step.ok small { color: var(--ok); font-weight: 600; }
.eis-step.bad small { color: var(--accent); font-weight: 600; }
.eis-step.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft), var(--shadow); }
.eis-step.on:not(.ok):not(.bad) .n { background: var(--primary); color: var(--primary-ink); }
.eis-flow { margin: -2px 2px 0; font-size: 12.5px; color: var(--faint); }
.eis-body .col-main { min-height: 420px; }
.card-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.card-tools .seg button { padding: 5px 12px; }
.card-h.sub { margin: 14px 0 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.card-h.sub h2 { font-size: 12.5px; }
.eis-empty { display: grid; place-items: center; min-height: 360px; color: var(--muted); text-align: center; padding: 20px; }
.eis-prog { height: 4px; background: var(--surface-3); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.eis-prog span { display: block; height: 100%; background: var(--primary); transition: width .15s linear; }
.eis-p { margin: 0 0 10px; font-size: 13px; color: var(--text); line-height: 1.5; }
.eis-p:last-child { margin-bottom: 0; }
.eis-p.muted { color: var(--muted); }
.eis-p.small { font-size: 12px; }
.eis-p.warn { color: var(--warn); margin-top: 8px; }
.btn.wide { width: 100%; justify-content: center; margin-top: 10px; }
.btn.primary-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.btn.primary-soft:hover { background: var(--primary); color: var(--primary-ink); }
.btn.primary.sm { padding: 5px 18px; font-size: 13px; }
.btn-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.res.small .res-v { font-size: 12.5px; font-weight: 600; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.chk input { width: 16px; height: 16px; accent-color: var(--primary); }
.fq-row { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.ctl input[type="range"] { padding: 0; border: 0; accent-color: var(--primary); }
.range-ends { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--faint); }
.lam-v { color: var(--primary); font-weight: 700; margin-left: 6px; }
.range2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.range2 .unit { min-width: 30px; padding: 0 6px; }
.range2 input::placeholder { color: var(--faint); }
/* verdict */
.verdict { border-width: 2px; }
.verdict.ok { border-color: var(--ok); background: var(--ok-soft); }
.verdict.bad { border-color: var(--accent); background: var(--bad-soft); }
.verdict .v-head { display: flex; align-items: center; gap: 10px; font-size: 17px; margin-bottom: 6px; }
.verdict.ok .v-head { color: var(--ok); }
.verdict.bad .v-head { color: var(--accent); }
.verdict svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.verdict p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text); }
/* circuit */
.circ-in { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13.5px; }
.ctl input.err, .ptable .pv.err { border-color: var(--accent); background: var(--bad-soft); }
.circ-msg { font-size: 12.5px; margin-top: -4px; }
.circ-ok { color: var(--ok); } .circ-err { color: var(--accent); }
.circ-box { display: flex; justify-content: center; padding: 6px 0 14px; margin-bottom: 8px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.circ-svg { max-width: 100%; height: auto; }
.circ-svg path, .circ-svg rect { fill: none; stroke: var(--text); stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.circ-svg rect { fill: var(--surface); }
.circ-svg .ce-lbl { font: 600 11.5px "Segoe UI", sans-serif; fill: var(--primary); text-anchor: middle; }
.circ-svg .ce-in { font: 700 10px "Segoe UI", sans-serif; fill: var(--text); text-anchor: middle; }
.circ-svg .node { fill: var(--text); }
.circ-svg .term { fill: var(--surface); stroke: var(--text); stroke-width: 1.7; }
/* tables */
.ptable { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ptable th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px 4px 6px; border-bottom: 1px solid var(--border-strong); font-size: 11.5px; }
.ptable td { padding: 5px 4px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ptable tr:last-child td { border-bottom: 0; }
.ptable td small { display: block; color: var(--faint); font-size: 10.5px; }
.ptable .pv { width: 100%; min-width: 0; padding: 4px 6px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--text); text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.ptable .pv:focus { outline: none; border-color: var(--primary); }
.ptable.params th:nth-child(2) { width: 46%; }
.ptable.params th:nth-child(3), .ptable.params td:nth-child(3) { text-align: center; width: 34px; }
.ptable.params td:nth-child(3) input { accent-color: var(--primary); }
.ptable td.err { text-align: right; color: var(--muted); white-space: nowrap; }
.ptable td.err.hi { color: var(--warn); font-weight: 600; }
.ptable-card { padding-bottom: 10px; }
.no-up .card-h h2 { text-transform: none; letter-spacing: 0; }
/* save menu */
.ph-actions { position: relative; }
.save-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 300px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-hover); padding: 6px;
}
.save-menu button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; border: 0; background: none; padding: 9px 12px; border-radius: 8px; cursor: pointer; color: var(--text); text-align: left; }
.save-menu button:hover { background: var(--primary-soft); }
.save-menu button b { font-size: 14px; }
.save-menu button small { color: var(--muted); font-size: 12px; }
.save-menu button.star b::after { content: "ZView®"; margin-left: 8px; font-size: 10.5px; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 1px 6px; border-radius: 999px; vertical-align: 1px; }
@media (max-width: 900px) {
  .eis-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------------- FRA workspace (shares the EIS workspace layout) ---------------- */
.eis-steps.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.eis-step.warn .n { background: var(--warn-soft); color: var(--warn); }
.eis-step.warn small { color: var(--warn); font-weight: 600; }
.eis-step.on.warn, .eis-step.on.bad { border-color: var(--primary); }
.verdict.warn { border-color: var(--warn); background: var(--warn-soft); }
.verdict.warn .v-head { color: var(--warn); }
.verdict p:empty { display: none; }
.verdict p:empty, .verdict .v-head:only-child { margin-bottom: 0; }
.eis-p.bad { color: var(--accent); margin-top: 8px; }
.eis-p.top { margin-top: 10px; }
.ctls.top { margin-top: 12px; }
.res-v .res-u { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.res.warn-v .res-v { color: var(--warn); }
.plot-note { margin: 2px 4px 0; font-size: 11.5px; color: var(--faint); text-align: right; }
.cal-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cal-st { font-weight: 700; font-size: 13.5px; padding: 3px 10px; border-radius: 999px; }
.cal-st.ok { color: var(--ok); background: var(--ok-soft); }
.cal-st.warn { color: var(--warn); background: var(--warn-soft); }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.ctl .chk + .num { flex: 1; }
/* rules of thumb */
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.rules li { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.rules svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.rules li.ok svg { color: var(--ok); }
.rules li.bad svg { color: var(--warn); }
.rules li.bad span { color: var(--text); font-weight: 600; }
/* wiring diagram */
.wiring { width: 100%; height: auto; display: block; margin: 2px 0 6px; }
.wiring .w-box { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1.4; }
.wiring .w-res { fill: var(--surface); stroke: var(--text); stroke-width: 1.5; }
.wiring .w-inj { fill: var(--warn-soft); stroke: var(--warn); stroke-width: 1.4; }
.wiring .w-wire { fill: none; stroke: var(--text); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.wiring .w-wire.thin { stroke-width: 1.1; stroke: var(--muted); }
.wiring .w-probe { fill: none; stroke-width: 1.8; stroke-dasharray: 3 2; }
.wiring .w-t { font: 11.5px "Segoe UI", "Yu Gothic UI", sans-serif; fill: var(--text); }
.wiring .w-t.s { font-size: 10.5px; fill: var(--muted); }
.wiring .w-t.b { font-weight: 700; fill: var(--text); }
.wiring .hc { fill: var(--c2); stroke: var(--c2); }
.wiring .hp { fill: var(--c1); stroke: var(--c1); }
.wiring .ch { fill: var(--c4); stroke: var(--c4); }
.wiring .w-t.hc, .wiring .w-t.hp, .wiring .w-t.ch { stroke: none; font-weight: 700; }
.wiring .w-probe.hc, .wiring .w-probe.hp, .wiring .w-probe.ch { fill: none; }
/* compare: trace list */
.tr-list { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 6px; }
.tr-list li { display: flex; align-items: center; gap: 8px; }
.tr-list .tr-name { flex: 1; min-width: 0; padding: 5px 8px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 13px; }
.tr-list input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.tr-list .x { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.tr-list .x:hover { color: var(--accent); background: var(--bad-soft); }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; margin-right: 6px; vertical-align: -1px; }
.ptable.cmp td:nth-child(n+2), .ptable.cmp th:nth-child(n+2) { text-align: right; }
.range2 .num { min-width: 0; }
.range2 .num input { min-width: 0; width: 0; flex: 1 1 auto; }

/* ---------------- Lock-in / PA workspace ---------------- */
.ctl .ro { font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; text-align: right; }
.ctl .ro.b { font-weight: 700; color: var(--primary); }
.ctl.stack .ro { text-align: left; }
.ctl .ro.small { font-size: 12.5px; color: var(--muted); }
.card-tools .speed { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.card-tools .speed .seg button { padding: 4px 9px; }
.ph-off { margin-right: auto; align-self: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.btn.run.stop { background: var(--accent); border-color: var(--accent); }
.rules li.bad.hard svg { color: var(--accent); }
.rules li span { line-height: 1.45; }
.rules li { align-items: flex-start; }
.eis-empty.short { min-height: 160px; }
.plot-note.left { text-align: left; }
.ptable.cal td:nth-child(n+2):not(:last-child), .ptable.cal th:nth-child(n+2) { text-align: right; }
.ptable .x { border: 0; background: none; color: var(--muted); font-size: 17px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.ptable .x:hover { color: var(--accent); background: var(--bad-soft); }
.wiring .w-beam { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-dasharray: 5 3; }

/* ---------------- LCR workspace ---------------- */
.lcd-big.ws { margin: 4px 0 6px; }
.lcd-big.ws .lcd-row.main .v { font-size: 58px; }
.lcd-big.ws .lcd-row { grid-template-columns: 80px minmax(0, 1fr) 64px; }
.lcd-dev { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; margin-top: 8px; color: var(--lcd-dim); font-size: 13px; font-variant-numeric: tabular-nums; }
.lcd-dev b { color: var(--lcd-ink); font-weight: 650; }
.lcd-big.ws.strip { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 18px; padding: 12px 20px; margin-bottom: 10px; }
.lcd-big.ws.strip .k { color: var(--lcd-dim); font-weight: 600; font-size: 14px; }
.lcd-big.ws.strip .v { font: 700 30px Consolas, "Cascadia Mono", monospace; }
.lcd-big.ws.strip .v.okc { color: #7CE0A3; }
.lcd-big.ws.strip .v.ngc { color: #FF9A9A; }
.lcd-big.ws.strip .d { color: var(--lcd-ink); font: 600 15px Consolas, "Cascadia Mono", monospace; }
.ptable.allp td:nth-child(odd) { color: var(--muted); width: 14%; }
.ptable.allp td:nth-child(even) { text-align: right; font-weight: 600; padding-right: 10px; }
.cal-steps.lcr li { grid-template-columns: 30px minmax(0, 1fr) auto; }
.cal-steps.lcr li .btn { grid-column: 2 / 4; justify-self: start; }
.cal-steps.lcr .cal-st { font-size: 12px; padding: 2px 8px; color: var(--muted); background: var(--surface); }
.cal-steps.lcr .cal-st.ok { color: var(--ok); background: var(--ok-soft); }
.cal-steps.lcr .cal-st.warn { color: var(--warn); background: var(--warn-soft); }
.cal-steps.top { margin-top: 12px; }
.bins4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; width: 100%; }
.bins4 .num { min-width: 0; }
.bins4 .num input { min-width: 0; width: 100%; }
.ptable.bins tr.ng td { color: var(--muted); }
.ptable.bins td:nth-child(n+2), .ptable.bins th:nth-child(n+2) { text-align: right; }
.btn.wide.top { margin-top: 10px; }
@media (max-width: 600px) {
  .lcd-big.ws { padding: 14px 14px 16px; }
  .lcd-big.ws .lcd-row { grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 6px; }
  .lcd-big.ws .lcd-row.main .k { font-size: 20px; }
  .lcd-big.ws .lcd-row.main .v { font-size: 36px; }
  .lcd-big.ws .lcd-row.main .u { font-size: 18px; }
  .lcd-big.ws .lcd-row .k { font-size: 16px; }
  .lcd-big.ws .lcd-row .v { font-size: 24px; }
  .lcd-big.ws .lcd-row .u { font-size: 15px; }
}
.eis-wrap .num .unit { white-space: nowrap; }

/* Z-Analyzer */
.ptable td.ng { color: var(--warn); font-weight: 600; }
.eis-body input.circ-in { width: 100%; text-align: left; }
.ptable.cmp tr.on td { font-weight: 700; color: var(--primary); }
.card-h h2 .nc { text-transform: none; }
@media (max-width: 640px) {
  .eis-body .col-main { min-height: 0; }
  .eis-body .plot-area { min-height: 0; }
}
.eis-body .ptable.cmp td:nth-child(n+2) { white-space: nowrap; }

/* Generator workspace */
.gen-pts { width: 100%; min-height: 64px; resize: vertical; font: 12.5px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 6px; padding: 6px 8px; }
.gen-pts:focus { outline: 2px solid var(--c1); outline-offset: 1px; }
.gen-scroll { max-height: 470px; overflow: auto; }
.gen-scroll .ptable tr.on td { background: var(--surface-2); font-weight: 600; }
.btn-row .small { align-self: center; color: var(--muted); }

/* Calibration workspace */
.cal-wide { overflow-x: auto; width: 0; min-width: 100%; }
.cal-tbl td.bar { width: 40%; min-width: 120px; }
.cal-tbl td.nv { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cal-scale { display: flex; justify-content: space-between; font-weight: 500; font-size: 10.5px; }
.cal-bar { position: relative; height: 14px; background: var(--surface-2); border-radius: 3px; }
.cal-bar .lim { position: absolute; top: -3px; bottom: -3px; width: 0; border-left: 1px dashed var(--accent); opacity: .7; }
.cal-bar .zero { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--border-strong); }
.cal-bar .b { position: absolute; top: 3px; height: 8px; background: var(--c1); border-radius: 2px; }
.cal-bar .b.due { background: var(--accent); }
.cal-seq { list-style: none; margin: 0; padding: 0; counter-reset: cs; font-size: 12.5px; }
.cal-seq li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0 5px 24px; border-bottom: 1px solid var(--border); position: relative; color: var(--muted); counter-increment: cs; }
.cal-seq li::before { content: counter(cs); position: absolute; left: 0; top: 5px; width: 17px; height: 17px; border-radius: 50%; background: var(--surface-2); font-size: 10.5px; display: grid; place-items: center; }
.cal-seq li.on { color: var(--text); font-weight: 600; }
.cal-seq li.on::before { background: var(--c1); color: #fff; }
.cal-seq li.done { color: var(--text); }
.cal-seq li.done::before { content: '✓'; background: var(--ok); color: #fff; }
.cal-seq li small { white-space: nowrap; color: var(--muted); }
td.ok, small.ok { color: var(--ok); }
td.warn-v, small.warn-v, p.warn-v { color: var(--warn); }
