/* Baker's Toolbox - Mobile-First Responsive Styles */

/* ========== CSS Custom Properties ========== */
:root {
  /* Colors - Warm bakery palette */
  --color-primary: #8B4513;
  --color-primary-light: #A0522D;
  --color-primary-dark: #6B3410;
  --color-accent: #D2691E;
  --color-accent-light: #F4A460;
  --color-bg: #FFF8F0;
  --color-surface: #FFFFFF;
  --color-surface-alt: #FFF3E6;
  --color-text: #2C1810;
  --color-text-secondary: #6B5B4F;
  --color-border: #E6D5C3;
  --color-border-light: #F0E6D8;
  --color-success: #2D8B46;
  --color-warning: #D4890A;
  --color-danger: #C0392B;
  --color-info: #2980B9;

  /* Step type colors */
  --color-active: #2980B9;
  --color-rest: #8E44AD;
  --color-proof: #F39C12;
  --color-bake: #E74C3C;

  /* Typography */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: Georgia, "Times New Roman", serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Borders */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

  /* Transitions */
  --transition: 0.2s ease;

  /* Layout */
  --header-height: 60px;
  --container-max: 1200px;
  --touch-target: 44px;
}

/* Dark theme */
[data-theme="dark"] {
  --color-primary: #D2A679;
  --color-primary-light: #E8C9A0;
  --color-primary-dark: #A07A50;
  --color-accent: #E8A84C;
  --color-accent-light: #F0C78E;
  --color-bg: #1a1a1a;
  --color-surface: #2c2c2c;
  --color-surface-alt: #363636;
  --color-text: #e8e8e8;
  --color-text-secondary: #a0a0a0;
  --color-border: #484848;
  --color-border-light: #3a3a3a;
}

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

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

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
  padding-top: var(--space-lg);
  padding-bottom: var(--space-2xl);
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  color: var(--color-primary-light);
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.3;
  color: var(--color-text);
}

h1 { font-size: 1.75rem; margin-bottom: var(--space-md); }
h2 { font-size: 1.375rem; margin-bottom: var(--space-sm); }
h3 { font-size: 1.125rem; margin-bottom: var(--space-sm); }

/* ========== Container ========== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ========== Header ========== */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
}

.logo-icon {
  font-size: 1.5rem;
}

/* Nav toggle (mobile hamburger) */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: var(--touch-target);
  height: var(--touch-target);
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}

.nav-toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: var(--transition);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Navigation */
.main-nav {
  display: none;
  position: absolute;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-md);
  flex-direction: column;
  gap: var(--space-xs);
  box-shadow: var(--shadow-md);
}

.main-nav.open {
  display: flex;
}

.nav-link {
  display: block;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-weight: 500;
  min-height: var(--touch-target);
  display: flex;
  align-items: center;
  transition: background var(--transition);
}

.nav-link:hover,
.nav-link.active {
  background: var(--color-surface-alt);
  color: var(--color-primary);
}

.nav-link.active {
  font-weight: 700;
}

/* Theme toggle */
.theme-toggle {
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.theme-icon::after {
  content: "☀️";
}

[data-theme="dark"] .theme-icon::after {
  content: "🌙";
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  min-height: var(--touch-target);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

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

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

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

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

.btn-sm {
  padding: var(--space-xs) var(--space-sm);
  min-height: 32px;
  font-size: 0.8125rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-sm:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-primary);
}

.btn-edit { color: var(--color-info); }
.btn-delete { color: var(--color-danger); }
.btn-use { color: var(--color-success); }
.btn-stop { color: var(--color-danger); }

/* ========== Form Elements ========== */
.input-field {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  min-height: var(--touch-target);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color var(--transition);
}

.input-field:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.15);
}

.input-field::placeholder {
  color: var(--color-text-secondary);
}

select.input-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B5B4F' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.form-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

/* ========== Hero Section ========== */
.hero {
  text-align: center;
  padding: var(--space-2xl) 0;
}

.hero h1 {
  font-size: 2rem;
  color: var(--color-primary);
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ========== Dashboard Cards ========== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  margin: var(--space-xl) 0;
}

.dashboard-card {
  display: block;
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text);
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
  color: var(--color-text);
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-sm);
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
}

.card-desc {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  margin-bottom: var(--space-md);
}

.card-stat {
  font-size: 0.875rem;
  color: var(--color-primary);
  font-weight: 600;
}

.stat-separator {
  margin: 0 var(--space-xs);
  color: var(--color-text-secondary);
}

/* ========== Features Grid ========== */
.features-section {
  margin: var(--space-2xl) 0;
}

.features-section h2 {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: var(--space-xl);
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.feature {
  padding: var(--space-lg);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
}

.feature h3 {
  color: var(--color-primary);
}

.feature p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
}

/* ========== Page Header ========== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.page-header-actions {
  display: flex;
  gap: var(--space-sm);
}

/* ========== Recipe Layout ========== */
.recipe-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.recipe-sidebar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  max-height: 300px;
  overflow-y: auto;
}

.sidebar-header {
  margin-bottom: var(--space-md);
}

.sidebar-header h2 {
  margin-bottom: var(--space-sm);
}

/* Recipe List */
.recipe-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.recipe-list-item {
  display: block;
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  min-height: var(--touch-target);
  font-family: var(--font-body);
  font-size: inherit;
  color: var(--color-text);
}

.recipe-list-item:hover {
  border-color: var(--color-primary);
  background: var(--color-surface-alt);
}

.recipe-list-item.active {
  border-color: var(--color-primary);
  background: var(--color-surface-alt);
  font-weight: 600;
}

.recipe-name {
  display: block;
  font-weight: 500;
}

.recipe-meta {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

/* Recipe Detail */
.recipe-detail {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.recipe-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.recipe-category-badge {
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-surface-alt);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary);
}

/* Scaling Controls */
.scaling-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.control-group label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.yield-label {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

.quick-scales {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  grid-column: 1 / -1;
}

.quick-scale {
  font-weight: 700;
}

/* Time Summary */
.time-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.time-item {
  text-align: center;
  padding: var(--space-sm);
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
}

.time-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.time-value {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* Ingredients List */
.ingredients-list {
  margin-bottom: var(--space-lg);
}

.ingredient-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.ingredient-amount {
  font-weight: 700;
  font-family: var(--font-mono);
  min-width: 4rem;
  text-align: right;
}

.ingredient-unit {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  min-width: 2.5rem;
}

.ingredient-name {
  flex: 1;
}

/* Steps List */
.steps-list {
  list-style: none;
  margin-bottom: var(--space-lg);
}

.step-item {
  padding: var(--space-md);
  border-left: 4px solid var(--color-border);
  margin-bottom: var(--space-sm);
  background: var(--color-surface-alt);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.step-type-active { border-left-color: var(--color-active); }
.step-type-rest { border-left-color: var(--color-rest); }
.step-type-proof { border-left-color: var(--color-proof); }
.step-type-bake { border-left-color: var(--color-bake); }

.step-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.step-number {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.step-badge {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.step-badge.active { background: var(--color-active); }
.step-badge.rest { background: var(--color-rest); }
.step-badge.proof { background: var(--color-proof); }
.step-badge.bake { background: var(--color-bake); }

.step-duration {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-left: auto;
}

.step-instruction {
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* Recipe Notes */
.recipe-notes-section {
  padding: var(--space-md);
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-accent);
}

.recipe-notes-text {
  font-style: italic;
  color: var(--color-text-secondary);
}

/* No Recipe State */
.no-recipe-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.empty-state-large {
  text-align: center;
  padding: var(--space-2xl);
}

.empty-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: var(--space-md);
}

.empty-state {
  text-align: center;
  padding: var(--space-xl);
  color: var(--color-text-secondary);
}

/* ========== Unit Converter ========== */
.unit-converter-section {
  margin-top: var(--space-2xl);
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.converter-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  align-items: center;
}

.converter-arrow {
  text-align: center;
  font-size: 1.5rem;
  color: var(--color-text-secondary);
}

.converter-result {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  padding: var(--space-md);
  min-height: 3rem;
}

/* ========== Ingredients Page ========== */
.low-stock-section {
  margin-bottom: var(--space-lg);
}

.low-stock-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.low-stock-item {
  padding: var(--space-sm) var(--space-md);
  background: rgba(192, 57, 43, 0.1);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}

.low-stock-name {
  font-weight: 600;
  display: block;
}

.low-stock-amount {
  color: var(--color-danger);
  font-size: 0.8125rem;
}

.all-good {
  color: var(--color-success);
  font-weight: 600;
  padding: var(--space-sm);
}

.filter-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

/* Ingredients Grid */
.ingredients-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.ingredient-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  transition: all var(--transition);
}

.ingredient-card.low-stock {
  border-color: var(--color-warning);
  background: rgba(212, 137, 10, 0.05);
}

.ingredient-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-sm);
}

.ingredient-card-name {
  font-size: 1rem;
  margin-bottom: 0;
}

.ingredient-card-category {
  font-size: 0.75rem;
  padding: 2px 8px;
  background: var(--color-surface-alt);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
}

.ingredient-card-amount {
  display: flex;
  align-items: baseline;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.amount-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.amount-unit {
  color: var(--color-text-secondary);
}

.low-badge {
  padding: 2px 8px;
  background: var(--color-warning);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: var(--space-sm);
}

.ingredient-card-actions {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

/* Substitutions */
.substitutions {
  border-top: 1px solid var(--color-border-light);
  padding-top: var(--space-sm);
}

.substitutions summary {
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
  min-height: var(--touch-target);
  display: flex;
  align-items: center;
}

.substitutions ul {
  list-style: none;
  padding: var(--space-sm) 0;
}

.substitutions li {
  padding: var(--space-xs) 0;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

.substitutions li strong {
  color: var(--color-text);
}

/* ========== Modal ========== */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal .modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
  opacity: 1;
  visibility: visible;
}

.modal .modal-content {
  position: relative;
  z-index: 2;
  background: var(--color-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--space-lg);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.modal-close {
  width: var(--touch-target);
  height: var(--touch-target);
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== Workflow / Timeline ========== */
.quick-timer-section {
  margin-bottom: var(--space-xl);
}

.quick-timer-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: var(--space-sm);
  align-items: end;
}

.quick-timers-list {
  margin-top: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.quick-timer-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.quick-timer-label {
  flex: 1;
  font-weight: 500;
}

.timer-display {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.125rem;
  min-width: 4rem;
  text-align: center;
}

.timer-display.active {
  color: var(--color-primary);
}

.timer-display.done {
  color: var(--color-success);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Timeline */
.timeline-section {
  margin-bottom: var(--space-xl);
}

.timeline-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  overflow: hidden;
}

.timeline-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.timeline-markers {
  position: relative;
  height: 30px;
  border-bottom: 1px solid var(--color-border);
}

.time-marker {
  position: absolute;
  top: 0;
  height: 100%;
  border-left: 1px solid var(--color-border-light);
}

.time-marker span {
  font-size: 0.6875rem;
  color: var(--color-text-secondary);
  padding-left: 4px;
}

.timeline-lanes {
  padding-top: var(--space-sm);
}

.timeline-lane {
  margin-bottom: var(--space-md);
}

.lane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
  padding: 0 var(--space-xs);
}

.lane-title {
  font-weight: 600;
  font-size: 0.875rem;
}

.lane-tasks {
  position: relative;
  height: 36px;
  background: var(--color-surface-alt);
  border-radius: var(--radius-sm);
}

.timeline-task {
  position: absolute;
  top: 2px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0 var(--space-sm);
  font-size: 0.6875rem;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity var(--transition);
}

.timeline-task.completed {
  opacity: 0.5;
}

.timeline-task.type-active { background: var(--color-active); }
.timeline-task.type-rest { background: var(--color-rest); }
.timeline-task.type-proof { background: var(--color-proof); }
.timeline-task.type-bake { background: var(--color-bake); }

.task-label {
  font-weight: 700;
}

.task-duration {
  opacity: 0.8;
}

/* Workflow Details */
.workflow-details-section {
  margin-bottom: var(--space-xl);
}

.workflow-recipe-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.workflow-recipe-section h3 {
  margin-bottom: var(--space-md);
}

/* Progress Bar */
.progress-bar {
  position: relative;
  height: 24px;
  background: var(--color-surface-alt);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-md);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--color-success);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.progress-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text);
}

/* Workflow Tasks */
.workflow-tasks {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.workflow-task {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
  transition: all var(--transition);
}

.workflow-task.completed {
  opacity: 0.6;
  text-decoration: line-through;
}

.task-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  flex: 1;
  cursor: pointer;
  min-height: var(--touch-target);
}

.task-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.task-info {
  display: flex;
  flex-direction: column;
}

.task-step-label {
  font-weight: 600;
  font-size: 0.875rem;
}

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

.task-actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.task-badge {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
}

.task-badge.active { background: var(--color-active); }
.task-badge.rest { background: var(--color-rest); }
.task-badge.proof { background: var(--color-proof); }
.task-badge.bake { background: var(--color-bake); }

.task-time {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
}

.btn-timer {
  font-weight: 700;
  color: var(--color-primary);
}

/* Task Detail Popup */
.task-detail-popup {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-top: 2px solid var(--color-primary);
  padding: var(--space-lg);
  z-index: 150;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.task-detail-content h3 {
  margin-bottom: var(--space-sm);
}

.task-detail-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  flex-wrap: wrap;
}

/* ========== Raptive Ad Slots ========== */
.raptive-ad {
  min-height: 90px;
  margin: var(--space-lg) 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== Footer ========== */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-lg) 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

/* ========== Focus Styles ========== */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

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

/* ========== Tablet (768px+) ========== */
@media (min-width: 768px) {
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.625rem; }

  .hero h1 { font-size: 2.75rem; }

  .nav-toggle { display: none; }

  .main-nav {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: var(--space-xs);
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
  }

  .nav-link {
    min-height: auto;
    padding: var(--space-xs) var(--space-sm);
  }

  .modal {
    align-items: center;
  }

  .modal .modal-content {
    max-width: 500px;
    border-radius: var(--radius-lg);
  }

  .dashboard-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .recipe-layout {
    grid-template-columns: 280px 1fr;
  }

  .recipe-sidebar {
    max-height: calc(100vh - var(--header-height) - 4rem);
    position: sticky;
    top: calc(var(--header-height) + var(--space-lg));
  }

  .filter-bar {
    grid-template-columns: 1fr 200px;
  }

  .ingredients-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .converter-row {
    grid-template-columns: 1fr auto 1fr auto 1fr;
  }

  .scaling-controls {
    grid-template-columns: repeat(3, 1fr);
  }

  .task-detail-popup {
    left: 50%;
    transform: translateX(-50%);
    max-width: 500px;
    border-radius: var(--radius-lg);
    bottom: var(--space-lg);
  }
}

/* ========== Desktop (1024px+) ========== */
@media (min-width: 1024px) {
  .ingredients-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .recipe-layout {
    grid-template-columns: 320px 1fr;
  }
}

/* ========== Print ========== */
@media print {
  .site-header,
  .site-footer,
  .nav-toggle,
  .raptive-ad,
  .theme-toggle,
  .btn,
  .btn-sm,
  .scaling-controls,
  .quick-scales,
  .filter-bar {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }

  .recipe-detail {
    border: none;
    box-shadow: none;
  }
}
