:root,
[data-theme="light"] {
  --bg: #faf6f0;
  --bg-secondary: #f0e8dc;
  --bg-card: #fffcf7;
  --text: #3d2b1f;
  --text-secondary: #7a6555;
  --border: #ddd0c0;
  --accent: #b8703f;
  --accent-hover: #964e1f;
  --accent-light: #f5e6d3;
  --success: #5a8a4a;
  --warning: #ad7b1b;
  --error: #c45a3c;
  --surface-shadow: 0 16px 30px rgba(61, 43, 31, 0.08);
}

[data-theme="dark"] {
  --bg: #1a140e;
  --bg-secondary: #2a2018;
  --bg-card: #2a2018;
  --text: #ede3d4;
  --text-secondary: #b59f8d;
  --border: #433429;
  --accent: #d4914e;
  --accent-hover: #e8a862;
  --accent-light: #3d2f20;
  --success: #7eab67;
  --warning: #d0a247;
  --error: #d4694a;
  --surface-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
}

body {
  background: var(--bg) url('../img/sourdough-bg.jpg') center top / cover fixed no-repeat;
}

[hidden] {
  display: none !important;
}

.page-wrapper {
  background: rgba(250, 246, 240, 0.9);
}

[data-theme="dark"] .page-wrapper {
  background: rgba(26, 20, 14, 0.9);
}

.sourdough-card {
  overflow: hidden;
}

.sd-app {
  display: grid;
  gap: 1rem;
}

.sd-panel {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.96) 0%, rgba(245, 230, 211, 0.82) 100%);
  box-shadow: var(--surface-shadow);
  padding: 1.15rem;
}

[data-theme="dark"] .sd-panel {
  background: linear-gradient(180deg, rgba(42, 32, 24, 0.98) 0%, rgba(34, 26, 20, 0.92) 100%);
}

.sd-panel-head,
.sd-hero-copy,
.sd-recipe-meta,
.sd-phase-head,
.sd-step-meta,
.sd-summary-grid,
.sd-mode-switch,
.sd-quick-grid,
.sd-summary-strip,
.sd-inline-grid,
.sd-export-actions,
.sd-reset-row {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.sd-panel-head {
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.sd-section-label {
  display: inline-block;
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sd-panel h2,
.sd-panel h3,
.sd-hero h1 {
  margin: 0;
  color: var(--text);
}

.sd-card-copy,
.sd-panel p,
.sd-helper,
.sd-phase-cue,
.sd-accordion-copy,
.sd-summary-text {
  color: var(--text-secondary);
  line-height: 1.6;
}

.sd-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.3fr);
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 1rem;
}

.sd-hero-media img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  border-radius: 24px;
}

.sd-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.3rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(255, 252, 247, 0.98) 0%, rgba(245, 230, 211, 0.88) 100%);
  box-shadow: var(--surface-shadow);
  min-width: 0;
}

[data-theme="dark"] .sd-hero-copy {
  background: linear-gradient(160deg, rgba(42, 32, 24, 0.98) 0%, rgba(32, 24, 18, 0.92) 100%);
}

.sd-hero .tool-hero-text {
  flex: 1;
  min-width: 0;
}

.sd-hero h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.05;
}

.sd-hero .tool-hero {
  flex-wrap: wrap;
  align-items: center;
}

.sd-hero .tool-header-logo {
  max-width: 80px;
  max-height: 80px;
}

.sd-subtitle {
  font-size: 1.02rem;
}

.sd-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sd-chip,
.sd-phase-tag,
.sd-difficulty {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 252, 247, 0.7);
  color: var(--text);
  font-size: 0.83rem;
  font-weight: 600;
}

[data-theme="dark"] .sd-chip,
[data-theme="dark"] .sd-phase-tag,
[data-theme="dark"] .sd-difficulty {
  background: rgba(61, 47, 32, 0.72);
}

.sd-difficulty-soft {
  border-color: rgba(90, 138, 74, 0.35);
  color: var(--success);
}

.sd-difficulty-firm {
  border-color: rgba(196, 90, 60, 0.35);
  color: var(--error);
}

.sd-mode-switch button,
.sd-unit-switch button,
.sd-link-btn,
.sd-secondary-btn,
.sd-export-actions button,
.sd-reset-row button,
.quick-guide-link {
  min-height: 44px;
  padding: 0.65rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
}

.sd-mode-switch button.is-active,
.sd-unit-switch button.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fffaf3;
}

.sd-link-btn,
.sd-secondary-btn,
.sd-export-actions button,
.sd-reset-row button {
  background: transparent;
}

.sd-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sd-input-card,
.sd-result-card,
.sd-insight-card,
.sd-levain-card,
.sd-summary-tile,
.sd-guidance-card,
.sd-phase-card,
.sd-step-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.82);
  padding: 0.95rem;
}

[data-theme="dark"] .sd-input-card,
[data-theme="dark"] .sd-result-card,
[data-theme="dark"] .sd-insight-card,
[data-theme="dark"] .sd-levain-card,
[data-theme="dark"] .sd-summary-tile,
[data-theme="dark"] .sd-guidance-card,
[data-theme="dark"] .sd-phase-card,
[data-theme="dark"] .sd-step-card {
  background: rgba(34, 26, 20, 0.84);
}

.sd-input-card h3,
.sd-levain-card h3,
.sd-step-card h3 {
  margin-bottom: 0.45rem;
}

.sd-inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sd-app label,
.sd-app summary {
  color: var(--text);
  font-weight: 600;
}

.sd-app input,
.sd-app select,
.sd-app textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
}

.sd-app textarea {
  min-height: 120px;
  resize: vertical;
}

.sd-app input[type="checkbox"] {
  width: 22px;
  min-height: 22px;
  padding: 0;
}

.sd-app input:focus-visible,
.sd-app select:focus-visible,
.sd-app textarea:focus-visible,
.sd-mode-switch button:focus-visible,
.sd-unit-switch button:focus-visible,
.sd-link-btn:focus-visible,
.sd-secondary-btn:focus-visible,
.sd-export-actions button:focus-visible,
.sd-reset-row button:focus-visible,
.sd-accordion-item summary:focus-visible {
  outline: 3px solid rgba(184, 112, 63, 0.25);
  outline-offset: 2px;
  border-color: var(--accent);
}

.sd-results-grid,
.sd-insights-grid,
.sd-summary-grid,
.sd-timeline-metrics,
.sd-levain-grid,
.sd-method-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.sd-result-card span,
.sd-insight-card span,
.sd-summary-tile span {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.sd-result-card strong,
.sd-insight-card strong,
.sd-summary-tile strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.05rem;
  color: var(--text);
}

.sd-phase-card,
.sd-step-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.9rem;
}

.sd-phase-time,
.sd-step-index {
  min-width: 5.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
}

.sd-phase-duration {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.sd-accordion-group,
.sd-accordion-stack {
  display: grid;
  gap: 0.7rem;
}

.sd-accordion-item,
details[data-accordion] {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 252, 247, 0.74);
  padding: 0.15rem 0.9rem 0.7rem;
}

[data-theme="dark"] .sd-accordion-item,
[data-theme="dark"] details[data-accordion] {
  background: rgba(34, 26, 20, 0.78);
}

.sd-accordion-item summary,
details[data-accordion] summary {
  cursor: pointer;
  list-style: none;
  padding: 0.8rem 0;
}

.sd-accordion-copy,
.sd-accordion-panel {
  padding-bottom: 0.25rem;
}

.sd-alert {
  margin-bottom: 0.55rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  border: 1px solid currentColor;
}

.sd-alert-error {
  color: var(--error);
  background: rgba(196, 90, 60, 0.12);
}

.sd-alert-caution {
  color: var(--warning);
  background: rgba(173, 123, 27, 0.14);
}

.sd-alert-info {
  color: var(--accent);
  background: rgba(184, 112, 63, 0.12);
}

.sd-export-actions,
.sd-reset-row {
  margin-top: 1rem;
}

.sd-guidance-card {
  margin-top: 0.9rem;
}

.sd-guidance-card h3 {
  margin-bottom: 0.35rem;
}

.sd-guidance-card strong {
  color: var(--text);
}

.sd-export-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sd-export-table {
  width: 100%;
}

@media (max-width: 1023px) {
  .sd-hero,
  .sd-quick-grid,
  .sd-results-grid,
  .sd-insights-grid,
  .sd-summary-grid,
  .sd-timeline-metrics,
  .sd-method-list,
  .sd-levain-grid,
  .sd-inline-grid {
    grid-template-columns: 1fr;
  }

  .sd-phase-card,
  .sd-step-card {
    grid-template-columns: 1fr;
  }

  .sd-phase-time,
  .sd-step-index {
    min-width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .share-section,
  aside,
  .ad-slot,
  .sd-mode-switch,
  .sd-unit-switch,
  .sd-export-actions,
  .sd-reset-row,
  .sd-link-btn,
  .sd-secondary-btn {
    display: none !important;
  }

  body,
  .page-wrapper,
  .sd-panel,
  .sd-hero-copy,
  .sd-input-card,
  .sd-result-card,
  .sd-insight-card,
  .sd-levain-card,
  .sd-summary-tile,
  .sd-phase-card,
  .sd-step-card {
    background: #fff !important;
    color: #111 !important;
    box-shadow: none !important;
  }
}


/* --- MODERN PILL TOGGLES FOR UNIT SWITCHES --- */
.sd-unit-switch {
  display: inline-flex;
  background: var(--bg-secondary) !important;
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--border);
  width: max-content;
}

.sd-unit-switch button {
  min-height: auto !important;
  padding: 0.35rem 0.75rem !important;
  border-radius: 6px !important;
  border: none !important;
  background: transparent !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  color: var(--text-secondary) !important;
  cursor: pointer;
  transition: all 0.2s ease !important;
}

.sd-unit-switch button.is-active {
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
  border: none !important;
}

[data-theme='dark'] .sd-unit-switch button.is-active {
  background: var(--bg-primary) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
}

/* =====================================================================
   Phase 2 additions — feed planner, proportional timeline, glossary,
   caution insight card, refined card elevation.
   ===================================================================== */

/* ---- Starter feeding planner ---------------------------------------- */

.sd-feed-planner {
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--accent-light) 400%);
  border: 1px solid var(--border);
}

[data-theme="dark"] .sd-feed-planner {
  background: var(--bg-card);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(212, 145, 78, 0.12) inset;
}

.sd-feed-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: end;
  margin-top: 1rem;
}

@media (max-width: 520px) {
  .sd-feed-grid { grid-template-columns: 1fr; }
}

.sd-feed-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}

.sd-inline-affix {
  display: flex;
  align-items: stretch;
}

.sd-inline-affix input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  min-width: 100px;
}

.sd-affix {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--input-border);
  border-left: none;
  border-top-right-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.sd-feed-output {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sd-feed-headline {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(184, 112, 63, 0.18);
}

.sd-feed-ratio {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 0.375rem 0.75rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  min-width: 84px;
  text-align: center;
  backdrop-filter: blur(4px);
}

.sd-feed-headline-body { flex: 1; min-width: 0; }

.sd-feed-subtitle {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.85;
  margin-bottom: 0.125rem;
}

.sd-feed-headline p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.sd-feed-grid-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
  margin-top: 0;
  align-items: stretch;
}

@media (min-width: 560px) {
  .sd-feed-grid-metrics { grid-template-columns: repeat(4, 1fr); }
}

.sd-feed-metric {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius, 8px);
  padding: 0.625rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.sd-feed-metric-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.sd-feed-metric strong {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.95rem;
  color: var(--text);
}

.sd-feed-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.sd-feed-table th,
.sd-feed-table td {
  padding: 0.5rem 0.625rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.sd-feed-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  background: var(--bg-secondary);
}

.sd-feed-table td {
  font-family: "IBM Plex Mono", monospace;
  color: var(--text);
  font-weight: 600;
}

.sd-feed-warning {
  color: var(--warning, #ad7b1b);
  font-size: 0.85rem;
  line-height: 1.5;
  padding: 0.625rem 0.75rem;
  background: var(--accent-light);
  border-left: 3px solid var(--warning, #ad7b1b);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 0;
}

/* ---- Proportional vertical timeline --------------------------------- */

#timelineList {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
  position: relative;
}

.sd-phase-block {
  position: relative;
  display: grid;
  grid-template-columns: 88px 4px 1fr;
  gap: 0.625rem;
  min-height: var(--phase-height, 56px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.875rem 0.75rem 0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.sd-phase-time {
  padding: 0.75rem 0 0 0.75rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.02em;
  align-self: start;
  line-height: 1.3;
  white-space: pre-line;
  word-spacing: -0.08em;
}

@media (max-width: 400px) {
  .sd-phase-block { grid-template-columns: 76px 4px 1fr; gap: 0.5rem; }
  .sd-phase-time  { font-size: 0.65rem; padding-left: 0.5rem; }
}

.sd-phase-rail {
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
  align-self: stretch;
  margin: 0.5rem 0;
}

.sd-phase-block.is-feed    .sd-phase-rail { background: #a07b2b; }
.sd-phase-block.is-mix     .sd-phase-rail { background: #b8703f; }
.sd-phase-block.is-ferment .sd-phase-rail { background: #a6554b; }
.sd-phase-block.is-shape   .sd-phase-rail { background: #8a5a3b; }
.sd-phase-block.is-retard  .sd-phase-rail { background: #4e6eab; }
.sd-phase-block.is-bake    .sd-phase-rail { background: #c34c3b; }
.sd-phase-block.is-default .sd-phase-rail { background: var(--text-secondary); }

.sd-phase-body {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 0.25rem 0;
  min-width: 0;
}

.sd-phase-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}

.sd-phase-head h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  flex: 1 1 100%;
  letter-spacing: -0.01em;
}

.sd-phase-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.sd-phase-pill {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--warning, #ad7b1b);
  color: #fff;
}

.sd-phase-duration {
  margin-left: auto;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

.sd-phase-body p {
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
  color: var(--text);
}

.sd-phase-cue {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 0.82rem;
}

.sd-phase-window {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  background: var(--bg-secondary);
  border-radius: 6px;
  display: inline-block;
}

@media (max-width: 480px) {
  .sd-phase-block { grid-template-columns: 68px 4px 1fr; gap: 0.5rem; }
  .sd-phase-time  { padding-left: 0.625rem; font-size: 0.72rem; }
}

/* ---- Inline glossary tooltip ---------------------------------------- */

.sd-term {
  position: relative;
  border-bottom: 1px dashed var(--accent);
  color: var(--accent);
  font-weight: 600;
  cursor: help;
  outline: none;
  border-radius: 2px;
  transition: background 0.15s, color 0.15s;
}.sd-term:focus {
  color: var(--accent-hover);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

/* Visible focus ring for keyboard users (the tooltip itself reveals on focus). */
.sd-term:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sd-term-tip {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg-card);
  font-size: 0.8rem;
  line-height: 1.4;
  padding: 0.625rem 0.875rem;
  border-radius: 10px;
  width: min(280px, 82vw);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 30;
  font-style: normal;
  font-weight: 400;
}

.sd-term-tip::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -5px;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: var(--text);
  border-radius: 2px;
}.sd-term:focus .sd-term-tip, .sd-term:focus-within .sd-term-tip, .sd-term.is-open .sd-term-tip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ---- Goal chip row (Plan view, above hero) -------------------------- */

.ll-goal-row {
  margin: 0.25rem 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ll-goal-prompt {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ll-goal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ll-goal-chip {
  appearance: none;
  border: 1px solid var(--border, rgba(122, 85, 51, 0.18));
  background: var(--bg-card, #fff);
  color: var(--text);
  padding: 0.5rem 0.85rem;
  min-height: 36px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
  font-family: inherit;
}

.ll-goal-chip:active {
  transform: scale(0.97);
}

.ll-goal-chip.is-active {
  background: var(--accent, #b8703f);
  color: #fff;
  border-color: var(--accent, #b8703f);
}

[data-theme="dark"] .ll-goal-chip {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .ll-goal-chip.is-active {
  background: var(--accent, #d2935f);
  color: #1a1a1a;
  border-color: var(--accent, #d2935f);
}

/* ---- Running-late row in live timer ----------------------------------- */

.ll-live-late-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.625rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: rgba(216, 110, 50, 0.08);
  border: 1px dashed rgba(184, 112, 63, 0.35);
}

.ll-live-late-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.ll-live-late-btns {
  display: flex;
  gap: 0.4rem;
}

.ll-live-btn-late {
  appearance: none;
  background: rgba(255, 255, 255, 0.7);
  color: var(--accent, #b8703f);
  border: 1px solid var(--accent, #b8703f);
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.ll-live-btn-late:active { transform: scale(0.96); }

[data-theme="dark"] .ll-live-late-row {
  background: rgba(216, 110, 50, 0.14);
  border-color: rgba(216, 110, 50, 0.4);
}

[data-theme="dark"] .ll-live-btn-late {
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent, #d2935f);
  border-color: var(--accent, #d2935f);
}

/* Stack the running-late row vertically on tight viewports. */
@media (max-width: 380px) {
  .ll-live-late-row {
    flex-direction: column;
    align-items: stretch;
  }
  .ll-live-late-btns {
    justify-content: space-between;
  }
}

/* ---- First-time guide + plain-English hero help ----------------------- */

.ll-first-time {
  margin: 0 0 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(184, 112, 63, 0.08), rgba(173, 123, 27, 0.06));
  border: 1px solid rgba(184, 112, 63, 0.25);
}

.ll-first-time > summary {
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--text);
  list-style: none;
  position: relative;
  padding-right: 1.5rem;
}

.ll-first-time > summary::-webkit-details-marker { display: none; }

.ll-first-time > summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}

.ll-first-time[open] > summary::after { content: "−"; }

.ll-first-time .ll-helper strong {
  color: var(--text);
  font-weight: 700;
}

[data-theme="dark"] .ll-first-time {
  background: linear-gradient(135deg, rgba(216, 110, 50, 0.14), rgba(173, 123, 27, 0.10));
  border-color: rgba(216, 110, 50, 0.35);
}

/* ---- "How Loaf Logic works" first-run onboarding strip (v1.0.6) -------- */
/* Top-of-Plan-view clarity card. Renders only when localStorage flag is
   unset, dismissed via "Got it". Single biggest fix for the "makes no sense"
   feedback in v1.0.6 — answers "what is this app and what do I do?" in
   three numbered steps that are visible the instant the user lands. */
.ll-how-it-works {
  position: relative;
  margin: 0 0 1rem;
  padding: 1rem 1.1rem 0.9rem;
  border-radius: 16px;
  background: linear-gradient(140deg, rgba(184, 112, 63, 0.10), rgba(173, 123, 27, 0.07));
  border: 1px solid rgba(184, 112, 63, 0.32);
  box-shadow: 0 1px 2px rgba(122, 62, 21, 0.05);
  animation: ll-how-it-works-rise 480ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes ll-how-it-works-rise {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Compact first-run strip on the Starter landing tab. */
.ll-feed-onboard__text {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.ll-how-it-works__dismiss {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.ll-how-it-works__dismiss:active { transform: scale(0.94); }

.ll-how-it-works__title {
  font-family: Lora, Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 2rem 0.7rem 0;
  letter-spacing: -0.01em;
}

.ll-how-it-works__steps {
  list-style: none;
  padding: 0;
  margin: 0 0 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.ll-how-it-works__step {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}

.ll-how-it-works__num {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent, #b8703f);
  color: #fff;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.ll-how-it-works__text {
  flex: 1;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
}
.ll-how-it-works__text strong { font-weight: 700; }

.ll-how-it-works__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.4rem;
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(184, 112, 63, 0.22);
}

.ll-how-it-works__link {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--accent, #b8703f);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 0.35rem 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 36px;
}
.ll-how-it-works__link:active { transform: scale(0.98); }

.ll-how-it-works__cta {
  appearance: none;
  background: var(--accent, #b8703f);
  color: #fff;
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  min-height: 40px;
  transition: background 0.15s, transform 0.1s;
}
.ll-how-it-works__cta:active { transform: scale(0.97); }

[data-theme="dark"] .ll-how-it-works {
  background: linear-gradient(140deg, rgba(216, 110, 50, 0.16), rgba(173, 123, 27, 0.10));
  border-color: rgba(216, 110, 50, 0.38);
}
[data-theme="dark"] .ll-how-it-works__footer { border-top-color: rgba(216, 110, 50, 0.28); }
[data-theme="dark"] .ll-how-it-works__cta { color: #1a1a1a; }

.ll-hero-help {
  margin: 0.65rem 0 0;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed var(--border);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.ll-hero-help strong {
  color: var(--text);
  font-weight: 700;
}

[data-theme="dark"] .ll-hero-help {
  background: rgba(0, 0, 0, 0.18);
}

/* ---- Hero-level recipe alert chip ------------------------------------- */

.ll-hero-alert {
  margin: 0.625rem 0 0.5rem;
}

.ll-hero-alert-btn {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(216, 110, 50, 0.13), rgba(173, 123, 27, 0.10));
  border: 1px solid rgba(173, 123, 27, 0.4);
  color: var(--text);
  font-family: inherit;
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  /* Subtle pulse so a baker doesn't miss it on a busy Plan view. */
  animation: ll-hero-alert-pop 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ll-hero-alert-btn:active { transform: translateY(0) scale(0.99); }

.ll-hero-alert-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(173, 123, 27, 0.22);
  color: #ad7b1b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.ll-hero-alert-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.ll-hero-alert-text {
  font-weight: 500;
  line-height: 1.35;
  /* Truncate gracefully on narrow viewports — full text lives below. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ll-hero-alert-more {
  font-size: 0.74rem;
  font-weight: 600;
  color: #ad7b1b;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

@keyframes ll-hero-alert-pop {
  0%   { opacity: 0; transform: translateY(8px) scale(0.96); }
  60%  { opacity: 1; transform: translateY(0) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .ll-hero-alert-btn { animation: none; }
}

[data-theme="dark"] .ll-hero-alert-btn {
  background: linear-gradient(135deg, rgba(216, 110, 50, 0.22), rgba(173, 123, 27, 0.18));
  border-color: rgba(216, 110, 50, 0.45);
}

[data-theme="dark"] .ll-hero-alert-icon {
  background: rgba(216, 110, 50, 0.32);
  color: #d99566;
}

[data-theme="dark"] .ll-hero-alert-more { color: #d99566; }

/* Brief attention flash when scrolled to from the hero chip. */
#warningList.is-flashing {
  animation: ll-warninglist-flash 900ms ease-out;
}

@keyframes ll-warninglist-flash {
  0%   { background: rgba(216, 110, 50, 0); }
  30%  { background: rgba(216, 110, 50, 0.18); }
  100% { background: rgba(216, 110, 50, 0); }
}

/* ---- Feed-tab head with starter-jar art ------------------------------- */

.ll-view-head-with-art {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
}

.ll-view-head-art {
  width: 96px;
  height: 128px;
  object-fit: cover;
  object-position: center;
  border-radius: 14px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(122, 62, 21, 0.18));
}

/* On very narrow viewports, stack the art below the headings rather than
   compete for horizontal space. */
@media (max-width: 380px) {
  .ll-view-head-with-art {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .ll-view-head-art {
    width: 100%;
    height: 180px;
    object-position: center 35%;
  }
}

/* ---- Method-tab decorative banner ------------------------------------- */

.ll-method-banner {
  margin: 0 0 0.75rem;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 4 / 1;
  background: linear-gradient(135deg, #faf6f0, #f0e6d8);
  animation: ll-hero-photo-rise 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ll-method-banner picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 50%;
  display: block;
}

/* v1.0.7 — vector technique overlay (stretch-fold method illustration). */
.ll-method-banner .ll-method-banner__technique {
  position: absolute;
  right: 12px;
  bottom: 10px;
  width: 100px;
  height: 70px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(40, 22, 6, 0.18));
}

@media (prefers-reduced-motion: reduce) {
  .ll-method-banner { animation: none; }
}

/* ---- Hero photo banner (HERA-generated boule) ------------------------- */

.ll-hero-photo {
  margin: 0.75rem 0 0.625rem;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 5 / 3;
  background: linear-gradient(135deg, #faf6f0, #f0e6d8);
  /* Subtle entrance — matches the .ll-empty-art settle. */
  animation: ll-hero-photo-rise 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ll-hero-photo picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
  /* Slow gentle zoom for cinematic feel — not so pronounced that it
     distracts. Pauses on prefers-reduced-motion. */
  animation: ll-hero-photo-zoom 18s ease-in-out infinite alternate;
}

/* v1.0.7 — vector crumb-shot overlay, bottom-left of hero photo. */
.ll-hero-photo .ll-hero-photo__crumb {
  position: absolute;
  left: 14px;
  bottom: 12px;
  width: 130px;
  height: 73px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 3px 6px rgba(40, 22, 6, 0.28));
  z-index: 1;
}

@keyframes ll-hero-photo-rise {
  0%   { opacity: 0; transform: translateY(8px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0)   scale(1); }
}

@keyframes ll-hero-photo-zoom {
  0%   { transform: scale(1); }
  100% { transform: scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  .ll-hero-photo,
  .ll-hero-photo img { animation: none; }
}

/* Drop the hero photo on very tight viewports to save vertical space. */
@media (max-height: 700px) and (max-width: 380px) {
  .ll-hero-photo { display: none; }
}

/* ---- Recipe gear list ("You'll need" chips) --------------------------- */

.ll-recipe-gear {
  margin: 0.5rem 0 0.25rem;
}

.ll-recipe-gear-label {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary, #7a6555);
  margin-bottom: 0.4rem;
}

.ll-recipe-gear-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ll-recipe-gear-item {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--bg-secondary, rgba(0, 0, 0, 0.04));
  border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.3;
}

[data-theme="dark"] .ll-recipe-gear-item {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ---- Recipe + computed warnings list ---------------------------------- */

.ll-warnings {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ll-warning {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.45;
  background: var(--bg-secondary, rgba(0, 0, 0, 0.04));
  border-left: 3px solid var(--text-secondary, #7a6555);
  color: var(--text);
}

.ll-warning-icon {
  flex-shrink: 0;
  font-weight: 600;
  line-height: 1.45;
}

.ll-warning-text { flex: 1; }

.ll-warning-info {
  background: rgba(78, 110, 171, 0.08);
  border-left-color: #4e6eab;
}

.ll-warning-caution {
  background: rgba(216, 110, 50, 0.10);
  border-left-color: #ad7b1b;
}

[data-theme="dark"] .ll-warning-info {
  background: rgba(78, 110, 171, 0.18);
}

[data-theme="dark"] .ll-warning-caution {
  background: rgba(216, 110, 50, 0.18);
}

/* ---- Validation error block ----------------------------------------- */

.ll-validation-errors {
  margin-top: 0.5rem;
  padding: 0.625rem 0.875rem;
  border-radius: 10px;
  background: var(--accent-light, rgba(173, 123, 27, 0.08));
  border-left: 3px solid var(--warning, #ad7b1b);
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.45;
}

.ll-validation-errors p {
  margin: 0.2rem 0;
}

.ll-validation-errors p:first-child { margin-top: 0; }
.ll-validation-errors p:last-child  { margin-bottom: 0; }

/* ---- Caution variant on insight cards ------------------------------- */

.sd-insight-card.is-caution {
  border-left: 3px solid var(--warning, #ad7b1b);
  background: linear-gradient(90deg, var(--accent-light) 0%, var(--bg-card) 40%);
}

.sd-insight-card.is-caution strong {
  color: var(--warning, #ad7b1b);
}

/* ---- Card elevation refinement -------------------------------------- */

.sd-panel {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 0 0 1px var(--border);
}

[data-theme="dark"] .sd-panel {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--border);
}

/* ---- Active tab indicator underline --------------------------------- */

.sd-tab-btn {
  position: relative;
}

.sd-tab-btn.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1rem;
  height: 3px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

/* =====================================================================
 * "Start a bake" primary CTA (Plan tab, above-fold). Added 2026-05-16
 * so the live timer is discoverable on cold launch — previously buried
 * 3 taps deep. One tap = derive plan + jump to Timeline + start timer.
 * ===================================================================== */
.ll-start-bake-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 16px 0 18px;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--accent, #d86e32), color-mix(in oklab, var(--accent, #d86e32) 80%, #b85019));
  color: #fff5e9;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 6px 20px rgba(216, 110, 50, 0.32), 0 1px 2px rgba(0,0,0,0.08);
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 120ms ease-out, box-shadow 120ms ease-out;
}
.ll-start-bake-cta:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 4px 14px rgba(216, 110, 50, 0.32);
}
.ll-start-bake-cta:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--accent, #d86e32) 70%, #fff);
  outline-offset: 3px;
}
.ll-start-bake-cta__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 245, 233, 0.16);
  border-radius: 14px;
  font-size: 18px;
  line-height: 1;
}
.ll-start-bake-cta__text { display: flex; flex-direction: column; gap: 2px; }
.ll-start-bake-cta__title {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
}
.ll-start-bake-cta__sub {
  font-size: 13px;
  opacity: 0.85;
  font-weight: 500;
}

/* =====================================================================
 * Timeline tab live-bake indicator. When liveTimer.active === true,
 * renderTimerBar() unhides #timelineTabPulse + swaps #timelineTabLabel
 * text to "Live Xh Ym".
 * ===================================================================== */
.ll-tab-pulse {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--accent, #d86e32);
  border-radius: 50%;
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent, #d86e32) 60%, transparent);
  animation: ll-tab-pulse-anim 1.8s ease-out infinite;
}
.ll-tab-pulse[hidden] { display: none; }
@keyframes ll-tab-pulse-anim {
  0%   { box-shadow: 0 0 0 0   color-mix(in oklab, var(--accent, #d86e32) 60%, transparent); }
  60%  { box-shadow: 0 0 0 8px color-mix(in oklab, var(--accent, #d86e32) 0%,  transparent); }
  100% { box-shadow: 0 0 0 0   color-mix(in oklab, var(--accent, #d86e32) 0%,  transparent); }
}

@media (prefers-reduced-motion: reduce) {
  .ll-start-bake-cta { transition: none; }
  .ll-tab-pulse { animation: none; }
}

/* ===========================================================================
 * Reverse-Timing Wizard (v1.0.9) — "When do I start?" drawer
 * Triggered from the Plan-tab goal strip; reuses the .ll-drawer drawer chrome.
 * ========================================================================= */
.ll-goal-wizard-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.7rem 0.85rem;
  border: 1px dashed color-mix(in oklab, var(--accent, #d86e32) 50%, transparent);
  border-radius: 12px;
  background: color-mix(in oklab, var(--accent, #d86e32) 6%, transparent);
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: background 160ms ease, border-color 160ms ease;
  min-height: 48px;
}.ll-goal-wizard-btn:focus-visible {
  background: color-mix(in oklab, var(--accent, #d86e32) 12%, transparent);
  border-style: solid;
}
.ll-goal-wizard-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}
.ll-goal-wizard-text {
  flex: 1;
  font-size: 0.92rem;
  line-height: 1.35;
}
.ll-goal-wizard-text strong { display: block; }

.ll-wizard-quick {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 0.75rem;
}
.ll-wizard-calc { width: 100%; margin-top: 0.25rem; }

/* --- GUIDED WIZARD (v1.0.14) — one-question-per-step onboarding ---------- */
/* Progress dots under the header. */
.ll-wizard-progress {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 0 0.25rem;
}
.ll-wizard-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent, #d86e32) 22%, transparent);
  transition: background 200ms ease, width 200ms ease;
}
.ll-wizard-dot.is-current {
  width: 22px;
  background: var(--accent, #d86e32);
}
.ll-wizard-dot.is-done {
  background: color-mix(in oklab, var(--accent, #d86e32) 60%, transparent);
}

.ll-wizard-body { min-height: 50vh; }

/* A single step panel. Hidden ones are display:none via [hidden]; the active
   one slides in. */
.ll-wizard-step-panel { animation: ll-wizard-slide 240ms cubic-bezier(0.25, 1, 0.5, 1); }
@keyframes ll-wizard-slide {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .ll-wizard-step-panel { animation: none; }
}

.ll-wizard-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent, #d86e32);
}
.ll-wizard-q {
  margin: 0 0 0.4rem;
  font-family: "Playfair Display", serif;
  font-size: 1.4rem;
  line-height: 1.2;
  font-weight: 700;
}
.ll-wizard-sub {
  margin: 0 0 1.1rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text-secondary, #6b5d52);
}

/* Big "when" chips — full-width, generous touch targets (>=56px). */
.ll-wizard-bigchips {
  display: grid;
  gap: 0.6rem;
}
.ll-wizard-bigchip {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  min-height: 64px;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border, #e6ddd2);
  border-radius: 14px;
  background: var(--bg-card, #fff);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 120ms ease;
}
.ll-wizard-bigchip:active { transform: scale(0.98); }.ll-wizard-bigchip:focus-visible {
  border-color: var(--accent, #d86e32);
  background: color-mix(in oklab, var(--accent, #d86e32) 6%, transparent);
}
.ll-wizard-bigchip.is-selected {
  border-color: var(--accent, #d86e32);
  background: color-mix(in oklab, var(--accent, #d86e32) 12%, transparent);
  box-shadow: 0 0 0 1px var(--accent, #d86e32) inset;
}
.ll-wizard-bigchip-emoji { font-size: 1.7rem; line-height: 1; flex-shrink: 0; }
.ll-wizard-bigchip-label { font-size: 1.02rem; font-weight: 600; display: block; }
.ll-wizard-bigchip-sub {
  display: block;
  font-size: 0.82rem;
  color: var(--text-secondary, #6b5d52);
  margin-top: 0.1rem;
}
.ll-wizard-bigchip-label,
.ll-wizard-bigchip-sub { flex: 1; }

.ll-wizard-custom { margin-top: 0.85rem; }
.ll-wizard-custom input[type="datetime-local"] { min-height: 48px; font-size: 1rem; }

/* Difficulty cards — same big-target language. */
.ll-wizard-cards {
  display: grid;
  gap: 0.6rem;
}
.ll-wizard-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  min-height: 72px;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border, #e6ddd2);
  border-radius: 14px;
  background: var(--bg-card, #fff);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 120ms ease;
}
.ll-wizard-card:active { transform: scale(0.98); }.ll-wizard-card:focus-visible {
  border-color: var(--accent, #d86e32);
  background: color-mix(in oklab, var(--accent, #d86e32) 6%, transparent);
}
.ll-wizard-card.is-selected {
  border-color: var(--accent, #d86e32);
  background: color-mix(in oklab, var(--accent, #d86e32) 12%, transparent);
}
.ll-wizard-card-emoji { font-size: 1.9rem; line-height: 1; flex-shrink: 0; }
.ll-wizard-card-head { flex: 1; }
.ll-wizard-card-head strong { display: block; font-size: 1.05rem; }
.ll-wizard-card-head small { display: block; font-size: 0.82rem; color: var(--text-secondary, #6b5d52); margin-top: 0.1rem; }
.ll-wizard-card-go { font-size: 1.4rem; opacity: 0.5; flex-shrink: 0; }

/* Kitchen-temperature step. */
.ll-wizard-temp { padding: 0.5rem 0 0; text-align: center; }
.ll-wizard-temp-read {
  font-family: "IBM Plex Mono", monospace;
  font-size: 2.6rem;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 1rem;
  color: var(--accent, #d86e32);
}
.ll-wizard-temp-read span:last-child { font-size: 1.4rem; opacity: 0.8; }
.ll-wizard-temp-slider {
  width: 100%;
  height: 44px;
  cursor: pointer;
  accent-color: var(--accent, #d86e32);
}
.ll-wizard-temp-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary, #6b5d52);
  margin-top: -0.25rem;
}
.ll-wizard-temp-hint {
  margin: 1rem 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-secondary, #6b5d52);
  min-height: 2.6em;
}

/* Action rows — primary button big + full width; Skip/Back quiet. */
.ll-wizard-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}
.ll-wizard-actions .ll-wizard-next,
.ll-wizard-actions .ll-btn-primary { flex: 1; min-height: 52px; font-size: 1.02rem; }
.ll-wizard-actions-stack { flex-direction: column; align-items: stretch; }
.ll-wizard-actions-stack .ll-wizard-apply { width: 100%; min-height: 54px; font-size: 1.05rem; }
.ll-wizard-skip,
.ll-wizard-back {
  border: none;
  background: none;
  color: var(--text-secondary, #6b5d52);
  font: inherit;
  font-size: 0.92rem;
  padding: 0.75rem 0.85rem;
  min-height: 44px;
  border-radius: 10px;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease;
}.ll-wizard-skip:focus-visible, .ll-wizard-back:focus-visible {
  color: var(--text, #2c1206);
  background: color-mix(in oklab, var(--accent, #d86e32) 8%, transparent);
}

/* Result "Mix dough at X" hero. */
.ll-wizard-mixhero {
  text-align: center;
  padding: 1.1rem 1rem 1.2rem;
  margin-bottom: 1rem;
  border-radius: 16px;
  background: color-mix(in oklab, var(--accent, #d86e32) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent, #d86e32) 25%, transparent);
}
.ll-wizard-mixhero-kicker {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary, #6b5d52);
}
.ll-wizard-mixhero-time {
  display: block;
  font-family: "Playfair Display", serif;
  font-size: 1.75rem;
  line-height: 1.15;
  font-weight: 700;
  margin: 0.3rem 0 0.45rem;
  color: var(--text, #2c1206);
}
.ll-wizard-mixhero-recipe {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary, #6b5d52);
}
.ll-wizard-rolled {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  background: color-mix(in oklab, var(--accent, #d86e32) 9%, transparent);
  font-size: 0.88rem;
  line-height: 1.45;
}
.ll-wizard-steps-label {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary, #6b5d52);
}

.ll-wizard-result {
  margin-top: 0;
}
.ll-wizard-warn {
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: color-mix(in oklab, #c93d3d 12%, transparent);
  color: color-mix(in oklab, #c93d3d 80%, #2c1206);
  font-size: 0.9rem;
}
.ll-wizard-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.ll-wizard-summary > div {
  padding: 0.55rem 0.5rem;
  border-radius: 10px;
  background: color-mix(in oklab, var(--accent, #d86e32) 8%, transparent);
  text-align: center;
}
.ll-wizard-summary > div span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
}
.ll-wizard-summary > div strong {
  display: block;
  font-size: 0.9rem;
  margin-top: 0.15rem;
}
.ll-wizard-phases {
  list-style: none;
  padding: 0;
  margin: 0 0 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.ll-wizard-phases li {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: color-mix(in oklab, var(--accent, #d86e32) 4%, transparent);
  border-left: 3px solid color-mix(in oklab, var(--accent, #d86e32) 55%, transparent);
}
.ll-wizard-time {
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  opacity: 0.85;
  padding-top: 0.1rem;
}
.ll-wizard-step strong { display: block; font-size: 0.92rem; }
.ll-wizard-dur {
  display: inline-block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
  margin-top: 0.15rem;
}
.ll-wizard-note {
  display: block;
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 0.2rem;
}
.ll-wizard-apply { width: 100%; }

/* --- SHARE-RECIPE QR CODE (V2 Feature 2) ---------------------------------
   The share URL carries the full recipe state as base64, rendered as an
   inline SVG QR so a friend can scan a recipe straight off the screen.
   Always sits on a white backdrop with padding (a QR scanner needs the light
   quiet zone), even in dark mode — the dark modules use the theme --text. */
.share-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin: 0.25rem auto 1.1rem;
  padding: 0;
  text-align: center;
}
.share-qr {
  /* White card behind the code guarantees scanner contrast in dark theme. */
  background: #ffffff;
  border: 1px solid var(--border, #ddd0c0);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--surface-shadow, 0 16px 30px rgba(61, 43, 31, 0.08));
  line-height: 0;
  /* Sized for comfortable phone-camera scanning; scales down on tiny screens
     but never larger than a thumb-and-a-half so it stays on one screen. */
  width: min(62vw, 232px);
  max-width: 232px;
}
.share-qr svg {
  display: block;
  width: 100%;
  height: auto;
  /* Keep the SVG pixel grid crisp at any rendered size. */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.share-qr[hidden] { display: none !important; }
.share-qr-caption {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-secondary, #7a6555);
  letter-spacing: 0.01em;
  max-width: 24ch;
}

/* The QR is the one share surface worth keeping on a printed recipe card —
   the export buttons + reset row are hidden in print, but the QR stays so a
   printed sheet is still scannable. (.share-section is hidden above; the QR
   lives in the collapsible card, not that section.) */
@media print {
  .share-qr-wrap { break-inside: avoid; }
  .share-qr { box-shadow: none; border-color: #000; }
}

/* ---- Starter health & feeding log (R4) ---------------------------------
   On-device starter companion: a health indicator + next-feed-due + feeding
   list, extending the Feed view (NOT a new tab). Mobile-first, big touch
   targets, offline. */
.sd-starter { margin-top: 1rem; }

.sd-starter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sd-starter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.sd-starter-pill::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}
.sd-starter-pill-active {
  color: var(--success, #5a8a4a);
  background: color-mix(in srgb, var(--success, #5a8a4a) 14%, transparent);
  border-color: color-mix(in srgb, var(--success, #5a8a4a) 35%, transparent);
}
.sd-starter-pill-sluggish {
  color: var(--warning, #ad7b1b);
  background: color-mix(in srgb, var(--warning, #ad7b1b) 14%, transparent);
  border-color: color-mix(in srgb, var(--warning, #ad7b1b) 35%, transparent);
}
.sd-starter-pill-needs-feeding {
  color: var(--error, #c45a3c);
  background: color-mix(in srgb, var(--error, #c45a3c) 14%, transparent);
  border-color: color-mix(in srgb, var(--error, #c45a3c) 35%, transparent);
}

.sd-starter-blurb {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-secondary, #7a6555);
}

.sd-starter-due {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 0.9rem;
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary, #7a6555);
}
.sd-starter-due strong { color: var(--text); font-family: "IBM Plex Mono", monospace; }
.sd-starter-due-now { color: var(--error, #c45a3c) !important; }

.sd-starter-log-btn {
  margin-top: 0.85rem;
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1rem;
}

/* Log-a-feeding form */
.sd-starter-form {
  margin-top: 0.85rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.sd-starter-form-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-secondary, #7a6555);
}
.sd-starter-optional {
  font-weight: 400;
  font-size: 0.78em;
  color: var(--text-secondary, #7a6555);
}
.sd-starter-form select,
.sd-starter-form input[type="text"] {
  min-height: 44px;
}

.sd-starter-rise {
  border: 0;
  margin: 0;
  padding: 0;
}
.sd-starter-rise-legend {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.sd-starter-rise-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.sd-starter-rise-btn {
  min-height: 48px;
  padding: 0.5rem 0.6rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.sd-starter-rise-btn.is-selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.sd-starter-form-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.sd-starter-form-actions .btn {
  flex: 1 1 auto;
  min-height: 46px;
}
.sd-starter-form-error {
  margin: 0;
  font-size: 0.82rem;
  color: var(--error, #c45a3c);
  font-weight: 600;
}

/* Past feedings list */
.sd-starter-list { margin-top: 1rem; }
.sd-starter-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary, #7a6555);
}
.sd-starter-clear {
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  min-height: 32px;
}
.sd-starter-feedings {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sd-starter-feeding {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
}
.sd-starter-feeding-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.sd-starter-feeding-ratio {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}
.sd-starter-feeding-when {
  font-size: 0.8rem;
  color: var(--text-secondary, #7a6555);
}
.sd-starter-feeding-tags {
  font-size: 0.76rem;
  color: var(--text-secondary, #7a6555);
}
.sd-starter-feeding-side {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.sd-starter-rise-chip {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}
.sd-starter-rise-good {
  color: var(--success, #5a8a4a);
  background: color-mix(in srgb, var(--success, #5a8a4a) 14%, transparent);
}
.sd-starter-rise-weak {
  color: var(--warning, #ad7b1b);
  background: color-mix(in srgb, var(--warning, #ad7b1b) 16%, transparent);
}
.sd-starter-feeding-del {
  border: 0;
  background: none;
  color: var(--text-secondary, #7a6555);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ===== Starter troubleshooting / revival (R6) ===========================
   The "Troubleshoot it" entry under the feeding log + the guided diagnostic
   sheet. Reuses the bread palette + the wizard/starter card conventions: big
   tap targets (>=56px), warm accents, severity colours for the verdict. */

/* The entry button in the "My starter" card. */
.sd-starter-help-btn {
  margin-top: 1rem;
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 0.9rem;
  border: 1.5px dashed var(--border, #e6ddd2);
  border-radius: 14px;
  background: var(--bg-secondary);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 120ms ease;
}
.sd-starter-help-btn:active { transform: scale(0.99); }.sd-starter-help-btn:focus-visible {
  border-color: var(--accent, #d86e32);
  border-style: solid;
  background: color-mix(in oklab, var(--accent, #d86e32) 6%, transparent);
}
.sd-starter-help-icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.sd-starter-help-text { flex: 1; min-width: 0; }
.sd-starter-help-title { display: block; font-size: 1rem; font-weight: 600; }
.sd-starter-help-sub {
  display: block;
  font-size: 0.82rem;
  color: var(--text-secondary, #7a6555);
  margin-top: 0.12rem;
}
.sd-starter-help-chev {
  font-size: 1.5rem;
  color: var(--text-secondary, #7a6555);
  flex-shrink: 0;
}

/* The diagnostic sheet body. */
.ll-troubleshoot-body { padding-bottom: 1.5rem; }

.ll-ts-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent, #d86e32);
}
.ll-ts-q {
  margin: 0 0 0.45rem;
  font-family: "Playfair Display", serif;
  font-size: 1.3rem;
  line-height: 1.25;
  font-weight: 700;
}
.ll-ts-help {
  margin: 0 0 1.05rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-secondary, #6b5d52);
}

/* Answer buttons — full-width, generous touch targets. */
.ll-ts-answers { display: grid; gap: 0.6rem; }
.ll-ts-answer {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 60px;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--border, #e6ddd2);
  border-radius: 14px;
  background: var(--bg-card, #fff);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 120ms ease;
}
.ll-ts-answer:active { transform: scale(0.98); }.ll-ts-answer:focus-visible {
  border-color: var(--accent, #d86e32);
  background: color-mix(in oklab, var(--accent, #d86e32) 6%, transparent);
}
.ll-ts-answer-label { flex: 1; font-size: 0.98rem; }
.ll-ts-answer-chev { font-size: 1.35rem; color: var(--text-secondary, #7a6555); flex-shrink: 0; }
/* The "yes — fuzz / pink / rotten" answer is the dangerous path — flag it red. */
.ll-ts-answer-danger {
  border-color: color-mix(in oklab, var(--error, #c0392b) 45%, var(--border, #e6ddd2));
}.ll-ts-answer-danger:focus-visible {
  border-color: var(--error, #c0392b);
  background: color-mix(in oklab, var(--error, #c0392b) 7%, transparent);
}

/* The resolved guidance card. */
.ll-ts-result {
  border: 1.5px solid var(--border, #e6ddd2);
  border-radius: 16px;
  padding: 1.1rem;
  background: var(--bg-card, #fff);
}
.ll-ts-result-danger {
  border-color: var(--error, #c0392b);
  background: color-mix(in oklab, var(--error, #c0392b) 5%, transparent);
}
.ll-ts-result-caution {
  border-color: color-mix(in oklab, var(--accent, #d86e32) 55%, var(--border, #e6ddd2));
  background: color-mix(in oklab, var(--accent, #d86e32) 4%, transparent);
}
.ll-ts-result-ok {
  border-color: color-mix(in oklab, #2e7d32 50%, var(--border, #e6ddd2));
  background: color-mix(in oklab, #2e7d32 4%, transparent);
}
.ll-ts-result-head { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.ll-ts-result-title {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 1.25rem;
  line-height: 1.2;
  font-weight: 700;
}
.ll-ts-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  color: #fff;
}
.ll-ts-badge-danger { background: var(--error, #c0392b); }
.ll-ts-badge-caution { background: var(--accent, #d86e32); }
.ll-ts-badge-ok { background: #2e7d32; }
.ll-ts-result-summary {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  line-height: 1.5;
}
.ll-ts-steps {
  margin: 0 0 0.85rem;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.ll-ts-steps li { font-size: 0.92rem; line-height: 1.45; }

/* The engine-derived revival routine block. */
.ll-ts-plan {
  margin: 0 0 0.85rem;
  padding: 0.85rem;
  border: 1px solid var(--border, #e6ddd2);
  border-radius: 12px;
  background: var(--bg-secondary);
}
.ll-ts-plan-head {
  margin: 0 0 0.6rem;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.ll-ts-plan-meta {
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--accent, #d86e32);
  font-family: "IBM Plex Mono", monospace;
}
.ll-ts-plan-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.ll-ts-plan-row { display: flex; flex-direction: column; gap: 0.12rem; }
.ll-ts-plan-day {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary, #7a6555);
}
.ll-ts-plan-action { font-size: 0.9rem; line-height: 1.45; }
.ll-ts-plan-src {
  margin: 0.6rem 0 0;
  font-size: 0.74rem;
  font-style: italic;
  color: var(--text-secondary, #8a7665);
}
.ll-ts-note {
  margin: 0 0 1rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text-secondary, #6b5d52);
}
.ll-ts-result-actions { display: flex; gap: 0.6rem; }
.ll-ts-result-actions .btn { flex: 1; min-height: 48px; }
@media (max-width: 360px) {
  .ll-ts-result-actions { flex-direction: column; }
}

/* =====================================================================
   Guided "FIRST BAKE" walkthrough (R7)
   A hand-held linear teaching layer over the planner's engine numbers.
   Plan-tab entry card + a full bottom-sheet flow (rail + progress + stage).
   Warm bread palette, big tap targets, mobile-first.
   ===================================================================== */

/* ---- Plan-tab entry card ("Start / Resume my first bake") ---- */
.ll-firstbake-entry {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  margin: 0 0 1rem;
  padding: 0.95rem 1rem;
  border: 1.5px solid color-mix(in oklab, var(--accent, #b8703f) 38%, var(--border, #e6ddd2));
  border-radius: 16px;
  background:
    linear-gradient(135deg,
      color-mix(in oklab, var(--accent, #b8703f) 9%, var(--bg-card, #fffcf7)),
      var(--bg-card, #fffcf7) 70%);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(120, 70, 30, 0.07);
  transition: border-color 160ms ease, transform 120ms ease, box-shadow 160ms ease;
}.ll-firstbake-entry:focus-visible {
  border-color: var(--accent, #b8703f);
  box-shadow: 0 4px 16px rgba(120, 70, 30, 0.12);
}
.ll-firstbake-entry:active { transform: scale(0.99); }
.ll-firstbake-entry__icon {
  flex-shrink: 0;
  font-size: 1.9rem;
  line-height: 1;
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in oklab, var(--accent, #b8703f) 14%, transparent);
}
.ll-firstbake-entry__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.18rem; }
.ll-firstbake-entry__title {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 1.08rem;
  line-height: 1.15;
}
.ll-firstbake-entry__sub {
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--text-secondary, #7a6555);
}
.ll-firstbake-entry__progress { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.25rem; }
.ll-firstbake-entry__bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent, #b8703f) 16%, var(--border, #e6ddd2));
  overflow: hidden;
}
.ll-firstbake-entry__bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent, #b8703f);
  transition: width 240ms ease;
}
.ll-firstbake-entry__count {
  flex-shrink: 0;
  font-size: 0.74rem;
  font-weight: 700;
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent, #b8703f);
}
.ll-firstbake-entry__chev { flex-shrink: 0; font-size: 1.5rem; color: var(--text-secondary, #7a6555); }

/* ---- Sheet header (richer than the base drawer head) ---- */
.ll-firstbake-head { align-items: flex-start; }
.ll-firstbake-head__titles { display: flex; flex-direction: column; gap: 0.12rem; min-width: 0; }
.ll-firstbake-head__sub {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.3;
  color: var(--text-secondary, #7a6555);
  font-family: "IBM Plex Mono", monospace;
}

/* ---- Horizontal stage rail (tap to jump) ---- */
.ll-firstbake-rail {
  display: flex;
  gap: 0.4rem;
  padding: 0.65rem 1rem 0.35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border, #e6ddd2);
}
.ll-firstbake-rail::-webkit-scrollbar { display: none; }
.ll-fb-rail-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.22rem;
  min-width: 3.1rem;
  padding: 0.35rem 0.35rem 0.4rem;
  border: 1.5px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary, #7a6555);
  font: inherit;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.ll-fb-rail-item:active { transform: scale(0.97); }
.ll-fb-rail-icon {
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1.15rem;
  background: color-mix(in oklab, var(--border, #e6ddd2) 50%, transparent);
  transition: background 140ms ease, color 140ms ease;
}
.ll-fb-rail-label { font-size: 0.66rem; font-weight: 600; line-height: 1; white-space: nowrap; }
.ll-fb-rail-item.is-done { color: var(--accent, #b8703f); }
.ll-fb-rail-item.is-done .ll-fb-rail-icon {
  background: color-mix(in oklab, #2e7d32 22%, transparent);
  color: #2e7d32;
}
.ll-fb-rail-item.is-current {
  border-color: var(--accent, #b8703f);
  color: var(--text, #3a2a1c);
}
.ll-fb-rail-item.is-current .ll-fb-rail-icon {
  background: var(--accent, #b8703f);
  color: #fff;
}

/* ---- Top progress bar ---- */
.ll-firstbake-progress { padding: 0 1rem; }
.ll-firstbake-progress__bar {
  display: block;
  height: 5px;
  border-radius: 999px;
  margin-top: 0.5rem;
  background: color-mix(in oklab, var(--accent, #b8703f) 14%, var(--border, #e6ddd2));
  overflow: hidden;
}
.ll-firstbake-progress__fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent, #b8703f), color-mix(in oklab, var(--accent, #b8703f) 60%, #e8a862));
  transition: width 280ms cubic-bezier(0.25, 1, 0.5, 1);
}

/* ---- Current stage card ---- */
.ll-firstbake-body { padding-top: 1rem; }
.ll-fb-stage-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.4rem; }
.ll-fb-stage-step {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary, #7a6555);
}
.ll-fb-time {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent, #b8703f);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent, #b8703f) 10%, transparent);
  white-space: nowrap;
}
.ll-fb-time--wait { color: #2e7d32; background: color-mix(in oklab, #2e7d32 10%, transparent); }
.ll-fb-time-clock { font-size: 0.95rem; }
.ll-fb-stage-title {
  margin: 0 0 0.9rem;
  font-family: "Playfair Display", serif;
  font-size: 1.4rem;
  line-height: 1.15;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ll-fb-stage-emoji { font-size: 1.5rem; }

.ll-fb-block {
  margin: 0 0 0.85rem;
  padding: 0.85rem 0.9rem;
  border-radius: 13px;
  border: 1px solid var(--border, #e6ddd2);
  background: var(--bg-card, #fffcf7);
}
.ll-fb-do {
  border-color: color-mix(in oklab, var(--accent, #b8703f) 35%, var(--border, #e6ddd2));
  background: color-mix(in oklab, var(--accent, #b8703f) 5%, var(--bg-card, #fffcf7));
}
.ll-fb-look {
  border-color: color-mix(in oklab, #2e7d32 30%, var(--border, #e6ddd2));
  background: color-mix(in oklab, #2e7d32 4%, var(--bg-card, #fffcf7));
}
.ll-fb-block-label {
  margin: 0 0 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary, #7a6555);
}
.ll-fb-do .ll-fb-block-label { color: var(--accent-hover, #964e1f); }
.ll-fb-look .ll-fb-block-label { color: #2e7d32; }
.ll-fb-block-text { margin: 0; font-size: 0.95rem; line-height: 1.55; }

.ll-fb-tip {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: var(--bg-secondary, #f0e8dc);
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text-secondary, #6b5d52);
}
.ll-fb-tip-icon { flex-shrink: 0; font-size: 1rem; }
.ll-fb-src {
  margin: 0 0 1rem;
  font-size: 0.74rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--text-secondary, #8a7665);
}

.ll-fb-nav { display: flex; gap: 0.6rem; align-items: stretch; }
.ll-fb-nav .btn { flex: 1; min-height: 52px; font-size: 0.98rem; }
.ll-fb-back-spacer { flex: 0 0 0; }
.ll-fb-nav .ll-fb-back { flex: 0 0 38%; }
.ll-fb-stage.is-done .ll-fb-stage-title { color: var(--accent-hover, #964e1f); }

@media (max-width: 360px) {
  .ll-firstbake-entry__sub { font-size: 0.78rem; }
  .ll-fb-stage-title { font-size: 1.25rem; }
}

/* ---------------------------------------------------------------------------
   Dough Temperature (DDT) calculator card (#waterTempCalcCard, R9). Reuses the
   .ll-card / .ll-field / .sd-guidance-card shells; these rules style the
   summary affordance, the big water-temp result, and the reverse sub-section.
   Mobile-first, large tap targets.
   --------------------------------------------------------------------------- */
.ll-ddtcalc > summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
}
.ll-ddtcalc > summary::-webkit-details-marker { display: none; }
.ll-ddtcalc__summary-icon { font-size: 1.5rem; line-height: 1; flex: 0 0 auto; }
.ll-ddtcalc__summary-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.ll-ddtcalc__summary-sub { margin: 0; }
.ll-ddtcalc__result.sd-guidance-card { text-align: left; }
.ll-ddtcalc__big { margin: 0.15rem 0 0.35rem; }
.ll-ddtcalc__big strong { font-size: 1.7rem; line-height: 1.15; color: var(--accent); }
.ll-ddtcalc__reverse {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border, rgba(0, 0, 0, 0.12));
}
.ll-ddtcalc__reverse-out { margin-top: 0.5rem; }
.ll-ddtcalc__reverse-out strong { color: var(--accent); }

/* A5 native-feel: hover styling only on devices that can truly hover.
   On touch, WebView :hover 'sticks' after a tap - every hover rule was
   moved here mechanically (bodies unchanged) so taps stay clean. */
@media (hover: hover) {
.sd-mode-switch button:hover, .sd-unit-switch button:hover, .sd-link-btn:hover, .sd-secondary-btn:hover, .sd-export-actions button:hover, .sd-reset-row button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.sd-mode-switch button.is-active:hover, .sd-unit-switch button.is-active:hover {
  color: #fffaf3;
}
.sd-unit-switch button:hover:not(.is-active) {
  color: var(--text-primary) !important;
  background: rgba(0,0,0,0.05) !important;
  border: none !important;
}
[data-theme='dark'] .sd-unit-switch button:hover:not(.is-active) {
  background: rgba(255,255,255,0.05) !important;
}
.sd-term:hover {
  color: var(--accent-hover);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.sd-term:hover .sd-term-tip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.ll-goal-chip:hover {
  background: var(--bg-secondary, rgba(0, 0, 0, 0.04));
}
[data-theme="dark"] .ll-goal-chip:hover {
  background: rgba(255, 255, 255, 0.08);
}
.ll-live-btn-late:hover { background: var(--accent, #b8703f); color: #fff; }
[data-theme="dark"] .ll-live-btn-late:hover {
  background: var(--accent, #d2935f);
  color: #1a1a1a;
}
.ll-how-it-works__dismiss:hover { background: rgba(122, 62, 21, 0.08); color: var(--text); }
.ll-how-it-works__link:hover { color: var(--text); }
.ll-how-it-works__cta:hover { filter: brightness(1.05); }
.ll-hero-alert-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(173, 123, 27, 0.18);
}
.ll-start-bake-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(216, 110, 50, 0.4), 0 1px 2px rgba(0,0,0,0.08);
}
.ll-goal-wizard-btn:hover {
  background: color-mix(in oklab, var(--accent, #d86e32) 12%, transparent);
  border-style: solid;
}
.ll-wizard-bigchip:hover {
  border-color: var(--accent, #d86e32);
  background: color-mix(in oklab, var(--accent, #d86e32) 6%, transparent);
}
.ll-wizard-card:hover {
  border-color: var(--accent, #d86e32);
  background: color-mix(in oklab, var(--accent, #d86e32) 6%, transparent);
}
.ll-wizard-skip:hover, .ll-wizard-back:hover {
  color: var(--text, #2c1206);
  background: color-mix(in oklab, var(--accent, #d86e32) 8%, transparent);
}
.sd-starter-rise-btn:hover { border-color: var(--accent); }
.sd-starter-feeding-del:hover { color: var(--error, #c45a3c); background: var(--bg-secondary); }
.sd-starter-help-btn:hover {
  border-color: var(--accent, #d86e32);
  border-style: solid;
  background: color-mix(in oklab, var(--accent, #d86e32) 6%, transparent);
}
.ll-ts-answer:hover {
  border-color: var(--accent, #d86e32);
  background: color-mix(in oklab, var(--accent, #d86e32) 6%, transparent);
}
.ll-ts-answer-danger:hover {
  border-color: var(--error, #c0392b);
  background: color-mix(in oklab, var(--error, #c0392b) 7%, transparent);
}
.ll-firstbake-entry:hover {
  border-color: var(--accent, #b8703f);
  box-shadow: 0 4px 16px rgba(120, 70, 30, 0.12);
}
}
