@layer pages {
/* ═══════════════════════════════════════════════════════════════════
   FORM WIZARD (recipe/form.php)
   ======================================================================= */

/* Wizard header — inlocuieste app-header pe paginile de form */
.wizard-header {
  padding: 12px 20px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.wizard-header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.wizard-back-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.wizard-back-btn:hover { color: var(--text-secondary); text-decoration: none; }

.wizard-title {
  font-family: var(--font-family-serif);
  font-size: 16px;  /* mobile-first base */
  color: var(--text-primary);
}

/* Draft btn */
.draft-btn {
  font-size: 12px;  /* mobile-first base */
  color: var(--brand);
  border: 1px solid var(--brand-soft);
  background: var(--bg);
  padding: 4px 10px;  /* mobile-first base */
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--duration-fast);
}
.draft-btn:hover { background: var(--brand-soft); }

/* Step dots */
.wizard-steps { display: flex; align-items: center; }

.wstep {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  cursor: default;
}
.wstep:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 11px;
  left: calc(50% + 14px);
  right: calc(-50% + 14px);
  height: 1.5px;
  background: var(--border);
}
.wstep.done:not(:last-child)::after { background: var(--brand); }

.wstep-dot {
  width: 26px; height: 26px;  /* mobile-first base */
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: var(--font-weight-bold);  /* mobile-first */
  color: var(--text-muted);
  background: var(--bg);
  position: relative; z-index: 1;
  transition: background var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast);
}
.wstep.done   .wstep-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.wstep.active .wstep-dot { background: var(--text-primary); border-color: var(--text-primary); color: var(--bg); }

.wstep-label {
  display: none;  /* mobile-first: hidden pe ecrane mici */
  font-size: 12px; color: var(--text-muted);
  letter-spacing: 0.04em; text-align: center; line-height: 1.2;
  transition: color var(--duration-fast);
}
.wstep.active .wstep-label { color: var(--text-primary); font-weight: var(--font-weight-medium); }
.wstep.done   .wstep-label { color: var(--brand); }

/* Step panels */
.wizard-step { display: none; }
.wizard-step.active { display: block; }

.form-step-body {
  padding-bottom: calc(72px + 80px);
}

/* ── Sections — structura exactă din machetă ────────────────────── */
.form-section {
  padding: var(--space-4) var(--space-4) 0;  /* mobile-first base */
}

/* fs-label: uppercase mic, letter-spacing 0.12em, exact ca macheta */
.fs-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: var(--font-weight-medium);
  margin-bottom: 12px;
}

/* field + field-label + field-input — clasa exactă din machetă */
.field { margin-bottom: var(--space-4); display: block; }
.field:last-child { margin-bottom: 0; }

.field-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 4px;
  width: 100%;
  box-sizing: border-box;
}
.req { color: var(--brand); font-size: 13px; }

/* field-input: background parchment, border cald — identic cu macheta */
.field-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: var(--font-size-base);
  color: var(--text-primary);
  font-family: var(--font-family-base);
  outline: none;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}
.field-input:focus { border-color: var(--brand); background: var(--bg); }
.field-input::placeholder { color: var(--text-muted); }
.field-input.textarea { resize: none; height: 80px; line-height: 1.6; }
.field-input.error { border-color: var(--danger); }

/* char-count — dreapta sub input */
.char-count {
  font-size: 13px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 3px;
}

/* ── Categorie grid — cu SVG icon ────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.cat-opt {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px;
  min-height: 44px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: background var(--duration-fast), border-color var(--duration-fast);
  -webkit-tap-highlight-color: transparent;
}
.cat-opt:hover { background: var(--surface-2); border-color: var(--border-strong); }
.cat-opt:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.cat-opt.selected {
  background: var(--brand-soft);
  border-color: var(--brand);
}

.cat-opt-icon {
  width: 20px; height: 20px;
  min-width: 20px; min-height: 20px;
  stroke: var(--text-muted); fill: none;
  stroke-width: 1.5; stroke-linecap: round;
  display: block; margin: 0 auto 4px;
  overflow: hidden;
  transition: stroke var(--duration-fast);
}
.cat-opt.selected .cat-opt-icon { stroke: var(--brand-hover); }

.cat-opt-name {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
  line-height: 1.2;
}
.cat-opt.selected .cat-opt-name { color: var(--brand-hover); }

/* Subcategorii — mai compacte, fără icon */
.cat-grid--sub { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cat-opt--sub {
  min-height: 44px;
  padding: var(--space-2) var(--space-2);
  justify-content: center;
}
.cat-opt--sub .cat-opt-name { font-size: 12px; }

.cat-sub-header {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
  font-weight: var(--font-weight-medium);
}

/* ── Dificultate — easy/med/hard cu culori semantice ─────────────── */
.diff-row { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }  /* mobile-first: wrap */

.diff-opt {
  flex: 1 1 calc(33% - 4px); min-width: 80px;  /* mobile-first */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  transition: background var(--duration-fast), border-color var(--duration-fast);
  -webkit-tap-highlight-color: transparent;
}
.diff-opt:hover { background: var(--surface-2); }

.diff-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
}
.diff-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Selected states semantice */
.diff-opt.easy.selected { background: var(--brand-soft); border-color: var(--brand); }
.diff-opt.easy.selected .diff-label { color: var(--brand-hover); }

.diff-opt.medium.selected { background: var(--diff-med-bg); border-color: var(--diff-med-text); }
.diff-opt.medium.selected .diff-label { color: var(--diff-med-text); }

.diff-opt.hard.selected { background: var(--danger-soft); border-color: var(--danger); }
.diff-opt.hard.selected .diff-label { color: var(--danger); }

[data-theme="dark"] .diff-opt.easy.selected   { background: var(--brand-soft); border-color: var(--brand); }
[data-theme="dark"] .diff-opt.medium.selected { background: var(--diff-med-bg); border-color: var(--diff-med-text); }
[data-theme="dark"] .diff-opt.hard.selected   { background: var(--danger-soft); border-color: var(--danger); }

/* ── Timp & porții — time-input-wrap cu unitate în dreapta ──────── */
.time-row { display: flex; gap: var(--space-2); margin-bottom: var(--space-4); }  /* mobile-first */
.time-field { flex: 1; }

.time-input-wrap {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color var(--duration-fast);
}
.time-input-wrap:focus-within { border-color: var(--brand); }
.time-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 10px;
  font-size: var(--font-size-base);
  color: var(--text-primary);
  font-family: var(--font-family-base);
  outline: none;
  width: 0; /* flex child, nu overflow */
  min-width: 0;
}
.time-unit {
  font-size: 13px;
  color: var(--text-muted);
  padding-right: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}
/* Input editabil unitate porție — înlocuiește .time-unit fix pe câmpul Porții */
.servings-unit-input {
  flex: 0 0 auto;
  width: 72px;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  padding: 12px 10px;
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-family-base);
  outline: none;
  text-align: center;
}
.servings-unit-input::placeholder { color: var(--text-muted); opacity: 0.7; }
.servings-unit-input:focus { color: var(--text-primary); border-left-color: var(--brand); }

/* ── Vizibilitate — vis-opt cu SVG icon ──────────────────────────── */
.vis-row { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-5); }  /* mobile-first */

.vis-opt {
  width: 100%;  /* mobile-first: full width pe column layout */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: background var(--duration-fast), border-color var(--duration-fast);
  -webkit-tap-highlight-color: transparent;
}
.vis-opt:hover { background: var(--surface-2); border-color: var(--border-strong); }
.vis-opt.selected { background: var(--bg); border-color: var(--text-primary); }

.vis-opt svg {
  width: 16px; height: 16px;
  min-width: 16px; min-height: 16px;
  stroke: var(--text-muted); fill: none;
  stroke-width: 1.6; stroke-linecap: round;
  flex-shrink: 0;
  transition: stroke var(--duration-fast);
}
.vis-opt.selected svg { stroke: var(--text-primary); }

.vis-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
}
.vis-opt.selected .vis-name { color: var(--text-primary); }

.vis-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Ingredient rows in wizard */
.group-block {
  margin: 0 var(--space-5) var(--space-4);
}
.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}
.group-name,
.group-header__name {
  font-family: var(--font-family-serif);
  font-size: var(--font-size-md);
  color: var(--text-primary);
}
/* Lista grup named — border subtil diferit de lista default */
.ingr-list--group {
  border-color: var(--brand);
  border-style: dashed;
}
/* Prompt creare grup nou */
.group-name-prompt {
  margin: 0 var(--space-5) var(--space-3);
  display: flex; gap: var(--space-2); align-items: center;
}
.group-edit {
  font-size: var(--font-size-xs);
  color: var(--brand);
  cursor: pointer;
}
.ingr-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-2);
}
.ingr-row-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 11px var(--space-3);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.ingr-row-item:last-child { border-bottom: none; }
.ingr-row-item:nth-child(even) { background: var(--surface); }

.ingr-drag-handle {
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: grab;
  padding: var(--space-1);
  flex-shrink: 0;
  opacity: 0.4;
}
.ingr-drag-handle span {
  display: block;
  width: 14px; height: 2px;
  background: var(--text-muted);
  border-radius: 1px;
}
.ingr-drag-handle:active { cursor: grabbing; }

.ingr-name { flex: 1; min-width: 0; }
.ingr-name-text {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ingr-name-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}
.ingr-qty-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.ingr-qty {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
  min-width: 28px;
  text-align: right;
}
.ingr-unit {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 24px;
}
.ingr-del-btn {
  width: 24px; height: 24px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color var(--duration-fast), border-color var(--duration-fast);
}
.ingr-del-btn:hover { color: var(--danger); border-color: var(--danger); }

/* Buton adaugă ingredient per grup */
.add-ingr-btn {
  width: 100%;
  background: transparent;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 11px;
  font-size: var(--font-size-sm);
  color: var(--brand);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 7px;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}
.add-ingr-btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.add-ingr-btn svg { flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* Panou adăugare ingredient — cu border brand */
.add-panel {
  margin: 0 var(--space-5) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--brand);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  position: relative;
}
.ap-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}
.ap-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px var(--space-3);
  margin-bottom: var(--space-2);
  position: relative;
}
.ap-search svg { flex-shrink: 0; stroke: var(--text-muted); fill: none; stroke-width: 1.8; stroke-linecap: round; }
.ap-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  outline: none;
}
.ap-search input::placeholder { color: var(--text-muted); }
.ap-row {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.ap-qty {
  flex: 0 0 80px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  outline: none;
}
.ap-unit {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  outline: none;
}
.ap-note {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  outline: none;
  margin-bottom: var(--space-2);
}
.ap-note::placeholder { color: var(--text-muted); }

/* Notice creare ingredient nou */
.ap-create-notice {
  display: flex; align-items: flex-start; gap: var(--space-2);
  font-size: var(--font-size-xs); color: var(--text-secondary);
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3); line-height: var(--line-height-base);
}
.ap-create-notice svg { flex-shrink: 0; margin-top: 1px; stroke: var(--text-muted); fill: none; stroke-width: 2; stroke-linecap: round; }
.ap-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.ap-cancel {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  cursor: pointer;
}
.ap-add {
  flex: 2;
  background: var(--text-primary);
  border: none;
  border-radius: var(--radius-md);
  padding: 10px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--bg);
  cursor: pointer;
}

/* Buton adaugă grup */
.add-group-btn {
  margin: 0 var(--space-5) var(--space-5);
  width: calc(100% - var(--space-5) * 2);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px;
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 7px;
}
.add-group-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.add-group-btn svg { flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* Step edit rows — Pas 3 Preparare */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5) var(--space-2);
}
.sh-count {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}
.step-edit-row {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: var(--space-6) var(--space-5) 0;
}
.step-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.step-num {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: var(--text-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: var(--font-weight-bold);
  color: var(--bg);
  flex-shrink: 0;
}
.step-connector {
  width: 1.5px;
  background: var(--border);
  min-height: 120px;
  margin: var(--space-2) auto 0;
}
.step-body {
  flex: 1;
  padding-bottom: var(--space-6);
  min-width: 0;
}
.step-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.step-desc-input {
  flex: 1;
  width: 100%;
  border: none;
  background: transparent;
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  line-height: 1.7;
  outline: none;
  resize: none;
  min-height: 80px;
  padding: 0;
  display: block;
}
.step-desc-input::placeholder { color: var(--text-muted); }
.step-actions {
  display: flex;
  gap: var(--space-1);
  padding-top: 2px;
  flex-shrink: 0;
}
.step-bottom-row {
  display: flex;
  align-items: center;
  margin-top: var(--space-3);
}
.step-del-btn {
  color: var(--text-muted);
  padding: var(--space-1);
  flex-shrink: 0;
  transition: color var(--duration-fast);
}
.step-del-btn:hover { color: var(--danger); }

.step-timer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--brand);
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 0;
  transition: color var(--duration-fast);
}
.step-timer-toggle svg { stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.step-timer-toggle.active {
  background: var(--brand-soft);
  border: 1px solid var(--brand);
  padding: 4px var(--space-3);
  border-radius: var(--radius-full);
  color: var(--brand-hover);
}
.step-divider {
  height: 1px;
  background: var(--border);
  margin: 0 var(--space-5) 0 calc(var(--space-5) + 36px + 18px);
}

/* Selector ingrediente per pas — Pas 3 wizard */
.step-ingr-selector {
  margin-top: var(--space-2);
  margin-bottom: var(--space-1);
}
.step-ingr-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 0;
  transition: color var(--duration-fast);
}
.step-ingr-toggle:hover,
.step-ingr-toggle[aria-expanded="true"] { color: var(--brand); }
.step-ingr-toggle svg { stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.step-ingr-toggle-label { font-size: 13px; }
.step-ingr-toggle.has-selection { color: var(--brand); }
.step-ingr-panel {
  margin-top: var(--space-2);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.step-ingr-hint {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}
.step-ingr-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.step-ingr-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-xs);
  padding: 4px var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color var(--duration-fast), background var(--duration-fast), color var(--duration-fast);
  white-space: nowrap;
}
.step-ingr-chip-btn:hover { border-color: var(--brand); color: var(--brand); }
.step-ingr-chip-btn.selected {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.step-ingr-chip-btn.selected svg { stroke: #fff; }
.step-ingr-empty {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-style: italic;
}

/* Buton adaugă pas */
.add-step-btn {
  margin: var(--space-4) var(--space-5) var(--space-6) calc(var(--space-5) + 36px + 18px);
  background: transparent;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  font-size: var(--font-size-sm);
  color: var(--brand);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: var(--space-2);
  transition: border-color var(--duration-fast), background var(--duration-fast);
}
.add-step-btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.add-step-btn svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* Pas 4 — Foto & Publicare */
.photo-main {
  margin: 0 var(--space-5);
  border-radius: var(--radius-lg);
  border: 1.5px dashed var(--border);
  height: 180px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}
.photo-main:hover { border-color: var(--brand); background: var(--brand-soft); }
.ph-icon {
  width: 32px; height: 32px;
  stroke: var(--text-muted); fill: none;
  stroke-width: 1.2; stroke-linecap: round;
}
.photo-botanical {
  position: absolute;
  right: 14px; bottom: 12px;
  opacity: 0.13;
  pointer-events: none;
}
.photo-main-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}
.photo-main-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* Photo grid — thumburi existente + buton adaugă */
.photo-grid {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5) 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.photo-grid::-webkit-scrollbar { display: none; }

.photo-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.photo-thumb.primary-thumb {
  border: 2px solid var(--brand);
}
.primary-badge {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: var(--bg);
  font-size: 8px;
  font-weight: var(--font-weight-bold);
  padding: 2px 5px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: 0.04em;
  pointer-events: none;
}
.photo-add-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  border: 1.5px dashed var(--border);
  background: transparent;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.photo-add-thumb:hover { border-color: var(--brand); background: var(--brand-soft); }

.photo-thumb-delete {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(42,37,32,0.75);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding: 0;
  opacity: 0;
  transition: opacity var(--duration-fast);
  z-index: 2;
}
.photo-thumb:hover .photo-thumb-delete { opacity: 1; }
.photo-thumb-delete:hover { background: var(--danger); }
/* Thumb local (preview înainte de submit) — X vizibil permanent */
.photo-thumb--local { border-color: var(--brand-soft); }
.photo-thumb--local .photo-thumb-delete { opacity: 1; background: rgba(42,37,32,0.55); }

.pub-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-5) var(--space-5) 0;
}

/* Setting row — vizibilitate + status */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  gap: var(--space-3);
}
.setting-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
}
.setting-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Segment control Publică/Privată */
.seg-ctrl {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
}
.seg-opt {
  padding: 6px var(--space-3);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--duration-fast), color var(--duration-fast);
  user-select: none;
}
.seg-opt.active {
  background: var(--text-primary);
  color: var(--bg);
}

/* Status pills Draft/Publică */
.status-opts {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}
.status-opt {
  padding: 5px var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  cursor: pointer;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: transparent;
  white-space: nowrap;
  user-select: none;
  transition: background var(--duration-fast), color var(--duration-fast), border-color var(--duration-fast);
}
.status-opt.active-draft {
  background: var(--surface);
  border-color: var(--text-muted);
  color: var(--text-secondary);
}
.status-opt.active-pub {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg);
}

/* Summary block */
.summary-block {
  margin: var(--space-5) var(--space-5) 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.summary-title {
  font-family: var(--font-family-serif);
  font-size: var(--font-size-md);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}
.summary-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--border);
}
.summary-row:last-child { border-bottom: none; }
.summary-key {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}
.summary-val {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
  display: flex;
  align-items: center;
  gap: 5px;
}
.summary-val--ok  { color: var(--brand); }
.summary-val--warn { color: var(--warning); }
.summary-val--neutral { color: var(--text-muted); }
.check-icon {
  width: 13px; height: 13px;
  stroke: var(--brand); fill: none;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}
.warn-icon {
  width: 13px; height: 13px;
  stroke: var(--warning); fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   COOKING MODE (recipe/cooking_mode.php)
   ======================================================================= */

/* Cook header — sticky, inlocuieste app-header */
.cook-header {
  padding: var(--space-3) var(--space-5) var(--space-2);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.cook-header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.cook-back-btn {
  display: flex; align-items: center; gap: 5px;
  font-size: var(--font-size-sm); color: var(--text-muted);
  text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.cook-back-btn:hover { color: var(--text-secondary); text-decoration: none; }

.cook-header__title {
  font-family: var(--font-family-serif);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  font-weight: var(--font-weight-normal);
}

.cook-step-counter {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Progress bar */
.cook-progress-track {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.cook-progress-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 2px;
  transition: width var(--duration-normal) var(--easing-default);
}

/* Step dots */
.cook-step-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: var(--space-4) var(--space-5) 0;
  flex-wrap: wrap;
}

.cook-dot {
  width: 28px; height: 28px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: var(--font-weight-bold);
  color: var(--text-muted);
  background: var(--bg);
  cursor: pointer;
  transition: background var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast);
  -webkit-tap-highlight-color: transparent;
}
.cook-dot.done   { background: var(--brand);        border-color: var(--brand);        color: #fff; }
.cook-dot.active { background: var(--text-primary);  border-color: var(--text-primary); color: var(--bg); }
.cook-dot:hover:not(.active):not(.done) { background: var(--surface); }

/* Step card */
.cook-step-card {
  margin: var(--space-4) var(--space-5) 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  position: relative;
  padding: var(--space-5) var(--space-5) var(--space-4);
}

.cook-step-badge {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: var(--space-2);
}

.cook-step-text {
  font-size: var(--font-size-base);
  color: var(--text-primary);
  line-height: var(--line-height-loose);
  margin-bottom: var(--space-4);
}

.cook-step-ingr {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

/* Buton timer inline */
.cook-step-timer-wrap { margin-bottom: var(--space-3); }

.cook-add-timer-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--font-size-xs); color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand);
  border-radius: var(--radius-full);
  padding: 5px var(--space-3);
  cursor: pointer;
  transition: background var(--duration-fast);
}
.cook-add-timer-btn:hover { background: var(--brand); color: #fff; }

/* Marchează finalizat */
.cook-done-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  background: transparent;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color var(--duration-fast), color var(--duration-fast), background var(--duration-fast);
}
.cook-done-btn:hover { border-color: var(--brand); color: var(--brand); }
.cook-done-btn.done-state {
  background: var(--brand-soft); border-color: var(--brand);
  color: var(--brand-hover); border-style: solid;
}

/* Timere section */
.cook-timers-section {
  padding: var(--space-4) var(--space-5) 0;
}

.cook-timers-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.cook-timers-list { display: flex; flex-direction: column; gap: var(--space-2); }

/* Timer pill states */
.timer-pill {
  display: flex; align-items: center; gap: var(--space-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 11px var(--font-size-sm);
  transition: border-color var(--duration-fast), background var(--duration-fast);
}

.timer-pill.running  { border-color: var(--brand); background: var(--brand-soft); }
.timer-pill.paused   { border-color: var(--text-muted); background: var(--surface); }
.timer-pill.finished { border-color: var(--brand); background: var(--brand-soft); }

.timer-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.timer-icon svg {
  width: 16px; height: 16px;
  stroke: var(--text-muted); fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.timer-pill.running .timer-icon { background: var(--brand-soft); border-color: var(--brand); }
.timer-pill.running .timer-icon svg { stroke: var(--brand-hover); }

.timer-body { flex: 1; min-width: 0; }
.timer-name { font-size: var(--font-size-sm); color: var(--text-primary); font-weight: var(--font-weight-medium); margin-bottom: 1px; }

.timer-display {
  font-family: var(--font-family-serif);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-normal);
  color: var(--text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.timer-pill.running  .timer-display { color: var(--brand); }
.timer-pill.finished .timer-display { color: var(--brand); }

.timer-sub { font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 1px; }

.timer-ctrl { display: flex; gap: var(--space-2); flex-shrink: 0; }

.t-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-full);
  background: var(--text-primary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: opacity var(--duration-fast);
  border: none;
}
.t-btn:hover { opacity: 0.8; }
.t-btn svg {
  width: 13px; height: 13px;
  stroke: #fff; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.t-btn.play   { background: var(--brand); }
.t-btn.stop   { background: var(--text-muted); }

/* Ingrediente chips */
.cook-ingr-section { padding: var(--space-4) var(--space-5) 0; }
.cook-ingr-title {
  font-size: var(--font-size-xs); font-weight: var(--font-weight-bold);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted);
  margin-bottom: var(--space-2);
  display: flex; align-items: center; gap: var(--space-2);
}
.cook-ingr-scale-badge {
  font-size: 11px; font-weight: 600; letter-spacing: 0;
  text-transform: none; color: var(--brand);
  background: var(--brand-soft); border-radius: var(--radius-full);
  padding: 2px 8px;
}
.cook-ingr-group {
  font-family: var(--font-family-serif);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin: var(--space-3) 0 var(--space-2);
  font-style: italic;
}
.cook-ingr-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-2); }
.cook-ingr-chip {
  font-size: var(--font-size-xs);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px var(--space-3);
  color: var(--text-secondary);
}
.cook-ingr-chip strong { color: var(--text-primary); font-weight: var(--font-weight-bold); }

/* Cook nav */
.cook-nav {
  position: fixed;
  bottom: 0;
  left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 1200px;
  padding: var(--space-3) var(--space-5) calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  background: rgba(250, 248, 244, 0.97);
  border-top: 1px solid var(--border);
  display: flex; gap: var(--space-2);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-sticky);
}

[data-theme="dark"] .cook-nav { background: rgba(26, 23, 20, 0.97); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cook-nav { background: rgba(26, 23, 20, 0.97); }
}


/* ── Mobile-first — ≥ 481px restaurare desktop ─────────────────── */
@media (min-width: 481px) {
  .form-section { padding: var(--space-5) var(--space-5) 0; }
  .wstep-label { display: block; }
  .wstep-dot   { width: 22px; height: 22px; font-size: 12px; }
  .cat-opt  { padding: 10px 8px; }
  .cat-opt-name { font-size: 13px; }
  .diff-opt { flex: 1; min-width: auto; }
  .time-row { gap: var(--space-2); }
  .vis-row { flex-direction: row; gap: var(--space-2); }
  .vis-opt  { width: auto; flex: 1; }
  .wizard-title { font-size: 18px; }
  .draft-btn    { padding: 5px 12px; font-size: var(--font-size-sm); }
}
} /* end @layer pages */
