/**
 * ============================================================================
 * FILE: /pizza/css/pizza.css
 * Pizza Dough Calculator - Retro Pizzeria Styles (v5)
 * ============================================================================
 * Mobile-first, retro Pizza Hut / old-school pizzeria aesthetic.
 * Palette: deep red, warm cream, brown, gold accents.
 * v5: Retains v3 retro appearance + adds v4 settings modal,
 *     scale graduation snap notes, hydration profiles.
 * Includes print stylesheet at the bottom.
 * ============================================================================
 */

/* ---- Google Fonts loaded in HTML ---- */
/* Bungee Shade (display), Playfair Display (headings), Source Sans 3 (body) */

/* ==== CSS Custom Properties ==== */
:root {
  /* Core palette - retro pizzeria */
  --red-deep:     #8B1A1A;
  --red-bright:   #C41E3A;
  --red-light:    #E8534A;
  --cream:        #FFF8F0;
  --cream-dark:   #F5E6D3;
  --brown-dark:   #3E2723;
  --brown-mid:    #5D4037;
  --brown-warm:   #8D6E63;
  --gold:         #D4A843;
  --gold-light:   #F0D68A;
  --green-olive:  #6B7B3A;
  --white:        #FFFFFF;

  /* Functional */
  --text-primary:    var(--brown-dark);
  --text-secondary:  var(--brown-mid);
  --bg-page:         var(--cream);
  --bg-card:         var(--white);
  --bg-accent:       var(--cream-dark);
  --border-subtle:   #E0D5C7;
  --shadow-soft:     0 2px 8px rgba(62,39,35,0.10);
  --shadow-medium:   0 4px 16px rgba(62,39,35,0.15);
  --radius:          8px;
  --radius-lg:       12px;

  /* Typography scale */
  --font-display: 'Bungee Shade', 'Impact', sans-serif;
  --font-heading: 'Playfair Display', 'Georgia', serif;
  --font-body:    'Source Sans 3', 'Segoe UI', sans-serif;
}

/* ==== Reset & Base ==== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-page);
  line-height: 1.6;
  min-height: 100vh;
}

/* ==== Checkered Header Bar ==== */
.header-bar {
  background: var(--red-deep);
  padding: 0;
  position: relative;
  overflow: hidden;
}

.header-bar::before {
  content: '';
  display: block;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    var(--red-bright) 0px, var(--red-bright) 16px,
    var(--gold) 16px, var(--gold) 32px
  );
}

.header-content {
  padding: 1.25rem 1rem 1rem;
  text-align: center;
  position: relative;
}

.header-content h1 {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 5vw, 2.2rem);
  color: var(--gold-light);
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin-bottom: 0.15rem;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.header-content .subtitle {
  font-family: var(--font-heading);
  font-style: italic;
  color: var(--cream-dark);
  font-size: 0.95rem;
  opacity: 0.9;
}

.header-bar::after {
  content: '';
  display: block;
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    var(--white) 0px, var(--white) 8px,
    var(--red-deep) 8px, var(--red-deep) 16px
  );
}

/* Back link */
.back-link {
  position: absolute;
  top: 1.25rem;
  left: 1rem;
  color: var(--cream-dark);
  text-decoration: none;
  font-size: 0.85rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.back-link:hover { opacity: 1; }

/* ==== Main Container ==== */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

/* ==== Input Card ==== */
.input-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-medium);
  padding: 1.5rem;
  margin-top: 1.25rem;
  border: 2px solid var(--border-subtle);
  position: relative;
}

.input-card::before {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px;
  height: 4px;
  background: linear-gradient(90deg, var(--red-deep), var(--red-bright), var(--gold));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.input-group {
  margin-bottom: 1.5rem;
}
.input-group:last-child { margin-bottom: 0; }

.input-group label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.input-group .input-hint {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 0.15rem;
}

/* Number input */
.weight-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1.25rem;
  font-family: var(--font-body);
  font-weight: 600;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--text-primary);
  text-align: center;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
}
.weight-input::-webkit-inner-spin-button,
.weight-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.weight-input:focus {
  outline: none;
  border-color: var(--red-bright);
  box-shadow: 0 0 0 3px rgba(196,30,58,0.15);
}
.input-suffix {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-left: 0.5rem;
}

/* Slider + number combo */
.slider-combo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.slider-combo input[type="range"] {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, var(--cream-dark), var(--brown-warm));
  border-radius: 3px;
  outline: none;
}
.slider-combo input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--red-bright);
  border: 3px solid var(--white);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}
.slider-combo input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--red-bright);
  border: 3px solid var(--white);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}
.ww-number-input {
  width: 60px;
  padding: 0.4rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--cream);
  font-family: var(--font-body);
}
.ww-number-input:focus {
  outline: none;
  border-color: var(--red-bright);
}
.ww-display-badge {
  background: var(--red-deep);
  color: var(--gold-light);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 50px;
  text-align: center;
}

/* Fermentation radio group */
.radio-group {
  display: flex;
  gap: 0.5rem;
}
.radio-option {
  flex: 1;
  position: relative;
}
.radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.radio-option .radio-label {
  display: block;
  padding: 0.65rem 0.5rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--cream);
  transition: all 0.2s;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.radio-option input:checked + .radio-label {
  background: var(--red-deep);
  color: var(--gold-light);
  border-color: var(--red-deep);
}
.radio-option .radio-label:active {
  transform: scale(0.98);
}

/* ==== Error Messages ==== */
#error-msg {
  display: none;
  background: #FFF0F0;
  border: 2px solid var(--red-light);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  color: var(--red-deep);
  font-weight: 600;
  font-size: 0.9rem;
}
#error-msg.visible { display: block; }
#error-msg p { margin-bottom: 0.25rem; }
#error-msg p:last-child { margin-bottom: 0; }

/* ==== Results ==== */
#results {
  margin-top: 1.25rem;
}

.recipe-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-subtle);
}

.tangzhong-section {
  border-left: 4px solid var(--gold);
}
.main-dough-section {
  border-left: 4px solid var(--red-bright);
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--red-deep);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.section-icon { font-size: 1.2rem; }
.section-sub {
  font-size: 0.8rem;
  font-weight: 400;
  font-style: italic;
  color: var(--text-secondary);
  margin-left: 0.25rem;
}

.section-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed var(--border-subtle);
}

.group-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brown-warm);
  margin: 1rem 0 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}
.group-title:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* Ingredient rows */
.ingredient-list {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.ingredient-row {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.4rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  min-height: 44px;
  gap: 0.5rem;
}
.ingredient-row:hover { background: var(--cream); }
.ingredient-row:has(.ingredient-check:checked) {
  opacity: 0.45;
  text-decoration: line-through;
}

.ingredient-check {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--red-bright);
  cursor: pointer;
}

.ingredient-name {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
}

.ingredient-amount {
  text-align: right;
  white-space: nowrap;
}
.ingredient-amount strong {
  font-size: 1.1rem;
  color: var(--red-deep);
}
.gram-hint {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.volume-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--green-olive);
  font-style: italic;
}

/* Hydration badge under WW slider */
.hydration-badge-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.hydration-badge {
  background: var(--brown-dark);
  color: var(--gold-light);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-body);
}
.hydration-hint {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Hydration description (v5 — below badge) */
.hydration-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  font-style: italic;
  line-height: 1.4;
}

/* Totals bar */
.recipe-totals-wrap {
  margin-bottom: 1rem;
}
.recipe-totals {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--red-deep);
  color: var(--gold-light);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius) var(--radius) 0 0;
  font-family: var(--font-heading);
}
.total-label { font-size: 1rem; }
.total-value { font-size: 1.3rem; font-weight: 700; }

.recipe-subtotals {
  display: flex;
  justify-content: space-around;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--cream-dark);
  border-radius: 0 0 var(--radius) var(--radius);
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

/* Scale graduation snap notes (v5) */
.snap-info {
  border-radius: 0 0 var(--radius) var(--radius);
  margin-top: 0;
  font-size: 0.78rem;
  font-style: italic;
  opacity: 0.85;
}
.snap-note {
  font-weight: 400;
}

.group-hint {
  font-weight: 400;
  font-size: 0.75rem;
  font-style: italic;
  color: var(--brown-warm);
}

/* ==== Collapsible Sections ==== */
.collapsible-wrap {
  margin-top: 0.75rem;
}

.collapse-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: background 0.15s;
  min-height: 44px;
}
.collapse-toggle:hover { background: var(--cream-dark); }
.collapse-toggle::after {
  content: '▸';
  transition: transform 0.2s;
  font-size: 0.85rem;
}
.collapse-toggle[aria-expanded="true"]::after { transform: rotate(90deg); }

.collapsible-body {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 1rem;
}
.collapsible-body.open { display: block; }

/* Baker's % table */
.bakers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.bakers-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.bakers-table td:last-child {
  text-align: right;
  font-weight: 600;
  color: var(--red-deep);
}
.bakers-table .total-row td {
  border-top: 2px solid var(--brown-dark);
  font-weight: 700;
  font-size: 1rem;
}
.bakers-table .sub-row td {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
  border-bottom-style: dashed;
}

/* Pan guide buttons */
#pan-guide-body {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 0.75rem;
}
#pan-guide-body.open { display: grid; }
#pan-guide-body {
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.pan-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.5rem;
  background: var(--cream);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  min-height: 56px;
  font-family: var(--font-body);
}
.pan-btn:hover {
  border-color: var(--red-bright);
  background: var(--cream-dark);
}
.pan-btn:active {
  transform: scale(0.97);
}
.pan-name {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
}
.pan-grams {
  font-size: 1rem;
  font-weight: 700;
  color: var(--red-deep);
}

/* ==== Procedure ==== */
#procedure {
  margin-top: 1.5rem;
}

.procedure-day {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--red-deep);
  padding: 0.5rem 0;
  margin: 1.25rem 0 0.75rem;
  border-bottom: 2px solid var(--gold);
}
.procedure-day:first-child { margin-top: 0; }

.procedure-step {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.step-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.step-number {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--red-deep);
  color: var(--gold-light);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.step-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--brown-dark);
}

.step-text {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-left: 2.4rem;
}
.step-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Storage note */
.storage-note {
  background: linear-gradient(135deg, #E8F4F8, #F0F7FA);
  border: 2px solid #A8D4E0;
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  margin-top: 1rem;
}
.storage-note h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: #2E6B7A;
  margin-bottom: 0.4rem;
}
.storage-note p {
  font-size: 0.88rem;
  color: #3A6B76;
  line-height: 1.6;
}
.storage-note strong { color: #1E5060; }

/* ==== Print Button ==== */
.print-bar {
  text-align: center;
  margin-top: 1.5rem;
  padding-bottom: 2rem;
}
.print-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  background: var(--brown-dark);
  color: var(--cream);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s;
  min-height: 44px;
}
.print-btn:hover { background: var(--brown-mid); }

/* ==== Footer ==== */
.site-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
}
.site-footer a {
  color: var(--red-deep);
  text-decoration: none;
}

/* Totals grams (secondary) */
.total-grams {
  font-size: 0.85rem;
  font-weight: 400;
  opacity: 0.8;
}

/* ==== Toolbar ==== */
.toolbar {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  justify-content: flex-end;
}
.toolbar-btn {
  padding: 0.5rem 0.85rem;
  font-size: 0.8rem;
  font-family: var(--font-body);
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  min-height: 38px;
  white-space: nowrap;
}
.toolbar-btn:hover { background: var(--cream-dark); }
.toolbar-btn.active {
  background: var(--green-olive);
  color: var(--white);
  border-color: var(--green-olive);
}

/* ==== Font Size Classes ==== */
body.font-normal  { font-size: 16px; }
body.font-large   { font-size: 19px; }
body.font-x-large { font-size: 22px; }

/* Scale ingredient amounts with font size */
body.font-large .ingredient-amount strong   { font-size: 1.3rem; }
body.font-x-large .ingredient-amount strong { font-size: 1.5rem; }

body.font-large .step-text   { font-size: 1rem; }
body.font-x-large .step-text { font-size: 1.1rem; }

body.font-large .total-value   { font-size: 1.5rem; }
body.font-x-large .total-value { font-size: 1.7rem; }

/* ==== Settings Modal (v5) ==== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open {
  display: flex;
}
.modal-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 460px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-medium);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--brown-dark);
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
  padding: 0 0.25rem;
}
.modal-close:hover { color: var(--red-deep); }
.modal-body {
  padding: 1.25rem;
}
.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  text-align: right;
}
.modal-save {
  padding: 0.55rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--red-deep);
  color: var(--gold-light);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}
.modal-save:hover { background: var(--red-bright); }

.settings-group {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}
.settings-group legend {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--brown-dark);
  padding: 0 0.35rem;
}
.settings-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0.35rem 0 0.75rem;
  line-height: 1.4;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.settings-row label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
}
.settings-row input {
  width: 90px;
  padding: 0.4rem 0.5rem;
  font-size: 0.95rem;
  font-family: var(--font-body);
  font-weight: 700;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius);
  text-align: center;
  color: var(--brown-dark);
  background: var(--cream);
}
.settings-row input:focus {
  outline: none;
  border-color: var(--red-bright);
  box-shadow: 0 0 0 3px rgba(196,30,58,0.15);
}
.settings-radio-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.settings-radio-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}
.settings-radio-label input[type="radio"] {
  accent-color: var(--red-bright);
  margin: 0;
}
.settings-radio-note {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.settings-note {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  line-height: 1.4;
  font-style: italic;
}
.profile-select {
  width: 100%;
  padding: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--brown-dark);
  cursor: pointer;
}
.profile-select:focus {
  outline: none;
  border-color: var(--red-bright);
}
.profile-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  font-style: italic;
  min-height: 1.2em;
}

/* ==== Responsive ==== */
@media (max-width: 400px) {
  .header-content h1 { font-size: 1.2rem; }
  .input-card { padding: 1rem; }
  .recipe-section { padding: 1rem; }
  .step-text { margin-left: 0; margin-top: 0.4rem; }
  #pan-guide-body { grid-template-columns: 1fr; }
  .radio-option .radio-label { font-size: 0.78rem; padding: 0.5rem 0.3rem; }
  .settings-row { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
  .settings-row input { width: 100%; }
  .settings-radio-group { flex-direction: column; gap: 0.5rem; }
}

/* ==== Print Stylesheet ==== */
@media print {
  body {
    background: white;
    color: black;
    font-size: 11pt;
  }
  .header-bar { background: white !important; }
  .header-bar::before, .header-bar::after { display: none; }
  .header-content h1 {
    color: black;
    text-shadow: none;
    font-family: Georgia, serif;
  }
  .header-content .subtitle { color: #555; }
  .back-link,
  .print-bar,
  .collapsible-wrap,
  .site-footer,
  .input-card,
  .toolbar { display: none !important; }
  .modal-overlay { display: none !important; }

  .recipe-section {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
  .ingredient-check { display: none; }
  .ingredient-row { padding: 0.2rem 0; min-height: auto; }
  .ingredient-amount strong { color: black; }
  .recipe-totals { background: #333; }
  .procedure-step { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .step-number { background: #333; }
  .storage-note { background: #f5f5f5; border-color: #ccc; }
}
