/* ===================================================
   Soap Calculator — Mobile-First Styles
   No external dependencies. System font stack only.
   =================================================== */

/* ── Reset & Custom Properties ────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-dark:  #2d6a4f;
  --green-mid:   #40916c;
  --green-light: #74c69d;
  --green-pale:  #d8f3dc;
  --bg:          #faf9f7;
  --surface:     #ffffff;
  --border:      #e4e2de;
  --text:        #1b1b1b;
  --text-muted:  #6b7280;
  --red:         #dc2626;
  --amber:       #d97706;
  --blue:        #2563eb;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 2px 12px rgba(0,0,0,.10);
  --radius:      10px;
  --radius-sm:   6px;
  --font:        system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition:  0.18s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--green-dark); text-decoration: underline; }
a:hover { color: var(--green-mid); }

mark { background: var(--green-pale); color: var(--text); border-radius: 2px; padding: 0 2px; }

/* ── Layout ───────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ── Header ───────────────────────────────────────── */
.site-header {
  background: var(--green-dark);
  color: #fff;
  padding: 1rem 0 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #fff;
}

.site-logo-icon {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.site-logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.site-tagline {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Tab Navigation */
#tab-nav {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-top: 1px solid rgba(255,255,255,.15);
}
#tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: rgba(255,255,255,.75);
  padding: 0.65rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
  font-family: var(--font);
}
.tab-btn:hover { color: #fff; }
.tab-btn.active {
  color: #fff;
  border-bottom-color: var(--green-light);
}

/* ── Hero ─────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
  color: #fff;
  padding: 2.5rem 0 2rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.hero p {
  font-size: clamp(0.875rem, 2.5vw, 1.05rem);
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

.hero-badges {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.badge {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  font-weight: 500;
}

/* ── Main Content ─────────────────────────────────── */
main { padding: 2rem 0 4rem; }

.tool-section {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.tool-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-subtitle {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1.25rem 0 0.75rem;
}

/* ── Lye Calculator Controls ──────────────────────── */
.lye-controls {
  display: grid;
  gap: 1rem;
}

.control-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.control-label {
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 110px;
}

/* Toggle button group */
.btn-group {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.btn-group button {
  background: var(--surface);
  border: none;
  padding: 0.4rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.btn-group button + button { border-left: 1px solid var(--border); }
.btn-group button.active {
  background: var(--green-dark);
  color: #fff;
}
.btn-group button:hover:not(.active) { background: var(--green-pale); color: var(--text); }

/* Sliders */
.slider-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 180px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  background: var(--green-pale);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--green-dark);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--green-dark);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.slider-display {
  font-size: 0.875rem;
  font-weight: 600;
  min-width: 38px;
  text-align: right;
  color: var(--green-dark);
}

/* KOH purity row */
#koh-purity-row {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
#koh-purity-row input {
  width: 80px;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: var(--font);
}

/* Oil Search */
.oil-search-wrap {
  position: relative;
  margin-bottom: 1rem;
}

.oil-search-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

#oil-search {
  flex: 1;
  min-width: 200px;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font);
  background: var(--surface);
  transition: border-color var(--transition);
  outline: none;
}
#oil-search:focus { border-color: var(--green-mid); box-shadow: 0 0 0 3px rgba(64,145,108,.15); }

#oil-weight-input {
  width: 90px;
  padding: 0.55rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font);
  text-align: right;
  outline: none;
}
#oil-weight-input:focus { border-color: var(--green-mid); box-shadow: 0 0 0 3px rgba(64,145,108,.15); }

.unit-label-inline {
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0 0.25rem;
}

/* Dropdown */
#oil-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 250px;
  overflow-y: auto;
  z-index: 200;
  scrollbar-width: thin;
}

.dropdown-item {
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background var(--transition);
}
.dropdown-item:hover,
.dropdown-item:focus { background: var(--green-pale); outline: none; }
.dropdown-item.no-results { color: var(--text-muted); cursor: default; }

/* Oil List */
#oil-list { margin-bottom: 1rem; }

.oil-list-empty {
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 0.75rem 0;
  font-style: italic;
}

.oil-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  gap: 0.5rem;
  flex-wrap: wrap;
}
.oil-row:last-child { border-bottom: none; }

.oil-name {
  font-size: 0.9rem;
  font-weight: 500;
  flex: 1;
  min-width: 140px;
}

.oil-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.oil-weight-input {
  width: 75px;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: var(--font);
  text-align: right;
  outline: none;
}
.oil-weight-input:focus { border-color: var(--green-mid); }

.oil-unit {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 16px;
}

.oil-pct {
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 40px;
  text-align: right;
}

.btn-remove-oil {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  transition: background var(--transition), color var(--transition);
}
.btn-remove-oil:hover { background: #fee2e2; color: var(--red); border-color: #fca5a5; }

/* ── Two-column Layout (desktop) ──────────────────── */
.lye-layout {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .lye-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* ── Results ──────────────────────────────────────── */
.results-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
}
.results-empty-icon { margin: 0 auto 0.75rem; }

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.result-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  text-align: center;
}
.result-card.result-primary {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: #fff;
}
.result-card.result-primary .result-label { color: rgba(255,255,255,.8); }
.result-card.result-wide { grid-column: 1 / -1; }
.result-card.result-good { border-color: var(--green-mid); background: #f0fdf4; }
.result-card.result-bad { border-color: var(--red); background: #fef2f2; }

.result-value {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.result-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Fatty Acid Chart */
.fatty-chart { margin-bottom: 1rem; }

.fatty-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.fatty-label {
  font-size: 0.78rem;
  min-width: 80px;
  color: var(--text-muted);
}
.fatty-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--green-pale);
  border-radius: 4px;
  overflow: hidden;
}
.fatty-bar {
  height: 100%;
  background: var(--green-mid);
  border-radius: 4px;
  transition: width 0.4s ease;
  min-width: 2px;
}
.fatty-value {
  font-size: 0.78rem;
  min-width: 38px;
  text-align: right;
  font-weight: 500;
}

/* Quality Ratings */
.ratings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.rating-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
}
.rating-card.rating-good { border-left: 3px solid var(--green-mid); }
.rating-card.rating-low  { border-left: 3px solid var(--amber); }
.rating-card.rating-high { border-left: 3px solid var(--blue); }
.rating-card.rating-info { border-left: 3px solid var(--green-light); }

.rating-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}
.rating-bar-wrap {
  height: 6px;
  background: var(--green-pale);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}
.rating-bar {
  height: 100%;
  background: var(--green-mid);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.rating-good .rating-bar  { background: var(--green-mid); }
.rating-low  .rating-bar  { background: var(--amber); }
.rating-high .rating-bar  { background: var(--blue); }

.rating-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rating-value { font-size: 1rem; font-weight: 700; }
.rating-value-large { font-size: 1.4rem; font-weight: 700; margin: 0.25rem 0; }

.rating-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rating-badge.rating-good { background: #dcfce7; color: #166534; }
.rating-badge.rating-low  { background: #fef3c7; color: #92400e; }
.rating-badge.rating-high { background: #dbeafe; color: #1e3a8a; }

.rating-ideal { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.2rem; }

/* Results actions */
.results-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: var(--green-dark);
  color: #fff;
  border-color: var(--green-dark);
}
.btn-primary:hover { background: var(--green-mid); border-color: var(--green-mid); }

.btn-secondary {
  background: var(--green-pale);
  color: var(--green-dark);
  border-color: var(--green-light);
}
.btn-secondary:hover { background: #b7e4c7; }

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-outline:hover { background: var(--bg); color: var(--text); }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }

#add-oil-btn {
  padding: 0.55rem 1rem;
  background: var(--green-dark);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  transition: background var(--transition);
}
#add-oil-btn:hover { background: var(--green-mid); }

/* ── Cost & Batch Calc Shared ─────────────────────── */
.calc-layout {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 900px) {
  .calc-layout { grid-template-columns: 1fr 1fr; align-items: start; }
}

.calc-inputs { display: flex; flex-direction: column; gap: 0.1rem; }
.calc-results { }

.cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
  flex-wrap: wrap;
}
.cost-row label {
  font-size: 0.875rem;
  color: var(--text);
  flex: 1;
  min-width: 140px;
}
.cost-row input[type="number"],
.cost-row input[type="text"] {
  width: 120px;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: var(--font);
  outline: none;
  text-align: right;
}
.cost-row input[type="text"] { text-align: left; }
.cost-row input:focus { border-color: var(--green-mid); box-shadow: 0 0 0 2px rgba(64,145,108,.15); }

.cost-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}
.cost-prefix, .cost-suffix {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.cost-input-wrap input {
  width: 90px;
  text-align: right;
}

.btn-remove-addon {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.btn-remove-addon:hover { background: #fee2e2; color: var(--red); }

.cost-tip {
  background: #fefce8;
  border: 1px solid #fde047;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

.hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0.25rem 0;
  line-height: 1.5;
}

.addon-name { width: 120px !important; text-align: left !important; flex: 1; }

/* Batch scaler */
.batch-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.scale-factor {
  background: var(--green-pale);
  color: var(--green-dark);
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 0.5rem;
}
.batch-scaled-list { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.batch-scaled-list .cost-row {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.batch-scaled-list .cost-row:last-child { border-bottom: none; }

/* Fragrance slider */
.frag-slider-wrap { margin: 0.5rem 0 0.25rem; }
.frag-slider { width: 100%; }
.frag-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* ── Content Sections (below tools) ───────────────── */
.content-section {
  margin-top: 3rem;
}
.content-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--green-pale);
}
.content-section p {
  margin-bottom: 1rem;
  color: #374151;
  line-height: 1.75;
}

/* How-to steps */
.how-to-steps {
  counter-reset: step;
  display: grid;
  gap: 0.75rem;
}
.step-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}
.step-num {
  counter-increment: step;
  width: 28px;
  height: 28px;
  min-width: 28px;
  background: var(--green-dark);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}
.step-num::before { content: counter(step); }
.step-text { font-size: 0.9rem; line-height: 1.6; }

/* Oils table */
.oils-table-wrap { overflow-x: auto; margin-top: 1rem; }
.oils-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.oils-table th {
  background: var(--green-dark);
  color: #fff;
  padding: 0.6rem 0.8rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  white-space: nowrap;
}
.oils-table td {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--border);
}
.oils-table tr:nth-child(even) td { background: var(--bg); }
.oils-table tr:hover td { background: var(--green-pale); }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 0; }
.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-item:first-child { border-top: 1px solid var(--border); }

.faq-question {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 1rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-family: var(--font);
  color: var(--text);
  line-height: 1.4;
}
.faq-question:hover { color: var(--green-dark); }
.faq-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  transition: transform var(--transition);
  color: var(--text-muted);
}
.faq-item.open .faq-chevron { transform: rotate(180deg); }

.faq-answer {
  display: none;
  padding: 0 0 1rem;
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.75;
}
.faq-item.open .faq-answer { display: block; }

/* ── Footer ───────────────────────────────────────── */
.site-footer {
  background: #1a1a1a;
  color: rgba(255,255,255,.65);
  padding: 2rem 0;
  margin-top: 4rem;
  font-size: 0.85rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.footer-inner a { color: var(--green-light); text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; }
.footer-disclaimer {
  font-size: 0.75rem;
  color: rgba(255,255,255,.4);
  margin-top: 1rem;
  line-height: 1.6;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 600px) {
  .results-grid { grid-template-columns: 1fr 1fr; }
  .ratings-grid { grid-template-columns: 1fr 1fr; }
  .result-card.result-wide { grid-column: 1 / -1; }

  .hero { padding: 1.5rem 0 1.25rem; }

  .tool-section { padding: 1rem; }

  .cost-row label { min-width: 100px; }
  .cost-row input[type="number"],
  .cost-row input[type="text"] { width: 100px; }
}

@media (max-width: 400px) {
  .results-grid { grid-template-columns: 1fr; }
  .ratings-grid { grid-template-columns: 1fr; }
}

/* ── Print ────────────────────────────────────────── */
@media print {
  .site-header, #tab-nav, .results-actions { display: none !important; }
  .tool-section { box-shadow: none; border: 1px solid var(--border); }
}

/* ── Accessibility ────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--green-mid);
  outline-offset: 2px;
}

/* ── SVG Icon System ──────────────────────────────── */
/* Base rule "img, svg { display: block }" is too broad — override for inline icons */
svg.btn-icon,
svg.tool-icon,
svg.logo-icon { display: inline-block; max-width: none; }

.btn-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  vertical-align: -2px;
  color: currentColor;
}

.tool-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: currentColor;
}

.logo-icon {
  width: 20px;
  height: 20px;
  color: #fff;
}

/* Results empty state: was emoji, now SVG */
.results-empty-icon {
  font-size: 0;            /* hide if still an emoji fallback */
  width: 48px;
  height: 48px;
  margin: 0 auto 0.75rem;
  color: var(--green-light);
  display: block;
}

/* ── Screen-reader only ───────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── How-to steps (ol > li, no .step-num span) ────── */
ol.how-to-steps {
  list-style: none;
  padding-left: 0;
  counter-reset: step;
}

ol.how-to-steps > .step-item {
  counter-increment: step;
}

ol.how-to-steps > .step-item::before {
  content: counter(step);
  min-width: 28px;
  width: 28px;
  height: 28px;
  background: var(--green-dark);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.step-content {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ── Abbreviation styles ──────────────────────────── */
abbr[title] {
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  cursor: help;
}

/* ── Saponification formula block ─────────────────── */
.formula-block {
  background: var(--green-pale);
  border-left: 3px solid var(--green-mid);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.75rem 1rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.875rem;
  color: var(--green-dark);
  margin: 1rem 0;
  overflow-x: auto;
}

/* ── Oil table rating cells ───────────────────────── */
.rating-cell {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  white-space: nowrap;
}
.rating-cell.rating-5,
.rating-cell.rating-4 { background: #dcfce7; color: #166534; }
.rating-cell.rating-3  { background: #fef3c7; color: #92400e; }
.rating-cell.rating-2,
.rating-cell.rating-1  { background: #fee2e2; color: #991b1b; }

/* ── FAQ: dl/dt/dd reset ──────────────────────────── */
.faq-list {
  display: flex;
  flex-direction: column;
}
.faq-list dt,
.faq-list dd { margin: 0; padding: 0; }

/* ── Saved Recipes Bar ────────────────────────────── */
#saved-recipes-bar {
  padding: 0.5rem 0 0.25rem;
}
.recipes-bar-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}
.recipes-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.recipe-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: var(--green-pale);
  border: 1px solid var(--green-light);
  border-radius: 20px;
  padding: 0.2rem 0.15rem 0.2rem 0.65rem;
  font-size: 0.78rem;
  white-space: nowrap;
  max-width: 200px;
}
.recipe-chip-load {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--green-dark);
  font-weight: 500;
  font-family: var(--font);
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 130px;
}
.recipe-chip-load:hover { text-decoration: underline; }
.recipe-chip-del {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 0.1rem 0.3rem;
  border-radius: 20px;
  line-height: 1;
  flex-shrink: 0;
}
.recipe-chip-del:hover { background: #fee2e2; color: var(--red); }

/* ── Preset Starter Recipes Panel ────────────────── */
.presets-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.presets-summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--green-dark);
  cursor: pointer;
  background: var(--green-pale);
  list-style: none;
  user-select: none;
}
.presets-summary::-webkit-details-marker { display: none; }
.presets-chevron {
  margin-left: auto;
  transition: transform var(--transition);
}
details[open] .presets-chevron { transform: rotate(180deg); }

.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--surface);
}

.preset-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font);
  text-align: left;
  transition: border-color var(--transition), background var(--transition);
}
.preset-card:hover { border-color: var(--green-mid); background: var(--green-pale); }

.preset-name {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--green-dark);
}
.preset-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.preset-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  background: var(--green-pale);
  color: var(--green-dark);
  border-radius: 20px;
  margin-top: 0.15rem;
}

/* ── Safety Checklist ─────────────────────────────── */
.safety-checklist {
  border: 1px solid #fde047;
  border-radius: var(--radius-sm);
  background: #fefce8;
  margin-top: 1rem;
  overflow: hidden;
}
.safety-checklist summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #92400e;
  cursor: pointer;
  list-style: none;
}
.safety-checklist summary::-webkit-details-marker { display: none; }
.safety-list {
  margin: 0;
  padding: 0 0.85rem 0.85rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.safety-list li {
  font-size: 0.83rem;
  color: #78350f;
  line-height: 1.5;
}

/* ── Recipe Save Modal ────────────────────────────── */
.recipe-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.recipe-modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  padding: 1.5rem;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.recipe-modal h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green-dark);
  margin: 0;
}
.modal-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.modal-hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.modal-label input,
.modal-label textarea {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: var(--font);
  outline: none;
  resize: vertical;
}
.modal-label input:focus,
.modal-label textarea:focus { border-color: var(--green-mid); box-shadow: 0 0 0 2px rgba(64,145,108,.15); }
.recipe-modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* ── Candle Calculator ───────────────────────────── */
.candle-layout {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 900px) {
  .candle-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}
.candle-inputs,
.candle-results { display: flex; flex-direction: column; gap: 1rem; }

.wax-type-group { flex-wrap: wrap; }
.wax-type-btn {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.wax-type-btn.active,
.wax-type-btn:hover { background: var(--green-pale); border-color: var(--green-mid); }

.unit-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.unit-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.warning-text {
  color: var(--amber);
  font-size: 0.82rem;
  margin-top: 0.3rem;
}

.scent-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}
.scent-name {
  flex: 1;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: var(--font);
  outline: none;
}
.scent-name:focus { border-color: var(--green-mid); }
.scent-pct {
  width: 4rem;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  text-align: right;
  outline: none;
  font-family: var(--font);
}
.scent-pct:focus { border-color: var(--green-mid); }
.scent-pct-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.scent-remove {
  padding: 0.25rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
}
.scent-remove:hover { color: var(--red); background: #fef2f2; }

.candle-scent-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}
.candle-scent-table th,
.candle-scent-table td {
  padding: 0.4rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.candle-scent-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sub-heading {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--green-dark);
  margin: 0;
}

.cost-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.6rem;
}
.cost-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}
.cost-input {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  width: 100%;
}
.cost-input:focus { border-color: var(--green-mid); }

.wick-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.wick-table th,
.wick-table td {
  padding: 0.4rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.wick-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

/* ── Mold Calculator ─────────────────────────────── */
.mold-layout {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 900px) {
  .mold-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}
.mold-inputs,
.mold-results { display: flex; flex-direction: column; gap: 1rem; }

.shape-btn {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.shape-btn.active,
.shape-btn:hover { background: var(--green-pale); border-color: var(--green-mid); }

.mold-unit-btn {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.mold-unit-btn.active,
.mold-unit-btn:hover { background: var(--green-pale); border-color: var(--green-mid); }

.mold-dim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.dim-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
}
.number-input {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  width: 100%;
}
.number-input:focus { border-color: var(--green-mid); }

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  cursor: pointer;
}
.bar-count-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.35rem; }

/* Shared result cards */
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.result-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.stat-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.stat-box.stat-highlight { border-color: var(--green-mid); background: var(--green-pale); }
.stat-box.stat-positive  { border-color: var(--green-mid); background: #f0fdf4; }
.stat-box.stat-negative  { border-color: #fca5a5; background: #fef2f2; }
.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--green-dark);
}
.stat-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Candle scents content section */
.candle-scents-list {
  margin: 0.5rem 0 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
}
.candle-scents-list li { padding-left: 0.25rem; }
