/* ============================================================
   PIZZA LAB — styles.css
   Mobile-first, iOS-optimised, dark/light theme
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,600;0,700;0,800;1,600&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Custom Properties ── */
:root {
  /* Dark theme (default) */
  --bg-primary: #0F0F1A;
  --bg-secondary: #1A1A2E;
  --bg-card: #1E1E32;
  --bg-card-hover: #252540;
  --bg-input: #12121F;
  --bg-modal: #1A1A2E;

  --text-primary: #F0EBE0;
  --text-secondary: #A09880;
  --text-muted: #5A5570;
  --text-inverse: #0F0F1A;

  --accent-orange: #E85D26;
  --accent-orange-light: #F4793D;
  --accent-gold: #F4A261;
  --accent-gold-light: #F7B985;
  --accent-green: #52B788;
  --accent-red: #E63946;
  --accent-blue: #4361EE;

  --border-color: rgba(255,255,255,0.08);
  --border-color-strong: rgba(255,255,255,0.15);
  --divider: rgba(255,255,255,0.05);

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);
  --shadow-accent: 0 4px 20px rgba(232,93,38,0.25);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --nav-height: 80px;
  --header-height: 60px;
  --safe-bottom: env(safe-area-inset-bottom, 20px);
  --safe-top: env(safe-area-inset-top, 0px);

  --transition: 200ms ease;
  --transition-slow: 400ms ease;
}

/* Light theme */
[data-theme="light"] {
  --bg-primary: #F8F4EE;
  --bg-secondary: #EDE8E0;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F5F0E8;
  --bg-input: #F0EBE0;
  --bg-modal: #FFFFFF;

  --text-primary: #1A1412;
  --text-secondary: #6B5D50;
  --text-muted: #A09080;
  --text-inverse: #FFFFFF;

  --border-color: rgba(0,0,0,0.08);
  --border-color-strong: rgba(0,0,0,0.15);
  --divider: rgba(0,0,0,0.05);

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.15);
  --shadow-accent: 0 4px 20px rgba(232,93,38,0.2);
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: -webkit-fill-available;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom));
  padding-top: var(--safe-top);
}

/* ── Typography ── */
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; }
h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); font-weight: 700; }
h2 { font-size: clamp(1.2rem, 4vw, 1.6rem); font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { color: var(--text-secondary); }

/* ── App Shell ── */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

/* ── Top Header ── */
.app-header {
  position: sticky;
  top: var(--safe-top);
  z-index: 100;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
}

.header-back-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-primary);
  flex-shrink: 0;
  transition: all var(--transition);
}
.header-back-btn:active { transform: scale(0.92); background: var(--bg-card-hover); }

.header-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.header-action-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--text-secondary);
  transition: color var(--transition);
}
.header-action-btn:active { color: var(--accent-orange); }

/* ── Bottom Navigation ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 200;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  padding: 8px 0 calc(8px + var(--safe-bottom));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
}

.nav-item.active { color: var(--accent-orange); }
.nav-item:active { transform: scale(0.93); }

.nav-icon {
  font-size: 22px;
  line-height: 1;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.nav-dot {
  position: absolute;
  top: 4px;
  right: 50%;
  transform: translateX(12px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-orange);
  display: none;
}
.nav-item.has-badge .nav-dot { display: block; }

/* ── Screen Container ── */
.screen {
  display: none;
  animation: fadeIn 250ms ease;
}
.screen.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Home Screen ── */
.home-hero {
  padding: 28px 20px 16px;
  position: relative;
  overflow: hidden;
}

.home-hero::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(232,93,38,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-orange);
  margin-bottom: 6px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 2.8rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.hero-title span {
  color: var(--accent-orange);
  font-style: italic;
}

.hero-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ── Module Cards Grid ── */
.module-grid {
  padding: 8px 20px 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.module-card:active {
  transform: scale(0.96);
  background: var(--bg-card-hover);
}

.module-card.featured {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  background: linear-gradient(135deg, #E85D26 0%, #C44A1A 100%);
  border-color: transparent;
  color: white;
}

.module-card.featured .card-icon { font-size: 36px; }
.module-card.featured .card-title { color: white; font-size: 1.2rem; }
.module-card.featured .card-desc { color: rgba(255,255,255,0.75); }

.module-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 60px;
  background: radial-gradient(circle at top right, rgba(244,162,97,0.12) 0%, transparent 70%);
}

.card-icon { font-size: 28px; }

.card-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--accent-orange);
  color: white;
  align-self: flex-start;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.card-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ── Preset Strip ── */
.preset-strip {
  padding: 4px 20px 24px;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.preset-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.preset-scroll::-webkit-scrollbar { display: none; }

.preset-chip {
  flex-shrink: 0;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.preset-chip:active,
.preset-chip.active {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: white;
}

/* ── Scroll Content ── */
.screen-content {
  padding: 0 20px 20px;
}

/* ── Form Sections ── */
.form-section {
  margin-bottom: 24px;
}

.form-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.form-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.form-section-action {
  font-size: 0.8rem;
  color: var(--accent-orange);
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

/* ── Input Groups ── */
.input-group {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.input-row {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 12px;
  border-bottom: 1px solid var(--divider);
  transition: background var(--transition);
}
.input-row:last-child { border-bottom: none; }
.input-row:focus-within { background: var(--bg-card-hover); }

.input-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  pointer-events: none;
}

.input-sublabel {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.input-field {
  background: var(--bg-input);
  border: 1px solid var(--border-color-strong);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  width: 90px;
  outline: none;
  transition: border-color var(--transition);
  -webkit-appearance: none;
}
.input-field:focus { border-color: var(--accent-orange); }
.input-field.wide { width: 140px; }
.input-field.small { width: 70px; }

.input-unit {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 24px;
}

/* ── Segment Control ── */
.segment-control {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.segment-btn {
  flex: 1;
  padding: 8px 4px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.segment-btn.active {
  background: var(--accent-orange);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* ── Slider Input ── */
.slider-row {
  padding: 16px 16px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.slider-title { font-size: 0.9rem; font-weight: 500; color: var(--text-primary); }

.slider-value {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-orange);
}

input[type="range"] {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border-color-strong);
  border-radius: 4px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-orange);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(232,93,38,0.4);
  border: 3px solid white;
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-orange);
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(232,93,38,0.4);
}

.slider-track-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}
.slider-track-labels span { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; }

/* ── Toggle Switch ── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}

.toggle {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}
.toggle input { display: none; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--bg-input);
  border-radius: 13px;
  border: 1px solid var(--border-color-strong);
  cursor: pointer;
  transition: background var(--transition);
}
.toggle input:checked ~ .toggle-track { background: var(--accent-green); border-color: var(--accent-green); }
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
  pointer-events: none;
}
.toggle input:checked ~ .toggle-track .toggle-thumb { transform: translateX(18px); }

/* ── Flour Builder ── */
.flour-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  position: relative;
}

.flour-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.flour-type-badge {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.flour-remove-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
}
.flour-remove-btn:active { background: rgba(230,57,70,0.1); color: var(--accent-red); }

.flour-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}

.flour-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.flour-input-label { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.flour-input-divider { font-size: 0.8rem; color: var(--text-muted); text-align: center; margin-top: 14px; }

.add-flour-btn {
  width: 100%;
  padding: 13px;
  background: transparent;
  border: 1px dashed var(--border-color-strong);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-orange);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition);
}
.add-flour-btn:active { background: rgba(232,93,38,0.06); border-style: solid; }

/* ── Insight Cards ── */
.insight-card {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid;
}

.insight-card.info {
  background: rgba(67,97,238,0.08);
  border-color: rgba(67,97,238,0.2);
}
.insight-card.warning {
  background: rgba(244,162,97,0.1);
  border-color: rgba(244,162,97,0.25);
}
.insight-card.success {
  background: rgba(82,183,136,0.08);
  border-color: rgba(82,183,136,0.2);
}
.insight-card.danger {
  background: rgba(230,57,70,0.08);
  border-color: rgba(230,57,70,0.2);
}

.insight-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.insight-text { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; }
.insight-text strong { color: var(--text-primary); }

/* ── Result Card ── */
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}

.result-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--accent-orange) 0%, #C44A1A 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.result-header-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: white;
  font-weight: 700;
}

.result-header-sub { font-size: 0.8rem; color: rgba(255,255,255,0.75); }

.result-body { padding: 16px 20px; }

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--divider);
}
.result-row:last-child { border-bottom: none; }

.result-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.result-value {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.result-value.highlight { color: var(--accent-orange); }
.result-value.small { font-size: 0.85rem; font-family: var(--font-body); }

.result-baker-pct {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 6px;
}

/* ── Baker % Grid ── */
.baker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.baker-cell {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}

.baker-cell-value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-orange);
  display: block;
}

.baker-cell-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 3px;
}

/* ── Fermentation Timeline ── */
.timeline {
  padding: 4px 0;
}

.timeline-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 20px;
  position: relative;
}

.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 36px;
  width: 2px;
  height: calc(100% - 16px);
  background: var(--divider);
}

.timeline-dot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 36px;
}

.timeline-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-color-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.timeline-dot.active {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 4px rgba(232,93,38,0.15);
}

.timeline-content { flex: 1; padding-top: 4px; }

.timeline-time {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-orange);
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.timeline-step {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.timeline-note {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Warning Banner ── */
.warning-banner {
  background: rgba(230,57,70,0.1);
  border: 1px solid rgba(230,57,70,0.3);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.warning-banner .icon { font-size: 18px; flex-shrink: 0; }
.warning-banner .text { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; }
.warning-banner .text strong { color: var(--accent-red); }

/* ── Calculate Button ── */
.calc-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--accent-orange) 0%, #C44A1A 100%);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition);
  letter-spacing: 0.02em;
}
.calc-btn:active { transform: scale(0.97); box-shadow: none; }

.save-btn {
  width: 100%;
  padding: 14px;
  background: transparent;
  border: 1px solid var(--accent-orange);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-orange);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition);
  margin-top: 10px;
}
.save-btn:active { background: rgba(232,93,38,0.08); transform: scale(0.97); }

/* ── Planner Screen ── */
.date-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.datetime-field {
  background: var(--bg-input);
  border: 1px solid var(--border-color-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-primary);
  width: 100%;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.datetime-field:focus { border-color: var(--accent-orange); }

/* ── Saved Recipes Screen ── */
.recipes-list { display: flex; flex-direction: column; gap: 12px; }

.recipe-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.recipe-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-gold) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.recipe-card-info { flex: 1; min-width: 0; }

.recipe-card-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recipe-card-meta {
  font-size: 0.77rem;
  color: var(--text-muted);
}

.recipe-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.recipe-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: all var(--transition);
  color: var(--text-secondary);
}
.recipe-action-btn:active { transform: scale(0.9); }
.recipe-action-btn.load:active { background: rgba(82,183,136,0.15); color: var(--accent-green); }
.recipe-action-btn.delete:active { background: rgba(230,57,70,0.1); color: var(--accent-red); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state-icon { font-size: 52px; margin-bottom: 14px; opacity: 0.4; }
.empty-state-title { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 6px; }
.empty-state-text { font-size: 0.85rem; color: var(--text-muted); }

/* ── Step Process Card ── */
.process-steps {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}

.process-step {
  padding: 14px 16px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.process-step:last-child { border-bottom: none; }

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-orange);
  color: white;
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-top: 4px;
}
.step-text strong { color: var(--text-primary); }

/* ── Modal/Sheet ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
  backdrop-filter: blur(4px);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-modal);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 20px;
  padding-bottom: calc(20px + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform var(--transition-slow);
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }

.modal-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-color-strong);
  margin: 0 auto 20px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + var(--safe-top) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: calc(100% - 40px);
  max-width: 440px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color-strong);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-8px);
  animation: toastIn 250ms ease forwards, toastOut 250ms ease 2.5s forwards;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.success { border-color: rgba(82,183,136,0.4); }
.toast.error { border-color: rgba(230,57,70,0.4); }
.toast.warning { border-color: rgba(244,162,97,0.4); }

@keyframes toastIn {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-8px); }
}

/* ── Theme Toggle in Header ── */
.theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all var(--transition);
  flex-shrink: 0;
}
.theme-toggle-btn:active { transform: rotate(20deg) scale(0.9); }

/* ── Select Styled ── */
select.input-field {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23A09880' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
  width: 160px;
  text-align: left;
}
select.input-field option { background: var(--bg-secondary); color: var(--text-primary); }

/* ── Percentage Selector ── */
.pct-selector {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pct-btn {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.pct-btn.active {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: white;
}

/* ── Input mode toggle ── */
.input-mode-pill {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
  margin-bottom: 14px;
}
.mode-pill-btn {
  padding: 6px 16px;
  border-radius: 18px;
  border: none;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  background: transparent;
  color: var(--text-muted);
}
.mode-pill-btn.active {
  background: var(--accent-orange);
  color: white;
}

/* ── Summary Numbers ── */
.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.summary-cell {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
}

.summary-value {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  display: block;
}

.summary-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--divider);
  margin: 20px 0;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
}

/* ── Responsive / landscape ── */
@media (min-height: 700px) {
  .home-hero { padding: 32px 20px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── Install Banner ── */
.install-banner {
  margin: 16px 20px 0;
  background: linear-gradient(135deg, rgba(232,93,38,0.1) 0%, rgba(244,162,97,0.08) 100%);
  border: 1px solid rgba(232,93,38,0.2);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.install-banner-icon { font-size: 24px; }
.install-banner-text { flex: 1; font-size: 0.82rem; color: var(--text-secondary); }
.install-banner-text strong { color: var(--text-primary); display: block; margin-bottom: 2px; }
.install-btn {
  padding: 8px 14px;
  background: var(--accent-orange);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

/* spacer at top of screen content */
.screen-content-top {
  padding-top: 16px;
}

/* ── AI Recommendation Button & Card ── */
.ai-rec-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #4361EE 0%, #3A0CA3 100%);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(67,97,238,0.3);
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}
.ai-rec-btn:active { transform: scale(0.97); box-shadow: none; }
.ai-rec-btn:disabled { opacity: 0.7; cursor: wait; }

.ai-result-card {
  background: var(--bg-card);
  border: 1px solid rgba(67,97,238,0.25);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 6px;
}

.ai-result-header {
  padding: 12px 16px 10px;
  background: linear-gradient(135deg, rgba(67,97,238,0.12) 0%, rgba(58,12,163,0.08) 100%);
  border-bottom: 1px solid rgba(67,97,238,0.12);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.ai-result-body {
  padding: 14px 16px;
}

/* Loading dots */
.ai-loading {
  display: flex;
  justify-content: center;
  padding: 10px 0;
}
.ai-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.ai-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4361EE;
  animation: dotBounce 1.2s ease-in-out infinite;
}
.ai-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* Spinner inline */
.ai-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
