/* ================================================
   SHTENLI PRO 130 CALCULATOR — STYLE
   Industrial / Construction Theme
   ================================================ */

/* --- TOKENS --- */
:root,
[data-theme='light'] {
  /* Surfaces */
  --color-bg: #F5F3EF;
  --color-surface: #FFFFFF;
  --color-surface-2: #FAF9F7;
  --color-surface-offset: #EDEBE6;
  --color-border: #D8D4CC;
  --color-divider: #E4E0D8;

  /* Text */
  --color-text: #1E1C18;
  --color-text-muted: #6B6960;
  --color-text-faint: #AEADA8;

  /* Accent — Construction Orange */
  --accent: #D45A00;
  --accent-hover: #B84D00;
  --accent-light: #FFF0E6;
  --accent-mid: #FDDEC9;

  /* Component colors */
  --cement-color: #8A8580;
  --cement-bg: #F0EEEC;
  --sand-color: #C4952A;
  --sand-bg: #FDF6E3;
  --gravel-color: #7A6248;
  --gravel-bg: #F5EDE3;
  --water-color: #2E7DAB;
  --water-bg: #E3F2FB;

  /* Misc */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(30,28,24,0.07);
  --shadow-md: 0 4px 12px rgba(30,28,24,0.09);
  --shadow-lg: 0 12px 32px rgba(30,28,24,0.12);
  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Fonts */
  --font-display: 'Cabinet Grotesk', 'Arial', sans-serif;
  --font-body: 'General Sans', 'Helvetica Neue', sans-serif;

  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
}

[data-theme='dark'] {
  --color-bg: #18160F;
  --color-surface: #211F17;
  --color-surface-2: #29261C;
  --color-surface-offset: #1E1C14;
  --color-border: #3A3828;
  --color-divider: #302E22;
  --color-text: #E8E4D8;
  --color-text-muted: #8A8778;
  --color-text-faint: #55523E;

  --accent: #F07020;
  --accent-hover: #FF8A40;
  --accent-light: #2A1800;
  --accent-mid: #3D2010;

  --cement-color: #A8A49E;
  --cement-bg: #2A2820;
  --sand-color: #D4A843;
  --sand-bg: #2A2410;
  --gravel-color: #9A8068;
  --gravel-bg: #28201A;
  --water-color: #4A9FCC;
  --water-bg: #0E2030;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #18160F;
    --color-surface: #211F17;
    --color-surface-2: #29261C;
    --color-surface-offset: #1E1C14;
    --color-border: #3A3828;
    --color-divider: #302E22;
    --color-text: #E8E4D8;
    --color-text-muted: #8A8778;
    --color-text-faint: #55523E;
    --accent: #F07020;
    --accent-hover: #FF8A40;
    --accent-light: #2A1800;
    --accent-mid: #3D2010;
    --cement-color: #A8A49E;
    --cement-bg: #2A2820;
    --sand-color: #D4A843;
    --sand-bg: #2A2410;
    --gravel-color: #9A8068;
    --gravel-bg: #28201A;
    --water-color: #4A9FCC;
    --water-bg: #0E2030;
  }
}

/* --- BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}
body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}
input, button, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
svg { display: block; }
p { text-wrap: pretty; }

/* --- HEADER --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.logo-icon { color: var(--accent); flex-shrink: 0; }
.logo-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.2;
}
.logo-model {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
}
.logo-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
}
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.theme-toggle:hover {
  color: var(--accent);
  background: var(--accent-light);
  border-color: var(--accent);
}

/* --- MAIN LAYOUT --- */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2rem);
}
.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}
.panel-left, .panel-right {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

/* --- CARD --- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: clamp(1rem, 3vw, 1.5rem);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  max-width: 100%;
}
.card-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
  margin-bottom: 0.875rem;
}
.card-hint {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  margin-top: -0.5rem;
}

/* --- SPECS CARD --- */
.specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.spec-item {
  background: var(--color-surface-offset);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.spec-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
}
.spec-value {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
}

/* --- SLIDERS --- */
.slider-group { margin-bottom: 1rem; }
.slider-group:last-child { margin-bottom: 0; }
.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.slider-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}
.slider-value {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  min-width: 3rem;
  text-align: right;
}
.slider-value.accent { color: var(--accent); }
.slider-value.water-val { color: var(--water-color); }
.component-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Custom range sliders */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-divider);
  outline: none;
  cursor: pointer;
  transition: background var(--transition);
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2.5px solid var(--accent);
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: transform var(--transition), border-color var(--transition);
}
.slider::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.15); }
.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2.5px solid var(--accent);
  cursor: grab;
}
.slider-cement::-webkit-slider-thumb { border-color: var(--cement-color); }
.slider-cement::-moz-range-thumb { border-color: var(--cement-color); }
.slider-sand::-webkit-slider-thumb { border-color: var(--sand-color); }
.slider-sand::-moz-range-thumb { border-color: var(--sand-color); }
.slider-gravel::-webkit-slider-thumb { border-color: var(--gravel-color); }
.slider-gravel::-moz-range-thumb { border-color: var(--gravel-color); }
.slider-water::-webkit-slider-thumb { border-color: var(--water-color); }
.slider-water::-moz-range-thumb { border-color: var(--water-color); }

.slider-track-wrap { margin-bottom: 0.25rem; }
.slider-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0.2rem 0.1rem 0;
}
.slider-ticks span {
  font-size: 0.7rem;
  color: var(--color-text-faint);
}

/* Drum visual */
.load-visual {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.25rem;
}
.drum-outline {
  width: 80px;
  height: 110px;
  border: 2px solid var(--color-border);
  border-radius: 40px 40px 8px 8px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-surface-offset);
}
.drum-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, var(--accent), color-mix(in oklab, var(--accent), transparent 30%));
  transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0.75;
}
.drum-label-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
}
.drum-label-inner span:first-child {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-sm);
  color: var(--color-text);
}
.drum-sub {
  font-size: 0.68rem;
  color: var(--color-text-muted);
}
.drum-legend {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.drum-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Dots */
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-dot.full { background: var(--color-border); }
.legend-dot.nominal { background: color-mix(in oklab, var(--accent), white 40%); }
.legend-dot.actual { background: var(--accent); }
.legend-dot.cement-dot { background: var(--cement-color); }
.legend-dot.sand-dot { background: var(--sand-color); }
.legend-dot.gravel-dot { background: var(--gravel-color); }
.legend-dot.water-dot { background: var(--water-color); }

.component-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.component-dot.cement { background: var(--cement-color); }
.component-dot.sand { background: var(--sand-color); }
.component-dot.gravel { background: var(--gravel-color); }
.component-dot.water { background: var(--water-color); }
.component-dot.sm { width: 8px; height: 8px; }

/* --- PRESETS --- */
.preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.preset-btn {
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--color-text-muted);
  background: var(--color-surface-offset);
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.preset-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}
.preset-btn.active {
  color: var(--color-surface);
  background: var(--accent);
  border-color: var(--accent);
}

/* Ratio badge */
.ratio-badge {
  margin-top: 0.75rem;
  padding: 0.5rem 0.875rem;
  background: var(--color-surface-offset);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.ratio-badge strong {
  color: var(--color-text);
  font-family: var(--font-display);
}

/* W/C labels */
.wc-labels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.wc-tag {
  text-align: center;
  font-size: 0.7rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-divider);
  color: var(--color-text-muted);
  background: var(--color-surface-offset);
  line-height: 1.3;
}
.wc-tag.rigid { color: #A0482A; background: #FFF0EB; border-color: #F0C8B0; }
.wc-tag.normal { color: #2A7A45; background: #EDF7F2; border-color: #B0D8C0; }
.wc-tag.fluid { color: #2A6A9A; background: #EBF4FB; border-color: #A0C8E8; }
[data-theme='dark'] .wc-tag.rigid { color: #E09060; background: #2A1500; border-color: #5A3020; }
[data-theme='dark'] .wc-tag.normal { color: #70C890; background: #0A2A18; border-color: #206040; }
[data-theme='dark'] .wc-tag.fluid { color: #70B0E0; background: #0A1E30; border-color: #205070; }

/* --- RESULTS CARD --- */
.results-card { }

/* Composition bar */
.comp-bar-wrap { margin-bottom: 1.25rem; }
.comp-bar {
  height: 28px;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  background: var(--color-divider);
  margin-bottom: 0.625rem;
}
.comp-seg {
  height: 100%;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 0;
}
.seg-cement { background: var(--cement-color); }
.seg-sand { background: var(--sand-color); }
.seg-gravel { background: var(--gravel-color); }
.seg-water { background: var(--water-color); }
.comp-bar-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.comp-bar-legend span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Results grid */
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
  margin-bottom: 1rem;
}
.result-card {
  border-radius: var(--radius-lg);
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-divider);
}
.res-cement { background: var(--cement-bg); }
.res-sand { background: var(--sand-bg); }
.res-gravel { background: var(--gravel-bg); }
.res-water { background: var(--water-bg); }
.res-icon { color: var(--color-text-muted); margin-bottom: 0.125rem; }
.res-cement .res-icon { color: var(--cement-color); }
.res-sand .res-icon { color: var(--sand-color); }
.res-gravel .res-icon { color: var(--gravel-color); }
.res-water .res-icon { color: var(--water-color); }
.res-data { display: flex; flex-direction: column; gap: 0.1rem; }
.res-name {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.res-vol {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.res-mass {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.res-bar-mini {
  height: 4px;
  background: var(--color-divider);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.res-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.cement-fill { background: var(--cement-color); }
.sand-fill { background: var(--sand-color); }
.gravel-fill { background: var(--gravel-color); }
.water-fill { background: var(--water-color); }

/* Total row */
.total-row {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--color-surface-offset);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.total-item {
  flex: 1;
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: center;
}
.total-divider {
  width: 1px;
  height: 48px;
  background: var(--color-divider);
  flex-shrink: 0;
}
.total-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
}
.total-val {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.01em;
}
.total-val.accent { color: var(--accent); }

/* --- PLANNER CARD --- */
.planner-input-row {
  margin-bottom: 1.25rem;
}
.input-wrap {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.num-input {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-offset);
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  outline: none;
  transition: border-color var(--transition);
  -moz-appearance: textfield;
}
.num-input::-webkit-outer-spin-button,
.num-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.num-input:focus { border-color: var(--accent); }
.input-unit-toggle {
  display: flex;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.unit-btn {
  padding: 0.6rem 1rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface-offset);
  border: none;
  transition: color var(--transition), background var(--transition);
}
.unit-btn + .unit-btn { border-left: 1px solid var(--color-border); }
.unit-btn.active {
  color: var(--color-surface);
  background: var(--accent);
}
.unit-btn:hover:not(.active) {
  color: var(--accent);
  background: var(--accent-light);
}

/* Planner results */
.plan-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}
.plan-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}
.plan-val {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
}
.plan-val.accent { color: var(--accent); }
.plan-val.big {
  font-size: var(--text-xl);
  letter-spacing: -0.02em;
  line-height: 1;
}
.plan-divider {
  height: 1px;
  background: var(--color-divider);
  margin: 0.875rem 0;
}
.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}
.plan-item {
  background: var(--color-surface-offset);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.plan-item-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.plan-item-vals {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.plan-val-row {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  line-height: 1.2;
}
.plan-val-row span:not(.plan-unit) {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
}
.plan-val-mass span {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
}
.plan-unit {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.plan-time-row {
  display: flex;
  gap: 1rem;
}
.plan-time-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

/* --- DENSITY NOTE --- */
.density-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.density-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.density-val {
  margin-left: auto;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-text);
  font-size: var(--text-sm);
}
.note-text {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-style: italic;
}

/* --- FOOTER --- */
.site-footer {
  text-align: center;
  padding: 1.25rem;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  border-top: 1px solid var(--color-border);
}



/* --- MIXER SELECTOR --- */

.mixer-card { }

/* Brand tabs */
.brand-tabs {
  display: flex;
  gap: 0.375rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.brand-tab {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-border);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--color-text-muted);
  background: var(--color-surface-offset);
  transition: color var(--transition), background var(--transition), border-color var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  text-align: center;
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
}
.brand-tab:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}
.brand-tab.active {
  color: var(--color-surface);
  background: var(--accent);
  border-color: var(--accent);
}

/* Mixer card — must contain scroll overflow */
.mixer-card { overflow: hidden; }

/* Model scroll container */
.model-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.375rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
  min-width: 0;
  width: 100%;
}
.model-scroll::-webkit-scrollbar { height: 4px; }
.model-scroll::-webkit-scrollbar-track { background: transparent; }
.model-scroll::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}
.model-scroll:empty { display: none; }

/* Model card */
.model-card {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 108px;
  padding: 0.625rem 0.75rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-offset);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.model-card:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.model-card.active {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent), transparent 75%);
}
.mc-name {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.model-card.active .mc-name { color: var(--accent); }
.mc-drum {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}
.mc-drum strong {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-text);
  font-size: 0.72rem;
}
.mc-power {
  font-size: 0.66rem;
  color: var(--color-text-muted);
  margin-top: auto;
  padding-top: 0.2rem;
  border-top: 1px solid var(--color-divider);
}
.model-card.active .mc-power { border-top-color: color-mix(in oklab, var(--accent), transparent 70%); }

/* Custom form */
.custom-form {
  display: none;
}
.custom-form.visible {
  display: block;
}
.custom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}
.custom-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.custom-field.full-width {
  grid-column: 1 / -1;
}
.custom-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
}
.custom-input {
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-offset);
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  outline: none;
  transition: border-color var(--transition);
  -moz-appearance: textfield;
  width: 100%;
}
.custom-input::-webkit-outer-spin-button,
.custom-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.custom-input:focus { border-color: var(--accent); }
.custom-note {
  margin-top: 0.625rem;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  line-height: 1.5;
  font-style: italic;
}

/* Specs card header */
.specs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.875rem;
  gap: 0.5rem;
}
.specs-title { margin-bottom: 0; }
.mixer-badge {
  flex-shrink: 0;
  padding: 0.2rem 0.625rem;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  border: 1px solid color-mix(in oklab, var(--accent), transparent 60%);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent);
  font-family: var(--font-display);
}

/* --- RESPONSIVE --- */

/* Prevent horizontal overflow */
html, body { overflow-x: hidden; }

/* Better touch targets for sliders */
.slider {
  padding-block: 8px;
  height: auto;
  touch-action: pan-y;
  cursor: pointer;
}

/* Always 2-column grids — never collapse to 1 col on mobile */
.specs-grid    { grid-template-columns: 1fr 1fr; }
.results-grid  { grid-template-columns: 1fr 1fr; }
.plan-grid     { grid-template-columns: 1fr 1fr; }
.wc-labels     { grid-template-columns: 1fr 1fr 1fr; }
.total-row     { flex-direction: row; flex-wrap: nowrap; }
.load-visual   { flex-direction: row; align-items: center; }
.plan-time-row { flex-direction: row; gap: 1rem; }

/* Compact layout on mobile */
@media (max-width: 600px) {
  .card { padding: 0.875rem; }

  /* Compact specs */
  .spec-item  { padding: 0.45rem 0.6rem; }
  .spec-value { font-size: 0.8rem; }
  .spec-label { font-size: 0.62rem; }

  /* Compact result cards */
  .result-card { padding: 0.7rem; }
  .res-vol     { font-size: 1.15rem; }
  .res-mass    { font-size: 0.7rem; }

  /* Compact total row */
  .total-item  { padding: 0.6rem 0.4rem; }
  .total-val   { font-size: 0.9rem; }
  .total-label { font-size: 0.62rem; }

  /* Compact plan items */
  .plan-item { padding: 0.6rem; }
  .plan-item-vals span:not(.plan-unit) { font-size: 0.9rem; }
  .plan-unit  { font-size: 0.65rem; }

  /* Compact W/C labels */
  .wc-tag { font-size: 0.62rem; padding: 0.25rem 0.3rem; }

  /* Drum visual — compact */
  .drum-outline { width: 64px; height: 88px; border-radius: 32px 32px 6px 6px; }
  .drum-label-inner span:first-child { font-size: 0.78rem; }
  .drum-sub  { font-size: 0.6rem; }
  .drum-legend-item { font-size: 0.65rem; }

  /* Preset buttons */
  .preset-btn { padding: 0.35rem 0.65rem; font-size: 0.78rem; }
  .preset-grid { gap: 0.4rem; }

  /* Header */
  .logo-sub { display: none; }
  .logo-model { font-size: 0.9rem; }
}

/* Very small screens (< 360px) — collapse only what truly can't fit */
@media (max-width: 359px) {
  .specs-grid    { grid-template-columns: 1fr; }
  .total-row     { flex-direction: column; }
  .total-divider { width: 100%; height: 1px; }
  .logo-model    { font-size: 0.82rem; }
  .header-inner  { gap: 0.4rem; }
}

/* --- FOCUS VISIBLE --- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
