/* OpticsLab — Capture One / Hasselblad Phocus Neutral Obsidian Optical Studio Theme */
:root {
  --bg-dark: #0B0C0E;
  --bg-card: #131519;
  --bg-card-elevated: #1A1D23;
  --bg-input: #08090B;
  --bg-tonal: #1E2128;
  --bg-tonal-hover: #272B34;
  --border-color: rgba(255, 255, 255, 0.065);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --text-primary: #F3F4F6;
  --text-secondary: #D1D5DB;
  --text-muted: #8E95A5;
  --text-dim: #5E6472;
  --amber: #F59E0B;
  --amber-glow: rgba(245, 158, 11, 0.14);
  --cyan: #38BDF8;
  --emerald: #10B981;
  --topbar-h: 54px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select {
  font-family: inherit;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.label-alt {
  font-size: 0.85em;
  font-weight: 400;
  color: var(--text-dim);
  margin-left: 5px;
}

.label-num {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  margin-right: 4px;
}

/* ===== Top Navigation Bar ===== */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 24px;
  height: var(--topbar-h);
  background: rgba(11, 12, 14, 0.94);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  justify-self: start;
}

.brand-icon {
  width: 27px;
  height: 27px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.brand-text-cyan {
  color: var(--cyan);
  font-weight: 600;
}

.nav-tabs {
  display: flex;
  align-items: stretch;
  gap: 6px;
  height: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  padding: 2px 12px 0;
  transition: color 0.14s ease, border-color 0.14s ease;
  white-space: nowrap;
  cursor: pointer;
}

.nav-tab:hover {
  color: var(--text-primary);
}

.nav-tab.active {
  color: var(--text-primary);
  font-weight: 600;
  border-bottom-color: var(--amber);
}

/* Recessed Language Track (No Outer Border) */
.lang-pill {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 28px;
  padding: 3px;
  background: var(--bg-input);
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 500;
  white-space: nowrap;
}

.lang-link {
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.14s ease, background 0.14s ease;
}

.lang-link:hover {
  color: var(--text-primary);
}

.lang-link.active {
  color: var(--amber);
  background: #1F2229;
  font-weight: 600;
}

.lang-sep {
  display: none;
}

/* ===== Main Studio 2-Column Layout ===== */
.studio-grid {
  max-width: 1560px;
  margin: 0 auto;
  padding: 16px 24px;
  display: grid;
  grid-template-columns: 332px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.viewport-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.card {
  background: var(--bg-card);
  border: none;
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 4px 16px rgba(0, 0, 0, 0.35);
}

.card-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  line-height: 1.3;
}

.card-title > span:first-child {
  min-width: 0;
}

/* Sidebar control cards */
.ctrl-card {
  display: flex;
  flex-direction: column;
}

.ctrl-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding-top: 10px;
}

body[data-active-tool="dof"] .sidebar-col > .card-camera { flex: 1 1 auto; }
body[data-active-tool="dof"] .sidebar-col > .card-focal { flex: 1.5 1 auto; }
body[data-active-tool="dof"] .sidebar-col > .card-aperture { flex: 1.5 1 auto; }
body[data-active-tool="dof"] .sidebar-col > .card-distance { flex: 1.1 1 auto; }

/* Comparison Camera B is only relevant on the Bokeh & Equivalence tool */
body:not([data-active-tool="equivalence"]) #compare-sidebar-card {
  display: none;
}

/* ===== Camera select (recessed hardware slot, zero heavy border) ===== */
.select-wrap {
  position: relative;
}

.camera-select-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 36px;
  padding: 0 30px 0 12px;
  background: var(--bg-tonal);
  border: none;
  border-radius: 6px;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: background 0.14s ease;
}

.camera-select-display .sel-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
}

.camera-select-display .sel-spec {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.camera-select-display .sel-chevron {
  position: absolute;
  right: 11px;
  top: 50%;
  width: 11px;
  height: 11px;
  margin-top: -5.5px;
  color: var(--text-muted);
}

.select-wrap .native-select-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 13px;
}

.select-wrap:hover .camera-select-display,
.native-select-overlay:focus-visible + .camera-select-display,
.select-wrap:focus-within .camera-select-display {
  background: var(--bg-tonal-hover);
}

.studio-select {
  width: 100%;
  background: var(--bg-tonal);
  color: var(--text-primary);
  border: none;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12.5px;
  font-family: var(--font-sans);
  outline: none;
  cursor: pointer;
}

/* ===== Focal length module ===== */
.focal-readout {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.focal-readout .unit {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 4px;
}

/* Range sliders */
.studio-range {
  --pct: 50%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  background: transparent;
  outline: none;
  cursor: pointer;
  margin: 0;
}

.studio-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #38BDF8 0%, #38BDF8 var(--pct), #242730 var(--pct), #242730 100%);
}

.studio-range::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #38BDF8 0%, #38BDF8 var(--pct), #242730 var(--pct), #242730 100%);
}

.studio-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: #F8FAFC;
  border: 2px solid #0B0C0E;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  cursor: grab;
}

.studio-range::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #F8FAFC;
  border: 2px solid #0B0C0E;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  cursor: grab;
}

/* Quick pills — Recessed Segmented Track (Zero Individual Borders) */
.pill-row {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-input);
  border-radius: 6px;
}

.quick-pill {
  flex: 1;
  min-width: 0;
  text-align: center;
  height: 25px;
  padding: 0 4px;
  background: transparent;
  border: none;
  border-radius: 4px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.quick-pill:hover {
  color: var(--text-primary);
}

.quick-pill.active {
  color: var(--amber);
  font-weight: 600;
  background: #20232B;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

/* ===== Aperture control: Leica-style tick ruler ===== */
.aperture-readout {
  text-align: center;
  font-size: 27px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--amber);
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.ap-ruler {
  --ruler-pad: 12px;
  position: relative;
  height: 48px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  outline: none;
  border-radius: 6px;
  background: var(--bg-input);
  border: none;
}

.ap-ruler:focus-visible {
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.45);
}

.ap-ruler .ap-tick,
.ap-ruler .ap-label,
.ap-ruler .ap-needle {
  position: absolute;
  transform: translateX(-50%);
  left: calc(var(--ruler-pad) + (100% - 2 * var(--ruler-pad)) * var(--pos));
}

.ap-tick {
  top: 6px;
  width: 1.5px;
  height: 15px;
  background: #7A8294;
  border-radius: 1px;
}

.ap-tick.minor {
  top: 11px;
  width: 1px;
  height: 7px;
  background: #3F4554;
}

.ap-needle {
  top: 3px;
  width: 2px;
  height: 22px;
  background: var(--amber);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.75);
  transition: left 0.12s ease;
  pointer-events: none;
}

.ap-label {
  top: 27px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: color 0.12s ease;
}

.ap-label.active {
  color: var(--amber);
  font-weight: 600;
}

/* ===== Subject distance ===== */
.unit-toggle {
  background: var(--bg-input);
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 500;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 5px;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
}

.unit-toggle:hover {
  color: var(--text-secondary);
}

.unit-toggle .on {
  color: var(--amber);
  font-weight: 600;
}

.distance-control-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.distance-input-box {
  display: flex;
  align-items: stretch;
  height: 34px;
  background: var(--bg-input);
  border: none;
  border-radius: 6px;
  width: 106px;
  flex-shrink: 0;
  overflow: hidden;
}

.distance-input {
  width: 54px;
  padding-left: 10px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  outline: none;
  -moz-appearance: textfield;
}

.distance-input::-webkit-outer-spin-button,
.distance-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.distance-unit-label {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  padding-right: 6px;
}

.spin-btns {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-subtle);
  width: 22px;
}

.spin-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.spin-btn + .spin-btn {
  border-top: 1px solid var(--border-subtle);
}

.spin-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

/* ===== KPI 4-card row ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  flex: 0 0 auto;
}

.kpi-card {
  background: var(--bg-card);
  border: none;
  border-radius: 8px;
  padding: 12px 15px;
  display: flex;
  flex-direction: column;
  min-height: 90px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 4px 14px rgba(0, 0, 0, 0.3);
}

.kpi-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.3;
}

.kpi-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding-top: 6px;
}

.kpi-value {
  font-size: 25px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.kpi-value.amber {
  color: var(--amber);
}

.kpi-sub {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== Optical simulation card ===== */
.sim-card {
  position: relative;
  flex: 1 1 auto;
  min-height: 310px;
  display: flex;
  flex-direction: column;
  padding: 12px 16px 10px;
  overflow: hidden;
}

.sim-card .sim-title {
  position: absolute;
  top: 12px;
  left: 16px;
  z-index: 1;
}

.sim-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.sim-svg-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

.optical-svg {
  width: 100%;
  height: auto;
  max-height: 100%;
  display: block;
  margin: auto 0;
}

.optical-svg text {
  font-family: var(--font-sans);
}

/* ===== Matrix table card ===== */
.matrix-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 10px;
}

/* Tactile Solid Primary Button (Zero Outlined Dark Border) */
.print-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  background: #F3F4F6;
  color: #0B0C0E;
  border: none;
  border-radius: 5px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease, transform 0.1s ease;
}

.print-btn:hover {
  background: var(--amber);
  color: #0B0C0E;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.studio-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  font-family: var(--font-mono);
}

.studio-table th,
.studio-table td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.studio-table th {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-color);
}

.studio-table td {
  color: var(--text-secondary);
}

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

.studio-table td.row-label {
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-weight: 500;
}

.studio-table td.highlight-amber,
.studio-table th.highlight-amber {
  color: var(--amber);
  font-weight: 600;
}

.studio-table td.highlight-cyan {
  color: var(--cyan);
}

.studio-table .col-current {
  background: rgba(245, 158, 11, 0.07);
}

/* Tool panels (Equivalence, FoV, Print DPI) */
.tool-panel {
  display: none;
}

.tool-panel.active {
  display: block;
}

.comp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.comp-box {
  background: var(--bg-input);
  border: none;
  border-radius: 6px;
  padding: 10px 12px;
}

.comp-box-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 4px;
}

.comp-box.amber-box .comp-box-title {
  color: var(--amber);
}

.badge-grade {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-family: var(--font-sans);
  font-weight: 500;
}

.badge-exhibition { color: #34D399; }
.badge-fineart { color: var(--cyan); }
.badge-standard { color: var(--amber); }
.badge-wall { color: var(--text-muted); }

.sensor-badge {
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-input);
  border: none;
  padding: 4px 10px;
  border-radius: 5px;
}

/* ===== Below-Fold Engineering Directory & Technical Reference ===== */
.below-fold {
  max-width: 1560px;
  margin: 2px auto 56px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Native Optical Hardware BOM Strip (Zero Heavy Borders) */
.bom-card {
  padding: 13px 18px;
}

.bom-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.bom-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.bom-export-notice {
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--amber);
}

.bom-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.bom-item {
  background: var(--bg-input);
  border-radius: 6px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bom-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.bom-kicker {
  font-size: 10.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bom-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bom-sub {
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bom-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.bom-btn {
  height: 27px;
  padding: 0 10px;
  border-radius: 5px;
  background: var(--bg-tonal);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease;
}

.bom-btn:hover {
  background: var(--bg-tonal-hover);
  color: var(--text-primary);
}

.bom-btn-primary {
  background: rgba(245, 158, 11, 0.14);
  color: var(--amber);
}

.bom-btn-primary:hover {
  background: var(--amber);
  color: #0B0C0E;
}

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

/* Optical Benchmark & Preset Explorer */
.explorer-card {
  padding: 0;
  overflow: hidden;
}

.explorer-top {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.explorer-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.explorer-count-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-tonal);
  border: none;
  padding: 2px 8px;
  border-radius: 4px;
}

.explorer-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Recessed Filter Bar (Zero Borders) */
.filter-pills {
  display: inline-flex;
  align-items: center;
  background: var(--bg-input);
  border: none;
  border-radius: 6px;
  padding: 3px;
  gap: 2px;
  flex-wrap: wrap;
}

.filter-pill {
  height: 25px;
  padding: 0 10px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}

.filter-pill:hover {
  color: var(--text-primary);
}

.filter-pill.active {
  background: #20232B;
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 9px;
  width: 13px;
  height: 13px;
  color: var(--text-dim);
  pointer-events: none;
}

.search-input {
  height: 31px;
  width: 210px;
  padding: 0 10px 0 28px;
  background: var(--bg-input);
  border: none;
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-input:focus {
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.45);
}

/* High-density spec explorer table */
.explorer-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.explorer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.explorer-table th {
  padding: 9px 14px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  background: rgba(8, 9, 11, 0.55);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.explorer-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}

.explorer-table tbody tr {
  transition: background 0.12s ease;
}

.explorer-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.explorer-table tbody tr.active-preset-row {
  background: rgba(245, 158, 11, 0.07);
}

.explorer-table-wrap[data-collapsed="true"] tr.preset-row-extra {
  display: none;
}

.explorer-table tbody tr.filtered-out {
  display: none !important;
}

/* Borderless Brand Indicator Dots */
.brand-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-primary);
}

.brand-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.brand-dot.dot-sony { background: #FB923C; }
.brand-dot.dot-canon { background: #F87171; }
.brand-dot.dot-nikon { background: #FACC15; }
.brand-dot.dot-fujifilm { background: #34D399; }
.brand-dot.dot-other { background: #38BDF8; }

.preset-row-link {
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.14s ease;
}

.explorer-table tbody tr:hover .preset-row-link {
  color: var(--text-primary);
}

.mono-cell {
  font-family: var(--font-mono);
  font-size: 12px;
}

.spec-pair + .spec-pair {
  margin-left: 10px;
  color: var(--amber);
}

.dof-bar-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.dof-mini-track {
  width: 48px;
  height: 4px;
  background: var(--bg-input);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}

.dof-mini-fill {
  height: 100%;
  background: var(--cyan);
  border-radius: 999px;
}

/* Borderless Row Open Link */
.row-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
  transition: color 0.12s ease;
}

.explorer-table tbody tr:hover .row-action-btn {
  color: var(--amber);
}

.explorer-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.explorer-status {
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Borderless Tonal Expand Button */
.toggle-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: 5px;
  background: var(--bg-tonal);
  border: none;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s ease;
}

.toggle-all-btn:hover {
  background: var(--bg-tonal-hover);
}

/* 2-Column Technical Datasheet & Hairline-Divided FAQ */
.datasheet-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 14px;
  align-items: start;
}

.page-h1 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.seo-intro-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 6px;
}

.formula-list {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
  border-top: 1px solid var(--border-color);
}

.formula-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.formula-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.formula-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.formula-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--amber);
}

.faq-list {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  border-top: 1px solid var(--border-color);
}

details.faq-item {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  padding: 10px 0;
}

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

summary.faq-q {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 12.5px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

summary.faq-q::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-dim);
  flex-shrink: 0;
}

details.faq-item[open] summary.faq-q::after {
  content: "−";
  color: var(--amber);
}

.faq-a {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
  margin-top: 6px;
}

.footer {
  border-top: 1px solid var(--border-color);
  padding: 20px 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 11.5px;
}

/* ===== Responsive breakpoints ===== */
@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: auto 1fr;
    height: auto;
    padding: 10px 16px 0;
    row-gap: 6px;
  }
  .nav-tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 40px;
  }
  .studio-grid {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .datasheet-grid {
    grid-template-columns: 1fr;
  }
  .sim-card .sim-title {
    position: static;
    margin-bottom: 6px;
  }
}

@media (max-width: 640px) {
  .studio-grid { padding: 12px; }
  .below-fold { padding: 0 12px; }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .comp-grid {
    grid-template-columns: 1fr;
  }
  .search-input {
    width: 100%;
  }
}

/* Clean printable optical field card */
@media print {
  body {
    background: #FFFFFF !important;
    color: #0F172A !important;
  }
  .topbar, .below-fold, .print-btn, .pill-row, .studio-range, .footer {
    display: none !important;
  }
  .studio-grid {
    grid-template-columns: 260px 1fr !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .card, .kpi-card {
    background: #FFFFFF !important;
    border: 1px solid #CBD5E1 !important;
    box-shadow: none !important;
    color: #0F172A !important;
  }
  .kpi-value, .card-title, .studio-table th, .studio-table td {
    color: #0F172A !important;
  }
}
