/*
  PC Store Together DB — "the shop after closing"
  Materials lifted from the game: white pegboard wall, charcoal walls,
  the orange striped showcase case, plywood benches, the yellow-edged
  anti-static mat, and blue-strip shelf price tags.
  One loud element: every interactive tool sits on the workbench mat.
*/

:root {
  /* Materials */
  --pegboard: #ECEDEF;
  --pegboard-hole: #CDD0D6;
  --paper: #FFFFFF;
  --wall: #2B2D31;
  --wall-raised: #36383D;
  --case-orange: #F28A1A;
  --case-orange-deep: #B8620A;
  --mat: #24262A;
  --mat-cell: #2F3237;
  --mat-line: #44474E;
  --mat-yellow: #F2C230;
  --ply: #C8955A;
  --ply-light: #ECD9B8;
  --ply-edge: #A87638;
  --tag-blue: #2F64C8;
  --tag-blue-deep: #1F4A9C;

  /* Ink on light surfaces (pages reference these inline) */
  --ink-primary: #1F2125;
  --ink-secondary: #3E4249;
  --ink-muted: #5E636B;
  --border-pcb: #D5D8DD;
  --border-rule: #D5D8DD;
  --border-bright: #B9BDC4;
  --bg-subtle: #F4F5F6;

  /* Status lights, light context */
  --led-ok: #1F7A45;
  --led-ok-bg: #E2F3E8;
  --led-warn: #8A5A00;
  --led-warn-bg: #FBEFCB;
  --led-fault: #B42323;
  --led-fault-bg: #FBE3E3;

  --font-display: 'Rubik', 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius: 3px;
}

/* Dark workbench context: re-point ink and status variables so inline styles keep working */
.bench-console,
.schematic-box,
.readout-cell,
.site-header,
.site-footer {
  --ink-primary: #F4F5F6;
  --ink-secondary: #D3D6DB;
  --ink-muted: #A3A8B0;
  --border-pcb: var(--mat-line);
  --border-rule: var(--mat-line);
  --border-bright: #585C64;
  --bg-subtle: var(--mat-cell);
  --led-ok: #5FD38D;
  --led-ok-bg: rgba(95, 211, 141, 0.14);
  --led-warn: #F2C230;
  --led-warn-bg: rgba(242, 194, 48, 0.14);
  --led-fault: #FF7A6E;
  --led-fault-bg: rgba(255, 122, 110, 0.15);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  margin: 0;
  background-color: var(--pegboard);
  /* Pegboard: sparse round holes on a 28px pitch, each with a faint lower lip */
  background-image:
    radial-gradient(circle at 14px 14px, var(--pegboard-hole) 2.6px, transparent 3.2px),
    radial-gradient(circle at 14px 15.5px, rgba(255, 255, 255, 0.9) 2.6px, transparent 3.2px);
  background-size: 28px 28px;
  color: var(--ink-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

/* Type scale: major third (1.25) from 16px */
h1, h2 {
  font-family: var(--font-display);
  font-style: italic;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
  margin: 0 0 0.75rem;
}

h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.05rem);
  font-weight: 800;
  line-height: 1.04;
  max-width: 22ch;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.4rem, 2.3vw, 1.56rem);
  font-weight: 700;
  line-height: 1.15;
}

h3, h4 {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.6rem;
  color: var(--ink-primary);
}

p {
  margin: 0 0 1rem;
  max-width: 68ch;
}

a {
  color: var(--tag-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--tag-blue-deep);
  text-decoration-thickness: 2px;
}

.bench-console a,
.site-footer a {
  color: #8DB4FF;
}

:focus-visible {
  outline: 3px solid var(--wall);
  outline-offset: 2px;
}

.bench-console :focus-visible,
.site-header :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--mat-yellow);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--case-orange);
  color: var(--wall);
  font-weight: 700;
  padding: 0.75rem 1rem;
  z-index: 100;
  text-decoration: none;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ---------- Header: the charcoal shop wall ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--wall);
  color: var(--ink-primary);
  border-bottom: 4px solid var(--case-orange);
}

.site-header .container {
  max-width: 1440px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 1rem;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: #FFFFFF;
  text-decoration: none;
}

.brand-mark {
  display: block;
}

/* Small lit shop sign */
.shop-sign {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--led-ok);
  border: 1px solid rgba(95, 211, 141, 0.45);
}

.shop-sign .led-dot {
  box-shadow: 0 0 6px currentColor;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.nav-link {
  position: relative;
  padding: 0.5rem 0.6rem;
  text-decoration: none;
  color: var(--ink-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

.nav-link:hover {
  color: #FFFFFF;
  text-decoration: none;
}

.nav-link.is-active {
  color: #FFFFFF;
  font-weight: 700;
}

/* Active page: an orange price strip sitting on the header's orange rule */
.nav-link.is-active::after {
  content: '';
  position: absolute;
  left: 0.6rem;
  right: 0.6rem;
  bottom: -16px;
  height: 8px;
  background: var(--case-orange);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}

.lang-link {
  padding: 0.3rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink-secondary);
}

.lang-link + .lang-link {
  border-left: 1px solid var(--border-bright);
}

.lang-link:hover {
  color: #FFFFFF;
  background: var(--wall-raised);
}

.lang-link.is-active {
  background: var(--case-orange);
  color: var(--wall);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 0.42rem 0.8rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: #FFFFFF;
  cursor: pointer;
}

/* ---------- Page frame ---------- */
.main-content {
  padding-block: 1.75rem 4rem;
}

.breadcrumbs {
  margin-bottom: 1.1rem;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumbs li + li::before {
  content: '/';
  margin-right: 0.4rem;
  color: var(--border-bright);
}

.page-header {
  margin-bottom: 2rem;
}

.page-lead {
  color: var(--ink-secondary);
  font-size: 1.125rem;
  line-height: 1.55;
  max-width: 62ch;
  margin-bottom: 1rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  background: var(--paper);
  border: 1px solid var(--border-bright);
  border-radius: 999px;
  font-size: 0.84rem;
  color: var(--ink-secondary);
}

/* ---------- Home hero ---------- */
.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 2.25rem;
  align-items: start;
  margin-bottom: 3rem;
}

.hero-copy {
  padding-top: 0.75rem;
}

.hero-copy h1 {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  line-height: 1;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ---------- Buttons: chunky like the orange case ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.68rem 1.2rem 0.6rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  border-bottom-width: 4px;
  cursor: pointer;
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
  margin-bottom: 2px;
}

.btn-primary {
  background: var(--case-orange);
  color: var(--wall);
  border-color: var(--case-orange-deep);
}

.btn-primary:hover {
  background: #FF9A2E;
  color: var(--wall);
}

.btn-secondary {
  background: var(--paper);
  color: var(--ink-primary);
  border-color: var(--wall);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  color: var(--ink-primary);
}

.btn-bench {
  background: var(--mat-cell);
  color: var(--ink-primary);
  border-color: var(--mat-line);
}

.btn-bench:hover {
  background: #3A3D43;
  border-color: var(--mat-yellow);
}

/* ---------- Workbench: plywood lip + anti-static mat with yellow edge ---------- */
.bench-console {
  position: relative;
  background: var(--mat);
  color: var(--ink-primary);
  border-top: 10px solid var(--ply);
  border-radius: 2px;
  padding: 1.5rem;
  box-shadow: 0 1px 0 var(--ply-edge) inset, 0 14px 0 -10px rgba(43, 45, 49, 0.18);
}

/* The mat's yellow outline, inset like the in-game bench */
.bench-console::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 2px solid var(--mat-yellow);
  border-radius: 2px;
  pointer-events: none;
  opacity: 0.9;
}

.bench-console > * {
  position: relative;
}

.bench-console-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 1rem;
  margin-bottom: 1.15rem;
  border-bottom: 1px dashed var(--mat-line);
}

.bench-console h2,
.bench-console h3 {
  color: #FFFFFF;
}

.bench-subtext {
  color: var(--ink-muted);
  font-size: 0.9rem;
  margin: 0.15rem 0 0;
}

/* ---------- Showcase rig + shelf price tag ---------- */
.showroom-stage {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 1.1rem;
  align-items: center;
  margin-bottom: 1.15rem;
}

.rig-svg {
  width: 112px;
  height: 112px;
  display: block;
}

.rig-svg .rig-fan-ring {
  transition: stroke 160ms ease;
}

.rig-svg.rig-ok .rig-fan-ring {
  stroke: var(--led-ok);
}

.rig-svg.rig-warn .rig-fan-ring {
  stroke: var(--led-warn);
}

.rig-svg.rig-fault .rig-fan-ring {
  stroke: var(--led-fault);
}

/* White card with the blue strip, as on the game's shelf tags */
.placard-card {
  background: #FFFFFF;
  color: var(--wall);
  border-left: 8px solid var(--tag-blue);
  border-radius: 2px;
  padding: 0.7rem 1rem 0.8rem;
  transform: rotate(-1.2deg);
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.6);
}

.placard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #5E636B;
  margin-bottom: 0.15rem;
}

.placard-price {
  font-family: var(--font-display);
  font-style: italic;
  font-variant-numeric: tabular-nums;
  font-size: 2rem;
  font-weight: 800;
  color: var(--wall);
  line-height: 1.05;
}

.placard-meta {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: #3E4249;
}

/* ---------- Bench inputs & readouts ---------- */
.bench-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.bench-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.bench-field label {
  font-size: 0.875rem;
  color: var(--ink-secondary);
  font-weight: 500;
}

.bench-input,
.bench-select {
  width: 100%;
  background: var(--paper);
  color: var(--ink-primary);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.bench-console .bench-input,
.bench-console .bench-select {
  background: var(--mat-cell);
  color: #FFFFFF;
  border-color: var(--mat-line);
}

.bench-input:focus-visible,
.bench-select:focus-visible {
  outline: 2px solid var(--mat-yellow);
  outline-offset: 1px;
  border-color: var(--mat-yellow);
}

.readout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-top: 1.15rem;
}

.readout-cell {
  background: var(--mat-cell);
  border-radius: 2px;
  padding: 0.8rem 0.9rem;
}

.readout-label {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 0.2rem;
}

.readout-value {
  display: block;
  font-variant-numeric: tabular-nums;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
  color: #FFFFFF;
}

.readout-value.is-ok {
  color: var(--led-ok);
}

.readout-value.is-warn {
  color: var(--led-warn);
}

.readout-value.is-fault {
  color: var(--led-fault);
}

/* ---------- Status lights ---------- */
.led-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-secondary);
  white-space: nowrap;
}

.led-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.led-ok {
  color: var(--led-ok);
  background: var(--led-ok-bg);
}

.led-warn {
  color: var(--led-warn);
  background: var(--led-warn-bg);
}

.led-fault {
  color: var(--led-fault);
  background: var(--led-fault-bg);
}

/* ---------- Build checker schematic ---------- */
.checker-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(240px, 0.7fr);
  gap: 1.25rem;
  align-items: start;
}

.schematic-box {
  background: var(--mat);
  border-radius: 2px;
  padding: 1rem;
}

.schematic-title {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-secondary);
}

.schematic-svg {
  width: 100%;
  height: auto;
  display: block;
}

.schematic-svg text {
  font-family: var(--font-body);
}

/* Each zone is a <g>; JS swaps zone-ok / zone-warn / zone-fault and the colour flows down */
.schematic-zone {
  --zone: var(--led-ok);
}

.schematic-zone.zone-warn {
  --zone: var(--led-warn);
}

.schematic-zone.zone-fault {
  --zone: var(--led-fault);
}

.schematic-zone .zone-outline {
  stroke: var(--zone);
  fill: color-mix(in srgb, var(--zone) 9%, transparent);
  transition: stroke 160ms ease, fill 160ms ease;
}

.schematic-zone .zone-led {
  fill: var(--zone);
  filter: drop-shadow(0 0 3px var(--zone));
  transition: fill 160ms ease;
}

.schematic-zone .zone-part {
  fill: var(--zone);
  opacity: 0.75;
  transition: fill 160ms ease;
}

.schematic-zone .zone-label {
  fill: #F4F5F6;
  font-size: 11px;
  font-weight: 700;
}

.schematic-zone .zone-label.is-muted {
  fill: var(--ink-muted);
  font-weight: 600;
}

.schematic-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.schematic-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.is-ok { background: var(--led-ok); }
.legend-dot.is-warn { background: var(--led-warn); }
.legend-dot.is-fault { background: var(--led-fault); }

/* ---------- Sections & quiet paper panels ---------- */
.section {
  margin-top: 3rem;
}

.section-heading {
  margin-bottom: 1.1rem;
}

.asymmetric-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 0.92fr);
  gap: 1.5rem;
  align-items: start;
}

.surface-panel {
  background: var(--paper);
  border: 1px solid var(--border-pcb);
  border-radius: var(--radius);
  padding: 1.35rem;
}

.surface-panel > h2:first-child,
.surface-panel > h3:first-child {
  margin-top: 0;
}

/* ---------- Home task directory: a shelf of labelled bins ---------- */
.directory-ledger {
  background: var(--paper);
  border: 1px solid var(--border-pcb);
  border-bottom: 6px solid var(--ply);
  border-radius: var(--radius);
  overflow: hidden;
}

.ledger-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem 1.25rem;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-pcb);
  text-decoration: none;
  color: inherit;
}

.ledger-row:last-child {
  border-bottom: none;
}

.ledger-row:hover {
  background: #FFF6EA;
  text-decoration: none;
}

.ledger-row:hover .ledger-title {
  color: var(--case-orange-deep);
}

.ledger-title {
  font-weight: 700;
  font-size: 1.06rem;
  color: var(--ink-primary);
  display: block;
  margin-bottom: 0.15rem;
}

.ledger-desc {
  color: var(--ink-muted);
  font-size: 0.92rem;
  margin: 0;
}

.ledger-tag {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
  background: var(--ply-light);
  color: #5A3E17;
  white-space: nowrap;
}

/* ---------- Spec lists & tables ---------- */
.spec-list {
  margin: 0;
}

.spec-row {
  display: grid;
  grid-template-columns: minmax(7.5rem, 0.42fr) minmax(0, 1fr);
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-pcb);
  font-size: 0.94rem;
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-row dt {
  color: var(--ink-muted);
  font-weight: 500;
}

.spec-row dd {
  margin: 0;
  font-weight: 600;
  color: var(--ink-primary);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--paper);
  border: 1px solid var(--border-pcb);
  border-radius: var(--radius);
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  text-align: left;
}

/* Header row reads as a plywood shelf edge */
.spec-table th {
  background: var(--ply-light);
  color: #4A3313;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.7rem 0.95rem;
  border-bottom: 2px solid var(--ply);
  white-space: nowrap;
}

.spec-table td {
  padding: 0.75rem 0.95rem;
  border-bottom: 1px solid var(--border-pcb);
  vertical-align: top;
}

.spec-table tbody tr:hover td {
  background: #FAFAFB;
}

.spec-table tbody tr:last-child td {
  border-bottom: none;
}

.surface-panel .spec-table {
  border: 1px solid var(--border-pcb);
}

/* ---------- Fictional brand chips ---------- */
.brand-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 2px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  border-left: 4px solid currentColor;
  background: var(--bg-subtle);
}

.brand-intrex { color: #1F5FBF; }
.brand-halven { color: #A3337A; }
.brand-sans { color: #12796E; }
.brand-vline { color: #9A5B00; }
.brand-tools { color: #3D6B1F; }
.brand-platform { color: #4A4F57; }

/* ---------- Filters ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill-btn {
  background: var(--paper);
  color: var(--ink-secondary);
  border: 1px solid var(--border-bright);
  border-radius: 999px;
  padding: 0.38rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.pill-btn:hover {
  border-color: var(--wall);
  color: var(--ink-primary);
}

.pill-btn.is-active {
  background: var(--wall);
  color: #FFFFFF;
  border-color: var(--wall);
}

.bench-console .pill-btn {
  background: var(--mat-cell);
  color: var(--ink-secondary);
  border-color: var(--mat-line);
}

.bench-console .pill-btn:hover {
  color: #FFFFFF;
  border-color: var(--ink-muted);
}

.bench-console .pill-btn.is-active {
  background: var(--mat-yellow);
  color: var(--wall);
  border-color: var(--mat-yellow);
}

.search-input {
  min-width: 250px;
  padding: 0.52rem 0.85rem;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--paper);
  color: var(--ink-primary);
}

.search-input::placeholder {
  color: var(--ink-muted);
}

/* ---------- Profit calculator part rows ---------- */
.part-rows {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
}

.part-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.85fr) minmax(150px, 1.4fr) 110px auto;
  gap: 0.5rem;
  align-items: center;
}

.part-row-btn {
  background: transparent;
  color: var(--ink-muted);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.part-row-btn:hover {
  color: var(--led-fault);
  border-color: var(--led-fault);
}

/* ---------- Diagnostics monitor + thermal scale ---------- */
.monitor-bezel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.9rem;
  margin: -0.4rem -0.4rem 1.15rem;
  background: #1A1B1E;
  border-radius: 2px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

.thermal-meter-wrap {
  background: var(--paper);
  border: 1px solid var(--border-pcb);
  border-radius: var(--radius);
  padding: 0.95rem 1rem;
  margin-bottom: 1rem;
}

.bench-console .thermal-meter-wrap {
  background: var(--mat-cell);
  border-color: var(--mat-line);
}

.thermal-meter-track {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2E9E5B 0%, #5FD38D 66%, #F2C230 84%, #E5483A 100%);
}

.thermal-meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-top: 0.45rem;
}

.thermal-scale {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  border: 1px solid var(--border-pcb);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: var(--paper);
}

.thermal-zone {
  padding: 0.95rem 1rem;
  border-right: 1px solid var(--border-pcb);
}

.thermal-zone:last-child {
  border-right: none;
}

.thermal-zone.zone-ok {
  border-top: 6px solid #2E9E5B;
}

.thermal-zone.zone-warn {
  border-top: 6px solid var(--mat-yellow);
}

.thermal-zone.zone-fault {
  border-top: 6px solid #E5483A;
}

/* ---------- Keycaps ---------- */
kbd.keycap {
  display: inline-block;
  min-width: 1.9em;
  text-align: center;
  padding: 0.12rem 0.5rem;
  background: var(--paper);
  color: var(--ink-primary);
  border: 1px solid var(--border-bright);
  border-bottom-width: 3px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
}

/* ---------- Co-op player slots (dark bench context) ---------- */
.player-slot-1 { box-shadow: inset 0 4px 0 var(--case-orange); }
.player-slot-2 { box-shadow: inset 0 4px 0 #E75AA8; }
.player-slot-3 { box-shadow: inset 0 4px 0 #5FD38D; }
.player-slot-4 { box-shadow: inset 0 4px 0 #6FA0FF; }

.player-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.08rem 0.42rem;
  border-radius: 2px;
  margin-right: 0.45rem;
  background: #FFFFFF;
  color: var(--wall);
}

/* ---------- Assembly checklist ---------- */
.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-pcb);
  border-radius: var(--radius);
  background: var(--paper);
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid var(--border-pcb);
}

.checklist-item:last-child {
  border-bottom: none;
}

.checklist-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 0.15rem;
  accent-color: var(--case-orange);
  flex-shrink: 0;
}

.checklist-item.is-checked {
  background: var(--bg-subtle);
}

.checklist-item.is-checked .checklist-title {
  text-decoration: line-through;
  color: var(--ink-muted);
}

.checklist-title {
  font-weight: 700;
  display: block;
  margin-bottom: 0.15rem;
}

.checklist-detail {
  font-size: 0.92rem;
  color: var(--ink-muted);
  margin: 0;
}

/* ---------- Callout ---------- */
.callout {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-pcb);
  border-left: 6px solid var(--tag-blue);
  background: var(--paper);
  margin-block: 1rem;
  font-size: 0.95rem;
  color: var(--ink-secondary);
  max-width: 80ch;
}

.callout.is-warn {
  border-left-color: var(--mat-yellow);
  background: #FFFBEE;
}

/* ---------- Patch ledger ---------- */
.patch-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.patch-item {
  background: var(--paper);
  border: 1px solid var(--border-pcb);
  border-top: 4px solid var(--ply);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.2rem;
}

.patch-item .meta-pill {
  background: var(--ply-light);
  border-color: transparent;
  color: #4A3313;
  font-weight: 600;
}

/* ---------- Updates timeline (a real date sequence) ---------- */
.update-log {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 920px;
}

.update-entry {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 0 1.5rem;
}

.update-meta {
  padding-top: 1.15rem;
  text-align: right;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

.update-meta time {
  display: block;
  margin-bottom: 0.35rem;
}

.update-type {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 2px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
}

.update-type.is-content { background: #FFE6C7; color: #7A4300; }
.update-type.is-patch { background: #E3ECFB; color: var(--tag-blue-deep); }
.update-type.is-performance { background: #E2F3E8; color: #1F6B3D; }

.update-body {
  position: relative;
  padding: 1rem 0 1.5rem 1.5rem;
  border-left: 4px solid var(--ply);
}

.update-body::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 1.3rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper);
  border: 4px solid var(--ply-edge);
}

.update-entry:first-child .update-body::before {
  background: var(--case-orange);
  border-color: var(--case-orange-deep);
}

.update-body h3 {
  margin-bottom: 0.4rem;
}

.update-body ul {
  margin: 0 0 0.6rem;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.3rem;
  color: var(--ink-secondary);
  font-size: 0.95rem;
}

.update-body > a {
  font-size: 0.9rem;
  font-weight: 600;
}

.home-updates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.home-updates .patch-item time {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 0.35rem;
}

/* ---------- FAQ ---------- */
.faq-list {
  border: 1px solid var(--border-pcb);
  border-radius: var(--radius);
  background: var(--paper);
}

.faq-item {
  border-bottom: 1px solid var(--border-pcb);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  font-weight: 700;
  font-size: 1.02rem;
  cursor: pointer;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question:hover {
  background: #FAFAFB;
}

.faq-toggle {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  border: 1px solid var(--border-bright);
  font-size: 1.05rem;
  line-height: 1;
  color: var(--ink-muted);
  flex-shrink: 0;
  transition: transform 140ms ease, background-color 140ms ease;
}

.faq-item[open] .faq-toggle {
  transform: rotate(45deg);
  background: var(--case-orange);
  border-color: var(--case-orange);
  color: var(--wall);
}

.faq-answer {
  padding: 0 1.25rem 1.1rem;
  color: var(--ink-secondary);
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

/* ---------- Diagnostics split ---------- */
.fault-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 1.25rem;
  align-items: start;
}

.symptom-list {
  display: grid;
  gap: 0.5rem;
}

.symptom-btn {
  width: 100%;
  text-align: left;
  background: var(--paper);
  color: var(--ink-secondary);
  border: 1px solid var(--border-pcb);
  border-left: 6px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 0.8rem 0.95rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
}

.symptom-btn:hover {
  color: var(--ink-primary);
  border-left-color: var(--wall);
}

.symptom-btn.is-active {
  border-left-color: var(--case-orange);
  color: var(--ink-primary);
  font-weight: 700;
  background: #FFF6EA;
}

.bench-console .symptom-btn {
  background: var(--mat-cell);
  border-color: var(--mat-line);
  border-left-color: var(--mat-line);
}

.bench-console .symptom-btn.is-active {
  background: #3A3D43;
  border-left-color: var(--mat-yellow);
}

/* ---------- Guide pages ---------- */
.guide-source {
  font-size: 0.85rem;
  color: var(--ink-muted);
  max-width: 70ch;
}

.guide-list,
.guide-steps {
  max-width: 76ch;
  margin: 0 0 1rem;
  padding-left: 1.3rem;
  display: grid;
  gap: 0.5rem;
}

.guide-steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

/* Steps are a real sequence, so they carry numbers */
.guide-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  min-height: 1.9rem;
}

.guide-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.9rem;
  height: 1.9rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--case-orange);
  color: var(--wall);
  font-weight: 800;
  font-size: 0.9rem;
}

/* ---------- Screenshot galleries ---------- */
.shot-grid {
  display: grid;
  gap: 0.9rem;
}

.shot-grid.shots-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Three shots: one lead image, two stacked beside it */
.shot-grid.shots-3 {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.shot-grid.shots-3 .shot:first-child {
  grid-row: span 2;
}

.shot-grid.shots-1 {
  max-width: 860px;
}

.shot {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--border-pcb);
  border-radius: var(--radius);
  overflow: hidden;
}

.shot-link {
  display: block;
  flex: 1;
  background: var(--wall);
}

.shot img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.shot figcaption {
  padding: 0.55rem 0.8rem 0.65rem;
  font-size: 0.85rem;
  color: var(--ink-secondary);
  border-top: 3px solid var(--ply);
}

.shot-credit {
  margin: 0.6rem 0 0;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

@media (max-width: 640px) {
  .shot-grid.shots-2,
  .shot-grid.shots-3 {
    grid-template-columns: 1fr;
  }

  .shot-grid.shots-3 .shot:first-child {
    grid-row: auto;
  }
}

/* ---------- Ad slots: labelled, space reserved to avoid layout shift ---------- */
.ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 0 auto 1.75rem;
  max-width: 100%;
  overflow: hidden;
}

.ad-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.ad-frame {
  display: flex;
  justify-content: center;
  max-width: 100%;
}

.ad-top .ad-frame {
  min-height: 90px;
}

.ad-bottom {
  margin-top: 3rem;
  margin-bottom: 0;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--border-bright);
}

.ad-native {
  width: 100%;
}

.ad-rect {
  min-height: 250px;
}

@media (max-width: 767px) {
  .ad-top .ad-frame {
    min-height: 50px;
  }
}

/* ---------- Footer: back to the wall ---------- */
.site-footer {
  background: var(--wall);
  color: var(--ink-secondary);
  padding-block: 2.5rem;
  border-top: 10px solid var(--ply);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: #FFFFFF;
}

.footer-note,
.footer-meta {
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.footer-heading {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
  color: #FFFFFF;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
  font-size: 0.9rem;
}

.site-footer .footer-links a {
  color: var(--ink-secondary);
  text-decoration: none;
}

.site-footer .footer-links a:hover {
  color: var(--case-orange);
  text-decoration: underline;
}

/* ---------- Responsive ---------- */
/* Header nav collapses where its measured width no longer fits:
   EN needs ~1185px, RU ~1317px of header width (Onest 14.4px bold, measured). */
@media (max-width: 1420px) {
  html[lang="ru"] .nav-toggle {
    display: inline-flex;
  }

  html[lang="ru"] .primary-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 68px;
    background: var(--wall);
    border-bottom: 4px solid var(--case-orange);
    padding: 0.5rem 1.25rem 1rem;
    flex-direction: column;
    align-items: stretch;
  }

  html[lang="ru"] .primary-nav.is-open {
    display: flex;
  }

  html[lang="ru"] .nav-link {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--mat-line);
  }

  html[lang="ru"] .nav-link.is-active::after {
    left: -1.25rem;
    right: auto;
    top: 0;
    bottom: 0;
    width: 6px;
    height: auto;
  }
}

@media (max-width: 1280px) {
  .nav-toggle {
    display: inline-flex;
  }

  .primary-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 68px;
    background: var(--wall);
    border-bottom: 4px solid var(--case-orange);
    padding: 0.5rem 1.25rem 1rem;
    flex-direction: column;
    align-items: stretch;
  }

  .primary-nav.is-open {
    display: flex;
  }

  .nav-link {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--mat-line);
  }

  .nav-link.is-active::after {
    left: -1.25rem;
    right: auto;
    top: 0;
    bottom: 0;
    width: 6px;
    height: auto;
  }
}

@media (max-width: 960px) {
  .hero-split,
  .asymmetric-grid,
  .checker-layout,
  .fault-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .thermal-scale,
  .patch-list,
  .home-updates {
    grid-template-columns: 1fr;
  }

  .thermal-zone {
    border-right: none;
    border-bottom: 1px solid var(--border-pcb);
  }

  .thermal-zone:last-child {
    border-bottom: none;
  }
}

@media (max-width: 640px) {
  .bench-grid {
    grid-template-columns: 1fr;
  }

  .showroom-stage {
    grid-template-columns: 1fr;
  }

  .part-row {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .update-entry {
    grid-template-columns: 1fr;
  }

  .update-meta {
    text-align: left;
    padding: 0 0 0 1.75rem;
    border-left: 4px solid var(--ply);
  }

  .update-meta time {
    display: inline;
    margin-right: 0.5rem;
  }

  .shop-sign {
    display: none;
  }

  .bench-console {
    padding: 1.25rem;
  }

  .search-input {
    min-width: 0;
    width: 100%;
  }

  .spec-row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .faq-toggle,
  .rig-svg .rig-fan-ring,
  .schematic-zone .zone-outline,
  .schematic-zone .zone-led,
  .schematic-zone .zone-part {
    transition: none;
  }

  .btn:active {
    transform: none;
  }
}
