:root {
  --wine: #8d2531;
  --wine-deep: #5c1820;
  --terracotta: #bf684f;
  --sage: #637267;
  --ink: #2e2926;
  --muted: #756d66;
  --canvas: #f3f4f6;
  --paper: #ffffff;
  --sand: #e5e7eb;
  --line: #d7dbe1;
  --line-soft: #e8ebef;
  --success: #2e7257;
  --warning: #9a621b;
  --focus: rgba(141, 37, 49, .18);
}

* { box-sizing: border-box; }
[hidden] { display:none !important; }
body { margin: 0; color: var(--ink); background:#f5f6f896; font-family: "DM Sans", Arial, sans-serif; }
button, input, textarea, select { font: inherit; }
a { color: inherit; }

.app-header {
  position: sticky; top: 0; z-index: 30; min-height: 78px; display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr); align-items: center; gap: 22px;
  padding: 12px clamp(18px, 4vw, 58px); background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid rgba(215, 219, 225, .9); backdrop-filter: blur(14px);
}
.app-brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; text-decoration: none; }
.app-brand img { width: 43px; height: 43px; object-fit: contain; }
.app-brand span { display: grid; gap: 2px; }
.app-brand small, .eyebrow { color: var(--terracotta); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.app-brand strong { font-family: "Playfair Display", Georgia, serif; font-size: 20px; line-height: 1.05; }
.app-nav { display: flex; align-items: center; gap: 4px; }
.app-nav-link { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 8px 11px; color: var(--muted); border-radius: 8px; font-size: 13px; font-weight: 700; text-decoration: none; }
.app-nav-link:hover, .app-nav-link.is-active { color: var(--wine); background: #eef0f3; }
.nav-count { display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 8px; color: #fff; background: var(--wine); font-size: 10px; }
.app-nav > .app-nav-exit, .header-actions { display: none; }
.user-menu { display: flex; justify-self: end; align-items: center; gap: 9px; }
.user-avatar { display: grid; place-items: center; width: 32px; height: 32px; color: #fff; background: var(--wine); border-radius: 50%; font-size: 12px; font-weight: 800; }
.user-identity { display: grid; gap: 1px; }
.user-identity strong { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.user-identity small { color: var(--muted); font-size: 11px; }
.app-nav-exit { color: var(--wine); font-size: 12px; font-weight: 700; text-decoration: none; }

.workflow-page { width: min(1240px, calc(100% - 40px)); margin: 30px auto 64px; }
.workflow-tabs { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0 0 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); box-shadow: 0 10px 30px rgba(31, 41, 55, .05); }
.workflow-tab { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 9px; align-items: center; min-height: 75px; padding: 13px 15px; color: var(--muted); border-right: 1px solid var(--line-soft); }
.workflow-tab:last-child { border-right: 0; }
.workflow-tab-index { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; background: #faf7f2; font-size: 12px; font-weight: 800; }
.workflow-tab-main { display: grid; gap: 3px; min-width: 0; }
.workflow-tab-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 12px; }
.workflow-tab-main small { color: inherit; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.workflow-tab.is-active { color: var(--wine); background: #fdf1ee; box-shadow: inset 0 -3px 0 var(--wine); }
.workflow-tab.is-active .workflow-tab-index { color: #fff; border-color: var(--wine); background: var(--wine); }
.workflow-tab.is-done { color: var(--success); background: #f2f8f4; }
.workflow-tab.is-done .workflow-tab-index { color: #fff; border-color: var(--success); background: var(--success); }
.workflow-tab.is-locked { opacity: .58; background: #fbf9f6; }

.library-hero, .workflow-panel, .recipe-card, .empty-library {
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper); box-shadow: 0 12px 32px rgba(31, 41, 55, .06);
}
.library-hero { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 25px 28px; margin-bottom: 18px; background: linear-gradient(115deg, #ffffff, #f0f2f5); }
.library-hero h2, .workflow-panel h2, .empty-library h2, .recipe-card h2 { margin: 0; font-family: "Playfair Display", Georgia, serif; color: var(--ink); letter-spacing: -.02em; }
.library-hero h2 { margin-top: 5px; font-size: clamp(24px, 3vw, 32px); }
.library-hero > strong { padding: 9px 12px; color: var(--wine); border: 1px solid #d7dbe1; border-radius: 8px; background: #fff; font-size: 12px; }
.recipe-library { display: grid; gap: 14px; }
.recipe-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); gap: 24px; padding: 23px; transition: transform .18s ease, box-shadow .18s ease; }
.recipe-card:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(78, 56, 39, .1); }
.recipe-card h2 { margin: 10px 0 7px; font-size: 22px; }
.recipe-card p { margin: 0; color: var(--muted); font-size: 13px; }
.ops-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.ops-status, .workflow-status, .status-badge { display: inline-flex; align-items: center; width: fit-content; border: 1px solid transparent; border-radius: 8px; padding: 6px 9px; font-size: 11px; font-weight: 700; }
.ops-status-rascunho_chef { color: #635c55; background: #f1f3f5; }
.ops-status-aguardando_revisao, .ops-status-em_revisao { color: var(--warning); background: #fff5dc; border-color: #f1d393; }
.ops-status-revisada_aguardando_chef { color: #315b91; background: #edf4fc; border-color: #c7dcf2; }
.ops-status-aprovada_para_pdf { color: var(--success); background: #eaf6ef; border-color: #bde2cb; }
.ops-status-pdf_gerado { color: #6d4f89; background: #f4eff9; border-color: #ddd0e9; }
.recipe-progress { display: flex; gap: 5px; margin: 0 0 13px; overflow-x: auto; padding-bottom: 2px; }
.recipe-progress-step { display: inline-flex; align-items: center; gap: 5px; min-width: 72px; padding: 5px 8px 5px 5px; color: var(--muted); border: 1px solid var(--line-soft); border-radius: 8px; background: #f8f9fa; font-size: 10px; font-weight: 700; }
.recipe-progress-step > span { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #f1ebe4; font-size: 9px; }
.recipe-progress-step.is-active { color: var(--wine); border-color: #e8c5bf; background: #fff3f0; }
.recipe-progress-step.is-active > span { color: #fff; background: var(--wine); }
.recipe-progress-step.is-done { color: var(--success); background: #f0f8f3; }
.recipe-progress-step.is-done > span { color: #fff; background: var(--success); }
.recipe-progress-step.is-locked { opacity: .55; }
.stage-action-panel { display: grid; align-content: center; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #f8f9fa; }
.stage-action-panel p { display: grid; gap: 4px; line-height: 1.4; }
.stage-action-panel p strong { color: var(--ink); font-size: 13px; }
.stage-action-panel form { margin: 0; }
.stage-action-panel .button, .stage-action-panel form { width: 100%; }
.empty-library { display: grid; justify-items: start; gap: 10px; min-height: 230px; align-content: center; padding: 36px; text-align: left; background: linear-gradient(120deg, #fff, #f1f3f5); }
.empty-library h2 { font-size: 28px; }
.empty-library::before { content: "✦"; color: var(--terracotta); font-size: 24px; }

.two-column-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(340px, .8fr); gap: 20px; align-items: start; }
.workflow-panel { padding: 27px; }
.workflow-panel h2 { margin-bottom: 18px; font-size: 27px; }
.workflow-status { margin: 0 0 14px; color: var(--wine); background: #f9e8e5; }
.stack-form { display: grid; gap: 17px; }
label, .field-label { display: grid; gap: 7px; color: #4c453f; font-size: 12px; font-weight: 700; }
input, textarea, select { width: 100%; color: var(--ink); border: 1px solid #d8c9bb; border-radius: 10px; padding: 12px 13px; background: #fffdfb; outline: none; line-height: 1.4; transition: border-color .16s, box-shadow .16s, background .16s; }
textarea { resize: vertical; }
input:hover, textarea:hover, select:hover { border-color: #b99b8d; }
input:focus, textarea:focus, select:focus { border-color: var(--wine); box-shadow: 0 0 0 4px var(--focus); background: #fff; }
select { min-height: 45px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 43px; padding: 10px 16px; color: #fff; border: 1px solid var(--wine); border-radius: 8px; background: var(--wine); box-shadow: 0 8px 16px rgba(141, 37, 49, .16); font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .16s, background .16s, box-shadow .16s; }
.button:hover { background: var(--wine-deep); box-shadow: 0 11px 20px rgba(141, 37, 49, .22); transform: translateY(-1px); }
.button.ghost { color: var(--wine); border-color: #dcb7af; background: #fffaf8; box-shadow: none; }
.button.ghost:hover { background: #f9e8e5; }
.button.small { min-height: 34px; padding: 7px 11px; font-size: 11px; }
.button:disabled { cursor: not-allowed; opacity: .55; }
.inline-controls, .form-actions { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.inline-controls label { min-width: 210px; }
.text-preview { position: sticky; top: 104px; color: #594f47; background: #fffaf5; }
.text-preview h2, .text-preview h3, .review-original h2, .review-original h3, .revision-preview h2, .revision-preview h3 { font-family: "Playfair Display", Georgia, serif; color: var(--ink); }
.text-preview h3 { margin: 25px 0 8px; font-size: 18px; }
.text-preview ul, .text-preview ol { padding-left: 20px; line-height: 1.7; }
.preview-intro:empty { display: none; }
.review-original, .revision-preview, .mini-editor { padding: 17px; color: #504840; border: 1px solid var(--line); border-radius: 10px; background: #fff; line-height: 1.65; }
.mini-editor { min-height: 420px; outline: none; }
.mini-editor:focus { border-color: var(--wine); box-shadow: 0 0 0 4px var(--focus); }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 7px; }
.compact-list { display: grid; gap: 8px; margin-top: 22px; }
.compact-list p { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 13px; }
.compact-list strong { color: var(--ink); }
.admin-entity-list { gap:0; }
.admin-entity-row { padding:8px 0; border-bottom:1px solid var(--line-soft); }
.admin-entity-summary { display:flex; align-items:center; justify-content:space-between; gap:14px; min-width:0; }
.admin-entity-summary p { min-width:0; padding:8px 0; border:0; overflow-wrap:anywhere; }
.admin-entity-actions { display:flex; align-items:center; flex:0 0 auto; gap:6px; }
.admin-entity-actions form { margin:0; }
.admin-edit-form {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin:8px 0 4px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#f8f9fa;
}
.admin-edit-form[hidden] { display:none; }
.admin-edit-form label { margin:0; }
.admin-edit-form small { display:block; margin-top:5px; color:var(--muted); }
.admin-edit-form .form-actions { grid-column:1/-1; justify-content:flex-end; }
.admin-edit-category { grid-template-columns:minmax(0,1fr) auto; align-items:end; }
.admin-edit-category .form-actions { grid-column:auto; }
@media (max-width:700px) {
  .admin-edit-form,.admin-edit-category { grid-template-columns:1fr; }
  .admin-edit-form .form-actions,.admin-edit-category .form-actions { grid-column:1; justify-content:flex-start; }
}
.group-heading { margin: 20px 0 2px; font-family: "Playfair Display", Georgia, serif; font-size: 23px; }
.unread-card { border-color: #cf8980; background: #fffaf7; }
del { color: #a53a42; background: #fff0f0; } ins { color: var(--success); background: #eaf6ef; text-decoration: none; }
.status-badge { color: var(--success); background: #eaf6ef; } .status-badge.danger { color: #9e3038; background: #ffefef; }

.auth-page { min-height: 100vh; background: radial-gradient(circle at 15% 15%, #e4e7eb 0, transparent 32%), #f3f4f6; }
.auth-layout { width: min(1040px, calc(100% - 40px)); min-height: 100vh; display: grid; grid-template-columns: 1.1fr minmax(330px, .75fr); align-items: center; gap: clamp(40px, 8vw, 110px); margin: 0 auto; }
.auth-intro { max-width: 510px; }
.auth-intro img { width: 88px; height: 88px; object-fit: contain; margin-bottom: 19px; }
.auth-intro h1 { max-width: 470px; margin: 7px 0 15px; font-family: "Playfair Display", Georgia, serif; font-size: clamp(42px, 5vw, 61px); line-height: 1; letter-spacing: -.045em; }
.auth-intro p { max-width: 430px; color: var(--muted); font-size: 16px; line-height: 1.65; }
.auth-intro span { color: var(--wine); font-size: 13px; font-weight: 700; }
.auth-card { padding: 34px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .92); box-shadow: 0 22px 50px rgba(31, 41, 55, .1); }
.auth-card h2 { margin: 7px 0; font-family: "Playfair Display", Georgia, serif; font-size: 32px; }
.auth-copy { margin: 0 0 24px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.password-field { position:relative; display:block; }
.password-field input { padding-right:48px; }
.password-toggle {
  position:absolute;
  top:50%;
  right:8px;
  display:grid;
  place-items:center;
  width:36px;
  height:36px;
  padding:0;
  transform:translateY(-50%);
  color:var(--muted);
  border:0;
  border-radius:8px;
  background:transparent;
  cursor:pointer;
}
.password-toggle:hover { color:var(--wine); background:rgba(125,38,49,.07); }
.password-toggle:focus-visible { outline:3px solid var(--focus); outline-offset:1px; }
.remember-option { display:flex; align-items:center; justify-content:flex-start; gap:8px; width:max-content; cursor:pointer; }
.remember-option input { flex:0 0 auto; width:17px; height:17px; margin:0; accent-color:var(--wine); }
.remember-option span { font-size:12px; font-weight:600; }

.app-grid { display: grid; grid-template-columns: minmax(420px, 560px) minmax(420px, 1fr); align-items: start; gap: 26px; max-width: 1480px; margin: 0 auto; padding: 26px; }
.panel-section { margin-bottom: 16px; padding: 20px; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; box-shadow: 0 12px 30px rgba(31,41,55,.055); }
.panel-section h2 { margin: 0 0 16px; font-size: 16px; }
.preview-panel { position: sticky; top: 92px; min-width: 0; }
.preview-action-bar { display: flex; justify-content: flex-end; align-items:center; gap: 10px; min-height: 54px; margin-bottom: 12px; flex-wrap:wrap; }
.preview-action-bar.editor-global-actions{grid-column:1/-1;width:100%;min-width:0;margin:0;padding:0 2px;justify-self:stretch}
.preview-action-bar .editor-finalize-form { margin:0; display:flex; }
.preview-action-bar .editor-action-button { display:inline-flex; align-items:center; justify-content:center; gap:8px; white-space:nowrap; }
.preview-action-bar .editor-action-button i { width:1em; text-align:center; }
.theme-color-control {
  display:inline-flex;
  align-items:center;
  gap:9px;
  margin:0;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
}
.theme-color-control input[type="color"] {
  width:40px;
  min-width:40px;
  height:34px;
  min-height:34px;
  padding:3px;
  border-radius:8px;
  cursor:pointer;
}
.theme-color-control input[type="color"]:focus-visible {
  outline:3px solid var(--focus);
  outline-offset:2px;
}
.library-hero.library-hero-actions-only { justify-content:flex-end; }
.library-tabs {
  display:flex;
  align-items:flex-end;
  gap:4px;
  margin:0 0 -1px;
  padding:0 12px;
  position:relative;
  z-index:1;
}
.library-tab {
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:160px;
  min-height:46px;
  padding:10px 24px;
  color:var(--muted);
  border:1px solid var(--line);
  border-bottom-color:#7d2631;
  border-radius:12px 12px 0 0;
  background:#e9ebee;
  font-weight:700;
  text-decoration:none;
  transition:color .16s ease, background .16s ease, border-color .16s ease;
}
.library-tab:hover {
  color:var(--wine);
  background:#f3f4f6;
}
.library-tab.is-active {
  min-height:50px;
  color:#fff;
  border-color:var(--wine);
  border-bottom-color:var(--wine);
  background:var(--wine);
}
.library-tab:focus-visible {
  outline:3px solid var(--focus);
  outline-offset:2px;
}
.library-filters {
  margin-bottom:22px;
}
.library-filters.is-finalized {
  grid-template-columns:minmax(180px,2fr) repeat(2,minmax(140px,1fr)) auto;
}
.library-filters.is-active.is-chef {
  grid-template-columns:minmax(180px,2fr) repeat(2,minmax(140px,1fr)) auto;
}
.library-filters.is-finalized.is-chef {
  grid-template-columns:minmax(180px,2fr) minmax(140px,1fr) auto;
}
.library-folder {
  min-height:180px;
  padding:16px;
  border:1px solid #e0bfc3;
  border-top:2px solid #7d2631;
  border-radius:0 10px 10px 10px;
  background:transparent;
}
.library-folder .recipe-library {
  display:grid;
  gap:12px;
}
.library-folder .recipe-card,
.library-folder .empty-library {
  margin:0;
  background:#fff;
}
.preview-header { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 12px; }
.document-preview-shell { position: relative; min-width: 0; }
.document-preview-shell .document-preview { display: block; }
.preview-controls.preview-controls-overlay {
  position: absolute;
  top: 10px;
  right: 24px;
  z-index: 3;
}
.document-preview { width: 100%; height: calc(100vh - 160px); min-height: 720px; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; }
.icon-button { width: 33px; height: 33px; display: grid; place-items: center; border: 1px solid #e1d9d4; border-radius: 9px; color: #5c5551; background: #fff; cursor: pointer; }
.zoom-control { display: inline-flex; align-items: center; gap: 6px; padding: 5px; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; }
.zoom-control strong { min-width: 42px; font-size: 12px; text-align: center; }
@media (max-width: 640px) {
  .preview-controls.preview-controls-overlay { top: 8px; right: 18px; }
  .preview-controls-overlay .zoom-control { gap: 4px; padding: 4px; }
}
.list-items { display: grid; gap: 9px; }.list-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; padding: 9px; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; }.item-actions { display: flex; gap: 4px; }
.field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }.media-grid input { padding: 9px; }.bulk-parser { display: grid; gap: 10px; margin-bottom: 14px; padding: 12px; border: 1px solid #e5e7eb; border-radius: 10px; }.bulk-actions { display: flex; justify-content: flex-end; gap: 8px; }
.file-action { display: inline-flex; align-items: center; justify-content: center; }
.editor-context { width: min(1428px, calc(100% - 52px)); margin: 16px auto -10px; color: var(--muted); font-size: 13px; }
.file-action input { display: none; }
.button.icon-action { width: 40px; min-width: 40px; height: 40px; min-height: 40px; padding: 0; }
.button.icon-action svg { width: 19px; height: 19px; fill: currentColor; }
.tag-editor input[type="color"] { width: 38px; height: 32px; padding: 3px; border-radius: 8px; cursor: pointer; }
.list-item.tag-editor { grid-template-columns: minmax(0,1fr) 54px auto; }
.ingredient-group-editor { display:grid; gap:10px; margin:0; padding:14px; border:1px solid var(--line); border-radius:10px; }
.ingredient-group-editor legend { padding:0 6px; font-weight:800; color:var(--ink); }
.ingredient-group-items { display:grid; gap:8px; }
.editor-image-control { display:flex; align-items:center; gap:8px; margin-top:8px; }
.editor-image-preview { width:92px; height:68px; object-fit:cover; border:1px solid var(--line); border-radius:8px; background:#f3f4f6; }
.gallery-editor-item { grid-template-columns:92px minmax(0,1fr) auto; align-items:center; justify-content:start; }
.gallery-reference-controls { display:grid; gap:7px; min-width:0; }
.gallery-photo-label { color:var(--ink); font-size:13px; }
.gallery-step-select { min-width:0; width:100%; }
.gallery-reference-note { color:var(--muted); font-size:11px; }
.approved-step-list { display:grid; gap:10px; margin:0; padding-left:24px; }
.approved-step-list > li { padding:11px 12px; border:1px solid var(--line); border-radius:8px; background:var(--surface-soft); color:var(--text); line-height:1.45; }
.step-photo-chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.step-photo-chip { display:inline-flex; align-items:center; min-height:24px; padding:3px 8px; border-radius:999px; color:#fff; background:var(--wine); font-size:11px; font-weight:800; }
@media(max-width:700px){.gallery-editor-item{grid-template-columns:72px minmax(0,1fr)}.gallery-editor-item>.remove-item{grid-column:1/-1;width:100%}}
.multi-select { position: relative; }
.multi-select-trigger { width: 100%; min-height: 45px; padding: 10px 36px 10px 13px; text-align: left; }
.multi-select-menu { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30; display: none; max-height: 240px; overflow: auto; padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 14px 30px rgba(31,41,55,.14); }
.multi-select.is-open .multi-select-menu { display: grid; gap: 3px; }
.multi-select-search { height: 34px; padding: 8px 10px; font-size: 12px; }
.multi-select-option { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 6px 8px; border-radius: 7px; color: var(--ink); font-size: 13px; font-weight: 500; cursor: pointer; }
.multi-select-option:has(input:checked) { background: #f8ece8; }
.multi-select-option input { width: 14px; min-width: 14px; height: 14px; margin: 0; accent-color: var(--wine); }

@media (max-width: 980px) {
  .app-header { grid-template-columns: 1fr auto; }.app-nav { order: 3; grid-column: 1 / -1; justify-content: flex-start; overflow-x: auto; }.workflow-tabs { grid-template-columns: repeat(3, 1fr); }.workflow-tab { border-bottom: 1px solid var(--line-soft); }.recipe-card, .two-column-layout, .app-grid { grid-template-columns: 1fr; }.text-preview, .preview-panel { position: static; }.document-preview { height: 720px; }.auth-layout { grid-template-columns: 1fr; gap: 28px; padding: 50px 0; }.auth-intro { max-width: 650px; }.auth-intro h1 { font-size: 47px; }
}
@media (max-width: 640px) {
  .app-header { gap: 12px; min-height: auto; padding: 12px 16px; }.app-brand strong { font-size: 17px; }.user-identity { display: none; }.app-nav-link { padding: 7px 9px; font-size: 12px; }.workflow-page { width: min(100% - 24px, 1240px); margin: 18px auto 44px; }.workflow-tabs { grid-template-columns: 1fr; border-radius: 10px; }.workflow-tab { min-height: 60px; border-right: 0; }.library-hero { align-items: flex-start; flex-direction: column; padding: 21px; }.recipe-card { grid-template-columns: 1fr; gap: 16px; padding: 19px; }.stage-action-panel { padding: 14px; }.two-column-layout { gap: 14px; }.workflow-panel { padding: 20px; }.workflow-panel h2 { font-size: 25px; }.inline-controls, .inline-controls label { width: 100%; }.button { width: 100%; }.editor-toolbar .button { width: auto; }.auth-layout { width: min(100% - 32px, 1040px); }.auth-intro h1 { font-size: 43px; }.auth-card { padding: 26px 21px; }.field-grid { grid-template-columns: 1fr; }.app-grid { padding: 14px; }.document-preview { height: 640px; min-height: 540px; }
}
/* Recipe workflow v2 */
.recipe-context-header{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;margin-bottom:1rem;padding:1.15rem 1.3rem;border:1px solid var(--line,#eadfd6);border-radius:18px;background:#fff}
.recipe-context-header h2{margin:.2rem 0}.recipe-context-header p{margin:.2rem 0;color:#6e625b}
.recipe-authoring-layout{align-items:start}.recipe-authoring-layout .text-preview{position:sticky;top:1rem;max-height:calc(100vh - 2rem);overflow:auto}
.form-section{padding:1rem 0;border-bottom:1px solid #eee3db}.form-section:last-of-type{border-bottom:0}.form-section h3{margin:0 0 1rem}
.choice-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.65rem;margin:.75rem 0}.choice-card{display:flex!important;align-items:center;gap:.55rem;padding:.7rem .8rem;border:1px solid #e5d9d0;border-radius:12px;background:#fff}
.recipe-content-preview h2{margin-top:.25rem}.recipe-meta-preview{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.55rem;margin:.8rem 0}.recipe-meta-preview span{padding:.6rem;border-radius:10px;background:#f7f3ef;font-size:.85rem}
.recipe-detail-layout{align-items:start}.revision-summary,.return-note{margin-top:1rem;padding:1rem;border-radius:12px;background:#fff8e9;border:1px solid #f1dba8}
.review-field-pair{display:grid;grid-template-columns:1fr 1fr;gap:1rem;padding:1rem;border:1px solid #e8ddd5;border-radius:14px;background:#fff}.review-field-pair.is-changed{border-color:#df8c83;background:#fff8f6}.review-readonly{min-height:3.2rem;padding:.75rem;border-radius:10px;background:#f4f1ee;white-space:pre-wrap}.review-extras{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem;border:1px solid #e8ddd5;border-radius:14px;padding:1rem}
.approval-layout{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(340px,.8fr);gap:1rem;align-items:start}.approval-diffs{display:grid;gap:.75rem}.approval-diff{padding:1rem;border:1px solid #e8ddd5;border-radius:14px;background:#fff}.approval-diff.is-changed{border-color:#d7776f;box-shadow:inset 4px 0 #a62d35}.approval-diff header{display:flex;justify-content:space-between;gap:1rem;align-items:center}.approval-diff header h3{margin:0}.approval-diff header span{font-size:.75rem;text-transform:uppercase;letter-spacing:.06em;color:#776b64}.approval-columns{display:grid;grid-template-columns:1fr 1fr;gap:.75rem;margin-top:.65rem}.approval-columns>div{padding:.75rem;border-radius:10px;background:#f7f4f1;white-space:pre-wrap}.approval-columns small{display:block;margin-bottom:.4rem;color:#71645e}.approval-list-diff{display:grid;gap:.3rem;margin-top:.7rem}.approval-list-diff del,.approval-list-diff ins{padding:.35rem .55rem;border-radius:8px;text-decoration:none}.approval-list-diff del{background:#fde9e7;color:#8c2828}.approval-list-diff ins{background:#e8f6ed;color:#22623b}.approval-preview{position:sticky;top:1rem;max-height:calc(100vh - 2rem);overflow:auto}.approval-actions{display:grid;gap:1rem;margin-top:1rem}.approval-decision-row{display:grid;gap:12px}.approval-decision-row.has-two{grid-template-columns:repeat(2,minmax(0,1fr))}.approval-decision-row.has-one{grid-template-columns:minmax(0,560px)}.approval-decision-row form{min-width:0}.approval-decision-button{width:100%;height:100%}.approval-decision-button.is-selected{border-color:#8f2733;background:#f9eaeb;color:#771d28}.return-review-form{display:grid;gap:.7rem;max-width:none;padding-top:4px}.return-review-form[hidden]{display:none}.return-review-actions{display:flex;justify-content:flex-end;gap:10px}.return-review-actions .button{width:auto;min-width:150px}.editor-recipe-context{padding-bottom:0}
@media(max-width:900px){.approval-layout,.review-field-pair,.approval-columns{grid-template-columns:1fr}.recipe-authoring-layout .text-preview,.approval-preview{position:static;max-height:none}.recipe-meta-preview{grid-template-columns:1fr}.choice-grid,.review-extras{grid-template-columns:1fr}.recipe-context-header{flex-direction:column}}
/* Workflow permissions and unified navigation */
.header-icon-actions{display:flex;align-items:center;gap:10px;margin-left:auto}.header-icon-link{position:relative;display:grid;place-items:center;width:42px;height:42px;border:1px solid var(--line,#e8ddd2);border-radius:50%;color:inherit;background:#fff}.header-icon-link svg{width:21px;height:21px;fill:currentColor}.header-icon-count{position:absolute;right:-3px;top:-5px;min-width:19px;height:19px;padding:0 5px;border-radius:10px;background:#9d2933;color:#fff;font:700 11px/19px sans-serif;text-align:center}.workflow-tab[href]{text-decoration:none;color:inherit;cursor:pointer}.workflow-tab[href]:hover{box-shadow:inset 0 -3px #9d2933;background:#fff8f6}.workflow-tab.is-readonly{opacity:.66}.workflow-archived{display:flex;justify-content:space-between;gap:16px;padding:18px 22px;border:1px solid #dfcfc6;border-radius:16px;background:#f4efeb}.library-filters{display:grid;grid-template-columns:minmax(180px,2fr) repeat(3,minmax(140px,1fr)) auto;gap:12px;align-items:end}.library-filters label{display:grid;gap:6px}.hero-actions,.recipe-global-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.recipe-global-actions{margin:18px 0}.recipe-global-actions form,.stage-action-panel form{margin:0}.history-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}.history-grid article{display:grid;gap:4px;padding:13px;border:1px solid #eadfd6;border-radius:12px;background:#fff}.history-grid span,.history-grid small{color:#6d625a}.app-header>.user-menu{margin-left:0}
.recipe-current-stage{display:inline-flex;align-items:center;gap:.55rem;padding:.45rem .75rem;border:1px solid #d7e8df;border-radius:999px;background:#f1f8f4;color:#17684f;width:max-content}
.recipe-current-stage>span{display:grid;place-items:center;width:1.55rem;height:1.55rem;border-radius:50%;background:#287c61;color:#fff;font-weight:800;font-size:.78rem}
.recipe-current-stage strong{font-size:.82rem}.recipe-current-stage small{padding-left:.55rem;border-left:1px solid #bdd7ca;color:#53665f}.recipe-current-stage.is-archived{background:#f3f1ef;border-color:#ddd4ce;color:#75675e}
@media(max-width:800px){.app-header{gap:8px}.app-brand span{display:none}.header-icon-actions{margin-left:auto}.user-identity{display:none}.library-filters{grid-template-columns:1fr 1fr}.library-filters label:first-of-type{grid-column:1/-1}.workflow-tabs{overflow-x:auto}.workflow-tab{min-width:150px}.hero-actions{width:100%}}
@media(max-width:520px){.library-filters{grid-template-columns:1fr}.library-filters label:first-of-type{grid-column:auto}.app-nav,.header-actions{display:none!important}}
.ingredient-groups{display:grid;gap:16px}.ingredient-group{display:grid;grid-template-columns:1fr;gap:14px;align-items:stretch;padding:18px;border:1px solid #eadfd6;border-radius:14px;background:#fff}.ingredient-group label{display:grid;gap:7px;width:100%}.ingredient-group input,.ingredient-group textarea{width:100%}.ingredient-group textarea{min-height:150px}.ingredient-group .remove-ingredient-group{justify-self:end;width:max-content;margin-top:2px}@media(max-width:700px){.ingredient-group{padding:15px}.ingredient-group .remove-ingredient-group{justify-self:stretch;width:100%}}
/* Chef text layout refinement */
.recipe-action-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:18px 0 22px;padding:0}.recipe-action-toolbar form{margin:0}.action-with-icon{gap:9px}.action-with-icon svg,.attachment-action svg{width:19px;height:19px;flex:0 0 19px;fill:currentColor}.recipe-content-full{width:100%}.recipe-content-full .text-preview{position:static;top:auto;max-height:none;overflow:visible;width:100%;background:#fff}.recipe-content-full .recipe-content-preview{max-width:none}.recipe-content-full .workflow-panel{padding:clamp(24px,4vw,52px)}
.recipe-authoring-layout .stack-form{gap:0}.recipe-authoring-layout .form-section{display:grid;gap:16px;padding:24px 0}.recipe-authoring-layout .form-section>h3{margin:0}.recipe-authoring-layout .form-section>label,.recipe-authoring-layout .field-grid>label{align-content:start}.recipe-authoring-layout input,.recipe-authoring-layout textarea,.recipe-authoring-layout select{min-height:46px}.recipe-authoring-layout textarea{min-height:112px}.recipe-authoring-layout .field-grid{gap:16px}.recipe-authoring-layout .field-help{margin:0;line-height:1.55}.attachment-action{width:max-content;max-width:100%;gap:9px;padding-inline:15px}.attachment-action span{white-space:nowrap}
.chef-panel-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}.chef-panel-toolbar .workflow-status{margin:0}.chef-panel-toolbar .attachment-action{flex:0 0 auto;margin:0}
.recipe-authoring-layout .choice-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:0}.recipe-authoring-layout .choice-card{position:relative;display:flex!important;align-items:center;justify-content:flex-start;min-height:52px;margin:0;padding:11px 13px;font-size:13px;line-height:1.25;cursor:pointer}.recipe-authoring-layout .choice-card input[type="checkbox"]{appearance:none;-webkit-appearance:none;width:21px;min-width:21px;height:21px;min-height:21px;margin:0;padding:0;border:2px solid #c9afa4;border-radius:6px;background:#fff;box-shadow:none}.recipe-authoring-layout .choice-card input[type="checkbox"]:checked{border-color:var(--wine);background:var(--wine);box-shadow:inset 0 0 0 4px #fff}.recipe-authoring-layout .choice-card:has(input:checked){border-color:var(--wine);background:#fff4f2;color:var(--wine)}
@media(max-width:1050px){.recipe-authoring-layout .choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:560px){.recipe-action-toolbar{display:grid;grid-template-columns:1fr}.recipe-action-toolbar .button,.recipe-action-toolbar form{width:100%}.chef-panel-toolbar{align-items:stretch;flex-direction:column;margin-bottom:16px}.attachment-action{width:100%}.attachment-action span{white-space:normal}.recipe-authoring-layout .choice-grid{grid-template-columns:1fr}.recipe-content-full .workflow-panel{padding:22px 18px}}
.chef-form-actions{display:grid;grid-template-columns:1fr;justify-items:stretch;gap:10px;padding-top:22px}.chef-form-actions p{display:grid;gap:3px;margin:0 0 4px}.chef-form-actions p strong{color:var(--ink)}.chef-form-actions .button{width:100%;min-width:0}
.chef-submit-feedback{width:100%;min-height:0;margin:0;padding:0;color:var(--success);font-size:13px;font-weight:700}.chef-submit-feedback:empty{display:none}
.field-validation-invalid{color:#a61f2b}
.field-validation-invalid input:not([type="checkbox"]),.field-validation-invalid select,.field-validation-invalid textarea,
#ingredient-groups.field-validation-invalid{border-color:#b4232f!important;box-shadow:0 0 0 2px rgba(180,35,47,.1)}
.choice-grid.field-validation-invalid{padding:8px;border:1px solid #b4232f;border-radius:8px;background:rgba(180,35,47,.04)}
/* Unified form system */
:root{--form-gap:16px;--section-gap:24px;--field-height:46px;--field-radius:10px;--field-pad-x:13px;--field-pad-y:11px}
.stack-form,.editor-panel{align-content:start}.stack-form{gap:var(--section-gap)}
.stack-form label,.field-grid label,.form-field,.ingredient-group label,.review-field-pair label,.return-review-form label,.library-filters label,.inline-controls label{align-content:start;min-width:0;margin:0}
.field-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:var(--form-gap);align-items:start}
.field-grid>*{min-width:0}
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),select{min-height:var(--field-height);height:var(--field-height);padding:var(--field-pad-y) var(--field-pad-x);border-radius:var(--field-radius)}
textarea{display:block;width:100%;min-height:112px;padding:12px var(--field-pad-x);border-radius:var(--field-radius);line-height:1.55}
input[type="file"]{min-height:var(--field-height);padding:8px 10px}
input[type="color"]{width:100%;min-height:var(--field-height);height:var(--field-height);padding:5px}
.field-help,.muted-copy,.chef-submit-feedback{margin:0;line-height:1.55}
.form-section,.panel-section{display:grid;gap:var(--form-gap)}
.form-section{padding:var(--section-gap) 0}.form-section>h3,.panel-section>h2,.section-title h2,.section-title h3,.section-title h4{margin:0}
.section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.choice-grid,.review-extras{align-items:stretch}.choice-card{min-height:52px;margin:0}
.ingredient-groups{gap:var(--form-gap)}.ingredient-group{gap:var(--form-gap);padding:18px}.ingredient-group textarea{min-height:150px}
.library-filters{gap:var(--form-gap);align-items:end}.library-filters .button{min-height:var(--field-height)}.library-filter-submit{width:auto;min-width:84px;height:var(--field-height);padding-inline:18px;font-size:var(--ui-text,13px)}
.workflow-panel.review-transfer-panel{width:min(100%,520px);margin-top:28px;margin-left:auto;padding:14px 16px;gap:9px}.review-transfer-panel>p{margin:0;font-size:12px}.review-transfer-panel>p span{color:var(--muted);font-size:11px}.review-transfer-form{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:10px}.review-transfer-form label{display:grid;gap:5px;margin:0;font-size:11px}.review-transfer-form select{height:40px;min-height:40px;padding-block:8px}.stage-action-panel .review-transfer-form .button{width:auto;min-width:92px;min-height:40px;padding:8px 14px}
.review-entry-actions{display:grid;align-items:stretch;gap:16px;margin-top:18px}.review-entry-actions.has-two{grid-template-columns:repeat(2,minmax(0,1fr));width:100%}.review-entry-actions.has-one{grid-template-columns:minmax(0,560px);justify-content:end}.review-entry-actions+.review-reserved-note{margin-top:18px}.review-entry-actions .workflow-panel.review-transfer-panel,.review-entry-actions .workflow-panel.review-start-panel{display:grid;width:100%;height:100%;margin:0;padding:16px;gap:10px}.review-entry-actions .stage-action-panel>p{align-content:start;margin:0}.review-entry-actions .stage-action-panel>form{align-self:end;margin-top:auto}.review-start-panel form{display:flex;justify-content:flex-end}.stage-action-panel.review-start-panel .button{width:auto;min-width:128px;min-height:40px;padding:8px 16px}
.inline-controls{gap:var(--form-gap);align-items:end}.inline-controls select{min-width:220px}
.review-field-pair{gap:var(--form-gap);align-items:stretch}.review-field-pair>div,.review-field-pair>label{min-width:0}.review-readonly{min-height:var(--field-height);padding:12px 13px;line-height:1.55}.review-field-pair textarea{height:100%;min-height:112px}
.review-extras{gap:10px;margin:0;padding:16px}.review-extras legend{padding:0 7px}
.review-extras .choice-card{display:flex!important;align-items:center;justify-content:flex-start;gap:10px;min-height:56px;padding:13px 15px;color:#4c453f;font-size:13px;line-height:1.35;cursor:pointer}
.review-extras .choice-card input[type="checkbox"]{appearance:none;-webkit-appearance:none;flex:0 0 21px;width:21px;height:21px;min-width:21px;min-height:21px;margin:0;padding:0;border:2px solid #c9afa4;border-radius:6px;background:#fff;box-shadow:none}
.review-extras .choice-card input[type="checkbox"]:checked{border-color:var(--wine);background:var(--wine);box-shadow:inset 0 0 0 4px #fff}
.review-extras .choice-card:has(input:checked){border-color:var(--wine);background:#fff4f2;color:var(--wine)}
.approval-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--form-gap);align-items:start}.approval-actions>div,.approval-actions form{margin:0}.approval-actions form{display:grid;gap:12px}.approval-decision-row .button{width:100%}
.return-review-form{display:grid;gap:12px;width:100%;max-width:none}.return-review-form label,.return-review-form textarea,.return-review-form .button{width:100%}.return-review-form textarea{min-height:120px}
/* Application dialogs */
.app-dialog{position:fixed;inset:0;z-index:1200;display:none;place-items:center;padding:24px}
.app-dialog.is-open{display:grid}
.app-dialog__backdrop{position:absolute;inset:0;background:rgba(31,28,27,.62);backdrop-filter:blur(2px)}
.app-dialog__panel{position:relative;z-index:1;display:grid;gap:24px;width:min(100%,600px);padding:34px 32px 32px;border:1px solid #e1d8d3;border-radius:12px;background:#fff;box-shadow:0 24px 70px rgba(24,20,19,.28)}
.app-dialog__panel h2,.app-dialog__panel p{margin:0}.app-dialog__panel h2{padding-right:52px;font-size:25px;line-height:1.2;font-weight:700}.app-dialog__panel p{color:var(--muted);font-size:16px;line-height:1.55}
.app-dialog__message{display:grid;gap:16px}.app-dialog__message>div{display:grid;gap:4px}.app-dialog__message strong{color:var(--ink);font-size:12px;text-transform:uppercase;letter-spacing:.04em}.app-dialog__message>div:last-child p{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:13px}
.app-dialog__panel[data-dialog-type="error"]{border-top:4px solid #b4232f}.app-dialog__panel[data-dialog-type="warning"],.app-dialog__panel[data-dialog-type="conflict"]{border-top:4px solid var(--warning)}
.app-dialog__close{position:absolute;top:15px;right:15px;display:grid;place-items:center;width:45px;height:45px;padding:0;border:0;border-radius:10px;color:#737b85;background:#f4f1ef;font-size:28px;line-height:1;cursor:pointer}
.app-dialog__close:hover{color:var(--wine);background:#eee9e6}
.app-dialog__actions{display:flex;justify-content:flex-end;gap:12px;margin-top:2px}.app-dialog__actions .button{min-width:140px;min-height:40px}
.edit-stage-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.edit-stage-actions form{margin:0}.edit-stage-actions .button{display:grid;justify-items:start;gap:3px;width:100%;min-height:76px;padding:15px 18px;text-align:left}.edit-stage-actions .button strong{font-size:12px;text-transform:uppercase;letter-spacing:.04em}.edit-stage-actions .button span{font-size:15px}
.has-open-dialog{overflow:hidden}
@media(max-width:520px){.app-dialog{padding:14px}.app-dialog__panel{gap:20px;padding:28px 20px 20px}.app-dialog__panel h2{font-size:22px}.app-dialog__panel p{font-size:15px}.app-dialog__actions,.edit-stage-actions{display:grid;grid-template-columns:1fr}.app-dialog__actions .button{width:100%}}
.editor-panel{display:grid;gap:0}.panel-section{padding:22px 0;margin:0;border-bottom:1px solid var(--line-soft)}.panel-section:first-of-type{padding-top:0}.panel-section:last-of-type{border-bottom:0}.media-grid input[type="file"]{padding:8px 10px}.bulk-parser{margin:0;padding:16px;gap:12px}.bulk-actions{margin:0}
.multi-select-trigger{min-height:var(--field-height);padding:11px 13px}.multi-select-option{min-height:42px;padding:9px 10px}.multi-select-option input[type="checkbox"]{width:18px;height:18px;flex:0 0 18px}
.recipe-action-toolbar{align-items:stretch}.recipe-action-toolbar form{display:flex}.recipe-action-toolbar .button{min-height:46px}
.chef-form-actions{gap:12px;padding-top:24px;border-top:1px solid var(--line-soft)}.chef-form-actions p{line-height:1.5}.chef-form-actions .button{min-height:48px;padding-block:12px}
.status-badge{display:block;margin:0 0 16px;padding:11px 13px;border-radius:10px;line-height:1.5}
@media(max-width:700px){.field-grid{grid-template-columns:1fr}.section-title{align-items:flex-start}.section-title .button{width:100%}.library-filters{grid-template-columns:1fr}.library-filter-submit{width:100%}.inline-controls,.inline-controls label,.inline-controls select{width:100%}.review-field-pair{grid-template-columns:1fr}.approval-actions,.approval-decision-row.has-two,.approval-decision-row.has-one{grid-template-columns:1fr}.return-review-actions{flex-direction:column-reverse}.return-review-actions .button{width:100%}.panel-section{padding:18px 0}}
@media(max-width:520px){
  .library-tabs { gap:3px; padding:0; }
  .library-tab { flex:1 1 50%; min-width:0; min-height:44px; padding:9px 8px; font-size:12px; }
  .library-tabs.is-single .library-tab { flex:0 0 auto; min-width:160px; }
  .library-tab.is-active { min-height:47px; }
  .library-folder { padding:10px; border-radius:0 8px 8px 8px; }
}
@media(max-width:800px){
  .library-filters.is-active,
  .library-filters.is-finalized,
  .library-filters.is-active.is-chef,
  .library-filters.is-finalized.is-chef { grid-template-columns:1fr 1fr; }
}
@media(max-width:700px){
  .library-filters.is-active,
  .library-filters.is-finalized,
  .library-filters.is-active.is-chef,
  .library-filters.is-finalized.is-chef { grid-template-columns:1fr; }
}
@media(max-width:520px){.workflow-panel.review-transfer-panel{width:100%;margin-top:22px}.review-transfer-form{grid-template-columns:1fr}.stage-action-panel .review-transfer-form .button{width:100%}}
@media(max-width:900px){.review-entry-actions.has-two,.review-entry-actions.has-one{grid-template-columns:minmax(0,560px);justify-content:center}.review-entry-actions{margin-top:16px}.review-entry-actions .workflow-panel.review-transfer-panel,.review-entry-actions .workflow-panel.review-start-panel{width:100%}}
@media(max-width:520px){.review-entry-actions.has-two,.review-entry-actions.has-one{grid-template-columns:minmax(0,1fr)}.review-start-panel form,.stage-action-panel.review-start-panel .button{width:100%}}

/* Interface system v3. PDF pages use .print-body and remain isolated in pdf-layout.css. */
body:not(.print-body),
body:not(.print-body) button,
body:not(.print-body) input,
body:not(.print-body) textarea,
body:not(.print-body) select { font-family: "Roboto", Arial, sans-serif; }
body:not(.print-body) { color: #20242a; background: #f5f6f8; font-size: 14px; line-height: 1.5; }
body:not(.print-body) h1,
body:not(.print-body) h2,
body:not(.print-body) h3,
body:not(.print-body) h4,
body:not(.print-body) .app-brand strong,
body:not(.print-body) .group-heading { font-family: "Roboto", Arial, sans-serif; letter-spacing: -.018em; }

:root { --wine:#7d2631; --wine-deep:#611b24; --terracotta:#9d5544; --ink:#20242a; --muted:#68707c; --canvas:#f5f6f8; --line:#dfe3e8; --line-soft:#eceff2; --focus:rgba(125,38,49,.14); --field-height:44px; --field-radius:7px; --form-gap:14px; --section-gap:22px; }
.app-header { min-height:64px; grid-template-columns:minmax(220px,1fr) auto auto; gap:14px; padding:9px clamp(18px,3vw,40px); box-shadow:none; }
.app-brand img { width:36px; height:36px; }.app-brand small,.eyebrow { font-size:9px; letter-spacing:.1em; }.app-brand strong { font-size:15px; font-weight:600; }
.header-icon-actions { justify-self:end; gap:7px; }.header-icon-link { width:36px; height:36px; border-radius:7px; text-decoration:none; }.header-icon-link svg { width:18px; height:18px; }.header-icon-link i { font-size:16px; }.user-menu { gap:8px; padding-left:14px; border-left:1px solid var(--line-soft); }.user-avatar { width:30px; height:30px; }.app-nav-exit { margin-left:4px; }
.workflow-page { width:min(1180px,calc(100% - 40px)); margin:24px auto 52px; }
.workflow-tabs { margin-bottom:20px; border-radius:8px; box-shadow:none; }.workflow-tab { min-height:62px; padding:10px 12px; }.workflow-tab-index { width:25px; height:25px; }.workflow-tab-main strong { font-size:11px; }
.library-hero { padding:4px 0 18px; margin-bottom:18px; border:0; border-bottom:1px solid var(--line); border-radius:0; background:transparent; box-shadow:none; }.library-hero h2 { font-size:24px; font-weight:600; }.library-hero>strong { padding:6px 9px; border-radius:6px; }
.library-hero,.workflow-panel,.recipe-card,.empty-library { box-shadow:none; }.workflow-panel,.recipe-card,.empty-library { border-radius:8px; }
.recipe-library { gap:10px; }.recipe-card { grid-template-columns:minmax(0,1fr) minmax(220px,280px); gap:20px; padding:18px 20px; }.recipe-card:hover { transform:none; box-shadow:0 4px 16px rgba(20,27,35,.06); }.recipe-card h2 { margin:8px 0 5px; font-size:18px; font-weight:600; }.recipe-card p { font-size:12px; }.stage-action-panel { padding:14px; border-radius:7px; background:#f8f9fa; }
.workflow-panel { padding:22px; }.workflow-panel h2 { margin-bottom:14px; font-size:21px; font-weight:600; }.workflow-status,.ops-status,.status-badge { border-radius:6px; }.recipe-context-header { margin-bottom:14px; padding:16px 18px; border-radius:8px; }.recipe-context-header h2 { font-size:20px; }
.two-column-layout { gap:16px; }.form-section { padding:20px 0; }.form-section h3,.panel-section h2 { font-size:15px; font-weight:600; }
label,.field-label { gap:6px; color:#39414b; font-size:12px; font-weight:500; }
input,textarea,select { border-color:#ccd2d9; border-radius:7px; background:#fff; }.button { min-height:40px; padding:9px 14px; border-radius:7px; box-shadow:none; font-size:12px; font-weight:600; }.button:hover { transform:none; box-shadow:none; }.button.small { min-height:32px; }.button.ghost { border-color:#d4d9df; color:#343b44; background:#fff; }.button.ghost:hover { color:var(--wine); background:#f7f8f9; }
.choice-card,.ingredient-group,.review-field-pair,.review-extras,.approval-diff,.history-grid article,.bulk-parser { border-radius:8px; }.choice-card { background:#fafbfc; }.ingredient-group { padding:15px; }.review-readonly,.approval-columns>div,.recipe-meta-preview span { border-radius:6px; }
.app-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; max-width:1400px; padding:20px; }.editor-panel { padding:0 22px; border:1px solid var(--line); border-radius:8px; background:#fff; }.panel-section { padding:20px 0 22px; }.panel-section:first-of-type { padding-top:20px; }.preview-action-bar { min-height:44px; margin-bottom:8px; }.document-preview { border-radius:8px; }.list-item { padding:8px; border-radius:7px; }.multi-select-menu,.zoom-control,.icon-button { border-radius:7px; }
.auth-page { background:#f4f5f7; }.auth-layout { grid-template-columns:1fr minmax(330px,400px); gap:clamp(40px,7vw,90px); }.auth-intro h1 { max-width:520px; font-size:clamp(34px,4vw,48px); line-height:1.08; font-weight:600; }.auth-intro p { font-size:15px; }.auth-card { padding:28px; border-radius:9px; box-shadow:0 12px 36px rgba(20,27,35,.08); }.auth-card h2 { font-size:24px; font-weight:600; }
.empty-library { min-height:180px; padding:28px; background:#fff; }.empty-library h2 { font-size:21px; }.empty-library::before { content:""; display:none; }
@media(max-width:980px){.app-header{grid-template-columns:minmax(0,1fr) auto auto}.app-grid{grid-template-columns:1fr}.workflow-tabs{display:flex;overflow-x:auto}.workflow-tab{min-width:155px}.preview-panel{position:static}.auth-layout{grid-template-columns:1fr;gap:26px;padding:42px 0}.auth-intro{max-width:620px}}
@media(max-width:640px){.app-header{padding:9px 12px}.app-brand span{display:none}.header-icon-actions{gap:6px}.user-menu{display:none}.workflow-page{width:calc(100% - 24px);margin:16px auto 36px}.workflow-tabs{margin-inline:-12px;border-left:0;border-right:0;border-radius:0}.library-hero{gap:12px;padding-bottom:14px}.library-hero h2{font-size:21px}.recipe-card{padding:16px;gap:14px}.workflow-panel{padding:18px}.workflow-panel h2{font-size:19px}.recipe-context-header{padding:14px}.app-grid{padding:12px}.editor-panel{padding-inline:16px}.auth-layout{width:calc(100% - 28px);padding:28px 0}.auth-intro h1{font-size:34px}.auth-intro img{width:64px;height:64px}.auth-card{padding:22px 18px}.document-preview{height:70vh;min-height:480px}}

/* Visual identity v4: shared hierarchy for every workflow stage. */
:root {
  --ui-content-max: 1360px;
  --ui-page-gutter: 20px;
  --ui-title-page: 24px;
  --ui-title-panel: 20px;
  --ui-title-section: 16px;
  --ui-title-item: 14px;
  --ui-text: 14px;
  --ui-label: 12px;
  --ui-control-height: 44px;
  --ui-control-x: 13px;
  --ui-field-gap: 14px;
  --ui-block-gap: 16px;
  --ui-panel-padding: 22px;
}
.workflow-page,
.editor-context {
  width:min(var(--ui-content-max),calc(100% - (var(--ui-page-gutter) * 2)));
  max-width:none;
}
.app-grid {
  width:min(100%,calc(var(--ui-content-max) + (var(--ui-page-gutter) * 2)));
  max-width:none;
  padding-inline:var(--ui-page-gutter);
}
.workflow-page > :where(.workflow-panel,.recipe-library,.recipe-content-full,.approval-layout,.two-column-layout,.empty-library)
+ :where(.workflow-panel,.recipe-library,.recipe-content-full,.approval-layout,.two-column-layout,.empty-library) {
  margin-top:var(--ui-block-gap);
}
.recipe-library { gap:var(--ui-block-gap); }
.approval-diffs,
.ingredient-groups { gap:var(--ui-field-gap); }
body:not(.print-body) h1,
body:not(.print-body) h2,
body:not(.print-body) h3,
body:not(.print-body) h4,
body:not(.print-body) p { text-wrap: pretty; }
.library-hero h2 { font-size:var(--ui-title-page); line-height:1.2; }
.recipe-context-header h2,
.workflow-panel > h2,
.approval-intro > h2 { margin:0 0 14px; font-size:var(--ui-title-panel); line-height:1.25; font-weight:600; }
.recipe-context-header h2 { margin:3px 0; }
.form-section > h3,
.panel-section h2,
.section-title > h2,
.section-title > h3 { margin:0; font-size:var(--ui-title-section); line-height:1.3; font-weight:600; }
.section-title > h4,
.ingredient-group h4,
.review-field-pair h3,
.approval-diff h3 { margin:0; font-size:var(--ui-title-item); line-height:1.35; font-weight:600; }
.stack-form { gap:var(--ui-field-gap); }
.form-section,
.panel-section { gap:var(--ui-field-gap); }
.field-grid { gap:var(--ui-field-gap); }
label,
.field-label,
.library-filters label,
.inline-controls label,
.review-extras legend { gap:6px; margin:0; color:#39414b; font-size:var(--ui-label); line-height:1.35; font-weight:500; }
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
select,
.multi-select-trigger { height:var(--ui-control-height); min-height:var(--ui-control-height); padding:10px var(--ui-control-x); font-size:var(--ui-text); line-height:1.35; }
select {
  appearance:none;
  -webkit-appearance:none;
  padding-right:40px;
  background-color:#fff;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.25 6 6.25 11 1.25' fill='none' stroke='%2339414b' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 14px center;
  background-size:12px 8px;
}
select::-ms-expand { display:none; }
select:disabled {
  background-color:#f3f4f6;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.25 6 6.25 11 1.25' fill='none' stroke='%239299a3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.recipe-authoring-layout input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
.recipe-authoring-layout select { height:var(--ui-control-height); min-height:var(--ui-control-height); }
textarea { min-height:112px; padding:11px var(--ui-control-x); font-size:var(--ui-text); line-height:1.5; }
input[type="file"] { min-height:var(--ui-control-height); padding:8px 10px; font-size:13px; line-height:1.4; }
input::placeholder,
textarea::placeholder { color:#9299a3; opacity:1; }
.review-readonly { min-height:var(--ui-control-height); padding:11px var(--ui-control-x); font-size:var(--ui-text); line-height:1.5; }
.workflow-panel { padding:var(--ui-panel-padding); }
.editor-panel { padding-inline:var(--ui-panel-padding); }
.editor-panel > .panel-section {
  margin:0;
  padding:22px 0;
  border:0;
  border-bottom:1px solid var(--line-soft);
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
.editor-panel > .panel-section:last-child { border-bottom:0; }
.panel-section:first-of-type { padding-top:22px; }
.form-section { padding:22px 0; }
.review-field-pair { gap:var(--ui-field-gap); padding:16px; }
.review-field-pair > div,
.review-field-pair > label { display:grid; align-content:start; gap:6px; }
.approval-diff { padding:16px; }
.approval-columns { gap:var(--ui-field-gap); }
.choice-card { min-height:50px; padding:11px 13px; font-size:13px; line-height:1.35; }
.button { min-height:40px; font-size:12px; line-height:1.3; }
.button.small { min-height:32px; }
.recipe-action-toolbar .button,
.chef-form-actions .button { min-height:40px; padding-block:9px; }
.field-help,
.muted-copy { color:var(--muted); font-size:12px; line-height:1.5; }
@media(max-width:640px){
  :root { --ui-page-gutter:12px; --ui-title-page:21px; --ui-title-panel:19px; --ui-panel-padding:16px; }
  .app-header { grid-template-columns:minmax(0,1fr) auto; }
  .workflow-panel { padding:var(--ui-panel-padding); }
  .editor-panel { padding-inline:var(--ui-panel-padding); }
  .panel-section,.panel-section:first-of-type,.form-section { padding-block:18px; }
}

/* Premium editorial timeline */
.recipe-history { overflow:hidden; }
.history-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:20px; padding-bottom:16px; border-bottom:1px solid var(--line-soft); }
.history-heading h2 { margin:3px 0 0; }
.history-heading > span { flex:0 0 auto; padding:5px 9px; border-radius:999px; color:var(--muted); background:#f3f5f7; font-size:11px; font-weight:600; }
.history-timeline { position:relative; display:grid; padding-left:27px; }
.history-timeline::before { content:""; position:absolute; top:11px; bottom:11px; left:7px; width:1px; background:#d9dee4; }
.history-event { position:relative; display:grid; grid-template-columns:116px minmax(0,1fr); gap:16px; min-width:0; padding:0 0 20px; }
.history-event:last-child { padding-bottom:0; }
.history-marker { position:absolute; top:6px; left:-26px; z-index:1; width:13px; height:13px; border:3px solid #fff; border-radius:50%; background:#9aa2ad; box-shadow:0 0 0 1px #cbd1d8; }
.history-event--revision .history-marker { background:#b06a57; }
.history-event--pdf .history-marker { background:var(--wine); }
.history-event.is-latest .history-marker { background:var(--wine); box-shadow:0 0 0 1px var(--wine),0 0 0 5px rgba(125,38,49,.08); }
.history-event time { padding-top:2px; color:#7a828d; font-size:11px; font-weight:500; white-space:nowrap; }
.history-event-content { display:grid; grid-template-columns:minmax(190px,.7fr) minmax(130px,.45fr) minmax(240px,1fr); gap:18px; min-width:0; padding-bottom:20px; border-bottom:1px solid var(--line-soft); }
.history-event:last-child .history-event-content { padding-bottom:0; border-bottom:0; }
.history-event-content strong { color:var(--ink); font-size:13px; font-weight:600; }
.history-event-content span,.history-event-content small { overflow-wrap:anywhere; color:var(--muted); font-size:12px; line-height:1.45; }
.history-event-content small { color:#7b7270; }
@media(max-width:760px){
  .history-heading { align-items:flex-start; }
  .history-event { grid-template-columns:1fr; gap:5px; padding-bottom:18px; }
  .history-event-content { grid-template-columns:1fr; gap:3px; padding-bottom:18px; }
  .history-event time { order:2; }
  .history-event-content { order:1; }
}

/* Recipe page heading: same clean hierarchy used by the main library. */
.recipe-context-header {
  align-items:center;
  margin-bottom:18px;
  padding:4px 0 18px;
  border:0;
  border-bottom:1px solid var(--line);
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
.recipe-context-header h2 {
  margin:4px 0 5px;
  font-size:var(--ui-title-page);
  line-height:1.2;
}
.recipe-context-header p { margin:0; }
.recipe-context-header > .ops-status,
.recipe-context-header > .status-badge {
  align-self:center;
  margin:0;
}
@media(max-width:640px){
  .recipe-context-header { align-items:flex-start; padding-bottom:14px; }
}

/* Compact two-line recipe cards used by the active and finalized libraries. */
.recipe-library .recipe-card {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:5px;
  min-height:0;
  padding:11px 14px;
}
.recipe-card-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  min-width:0;
}
.recipe-card-title-line {
  display:flex;
  min-width:0;
  align-items:center;
  gap:8px;
}
.recipe-library .recipe-card-heading h2 {
  min-width:0;
  flex:0 1 auto;
  margin:0;
  overflow:hidden;
  font-size:17px;
  line-height:34px;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.recipe-phase-badge {
  flex:0 0 auto;
  padding:3px 8px;
  border:1px solid rgba(125,38,49,.16);
  border-radius:999px;
  color:var(--wine);
  background:rgba(125,38,49,.07);
  font-size:10px;
  font-weight:700;
  line-height:1.4;
  white-space:nowrap;
}
.recipe-card-actions {
  display:flex;
  flex:0 0 auto;
  align-items:center;
  gap:6px;
}
.recipe-card-actions form { margin:0; }
.recipe-card-icon {
  display:inline-grid;
  place-items:center;
  width:34px;
  min-width:34px;
  height:34px;
  min-height:34px;
  padding:0;
  color:var(--wine);
  border:1px solid #d4d9df;
  border-radius:7px;
  background:#fff;
  box-shadow:none;
  font:inherit;
  text-decoration:none;
  cursor:pointer;
}
.recipe-card-icon:hover { color:#fff; border-color:var(--wine); background:var(--wine); }
.recipe-card-icon-danger:hover { border-color:#a12634; background:#a12634; }
.recipe-card-icon:focus-visible {
  outline:3px solid var(--focus);
  outline-offset:2px;
  border-color:var(--wine);
}
.recipe-card-icon i { font-size:13px; }
.recipe-library .recipe-card .ops-row-meta {
  min-width:0;
  gap:5px 12px;
  overflow:hidden;
  font-size:11px;
  line-height:18px;
  white-space:nowrap;
}
.recipe-library .recipe-card .ops-row-meta span {
  overflow:hidden;
  text-overflow:ellipsis;
}
.visually-hidden {
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}

.visual-only-editor .visual-controls-panel { min-width: 0; }
.visual-editor-intro p:last-child { margin-bottom: 0; color: var(--muted); line-height: 1.6; }
.tag-color-list { display: grid; gap: 8px; }
.tag-editor-label { flex: 1; font-weight: 700; }
.tag-editor input[type="color"] { width: 48px; min-width: 48px; height: 36px; padding: 2px; }
.visual-image-fields { display: grid; gap: 16px; }
.visual-image-fields > label { display: grid; gap: 8px; }
.visual-image-fields .editor-image-control { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.content-integrity-warning { border-color: #e4b24f; background: #fff9e8; }
.content-integrity-warning h2 { margin-bottom: 10px; font-size: 20px; }
.content-integrity-warning ul { margin: 0 0 10px; }
.repeatable-field { display: grid; gap: 8px; }
.repeatable-items { display: grid; gap: 8px; }
.repeatable-items .list-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: start; }
.ingredient-group-items { display: grid; gap: 8px; }
.ingredient-group-items .list-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.item-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media(max-width:520px){
  .recipe-library .recipe-card { gap:8px; padding:13px; }
  .recipe-card-heading { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; }
  .recipe-card-title-line { flex-wrap:wrap; gap:3px 7px; }
  .recipe-library .recipe-card-heading h2 {
    line-height:1.25;
    white-space:normal;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
  }
  .recipe-library .recipe-card .ops-row-meta { flex-wrap:wrap; white-space:normal; }
}
