/* ============================================================================
 * MEAN WELL Spec Studio — styles
 * Design language applied from the "Taste Skill" anti-slop framework:
 *  · one locked accent (MEAN WELL red) + one neutral scale, tinted shadows
 *  · tabular monospace numerals for all data (datasheet "cockpit" density)
 *  · light + dark themes via tokens (prefers-color-scheme + manual override)
 *  · motivated micro-motion on one easing curve, gated by prefers-reduced-motion
 *  · WCAG AA text contrast, one corner-radius system
 * ==========================================================================*/

/* Locally hosted header lettering; available without a network connection. */
@font-face {
  font-family: "Satoshi";
  src: url("../assets/fonts/Satoshi-Variable.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

/* ---- design tokens : light ---- */
:root {
  --accent: #e2001a;
  --accent-strong: #b3001a;
  --accent-soft: #fdeaec;
  --accent-border: #f4cdd2;
  --accent-2: #2f7dd1;            /* chart secondary */

  --ink: #15181d;                /* off-black, never #000 */
  --ink-soft: #424953;
  --muted: #5b636d;              /* AA on card */
  --faint: #8a929c;              /* decorative only */

  --bg: #f5f7f9;
  --bg-2: #eceff3;
  --card: #ffffff;
  --card-2: #f7f9fb;
  --line: #e6e9ed;
  --line-2: #eef1f4;

  --green: #15803d;
  --amber: #a96400;
  --danger: #be1f2d;

  --chart-grid: #edf0f3;
  --chart-axis: #d2d8de;
  --chart-label: #79818b;
  --chart-faint: #cdd4db;
  --arrowhead: #98a0aa;

  /* shadows tinted to a slate hue, never pure black */
  --shadow: 0 1px 2px rgba(20,28,44,.045), 0 8px 22px rgba(20,28,44,.055);
  --shadow-lift: 0 2px 6px rgba(20,28,44,.07), 0 18px 38px rgba(20,28,44,.12);
  --material: color-mix(in srgb, var(--card) 78%, transparent);
  --material-strong: color-mix(in srgb, var(--card) 90%, transparent);
  --press-scale: .975;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI Variable Text", "Segoe UI", "PingFang TC", "Microsoft JhengHei UI", "Microsoft JhengHei", Arial, sans-serif;
  --mono: "SF Mono", "Cascadia Code", "Cascadia Mono", ui-monospace, Consolas, "Liberation Mono", Menlo, monospace;
  --font-industrial: "Bahnschrift", Arial, "PingFang TC", "Microsoft JhengHei UI", "Microsoft JhengHei", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-press: cubic-bezier(.2, .8, .2, 1);
}

/* ---- design tokens : dark (auto-follow system) ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #ff4255;
    --accent-strong: #ff7682;
    --accent-soft: #2a1418;
    --accent-border: #51242b;
    --accent-2: #5aa2e6;

    --ink: #eef1f5;
    --ink-soft: #c2c9d2;
    --muted: #99a1ab;
    --faint: #6c757f;

    --bg: #0e1116;
    --bg-2: #0a0d11;
    --card: #161a21;
    --card-2: #1c212a;
    --line: #272d37;
    --line-2: #1f242d;

    --green: #45cf7f;
    --amber: #e2a23f;
    --danger: #ff6b75;

    --chart-grid: #232a33;
    --chart-axis: #3a434e;
    --chart-label: #8b939d;
    --chart-faint: #3a434e;
    --arrowhead: #7b838e;

    --shadow: 0 1px 2px rgba(0,0,0,.45), 0 4px 12px rgba(0,0,0,.4);
    --shadow-lift: 0 2px 8px rgba(0,0,0,.5), 0 14px 30px rgba(0,0,0,.5);
    --material: color-mix(in srgb, var(--card) 74%, transparent);
    --material-strong: color-mix(in srgb, var(--card) 88%, transparent);
  }
}
/* ---- explicit overrides (manual toggle wins over system) ---- */
[data-theme="light"] {
  --accent:#e2001a;--accent-strong:#b3001a;--accent-soft:#fdeaec;--accent-border:#f4cdd2;--accent-2:#2f7dd1;
  --ink:#15181d;--ink-soft:#424953;--muted:#5b636d;--faint:#8a929c;
  --bg:#f5f7f9;--bg-2:#eceff3;--card:#ffffff;--card-2:#f7f9fb;--line:#e6e9ed;--line-2:#eef1f4;
  --green:#15803d;--amber:#a96400;--danger:#be1f2d;
  --chart-grid:#edf0f3;--chart-axis:#d2d8de;--chart-label:#79818b;--chart-faint:#cdd4db;--arrowhead:#98a0aa;
  --shadow:0 1px 2px rgba(20,28,44,.05),0 4px 10px rgba(20,28,44,.06);
  --shadow-lift:0 2px 6px rgba(20,28,44,.07),0 12px 26px rgba(20,28,44,.10);
  --material:color-mix(in srgb,var(--card) 78%,transparent);--material-strong:color-mix(in srgb,var(--card) 90%,transparent);
}
[data-theme="dark"] {
  --accent:#ff4255;--accent-strong:#ff7682;--accent-soft:#2a1418;--accent-border:#51242b;--accent-2:#5aa2e6;
  --ink:#eef1f5;--ink-soft:#c2c9d2;--muted:#99a1ab;--faint:#6c757f;
  --bg:#0e1116;--bg-2:#0a0d11;--card:#161a21;--card-2:#1c212a;--line:#272d37;--line-2:#1f242d;
  --green:#45cf7f;--amber:#e2a23f;--danger:#ff6b75;
  --chart-grid:#232a33;--chart-axis:#3a434e;--chart-label:#8b939d;--chart-faint:#3a434e;--arrowhead:#7b838e;
  --shadow:0 1px 2px rgba(0,0,0,.45),0 4px 12px rgba(0,0,0,.4);
  --shadow-lift:0 2px 8px rgba(0,0,0,.5),0 14px 30px rgba(0,0,0,.5);
  --material:color-mix(in srgb,var(--card) 74%,transparent);--material-strong:color-mix(in srgb,var(--card) 88%,transparent);
}

* { box-sizing: border-box; }
html { color-scheme: light dark; scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-size: 17px;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
  letter-spacing: 0;
}
button { font-family: inherit; cursor: pointer; color: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 32%, transparent); outline-offset: 2px; border-radius: var(--radius-xs); }

/* numerals: tabular monospace everywhere data appears */
.num, .sr-value, .ov-item .v, .viz-readout, .dr-value, .fc-val, .pick .model, .pick .sub,
.counter, .score, .axis-label { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* inline svg icons */
.icon { width: 1.05em; height: 1.05em; display: inline-block; vertical-align: -0.16em; stroke: currentColor; fill: none; flex: none; }

/* ===== Top bar ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 12px 24px;
  background: var(--material-strong);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  position: sticky; top: 0; z-index: 30;
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -14px; height: 14px; pointer-events: none;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 48%, transparent), transparent);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-mark { font-weight: 800; letter-spacing: 0; font-size: 19px; color: var(--accent); }
.brand-sub {
  color: var(--ink); font-family: "Satoshi", "Microsoft JhengHei", sans-serif; font-weight: 400; font-size: 20px; letter-spacing: -.025em; line-height: 1.2; white-space: nowrap;
}
.brand-emphasis { font-weight: 700; }
:root[lang="zh-Hant"] .brand-sub { font-family: "Microsoft JhengHei", sans-serif; font-weight: 500; font-size: 16px; letter-spacing: 0; }
.topbar-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.picker { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.picker select, .model-select select {
  font-family: inherit; font-size: 14px; color: var(--ink); font-weight: 600;
  padding: 10px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card-2); transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .12s var(--ease-press);
}
.picker select:hover, .model-select select:hover { border-color: var(--accent-border); box-shadow: var(--shadow); }
.picker select:active, .model-select select:active { transform: scale(var(--press-scale)); }
.language-control { position: relative; color: var(--ink-soft); }
.language-select { width: 144px; min-height: 44px; padding: 10px 28px 10px 36px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-soft); font: inherit; font-size: 14px; font-weight: 500; appearance: none; cursor: pointer; color-scheme: light; }
.language-select:hover { background: var(--bg-2); color: var(--ink); }
.language-select option { background: var(--card); color: var(--ink); }
.language-icon, .language-chevron { position: absolute; top: 50%; transform: translateY(-50%); pointer-events: none; }
.language-icon { width: 16px; height: 16px; left: 12px; }
.language-chevron { width: 14px; height: 14px; right: 10px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .language-select { color-scheme: dark; } }
:root[data-theme="dark"] .language-select { color-scheme: dark; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-soft);
  transition: color .2s var(--ease), background .2s var(--ease);
}
.theme-toggle:hover { color: var(--ink); background: var(--bg-2); }
.theme-toggle .icon { width: 17px; height: 17px; }

/* ===== Tabs ===== */
.tabs {
  display: flex; gap: 4px; padding: 5px 20px;
  background: var(--material);
  backdrop-filter: blur(18px) saturate(165%);
  -webkit-backdrop-filter: blur(18px) saturate(165%);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  position: sticky; top: 58px; z-index: 25; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  border: 0; background: transparent; padding: 11px 16px; font-size: 15px; font-weight: 650;
  color: var(--muted); border-radius: 999px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
  transition: color .2s var(--ease), background .2s var(--ease), transform .12s var(--ease-press);
}
.tabs button:hover { color: var(--ink); }
.tabs button:active { transform: scale(.96); }
.tabs button.active { color: var(--accent); background: var(--card); box-shadow: var(--shadow); }
.tabs .tab-ico { display: inline-flex; }
.tabs .icon { width: 17px; height: 17px; }

/* ===== Layout ===== */
main { max-width: 1280px; margin: 0 auto; padding: 36px 28px 78px; }

.section-head { margin: 2px 0 24px; }
.section-head h2 { margin: 0 0 8px; font-size: 2.25rem; font-weight: 800; letter-spacing: 0; line-height: 1.08; }
.section-head p, .sec-tagline { margin: 0; color: var(--ink-soft); font-size: 16.5px; max-width: 66ch; }
.sec-tagline { margin-bottom: 2px; }

/* ===== Learn: toolbar ===== */
.learn-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.model-select { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
.search-box { flex: 1; min-width: 230px; position: relative; }
.search-box input {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--ink);
  padding: 10px 13px 10px 36px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.search-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box::before {
  content: ""; position: absolute; left: 13px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%);
  background: var(--muted);
  -webkit-mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4-4'/%3E%3C/svg%3E");
  mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4-4'/%3E%3C/svg%3E");
}

/* ===== Learn: overview strip ===== */
.overview {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0;
  background: var(--material-strong); border: 1px solid color-mix(in srgb, var(--line) 82%, transparent); border-radius: var(--radius);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  overflow: hidden; margin-bottom: 26px; box-shadow: var(--shadow);
}
.overview .ov-item { padding: 15px 18px; border-right: 1px solid var(--line-2); }
.overview .ov-item .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.overview .ov-item .v { font-size: 15px; font-weight: 600; margin-top: 4px; letter-spacing: 0; }
.overview .ov-tag {
  grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 13px 18px; border-top: 1px solid var(--line-2); background: var(--card-2);
}
.chip {
  display: inline-block; font-size: 11.5px; font-weight: 600; padding: 4px 11px; letter-spacing: 0;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); border: 1px solid var(--accent-border);
}

/* ===== Learn: groups & rows ===== */
.spec-group { margin-bottom: 14px; border: 1px solid color-mix(in srgb, var(--line) 82%, transparent); border-radius: var(--radius); overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 17px; background: var(--card-2); cursor: pointer; user-select: none;
  transition: background .15s var(--ease);
}
.group-head:hover { background: color-mix(in srgb, var(--accent-soft) 50%, var(--card-2)); }
.group-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; letter-spacing: 0; display: flex; align-items: center; gap: 10px; }
.group-head h3 .icon { width: 17px; height: 17px; color: var(--accent); }
.group-head .count { font-size: 12px; color: var(--faint); font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.group-head .caret { transition: transform .2s var(--ease); color: var(--faint); display: inline-block; }
.spec-group.collapsed .caret { transform: rotate(-90deg); }
.spec-group.collapsed .group-body { display: none; }

.spec-row {
  display: flex; align-items: center; gap: 14px; justify-content: space-between;
  padding: 13px 17px; border-top: 1px solid var(--line-2); cursor: pointer;
  transition: background .14s var(--ease), transform .12s var(--ease-press);
}
.spec-row:hover { background: var(--accent-soft); }
.spec-row:active { transform: scale(.993); }
.spec-row .sr-main { min-width: 0; }
.spec-row .sr-label { font-weight: 600; font-size: 14px; letter-spacing: 0; }
.spec-row .sr-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.spec-row .sr-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.spec-row .sr-value { font-family: var(--font-industrial); font-size: 13.5px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--accent-strong); white-space: nowrap; letter-spacing: 0; }
.spec-row .sr-go { color: var(--faint); font-size: 15px; transition: transform .2s var(--ease), color .2s var(--ease); }
.spec-row:hover .sr-go { transform: translateX(2px); color: var(--accent); }
.spec-row.has-visual .sr-label::after {
  content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 7px; vertical-align: -1px; opacity: .75; background: var(--accent);
  -webkit-mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4v16h16'/%3E%3Cpath d='M7 14l3-3 3 2 4-6'/%3E%3C/svg%3E");
  mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4v16h16'/%3E%3Cpath d='M7 14l3-3 3 2 4-6'/%3E%3C/svg%3E");
}

/* ===== Detail drawer ===== */
.drawer-overlay { position: fixed; inset: 0; background: rgba(12,16,24,.38); z-index: 40; backdrop-filter: blur(5px) saturate(120%); -webkit-backdrop-filter: blur(5px) saturate(120%); }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(470px, 92vw);
  background: var(--material-strong); z-index: 50; box-shadow: -10px 0 40px rgba(12,16,24,.22);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  padding: 24px 26px; overflow-y: auto; border-left: 1px solid var(--line);
}
@media (prefers-reduced-motion: no-preference) { .drawer { animation: slideIn .3s var(--ease); transform-origin: right center; } }
@keyframes slideIn { from { transform: translateX(28px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer .dr-close { position: absolute; top: 16px; right: 18px; border: 0; background: transparent; font-size: 24px; color: var(--faint); line-height: 1; transition: color .2s var(--ease), transform .12s var(--ease-press); }
.drawer .dr-close:hover { color: var(--accent); }
.drawer .dr-close:active { transform: scale(.9); }
.drawer .dr-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700; }
.drawer h3 { margin: 7px 0 6px; font-size: 21px; font-weight: 800; letter-spacing: 0; padding-right: 30px; }
.drawer .dr-value {
  display: inline-block; margin: 8px 0 22px; font-size: 15px; font-weight: 600; letter-spacing: 0;
  background: var(--accent-soft); color: var(--accent-strong); padding: 7px 13px; border-radius: var(--radius-sm); border: 1px solid var(--accent-border);
}
.dr-block { margin-bottom: 18px; }
.dr-block .dr-h { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; letter-spacing: 0; }
.dr-block.what .dr-h { color: var(--ink); }
.dr-block.why .dr-h { color: var(--accent-strong); }
.dr-block.how .dr-h { color: var(--amber); }
.dr-block .dr-h .ic { display: inline-flex; }
.dr-block .dr-h .ic .icon { width: 15px; height: 15px; }
.dr-block p { margin: 0; font-size: 14px; color: var(--ink-soft); line-height: 1.62; max-width: 60ch; }
.dr-visual-link {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 4px;
  font-size: 13px; font-weight: 600; padding: 9px 15px; border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--accent-strong);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.dr-visual-link:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.dr-visual-link:active { transform: scale(.98); }
.dr-visual-link .icon { width: 15px; height: 15px; }

/* ===== Recommend ===== */
.rec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 760px) { .rec-grid { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid color-mix(in srgb, var(--line) 82%, transparent); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.field { margin-bottom: 17px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.field input, .field select {
  width: 100%; font-family: inherit; font-size: 14px; padding: 10px 12px; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card-2);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 7px; }
.seg button { border: 1px solid var(--line); background: var(--card-2); border-radius: 999px; padding: 8px 15px; font-size: 13px; font-weight: 600; color: var(--ink-soft); transition: color .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease-press), box-shadow .18s var(--ease); }
.seg button:hover { border-color: var(--accent-border); }
.seg button:active { transform: scale(.96); }
.seg button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary {
  width: 100%; border: 0; background: var(--accent); color: #fff; font-weight: 700; font-size: 15px;
  padding: 13px; border-radius: var(--radius-sm); margin-top: 4px; letter-spacing: 0;
  transition: background .2s var(--ease), transform .15s var(--ease), box-shadow .2s var(--ease);
}
.btn-primary:hover { background: var(--accent-strong); transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn-primary:active { transform: scale(.985); }
.rec-result .pick { display: flex; align-items: baseline; gap: 11px; margin-bottom: 4px; flex-wrap: wrap; }
.rec-result .pick .model { font-size: 26px; font-weight: 800; color: var(--accent); letter-spacing: 0; }
.rec-result .pick .sub { color: var(--ink-soft); font-size: 13.5px; }
.rec-result .dr-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700; margin-bottom: 12px; }
.rec-note { display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; padding: 12px 14px; border-radius: var(--radius-sm); margin-top: 10px; border: 1px solid var(--line); }
.rec-note .ic { flex-shrink: 0; display: inline-flex; margin-top: 1px; }
.rec-note .ic .icon { width: 16px; height: 16px; }
.rec-note.ok { background: color-mix(in srgb, var(--green) 9%, var(--card)); border-color: color-mix(in srgb, var(--green) 30%, var(--line)); }
.rec-note.ok .ic { color: var(--green); }
.rec-note.warn { background: color-mix(in srgb, var(--amber) 11%, var(--card)); border-color: color-mix(in srgb, var(--amber) 32%, var(--line)); }
.rec-note.warn .ic { color: var(--amber); }
.rec-note.bad { background: var(--accent-soft); border-color: var(--accent-border); }
.rec-note.bad .ic { color: var(--danger); }
.rec-note.info { background: var(--card-2); }
.rec-note.info .ic { color: var(--accent-2); }
.rec-sub { color: var(--muted); font-weight: 400; font-size: .9em; }
.rec-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 34px 12px; }

/* ===== Visualize ===== */
.viz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .viz-grid { grid-template-columns: 1fr; } }
.viz-card { background: var(--card); border: 1px solid color-mix(in srgb, var(--line) 82%, transparent); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.viz-card h3 { margin: 0 0 5px; font-size: 16px; font-weight: 700; letter-spacing: 0; }
.viz-card p.desc { margin: 0 0 14px; font-size: 13px; color: var(--ink-soft); line-height: 1.55; }
.viz-card svg { width: 100%; height: auto; display: block; }
.viz-card.flash-hi { animation: flashHi 1.4s var(--ease); }
@keyframes flashHi { 0%,100% { box-shadow: var(--shadow); } 30% { box-shadow: 0 0 0 2px var(--accent), var(--shadow-lift); } }
.viz-controls { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.viz-controls label { font-size: 12px; color: var(--muted); font-weight: 600; }
.viz-controls input[type=range] { flex: 1; min-width: 120px; accent-color: var(--accent); }
.viz-readout { font-size: 13px; font-weight: 600; color: var(--accent-strong); margin-top: 10px; min-height: 18px; letter-spacing: 0; }
.viz-legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink-soft); margin-top: 8px; flex-wrap: wrap; }
.viz-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.viz-legend .sw { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.viz-legend .sw-red { background: var(--accent); }
.viz-legend .sw-blue { background: var(--accent-2); }

/* svg chart helpers (themeable) */
.axis { stroke: var(--chart-axis); stroke-width: 1; }
.grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.axis-label { fill: var(--chart-label); font-size: 10px; font-family: var(--mono); }
.curve { fill: none; stroke-width: 2.5; }
.curve.red { stroke: var(--accent); }
.curve.blue { stroke: var(--accent-2); }
.dot { fill: var(--accent); }
.guide { stroke: var(--accent); }
.ripple-mid { stroke: var(--chart-faint); }
.bd-arrowhead { fill: var(--arrowhead); }

/* block diagram */
.bd-stage rect { fill: var(--card-2); stroke: var(--line); stroke-width: 1.5; cursor: pointer; transition: fill .15s var(--ease), stroke .15s var(--ease); }
.bd-stage:hover rect, .bd-stage.active rect { fill: var(--accent-soft); stroke: var(--accent); }
.bd-stage text { font-size: 10.5px; fill: var(--ink); font-family: var(--font); pointer-events: none; }
.bd-arrow { stroke: var(--arrowhead); stroke-width: 1.6; marker-end: url(#arrow); fill: none; }
.bd-explain {
  margin-top: 13px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; background: var(--card-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; min-height: 40px;
}
.bd-explain b { color: var(--ink); }

/* ===== Quiz ===== */
.quiz-modes { display: inline-flex; gap: 7px; margin-bottom: 20px; }
.quiz-modes button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 9px 19px; font-weight: 600; font-size: 14px; color: var(--ink-soft); transition: color .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease-press), box-shadow .18s var(--ease); }
.quiz-modes button:hover { border-color: var(--accent-border); }
.quiz-modes button:active { transform: scale(.96); }
.quiz-modes button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.flashcard { perspective: 1300px; max-width: 580px; margin: 0 auto; }
.fc-inner { position: relative; width: 100%; min-height: 250px; transition: transform .55s var(--ease); transform-style: preserve-3d; cursor: pointer; }
.flashcard.flipped .fc-inner { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); padding: 28px; display: flex; flex-direction: column; justify-content: center; }
.fc-front { align-items: center; text-align: center; }
.fc-front .fc-group { font-size: 11px; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.fc-front .fc-term { font-size: 25px; font-weight: 800; margin: 12px 0; letter-spacing: 0; }
.fc-front .fc-val { font-size: 15px; color: var(--accent-strong); font-weight: 600; background: var(--accent-soft); padding: 6px 13px; border-radius: var(--radius-sm); border: 1px solid var(--accent-border); }
.fc-front .fc-hint { margin-top: 18px; font-size: 11.5px; color: var(--muted); }
.fc-back { transform: rotateY(180deg); }
.fc-back .fc-b-h { font-size: 12.5px; font-weight: 700; color: var(--ink); margin-bottom: 4px; display: flex; align-items: center; gap: 7px; }
.fc-back .fc-b-h.why { color: var(--accent-strong); margin-top: 14px; }
.fc-back .fc-b-h .icon { width: 15px; height: 15px; }
.fc-back p { margin: 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; }
.quiz-bar { display: flex; align-items: center; justify-content: space-between; max-width: 580px; margin: 18px auto 0; gap: 10px; }
.quiz-bar .counter { font-size: 12.5px; color: var(--muted); }
.icon-btn { border: 1px solid var(--line); background: var(--card); border-radius: var(--radius-sm); padding: 9px 15px; font-weight: 600; font-size: 13px; color: var(--ink-soft); transition: color .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease-press), box-shadow .18s var(--ease); }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.icon-btn:active { transform: scale(.97); }

.mcq { max-width: 620px; margin: 0 auto; }
.mcq .q-clue { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 19px; font-size: 15px; line-height: 1.5; margin-bottom: 16px; box-shadow: var(--shadow); }
.mcq .q-clue .q-label { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 7px; letter-spacing: .01em; }
.mcq .opt { display: block; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius-sm); padding: 13px 16px; margin-bottom: 9px; font-size: 14px; font-weight: 600; color: var(--ink); transition: border-color .15s var(--ease), transform .12s var(--ease); }
.mcq .opt:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.mcq .opt.correct { background: color-mix(in srgb, var(--green) 12%, var(--card)); border-color: var(--green); color: var(--green); }
.mcq .opt.wrong { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.mcq .opt:disabled { cursor: default; }
.mcq .feedback { margin-top: 13px; font-size: 14px; font-weight: 600; min-height: 22px; display: flex; align-items: center; gap: 7px; }
.mcq .feedback .icon { width: 17px; height: 17px; }
.mcq .feedback.right { color: var(--green); }
.mcq .feedback.wrong { color: var(--accent-strong); }
.quiz-foot { display: flex; align-items: center; justify-content: space-between; max-width: 620px; margin: 16px auto 0; }
.quiz-foot .score { font-weight: 700; }

/* ===== Footer ===== */
.footer { max-width: 1080px; margin: 0 auto; padding: 22px 24px 34px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }

/* ===== Bilingual (EN + 中文) ===== */
.bi { display: block; }
.bi-en, .bi-zh { display: block; line-height: inherit; }
.bi-zh { color: var(--ink-soft); margin-top: 4px; }
.bi-inline { display: inline; }
.bi-inline .bi-en, .bi-inline .bi-zh { display: inline; margin: 0; }
.bi-inline .bi-zh { color: inherit; opacity: .72; font-weight: 400; }
.bi-inline .bi-zh::before { content: "·"; margin: 0 .35em; opacity: .55; }
h2 .bi-zh, h3 .bi-zh, .sr-label .bi-zh, .fc-term .bi-zh, .dr-value .bi-zh,
.sr-value .bi-zh, .pick .bi-zh, .sec-tagline .bi-zh, .group-head .bi-zh {
  color: var(--muted); font-weight: 400; font-size: .8em;
}
.tabs button .bi, .picker .bi, .model-select .bi { display: inline; }

/* Long-form reading (spec drawer + flashcard back): tag each language with a
   small EN / 中 chip plus a gap, so English and 中文 read as two clearly
   separated blocks instead of one undifferentiated wall of text. */
.dr-block p .bi-en, .dr-block p .bi-zh,
.fc-back p .bi-en, .fc-back p .bi-zh { position: relative; padding-left: 38px; }
.dr-block p .bi-en::before, .dr-block p .bi-zh::before,
.fc-back p .bi-en::before, .fc-back p .bi-zh::before {
  position: absolute; left: 0; top: .12em; box-sizing: border-box;
  min-width: 27px; text-align: center; font-size: 9px; font-weight: 700;
  letter-spacing: .04em; line-height: 1.5; padding: 1px 5px; border-radius: 5px;
}
.dr-block p .bi-en::before, .fc-back p .bi-en::before {
  content: "EN"; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line);
}
.dr-block p .bi-zh::before, .fc-back p .bi-zh::before {
  content: "中"; color: var(--accent-strong); background: var(--accent-soft); border: 1px solid var(--accent-border);
}
.dr-block p .bi-zh, .fc-back p .bi-zh { margin-top: 14px; }

@media (max-width: 560px) {
  .spec-row { flex-wrap: wrap; gap: 8px; }
  .spec-row .sr-main { width: 100%; }
  .spec-row .sr-right { width: 100%; min-width: 0; justify-content: flex-end; }
  .spec-row .sr-value { min-width: 0; white-space: normal; overflow-wrap: anywhere; text-align: right; }
  .spec-row .sr-go { flex-shrink: 0; }
  .topbar { padding: 10px 15px; }
  main { padding: 22px 15px 56px; }
  .brand-sub { display: none; }
  .tabs { top: 53px; }
  .section-head h2 { font-size: 21px; }
}

/* ===== Impeccable pass: a11y utility, onboarding, richer empty states ===== */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.intro-hint {
  width: min(1080px, calc(100% - 44px)); margin: 16px auto -4px; padding: 11px 15px;
  display: flex; align-items: center; gap: 12px;
  background: color-mix(in srgb, var(--accent-soft) 74%, var(--card)); border: 1px solid var(--accent-border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 13.5px; color: var(--ink);
}
.intro-hint .intro-ic { color: var(--accent); display: inline-flex; flex: none; }
.intro-hint .intro-ic .icon { width: 18px; height: 18px; }
.intro-hint .intro-text { flex: 1; line-height: 1.45; }
.intro-hint .intro-text .bi-zh { color: var(--ink-soft); }
.intro-hint .intro-x {
  flex: none; border: 1px solid var(--accent-border); background: var(--card); color: var(--accent-strong);
  border-radius: 999px; padding: 6px 14px; font-size: 12.5px; font-weight: 700;
  transition: color .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease-press);
}
.intro-hint .intro-x:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.intro-hint .intro-x:active { transform: scale(.96); }

.rec-empty { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 30px 16px; }
.rec-empty .rec-empty-ic { color: var(--faint); display: inline-flex; margin-bottom: 4px; }
.rec-empty .rec-empty-ic .icon { width: 26px; height: 26px; }
.rec-empty .rec-empty-t { margin: 0; font-weight: 600; color: var(--ink-soft); font-size: 14px; }
.rec-empty .rec-empty-b { margin: 0; font-size: 13px; color: var(--muted); max-width: 36ch; }

.field .field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.mcq .q-clue.q-clue-done { border-color: var(--green); }

/* ===== Industrial portfolio finder ===== */
.find-mode {
  display: inline-grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px;
  min-width: 420px; margin: 0 0 26px; padding: 4px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 38%, transparent);
}
.find-mode button {
  min-height: 44px; padding: 10px 20px; border: 0; border-radius: 6px;
  background: transparent; color: var(--muted); font-size: 15px; font-weight: 700;
  transition: color .18s var(--ease), background .18s var(--ease), transform .12s var(--ease-press), box-shadow .18s var(--ease);
}
.find-mode button:hover { color: var(--ink); }
.find-mode button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.led-field-help, .led-model-help { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 9px 0 0; }
.led-description { color: var(--ink-soft); line-height: 1.6; margin: 14px 0; }
.led-restriction { color: var(--ink-soft); background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font-size: 14px; line-height: 1.55; margin: 16px 0; }
.led-model-preview { color: var(--ink-soft); font-family: var(--font-tech, inherit); font-size: 15px; overflow-wrap: anywhere; margin: 18px 0 10px; }
.led-model-menu > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; cursor: pointer; color: var(--ink); font-size: 14px; list-style: none; }
.led-model-menu > summary::-webkit-details-marker { display: none; }
.led-model-menu > summary .icon { width: 15px; height: 15px; flex: none; transition: transform .18s var(--ease); }
.led-model-menu[open] > summary .icon { transform: rotate(180deg); }
.led-model-menu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.led-model-list { list-style: none; padding: 0; margin: 14px 0 0; }
.led-model { padding: 15px 0; border-top: 1px solid var(--line); }
.led-model-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; font-size: 15px; overflow-wrap: anywhere; }
.led-model-head > span { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.led-model-facts { color: var(--ink-soft); font-size: 14px; line-height: 1.6; margin-top: 8px; }
.led-model-output { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 7px 0; overflow-wrap: anywhere; }
.led-model-page { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; font-size: 14px; color: var(--accent-strong); text-underline-offset: 3px; }
.led-model-page .icon { width: 13px; height: 13px; }
.led-shell .portfolio-update-source { margin-bottom: 20px; }
.product-context[hidden] { display: none; }
.ranked-order { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 18px 0 22px; max-width: 72ch; }
.ranked-feature-help { color: var(--muted); font-size: 14px; line-height: 1.5; padding: 0 14px 12px; margin: 0; }
.ranked-search-field { margin-top: 22px; }
.ranked-entry { border-bottom: 1px solid var(--line); padding: 20px 0 0; }
.ranked-entry:last-child { border-bottom: 0; }
.ranked-reasons { display: flex; align-items: flex-start; gap: 12px 20px; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.ranked-reasons > strong { flex: none; color: var(--ink); padding-block: 4px; }
.ranked-reasons > div { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.ranked-missing { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 12px 0 0; }
.ranked-shell .portfolio-result { padding-top: 20px; }
#rankedMore { margin: 22px 0; }
#rankedMore[hidden] { display: none; }
#rankedClear { width: 100%; justify-content: center; margin-top: 10px; }
@media (max-width: 560px) { .find-mode button { padding-inline: 8px; } }
.find-mode button:active { transform: scale(.97); }
.find-mode button.active { background: var(--card); color: var(--accent); box-shadow: var(--shadow); }

.portfolio-shell {
  display: grid; grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.portfolio-filters { padding: 26px 30px 30px 0; border-right: 1px solid var(--line); }
.portfolio-output { min-width: 0; padding-left: 34px; }
.portfolio-field { margin-bottom: 20px; }
.portfolio-field label, .feature-menu > summary {
  display: block; margin-bottom: 8px; color: var(--ink-soft); font-size: 14px; font-weight: 700;
}
.portfolio-field input, .portfolio-field select {
  width: 100%; min-height: 48px; padding: 12px 14px; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 15px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .12s var(--ease-press), background .18s var(--ease);
}
.portfolio-field input:focus, .portfolio-field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.power-input { position: relative; }
.power-input input { padding-right: 40px; }
.power-input span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; font-weight: 700; pointer-events: none; }

.feature-menu { margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); transition: border-color .18s var(--ease), box-shadow .18s var(--ease); }
.feature-menu:hover, .feature-menu[open] { border-color: var(--accent-border); box-shadow: var(--shadow); }
.feature-menu > summary {
  min-height: 48px; margin: 0; padding: 12px 14px; display: flex; align-items: center; gap: 8px;
  list-style: none; cursor: pointer; color: var(--ink);
}
.feature-menu > summary::-webkit-details-marker, .product-menu > summary::-webkit-details-marker { display: none; }
.feature-chevron { display: inline-flex; margin-left: auto; color: var(--muted); transition: transform .18s var(--ease); }
.feature-chevron .icon { width: 15px; height: 15px; }
.feature-menu[open] .feature-chevron { transform: rotate(180deg); }
.filter-count {
  min-width: 20px; min-height: 20px; display: inline-grid; place-items: center;
  border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); font-size: 11px;
}
.filter-count:empty { display: none; }
.feature-options { max-height: 320px; overflow: auto; padding: 6px 12px 12px; border-top: 1px solid var(--line-2); }
.feature-option { display: flex !important; align-items: flex-start; gap: 10px; margin: 0 !important; padding: 9px 1px; font-size: 14px !important; font-weight: 500 !important; cursor: pointer; }
.feature-option input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }

.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.active-filter {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; max-width: 100%;
  padding: 7px 10px 7px 12px; border: 1px solid var(--accent-border); border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong); font-size: 13px; font-weight: 650;
}
.active-filter > .bi { overflow: hidden; text-overflow: ellipsis; }
.active-filter > span:last-child { display: inline-flex; flex: none; }
.active-filter .icon { width: 13px; height: 13px; }

.portfolio-result-bar {
  min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 15px;
}
.btn-quiet {
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 8px 11px;
  border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 14px; font-weight: 650;
  transition: color .18s var(--ease), background .18s var(--ease), transform .12s var(--ease-press);
}
.btn-quiet:hover:not(:disabled) { color: var(--accent); background: var(--accent-soft); }
.btn-quiet:active:not(:disabled) { transform: scale(.96); }
.btn-quiet:disabled { opacity: .38; cursor: default; }
.btn-quiet .icon { width: 15px; height: 15px; }

.portfolio-result { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--line-2); transition: background .18s var(--ease), box-shadow .18s var(--ease); }
.portfolio-result:hover { background: color-mix(in srgb, var(--card-2) 58%, transparent); box-shadow: 0 0 0 12px color-mix(in srgb, var(--card-2) 58%, transparent); }
.portfolio-result:last-child { border-bottom: 0; }
.portfolio-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.portfolio-title-row h3 { margin: 0; font-size: 24px; line-height: 1.18; letter-spacing: 0; }
.positioning { display: flex; flex-wrap: wrap; gap: 5px; }
.position-badge { padding: 4px 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; font-weight: 750; }
.position-badge.premium { color: var(--accent-strong); background: var(--accent-soft); border-color: var(--accent-border); }
.position-badge.value { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 9%, var(--card)); border-color: color-mix(in srgb, var(--accent-2) 28%, var(--line)); }
.series-meta { display: flex; flex-wrap: wrap; gap: 7px 18px; margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.series-meta > span { position: relative; }
.series-meta > span + span::before { content: ""; position: absolute; left: -8px; top: .45em; width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.series-tags, .application-tags, .match-reasons { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.series-tag, .application-tag, .match-chip { display: inline-flex; padding: 6px 9px; border-radius: 6px; font-size: 12.5px; line-height: 1.3; }
.series-tag { background: var(--card-2); border: 1px solid var(--line); color: var(--ink-soft); }
.application-tag { color: var(--accent-2); border: 1px solid color-mix(in srgb, var(--accent-2) 22%, var(--line)); }
.match-chip { color: var(--green); background: color-mix(in srgb, var(--green) 8%, var(--card)); border: 1px solid color-mix(in srgb, var(--green) 24%, var(--line)); }

.portfolio-actions { width: 210px; display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.btn-secondary, .product-menu > summary, .btn-study {
  box-sizing: border-box; width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 700; text-align: center;
  transition: color .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease-press), box-shadow .18s var(--ease);
}
.btn-secondary { color: var(--ink-soft); background: var(--card); border: 1px solid var(--line); }
.btn-secondary:hover { color: var(--accent); border-color: var(--accent-border); text-decoration: none; box-shadow: var(--shadow); }
.btn-secondary:active, .product-menu > summary:active, .btn-study:active { transform: scale(.97); }
.btn-secondary .icon, .product-menu .icon, .btn-study .icon { width: 16px; height: 16px; flex: none; }
.btn-study { border: 1px solid var(--accent); }
.product-menu { position: relative; }
.product-menu > summary { border: 1px solid var(--line); color: var(--ink-soft); background: var(--card); list-style: none; cursor: pointer; }
.product-menu > summary .icon:last-child { margin-left: auto; }
.product-menu[open] > summary { color: var(--accent); border-color: var(--accent-border); box-shadow: var(--shadow); }
.product-menu-list {
  position: absolute; z-index: 12; top: calc(100% + 5px); right: 0; width: 100%; min-width: 210px;
  padding: 5px; background: var(--material-strong); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow-lift);
  backdrop-filter: blur(18px) saturate(165%);
  -webkit-backdrop-filter: blur(18px) saturate(165%);
}
.product-menu-list a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; border-radius: 6px; color: var(--ink-soft); font-size: 14px; font-weight: 650; transition: color .15s var(--ease), background .15s var(--ease), transform .12s var(--ease-press); }
.product-menu-list a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.product-menu-list a:active { transform: scale(.98); }

.portfolio-warning { grid-column: 1 / -1; display: flex; align-items: flex-start; gap: 10px; padding: 18px 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.portfolio-warning > .icon { width: 18px; height: 18px; flex: none; color: var(--accent-2); margin-top: 1px; }
.portfolio-empty { padding: 62px 18px; text-align: center; color: var(--muted); font-size: 16px; }
.portfolio-empty p { margin: 4px auto; max-width: 42ch; }
.portfolio-empty-title { color: var(--ink-soft); font-weight: 700; }

@media (max-width: 760px) {
  .find-mode { width: 100%; min-width: 0; }
  .portfolio-shell { grid-template-columns: 1fr; }
  .portfolio-filters { padding: 18px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .portfolio-output { padding-left: 0; }
  .portfolio-result { grid-template-columns: 1fr; }
  .portfolio-actions { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-menu-list { left: 0; right: auto; }
}

@media (max-width: 520px) {
  .portfolio-actions { grid-template-columns: 1fr; }
  .series-meta > span + span::before { display: none; }
  .series-meta { gap: 5px 10px; }
}

/* ===== Reduced motion (skill: mandatory) ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar, .tabs, .drawer, .overview, .product-menu-list {
    background: var(--card) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .drawer-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: color-mix(in srgb, var(--ink) 34%, var(--bg));
    --line-2: color-mix(in srgb, var(--ink) 24%, var(--bg));
  }
  .topbar, .tabs, .card, .viz-card, .overview, .spec-group, .portfolio-field input,
  .portfolio-field select, .feature-menu, .btn-secondary, .product-menu > summary,
  .product-menu-list, .mcq .q-clue, .fc-face {
    border-color: var(--line) !important;
  }
}

/* ===== Learning workspace: shared composition ===== */
:root { --workspace: 1120px; --header-height: 68px; --chrome-height: 122px; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--chrome-height) + 24px); scrollbar-color: var(--line) var(--bg); }
::selection { color: var(--ink); background: var(--accent-soft); }
input, textarea { caret-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.axis-label { fill: var(--muted); }
body { font-size: 16px; }
.topbar { display: block; padding: 0 24px; background: var(--bg); border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.topbar::after { display: none; }
.topbar-inner { max-width: var(--workspace); min-height: 68px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.brand { flex-shrink: 0; }
.brand-sub { display: block; font-size: 20px; }
.brand-sub .bi-zh { display: none; }
.topbar-controls { gap: 4px; flex-wrap: nowrap; }
.theme-toggle { box-shadow: none; }
.tabs { top: var(--header-height); padding: 0 max(24px, calc((100% - var(--workspace)) / 2)); gap: 28px; overflow: visible; }
.tabs button { min-height: 54px; padding: 10px 0; border-radius: 0; font-size: 14px; border-bottom: 2px solid transparent; }
.tabs button.active { background: transparent; box-shadow: none; border-bottom-color: var(--accent); }
.tabs .bi-en, .tabs .bi-zh { display: block; }
.tabs .bi-zh { font-size: 11px; margin-top: 2px; }
.tabs .bi-zh::before { content: none; }
.tabs button:active { transform: none; }
.product-context { max-width: calc(var(--workspace) + 48px); margin: auto; padding: 24px 24px 0; }
.product-context .picker { justify-content: flex-start; }
.product-context select { min-height: 40px; }
main { max-width: calc(var(--workspace) + 48px); padding: 20px 24px 64px; }
.section-head { margin: 0 0 28px; }
.section-head h2 { font-size: 30px; line-height: 1.15; letter-spacing: -.02em; font-weight: 650; }
.section-head p, .sec-tagline { font-size: 15px; line-height: 1.55; max-width: 68ch; }
h2 .bi-zh { font-size: 16px; margin-top: 6px; letter-spacing: 0; }
.product-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.product-heading .section-head { margin-bottom: 20px; }
.product-heading .model-select { padding-top: 4px; flex-shrink: 0; }
.product-type { color: var(--muted) !important; font-size: 13px !important; margin-top: 6px !important; }
.overview { background: transparent; box-shadow: none; border: 0; border-radius: 0; backdrop-filter: none; -webkit-backdrop-filter: none; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; overflow: visible; }
.overview .ov-item { padding: 12px 20px 12px 0; border: 0; }
.overview .ov-item .k { font-size: 11px; color: var(--muted); }
.overview .ov-item .v { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.overview .ov-tag { padding: 8px 0 20px; gap: 8px 20px; background: transparent; border: 0; }
.chip { background: transparent; border: 0; color: var(--muted); padding: 0; border-radius: 0; font-size: 12px; font-weight: 400; }
.product-summary { border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.num, .sr-value, .ov-item .v, .viz-readout, .dr-value, .fc-val, .pick .model, .counter, .score, .axis-label { font-family: var(--font-industrial); font-variant-numeric: tabular-nums; }
.pick .sub { font-family: var(--font); }
.learn-workspace { display: grid; grid-template-columns: 184px minmax(0, 800px); gap: 40px; }
.category-sidebar { align-self: start; position: sticky; top: calc(var(--chrome-height) + 24px); }
.category-buttons { display: grid; gap: 4px; }
.category-buttons button { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); text-align: left; font-size: 13px; font-weight: 500; }
.category-buttons button:hover { background: var(--bg-2); color: var(--ink); }
.category-buttons button[aria-pressed="true"] { background: var(--bg-2); color: var(--ink); font-weight: 650; }
.category-buttons button[aria-pressed="true"] > .icon { color: var(--accent); }
.category-buttons .bi-zh { font-size: 11px; margin-top: 2px; color: var(--muted); font-weight: 400; }
.category-count { color: var(--muted); font-size: 11px; font-weight: 400; }
.category-mobile { display: none; }
.learn-reading { min-width: 0; }
.learn-toolbar { gap: 10px; margin-bottom: 12px; flex-wrap: nowrap; }
.search-box { min-width: 0; }
.search-box input { min-height: 44px; background: var(--card); }
#clearSpecSearch { flex-shrink: 0; font-size: 12px; }
.intro-hint { width: auto; margin: 0 0 18px; padding: 0; gap: 10px; align-items: center; background: transparent; border: 0; box-shadow: none; color: var(--muted); font-size: 12px; line-height: 1.5; }
.intro-ic { color: var(--muted); }
.intro-text { flex: 1; }
.intro-text .bi-zh { color: var(--muted); font-size: 11px; }
.intro-x { border: 0; background: transparent; color: var(--muted); padding: 8px; min-height: 40px; font-size: 12px; }
.search-status { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.search-status:empty { display: none; }
.spec-group { box-shadow: none; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 20px; }
.group-head, .group-head:hover { background: transparent; padding: 20px; cursor: default; }
.group-head h3 { font-size: 18px; font-weight: 650; }
.group-head .count { color: var(--muted); font-family: var(--font-industrial); }
.spec-row { display: grid; grid-template-columns: minmax(0, 34%) minmax(0, 1fr); align-items: start; gap: 24px; padding: 15px 20px; min-height: 54px; }
.spec-row:hover { background: var(--card-2); }
.spec-row:active { transform: none; }
.spec-row .sr-label { font-size: 14px; font-weight: 500; }
.spec-row .sr-main { width: auto; }
.spec-row .sr-right { display: grid; grid-template-columns: minmax(0, 1fr) 12px; align-items: start; gap: 14px; min-width: 0; width: auto; }
.spec-row .sr-value { color: var(--ink); font-size: 15px; font-weight: 500; white-space: normal; overflow-wrap: anywhere; text-align: left; line-height: 1.5; }
.sr-label .bi-zh, .sr-value .bi-zh { color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 4px; }
.spec-row.has-visual .sr-label::after { background: var(--muted); opacity: .75; }
.drawer { background: var(--card); width: min(520px, 100%); padding: 32px; backdrop-filter: none; -webkit-backdrop-filter: none; }
.drawer-overlay { backdrop-filter: none; -webkit-backdrop-filter: none; }
.drawer h3 { margin: 8px 0 16px; font-size: 25px; font-weight: 650; }
.drawer .dr-close { width: 44px; height: 44px; top: 16px; right: 16px; }
.drawer .dr-value { display: block; padding: 0 0 24px; margin: 0 0 24px; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 18px; overflow-wrap: anywhere; }
.dr-block { margin-bottom: 28px; }
.dr-block .dr-h, .dr-block.why .dr-h, .dr-block.how .dr-h { color: var(--ink); font-size: 14px; }
.dr-block p { font-size: 15px; line-height: 1.65; }
.dr-block p .bi-zh::before, .fc-back p .bi-zh::before { display: none; }
.card, .viz-card, .mcq .q-clue { box-shadow: none; border-radius: 12px; }
.portfolio-shell { gap: 0; }
.portfolio-filters { padding-right: 24px; }
.portfolio-output { min-width: 0; padding-left: 28px; }
.portfolio-new-filter { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); font-size: 14px; cursor: pointer; }
.portfolio-new-filter input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.portfolio-update-source { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 0 0 18px; }
.portfolio-update-source p { margin: 0 0 4px; }
.portfolio-update-source a { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; color: var(--accent-strong); }
.portfolio-update-source .icon { width: 14px; height: 14px; }
.portfolio-new-badge { color: var(--ink-soft); background: color-mix(in srgb, var(--accent-2) 8%, var(--card)); border-radius: var(--radius-xs); padding: 5px 8px; font-size: 13px; line-height: 1.5; }
.portfolio-update-notices { margin-top: 14px; }
.portfolio-update-notice + .portfolio-update-notice { margin-top: 16px; }
.portfolio-update-model { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 6px; font-family: var(--font-industrial); font-size: 15px; }
.portfolio-update-model span { color: var(--muted); }
.portfolio-update-description { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.lifecycle-results { margin-bottom: 24px; }
.lifecycle-results:empty { display: none; }
.lifecycle-heading, .lifecycle-status-row, .lifecycle-source, .lifecycle-source-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.lifecycle-heading { justify-content: space-between; margin-bottom: 8px; }
.lifecycle-heading h3 { margin: 0; font-size: 18px; font-weight: 650; }
.lifecycle-heading > span, .lifecycle-detail { color: var(--ink-soft); font-size: 13px; }
.lifecycle-notice { padding: 18px 0; border-bottom: 1px solid var(--line); }
.lifecycle-badge { display: inline-block; padding: 5px 8px; border-radius: var(--radius-xs); font-size: 13px; font-weight: 650; line-height: 1.5; }
.lifecycle-badge.is-eol { color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--card)); }
.lifecycle-badge.is-phaseout { color: var(--amber); background: color-mix(in srgb, var(--amber) 8%, var(--card)); }
.lifecycle-models { margin: 12px 0; font-family: var(--font-industrial); font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.lifecycle-replacement { margin: 12px 0; }
.lifecycle-replacement dt { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.lifecycle-replacement dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin: 0; font-size: 14px; }
.lifecycle-replacement a { font-family: var(--font-industrial); }
.lifecycle-replacement a, .lifecycle-source a, .lifecycle-source-links a { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; color: var(--accent-strong); text-underline-offset: 3px; overflow-wrap: anywhere; }
.lifecycle-replacement a .icon, .lifecycle-source a .icon, .lifecycle-source-links a .icon { width: 14px; height: 14px; flex: none; }
.lifecycle-help { margin: 8px 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.lifecycle-source { margin-top: 10px; color: var(--muted); font-size: 12px; }
.lifecycle-provenance { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.6; }
.lifecycle-provenance p { margin: 0 0 4px; }
.family-lifecycle { margin-top: 18px; border-top: 1px solid var(--line); }
.family-lifecycle .lifecycle-notice:last-child { border-bottom: 0; padding-bottom: 0; }
.portfolio-result { gap: 20px; padding: 24px 0; }
.portfolio-result:hover { background: transparent; box-shadow: none; }
.portfolio-title-row h3 { font-size: 22px; font-weight: 650; }
.portfolio-actions { width: 156px; }
.position-badge, .position-badge.premium, .position-badge.value, .application-tag { color: var(--muted); background: transparent; border-color: var(--line); font-weight: 500; }
.series-tag { background: transparent; }
.series-tag, .application-tag, .match-chip { font-size: 12px; padding: 4px 7px; }
.series-meta { font-size: 13px; }
.btn-study { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent-border); }
.product-menu-list { background: var(--card); backdrop-filter: none; -webkit-backdrop-filter: none; }
.find-mode, .quiz-modes, .topic-control { border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); box-shadow: none; padding: 4px; gap: 4px; }
.find-mode button, .quiz-modes button, .topic-control button { border: 0; border-radius: 7px; padding: 10px 16px; min-height: 44px; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 500; }
.find-mode button.active, .quiz-modes button.active, .topic-control button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(20,28,44,.08); }
.filter-toggle { display: none; }
#content[data-view="visualize"] { max-width: calc(var(--workspace) + 48px); }
.visual-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.visual-heading .section-head { margin: 0; }
.visual-toolbar { flex-shrink: 0; }
.topic-control { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 24px; }
.topic-control .bi-zh { font-size: 11px; }
.viz-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.viz-card { padding: 28px; border: 0; border-radius: 16px; min-width: 0; display: flex; flex-direction: column; scroll-margin-top: calc(var(--chrome-height) + 24px); }
#viz-ripple, #viz-block { grid-column: span 7; }
#viz-derating, #viz-efficiency { grid-column: span 5; }
#viz-ripple { background: color-mix(in srgb, var(--accent-2) 7%, var(--card)); }
#viz-block { background: color-mix(in srgb, var(--accent-2) 5%, var(--card)); }
.viz-card h3 { font-size: 22px; font-weight: 650; }
.viz-card p.desc { font-size: 15px; max-width: 65ch; }
.viz-chart-note { margin: 0 0 12px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.viz-graphic { display: flex; align-items: center; flex: 1; min-width: 0; min-height: 200px; }
.viz-graphic svg { max-height: 220px; }
#blockHolder svg { max-height: 280px; }
#blockHolder svg.is-vertical { max-height: none; }
.viz-controls { padding-top: 16px; margin-top: 20px; border-top: 1px solid var(--line); }
.viz-controls label { font-size: 14px; font-weight: 500; }
.viz-controls input[type="range"] { min-height: 44px; }
.viz-readout { font-size: 15px; color: var(--ink); line-height: 1.6; }
#viz-efficiency .viz-readout { padding-top: 16px; border-top: 1px solid var(--line); }
#viz-block .bd-stage text { font-size: 12px; }
#viz-block .bd-explain { background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 16px 0 0; margin-top: 20px; color: var(--ink-soft); font-size: 15px; }
@media (max-width: 900px) {
  .viz-grid { grid-template-columns: minmax(0, 1fr); }
  #viz-ripple, #viz-block, #viz-derating, #viz-efficiency { grid-column: auto; }
}
#content[data-view="quiz"] { max-width: 728px; }
.quiz-modes { display: flex; width: fit-content; margin: 0 0 24px; }
.flashcard, .quiz-bar, .mcq, .quiz-foot { max-width: 680px; }
.fc-inner { display: grid; min-height: 300px; transform: none !important; transition: none; }
.fc-face { position: static; grid-area: 1 / 1; min-width: 0; box-shadow: none; transform: none; padding: 32px; }
.fc-back { display: none; }
.flashcard.flipped .fc-front { display: none; }
.flashcard.flipped .fc-back { display: flex; }
.fc-front .fc-term { font-size: 28px; font-weight: 650; }
.fc-front .fc-val { color: var(--ink); background: var(--card-2); border-color: var(--line); overflow-wrap: anywhere; }
.fc-front .fc-group { color: var(--muted); text-transform: none; font-size: 13px; }
.fc-back p { font-size: 15px; line-height: 1.65; }
.fc-back .fc-b-h.why { color: var(--ink); }
.quiz-bar, .quiz-foot { flex-wrap: wrap; }
.footer { max-width: var(--workspace); padding: 24px 0 32px; font-size: 12px; }
.btn-primary, .btn-secondary, .btn-study, .icon-btn, .dr-visual-link, .picker select, .model-select select, .field input, .field select { min-height: 44px; }
button:active, .icon-btn:hover, .mcq .opt:hover:not(:disabled), .dr-visual-link:hover { transform: none; }

@media (max-width: 900px) {
  .learn-workspace { gap: 24px; }
  .portfolio-result { grid-template-columns: 1fr; }
  .portfolio-actions { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .portfolio-actions > * { width: auto; flex: 1; min-width: 120px; }
  .footer { margin: 0 24px; }
}
@media (max-width: 759px) {
  .topbar { padding: 0 16px; }
  .topbar-inner { min-height: 64px; flex-wrap: wrap; gap: 12px; }
  .brand-sub { font-size: 16px; }
  :root[lang="zh-Hant"] .brand-sub { font-size: 14px; }
  .topbar-controls { gap: 4px; }
  .language-select { width: 132px; }
  .tabs { padding: 0 16px; gap: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tabs button { justify-content: center; text-align: center; font-size: 12px; white-space: normal; padding: 10px 4px; }
  .tabs .tab-ico { display: none; }
  .tabs .bi-zh { font-size: 10px; }
  .product-context { padding: 20px 16px 0; }
  main { padding: 20px 16px 48px; }
  .product-heading { flex-direction: column; gap: 0; }
  .product-heading .section-head { margin-bottom: 12px; }
  .product-heading .model-select { margin-bottom: 16px; }
  .section-head h2 { font-size: 28px; }
  .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview .ov-item { padding: 10px 12px 10px 0; }
  .learn-workspace { display: block; }
  .category-sidebar { position: static; margin-bottom: 16px; }
  .category-buttons { display: none; }
  .category-mobile { display: grid; gap: 8px; color: var(--muted); font-size: 13px; }
  .category-mobile select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--card); color: var(--ink); font: inherit; }
  .portfolio-shell { display: block; }
  .filter-toggle { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 48px; margin-bottom: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); text-align: left; }
  #activeFilterCount { margin-left: auto; font-size: 12px; color: var(--muted); }
  .portfolio-shell[data-filters-open="false"] .portfolio-filters { display: none; }
  .portfolio-filters { padding: 0 0 20px; border: 0; }
  .portfolio-output { padding: 0; }
  .portfolio-actions { display: flex; }
  .topic-control button { padding: 8px 4px; font-size: 13px; }
  .visual-heading { display: block; }
  .visual-toolbar { margin-top: 20px; }
  .viz-card { padding: 20px; }
  .viz-card h3 { font-size: 20px; }
  .viz-controls { flex-wrap: wrap; }
  .viz-controls input { min-width: 0; }
  .footer { margin: 0 16px; }
}
@media (max-width: 560px) {
  .spec-row { grid-template-columns: 1fr; gap: 6px; padding: 16px; }
  .spec-row .sr-right { width: 100%; }
  .spec-row .sr-label { color: var(--muted); }
  .spec-row .sr-value { font-size: 16px; }
  .group-head { padding: 16px; }
  .drawer { padding: 24px; }
  .fc-face { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .tabs { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* Detail refinements from the desktop/mobile review. */
.product-facts > summary { display: none; }
.product-facts .product-type { margin: 0 0 12px !important; }
.intro-hint .intro-ic { color: var(--muted); }
.intro-hint .intro-x { color: var(--muted); border: 0; background: transparent; font-weight: 500; padding: 8px; }
.spec-row.has-visual .sr-label::after { display: none; }
.portfolio-actions .bi-inline, .find-mode .bi-inline, .quiz-modes .bi-inline { display: block; }
.portfolio-actions .bi-en, .portfolio-actions .bi-zh, .find-mode .bi-en, .find-mode .bi-zh, .quiz-modes .bi-en, .quiz-modes .bi-zh { display: block; }
.portfolio-actions .bi-zh::before, .find-mode .bi-zh::before, .quiz-modes .bi-zh::before { content: none; }
.portfolio-actions .bi-zh, .find-mode .bi-zh, .quiz-modes .bi-zh { margin-top: 3px; font-size: 12px; }
.portfolio-actions .btn-secondary, .portfolio-actions .product-menu > summary { font-weight: 500; }
@media (max-width: 759px) {
  .product-facts > summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 0 16px; cursor: pointer; color: var(--ink-soft); font-size: 13px; }
  .product-facts > summary::after { content: '+'; font-size: 18px; }
  .product-facts[open] > summary::after { content: '−'; }
  .product-facts > summary > span:last-child { font-family: var(--font-industrial); font-size: 13px; color: var(--muted); margin-left: auto; }
  .product-summary { margin-bottom: 20px; }
  .quiz-bar { display: grid; grid-template-columns: 1fr 1fr; }
  .quiz-bar .counter { grid-column: 1 / -1; grid-row: 1; text-align: center; margin-bottom: 4px; }
  #fcPrev { grid-column: 1; grid-row: 2; }
  #fcNext { grid-column: 2; grid-row: 2; }
}
@media (max-width: 560px) {
  #blockHolder .bd-stage text { font-size: 14px; }
}
