:root {
  --bg: #f6f2eb;
  --surface: #ffffff;
  --surface-soft: #faf7f2;
  --surface-hover: #f1ebe1;
  --border: #e5ddd0;
  --border-strong: #d4c8b6;

  --text: #1f1916;
  --text-muted: #6c6158;
  --text-soft: #8d8176;

  --accent: #c83e2b;
  --accent-hover: #b03322;
  --accent-soft: #fcebe8;
  --accent-text: #9d291a;

  --olive: #3a6b49;
  --olive-soft: #e9f3ec;
  --amber: #b86f18;
  --amber-soft: #fdf2e3;
  --water: #25689c;
  --water-soft: #e8f2fa;

  --shadow-sm: 0 1px 2px rgba(31, 25, 22, 0.05);
  --shadow-md: 0 8px 24px rgba(31, 25, 22, 0.08);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 9px;
}

[data-theme="dark"] {
  --bg: #151210;
  --surface: #201c19;
  --surface-soft: #28231f;
  --surface-hover: #322c27;
  --border: #342d28;
  --border-strong: #473e37;

  --text: #f5efe7;
  --text-muted: #b5a99d;
  --text-soft: #8c8075;

  --accent: #e05642;
  --accent-hover: #eb6855;
  --accent-soft: rgba(224, 86, 66, 0.16);
  --accent-text: #ff9a8b;

  --olive: #68b07d;
  --olive-soft: rgba(104, 176, 125, 0.16);
  --amber: #e2a24a;
  --amber-soft: rgba(226, 162, 74, 0.16);
  --water: #69b2ea;
  --water-soft: rgba(105, 178, 234, 0.16);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input, select {
  font: inherit;
  color: inherit;
}

.app-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px 48px;
  padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
}

/* Header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(200, 62, 43, 0.28);
  flex-shrink: 0;
}

.brand-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  min-width: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  box-shadow: var(--shadow-sm);
}

.icon-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.icon-btn:active {
  transform: scale(0.97);
}

.icon-btn.primary-tint {
  border-color: rgba(200, 62, 43, 0.25);
  color: var(--accent-text);
  background: var(--accent-soft);
}

.icon-btn.primary-tint:hover {
  border-color: var(--accent);
}

.badge-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.btn-label-desktop {
  display: none;
}

@media (min-width: 640px) {
  .btn-label-desktop {
    display: inline;
  }
}

/* Mobile Sticky Live Summary Bar */
.mobile-live-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: 0 -16px 14px;
  padding: 10px 14px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  text-align: center;
}

.mlb-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.mlb-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
}

.mlb-val {
  font-size: 0.88rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.mlb-accent .mlb-val {
  color: var(--accent);
}

@media (min-width: 900px) {
  .mobile-live-bar {
    display: none;
  }
}

/* Main Grid */
.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

@media (min-width: 900px) {
  .main-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(350px, 0.85fr);
    gap: 22px;
  }

  .results-column {
    position: sticky;
    top: 18px;
  }
}

.inputs-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.card-toggle-head {
  cursor: pointer;
  user-select: none;
  margin: -6px -8px 10px;
  padding: 6px 8px;
  border-radius: 12px;
  transition: background 0.14s;
}

.card-toggle-head:hover {
  background: var(--surface-soft);
}

.card-toggle-head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card-head-title-wrap {
  min-width: 0;
}

.card-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.card-collapsed-summary {
  display: none;
  margin: 3px 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-chevron {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 0.92rem;
  color: var(--text-muted);
  transition: transform 0.2s ease, background 0.14s;
  flex-shrink: 0;
}

.collapsible-card.is-collapsed {
  padding-top: 14px;
  padding-bottom: 14px;
}

.collapsible-card.is-collapsed .card-toggle-head {
  margin-bottom: -6px;
}

.collapsible-card.is-collapsed .card-body {
  display: none;
}

.collapsible-card.is-collapsed .card-collapsed-summary {
  display: block;
}

.collapsible-card.is-collapsed .card-chevron {
  transform: rotate(-90deg);
}

.card-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.pill-note {
  font-size: 0.76rem;
  font-weight: 650;
  color: var(--text-muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

/* Segmented Controls */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 13px;
  margin-bottom: 16px;
}

.segmented.three {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 0;
}

.seg-btn {
  border: none;
  background: transparent;
  padding: 10px 8px;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.seg-btn:hover {
  color: var(--text);
}

.seg-btn.active {
  background: var(--surface);
  color: var(--accent-text);
  box-shadow: 0 2px 6px rgba(31, 25, 22, 0.08);
}

/* Fields & Steppers */
.field-group {
  margin-bottom: 16px;
}

.field-group:last-child {
  margin-bottom: 0;
}

.field-group.compact {
  margin-bottom: 0;
}

.field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.field-header label {
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--text);
}

.sub-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.inline-result {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}

.inline-result.muted {
  color: var(--text-muted);
  font-weight: 600;
}

.stepper {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  overflow: hidden;
  min-height: 46px;
}

.stepper.compact {
  min-height: 40px;
}

.step-btn {
  width: 48px;
  border: none;
  background: transparent;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  user-select: none;
  flex-shrink: 0;
  transition: background 0.12s;
}

.stepper.compact .step-btn {
  width: 38px;
  font-size: 1.15rem;
}

.step-btn:hover {
  background: var(--surface-hover);
}

.step-btn:active {
  background: var(--border);
}

.step-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 0 8px;
  min-width: 0;
}

.step-input-wrap input {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  outline: none;
  padding: 6px 0;
}

.step-input-wrap input::-webkit-outer-spin-button,
.step-input-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.step-input-wrap input[type="number"] {
  -moz-appearance: textfield;
}

.step-input-wrap .unit {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Range Slider */
.slider {
  width: 100%;
  margin-top: 10px;
  accent-color: var(--accent);
  cursor: pointer;
  height: 6px;
}

/* Quick Chips */
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.row-spaced {
  margin-top: 12px;
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 650;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.14s;
  font-variant-numeric: tabular-nums;
}

.chip:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-strong);
}

.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-text);
}

.ball-suggest-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

/* Two column fields */
.two-col-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 420px) {
  .two-col-fields {
    grid-template-columns: 1fr;
  }
}

/* Fermentation rows */
.ferment-row {
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.ferment-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.ferment-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.ferment-dot.rt {
  background: var(--amber);
}

.ferment-dot.ct {
  background: var(--water);
}

.yeast-type-group {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.optional-block {
  padding-top: 14px;
  border-top: 1px dashed var(--border-strong);
}

/* Result Card */
.result-card {
  padding: 20px;
  box-shadow: var(--shadow-md);
}

.result-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.result-eyebrow {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.result-total-weight {
  font-size: 2.05rem;
  font-weight: 850;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.result-balls-pill {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 11px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.active-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.active-tags:empty {
  display: none;
}

.tag {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

.tag.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag.olive {
  background: var(--olive-soft);
  color: var(--olive);
}

.tag.accent {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.alert-box {
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid rgba(200, 62, 43, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 12px;
}

/* Ingredient Rows */
.ingredients-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.ing-row.highlight-yeast {
  background: var(--accent-soft);
  border-color: rgba(200, 62, 43, 0.25);
}

.ing-left {
  display: flex;
  align-items: center;
  gap: 11px;
}

.ing-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
}

.ing-icon.flour { background: var(--amber-soft); color: var(--amber); }
.ing-icon.water { background: var(--water-soft); color: var(--water); }
.ing-icon.salt { background: var(--surface-hover); color: var(--text-muted); }
.ing-icon.fat { background: var(--olive-soft); color: var(--olive); }
.ing-icon.yeast { background: var(--accent); color: #fff; }

.ing-name {
  font-size: 0.94rem;
  font-weight: 700;
}

.ing-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.ing-amount {
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.highlight-yeast .ing-amount {
  color: var(--accent-text);
}

/* Multi-stage Breakdown (Biga / Autolyse) */
.stages-container {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.stages-heading {
  margin: 0 0 10px;
  font-size: 0.86rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stage-card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  margin-bottom: 8px;
}

.stage-card:last-child {
  margin-bottom: 0;
}

.stage-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.stage-title {
  font-size: 0.88rem;
  font-weight: 750;
}

.stage-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stage-lines {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 12px;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.stage-line {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  color: var(--text-muted);
}

.stage-line strong {
  color: var(--text);
}

/* Fermentation Summary */
.ferment-summary {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-variant-numeric: tabular-nums;
}

/* Action Buttons */
.result-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.btn-primary,
.btn-secondary {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-hover);
}

.btn-primary:active,
.btn-secondary:active {
  transform: scale(0.98);
}

/* Settings Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 12, 10, 0.48);
  backdrop-filter: blur(2px);
  z-index: 90;
}

.settings-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 36px rgba(0, 0, 0, 0.2);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.settings-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.drawer-header h2 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

.settings-section {
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.settings-title {
  margin: 0 0 6px;
  font-size: 0.94rem;
  font-weight: 750;
}

.settings-desc {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.toggle-card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
}

.toggle-card:last-child {
  margin-bottom: 0;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.toggle-row strong {
  display: block;
  font-size: 0.9rem;
}

.toggle-row small {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.toggle-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Custom Switch */
.switch {
  appearance: none;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s;
}

.switch:checked {
  background: var(--accent);
}

.switch:checked::after {
  transform: translateX(20px);
}

.stack-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-pill {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--text-muted);
}

.info-pill strong {
  color: var(--text);
}

.pwa-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--olive-soft);
  border: 1px solid rgba(58, 107, 73, 0.25);
  font-size: 0.82rem;
}

.pwa-box strong {
  display: block;
  color: var(--olive);
  margin-bottom: 4px;
}

.pwa-box p {
  margin: 0 0 10px;
  color: var(--text-muted);
}

/* Schedule / Timeline Calculator */
.select-input,
.time-input {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  outline: none;
  cursor: pointer;
}

.select-input:focus,
.time-input:focus {
  border-color: var(--accent);
}

.rt-split-box {
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.readonly-pill {
  min-height: 40px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}

.schedule-alert {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid rgba(200, 62, 43, 0.28);
  color: var(--accent-text);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.schedule-tip {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  border: 1px solid rgba(184, 111, 24, 0.25);
  color: var(--text);
  font-size: 0.81rem;
  line-height: 1.4;
}

.timeline {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 12px;
  bottom: 14px;
  width: 2px;
  background: var(--border);
}

.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  padding-bottom: 14px;
}

.tl-item:last-child {
  padding-bottom: 0;
}

.tl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 5px 0 0 6px;
  background: var(--border-strong);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--border);
  position: relative;
  z-index: 1;
}

.tl-item.kind-rt .tl-dot {
  background: var(--amber);
  box-shadow: 0 0 0 2px var(--amber-soft);
}

.tl-item.kind-ct .tl-dot {
  background: var(--water);
  box-shadow: 0 0 0 2px var(--water-soft);
}

.tl-item.kind-biga .tl-dot,
.tl-item.kind-autolyse .tl-dot {
  background: var(--olive);
  box-shadow: 0 0 0 2px var(--olive-soft);
}

.tl-item.kind-oven .tl-dot {
  background: var(--text-muted);
}

.tl-item.kind-bake .tl-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tl-body {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 12px;
}

.tl-item.kind-bake .tl-body {
  background: var(--accent-soft);
  border-color: rgba(200, 62, 43, 0.28);
}

.tl-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.tl-title {
  font-size: 0.88rem;
  font-weight: 750;
}

.tl-item.kind-bake .tl-title {
  color: var(--accent-text);
}

.tl-time {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tl-detail {
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Kneading & Stretch-and-Fold Timer */
.timer-top-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(200, 62, 43, 0.35);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 0.82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  white-space: nowrap;
}

.timer-top-pill.ringing {
  background: var(--accent);
  color: #fff;
  animation: pulseGlow 1.1s infinite;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulseDot 1.3s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 62, 43, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(200, 62, 43, 0); }
}

.card-sub-inline {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.timer-steps-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.t-step-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.t-step-pill.done {
  background: var(--olive-soft);
  border-color: rgba(58, 107, 73, 0.3);
  color: var(--olive);
}

.t-step-pill.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-text);
}

.timer-stage {
  text-align: center;
  padding: 16px 14px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.timer-card.is-ringing .timer-stage {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.timer-phase-label {
  font-size: 0.84rem;
  font-weight: 750;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.timer-clock {
  font-size: 3.1rem;
  font-weight: 850;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.timer-card.is-running .timer-clock {
  color: var(--accent-text);
}

.timer-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.timer-progress-track {
  margin-top: 12px;
  height: 7px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.timer-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.25s linear;
}

.timer-ring-box {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  border: 2px solid var(--accent);
  margin-bottom: 12px;
  text-align: center;
  animation: pulseGlow 1.4s infinite;
}

.timer-ring-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-text);
}

.timer-ring-desc {
  font-size: 0.85rem;
  color: var(--text);
  margin: 4px 0 12px;
}

.timer-ring-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-giant {
  min-height: 54px;
  font-size: 1rem;
}

.timer-done-box {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--olive-soft);
  border: 1px solid rgba(58, 107, 73, 0.35);
  margin-bottom: 12px;
  text-align: center;
}

.timer-done-box strong {
  display: block;
  color: var(--olive);
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.timer-done-box p {
  margin: 0 0 12px;
  font-size: 0.84rem;
  color: var(--text);
}

.timer-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timer-secondary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.timer-config {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.timer-config-summary {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.timer-config-summary::-webkit-details-marker {
  display: none;
}

.timer-config-summary::after {
  content: "▾";
  font-size: 0.9rem;
  transition: transform 0.15s;
}

.timer-config[open] .timer-config-summary::after {
  transform: rotate(180deg);
}

.timer-config-body {
  margin-top: 12px;
}

.timer-toggles {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mini-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.timer-note {
  margin: 10px 0 0;
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 650;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 200;
  white-space: nowrap;
}
