:root {
  --brand-yellow: #f5c542;
  --brand-yellow-soft: #ffe9a6;
  --brand-yellow-light: #fff7d6;
  --brand-cream: #fffdf6;
  --brand-paper: #faf5e8;
  --brand-card: #ffffff;
  --brand-border: #ede4ce;
  --brand-black: #111111;
  --brand-text: #1b1b1b;
  --brand-muted: #6f6f6f;
  --success: #22a861;
  --success-soft: #e8f8ef;
  --warning: #f5b700;
  --warning-soft: #fff3c4;
  --info: #3b82f6;
  --info-soft: #eaf2ff;
  --danger: #e5484d;
  --danger-soft: #ffedee;
  --shadow: 0 18px 50px rgba(17, 17, 17, 0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Manrope, Arial, sans-serif;
  color: var(--brand-text);
  background:
    radial-gradient(rgba(17,17,17,0.045) 1px, transparent 1px),
    var(--brand-cream);
  background-size: 18px 18px;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}
a { color: inherit; text-decoration: none; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 224px 1fr;
  grid-template-rows: 76px 1fr;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 44px;
  background: linear-gradient(180deg, #ffdf72 0%, #f5c542 100%);
  border-bottom: 1px solid rgba(17,17,17,0.06);
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 18px;
  letter-spacing: 0;
}
.logo span span { font-weight: 800; }
.logo-mark {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.logo svg, .topbar svg, .sidebar svg, .main svg { width: 18px; height: 18px; stroke-width: 2.2; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  font-weight: 700;
}
.credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.7);
}
.header-link {
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.auth-controls {
  min-width: 116px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.auth-loading {
  font-size: 12px;
  font-weight: 600;
  color: rgba(20, 20, 20, 0.68);
}
.auth-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(20, 20, 20, 0.22);
  background: rgba(255, 255, 255, 0.62);
  color: #171717;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.auth-button.primary {
  border-color: #171717;
  background: #171717;
  color: #fff;
}
.auth-button:hover { filter: brightness(0.96); }
#clerk-user-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

.sidebar {
  grid-row: 2;
  background: rgba(255, 251, 239, 0.88);
  border-right: 1px solid var(--brand-border);
  padding: 30px 18px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 76px;
  height: calc(100vh - 76px);
}
.nav-list { display: grid; gap: 8px; }
.nav-list a {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 700;
  color: #232323;
}
.nav-list a.active {
  background: linear-gradient(90deg, var(--brand-yellow-light), rgba(255,233,166,0.75));
}
.sidebar-bottom { display: grid; gap: 22px; }
.upgrade-card {
  padding: 18px 18px;
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--brand-border);
  border-radius: 14px;
}
.upgrade-card svg { color: var(--warning); fill: var(--warning); }
.upgrade-card h3 { margin: 8px 0 4px; font-size: 14px; }
.upgrade-card p { margin: 0; color: var(--brand-muted); font-size: 12px; line-height: 1.45; }
.whats-new {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  font-weight: 700;
  font-size: 13px;
}
.whats-new span {
  margin-left: auto;
  width: 7px;
  height: 7px;
  background: var(--warning);
  border-radius: 999px;
}

.main {
  grid-column: 2;
  grid-row: 2;
  padding: 38px 44px 46px;
}
.page {
  max-width: 1180px;
  margin: 0 auto;
}
.drive-page {
  max-width: 1680px;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.page-title h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: 0;
}
.page-title p {
  margin: 8px 0 0;
  color: var(--brand-muted);
  font-weight: 600;
}
.grid { display: grid; gap: 22px; }
.grid.two { grid-template-columns: minmax(0, 1fr) 330px; }
.grid.editor { grid-template-columns: 270px minmax(520px, 1fr) 350px; align-items: start; }
.grid.projects { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.bulk-layout { max-width: 1180px; }
.mode-switch {
  width: fit-content;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 0 0 22px;
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  background: rgba(255,255,255,0.76);
}
.mode-switch button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  color: var(--brand-muted);
}
.mode-switch button.active {
  background: var(--warning);
  color: #111;
}
.card {
  background: rgba(255,255,255,0.88);
  border: 1px solid var(--brand-border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.panel { padding: 22px; }
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.section-title {
  margin: 0 0 16px;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--brand-border);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 800;
  white-space: nowrap;
}
.btn.primary {
  border-color: #e9aa00;
  background: linear-gradient(180deg, #ffc72c, #f5b700);
  color: #111;
}
.btn.ghost { background: rgba(255,255,255,0.65); }
.btn.full { width: 100%; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.is-loading svg { animation: button-spin 0.9s linear infinite; }
@keyframes button-spin { to { transform: rotate(360deg); } }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.badge.yellow { background: var(--warning-soft); color: #8a6200; }
.badge.green { background: var(--success-soft); color: #147a45; }
.badge.blue { background: var(--info-soft); color: #2365bd; }
.badge.gray { background: #f0f0ee; color: #575757; }
.status-dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; }

.metric-row { display: grid; grid-template-columns: repeat(5,1fr); gap: 14px; margin-bottom: 20px; }
.metric {
  padding: 17px;
  min-height: 84px;
}
.metric strong { display: block; font-size: 22px; }
.metric span { display: block; color: var(--brand-muted); font-size: 12px; font-weight: 700; }

.project-list { overflow: hidden; }
.loading-spinner { display: inline-flex; line-height: 0; }
.loading-spinner svg { animation: project-loader-spin .8s linear infinite; transform-origin: center; }
@keyframes project-loader-spin { to { transform: rotate(360deg); } }
.project-list.is-refreshing { position: relative; }
.project-refresh-indicator { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line); }
.project-pagination { display: flex; gap: 6px; }
@media (prefers-reduced-motion: reduce) {
  .loading-spinner svg { animation-duration: 1.8s; }
}
.project-row {
  display: grid;
  grid-template-columns: 78px minmax(0,1fr) auto auto auto;
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--brand-border);
}
.project-row[hidden],
.project-filter-empty[hidden] {
  display: none !important;
}
.project-delete-button {
  color: #a63d32;
  border-color: rgba(166, 61, 50, 0.28);
}
.project-delete-button:hover:not(:disabled),
.project-delete-button:focus-visible {
  background: #fff0ed;
  color: #8f2d24;
  border-color: rgba(166, 61, 50, 0.55);
}
.project-status-control select {
  min-height: 32px;
  padding: 4px 30px 4px 12px;
  border: 1px solid #d8cfbc;
  border-radius: 999px;
  background: #f7f6f2;
  color: #4f4f4f;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.project-status-control select:disabled {
  cursor: wait;
  opacity: 0.65;
}
.project-row:last-child { border-bottom: 0; }
.thumb, .cover {
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(17,17,17,0.08);
}
.thumb { width: 64px; height: 78px; }
.cover { width: 116px; height: 154px; }
.live-placeholder {
  background:
    linear-gradient(135deg, rgba(245, 197, 66, 0.18), rgba(34, 168, 97, 0.16)),
    #fffaf0;
  border: 1px dashed #d9c9a9;
  color: #7a5a00;
  display: grid;
  place-items: center;
  font-weight: 900;
  text-align: center;
}
.live-placeholder span { padding: 6px; }
.empty-state {
  display: grid;
  gap: 6px;
  place-items: center;
  padding: 34px 18px;
  color: var(--brand-muted);
  text-align: center;
}
.empty-state.compact { padding: 20px 16px; }
.empty-state strong { color: var(--brand-text); }
.project-row h3 { margin: 0 0 8px; font-size: 18px; }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: #7b7b7b; font-size: 13px; font-weight: 700; }
.dot-sep { color: #b6aa95; }

.searchbar, .filterbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.grid.projects .searchbar { flex-wrap: wrap; }
.searchbar label {
  flex: 1;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  background: #fff;
  color: #8c8c8c;
}
.searchbar input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--brand-text);
}
.pill-filter {
  height: 38px;
  border: 1px solid var(--brand-border);
  background: #fff;
  border-radius: 999px;
  padding: 0 14px;
  font-weight: 800;
}
.pill-filter.active { border-color: var(--warning); background: var(--brand-yellow-light); }

.form-card { padding: 18px 22px; }
.form-grid { display: grid; gap: 14px; }
.field {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}
.field span {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
}
.input, .select, .stepper {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--brand-border);
  border-radius: 9px;
  background: #fff;
  padding: 0 14px;
  color: #6b6b6b;
  font-weight: 600;
}
.textarea {
  min-height: 150px;
  padding: 12px 14px;
  line-height: 1.45;
  resize: vertical;
}
.stepper {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 0;
  overflow: hidden;
}
.stepper button {
  height: 42px;
  border: 0;
  background: #fff;
  font-weight: 800;
}
.stepper strong { text-align: center; font-size: 13px; }
.choice-row { display: grid; grid-template-columns: repeat(2,1fr); gap: 18px; }
.choice {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  background: #fff;
}
.radio {
  width: 20px;
  height: 20px;
  border: 2px solid #ddd2bb;
  border-radius: 999px;
  display: inline-block;
  position: relative;
}
.choice.active .radio { border-color: var(--warning); }
.choice.active .radio::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--warning);
  border-radius: inherit;
}
.choice strong { display: block; font-size: 13px; }
.choice small { color: var(--brand-muted); font-weight: 700; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.form-message {
  max-width: 560px;
  margin: 12px auto 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
}
.form-message.error {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(229, 72, 77, 0.22);
}
.form-message.success {
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid rgba(34, 168, 97, 0.22);
}
.form-message.warning {
  color: #8a6200;
  background: var(--warning-soft);
  border: 1px solid rgba(245, 183, 0, 0.28);
}
.job-error {
  max-width: none;
  margin: 12px 0 14px;
  display: grid;
  gap: 4px;
  line-height: 1.35;
}
.job-error strong,
.job-error span {
  display: block;
}
.ai-status-message {
  max-width: none;
  margin: 10px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-card { text-align: left; }
.preview-card .cover { margin: 12px auto 18px; width: 150px; height: 210px; }
.summary-line {
  min-height: 62px;
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  margin-top: 12px;
}
.summary-line svg { color: var(--warning); }
.summary-line strong { display: block; font-size: 13px; }
.summary-line span { color: var(--brand-muted); font-size: 12px; font-weight: 700; }
.output-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.output {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  font-size: 12px;
  font-weight: 800;
}
.output i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-style: normal;
}

.automation-summary {
  display: grid;
  grid-template-columns: repeat(9, minmax(42px, 1fr));
  align-items: center;
  gap: 12px;
  text-align: center;
}
.step-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 9px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--brand-yellow-light);
  color: #b17700;
}
.automation-summary strong { font-size: 12px; }
.automation-summary p { margin: 4px 0 0; color: var(--brand-muted); font-size: 11px; line-height: 1.35; font-weight: 700; }
.arrow { color: #a69475; font-weight: 900; }

.pipeline-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  align-items: center;
}
.pipeline-card .cover { width: 124px; height: 170px; }
.pipeline-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.pipeline-head h2 { margin: 0; font-size: 22px; }
.pipeline-labels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  text-align: center;
  margin: 20px 0 12px;
}
.pipeline-stage {
  display: grid;
  place-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
}
.stage-dot {
  width: 31px;
  height: 31px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 2px solid #d9d9d9;
  background: #fff;
  color: #9a9a9a;
}
.pipeline-stage.done .stage-dot, .pipeline-stage.active .stage-dot {
  border-color: var(--warning);
  background: var(--warning);
  color: #fff;
}
.progress-track {
  height: 9px;
  background: #eee9dd;
  border-radius: 999px;
  overflow: hidden;
}
.progress-track span { display: block; height: 100%; width: 68%; background: var(--warning); }
.progress-track.indeterminate span {
  width: 38%;
  animation: progress-slide 1.05s ease-in-out infinite;
}
.pdf-export-progress {
  width: min(640px, 100%);
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(245, 183, 0, 0.38);
  border-radius: 12px;
  background: #fffaf0;
  color: var(--brand-ink);
}
.pdf-export-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 900;
}
.pdf-export-progress-head strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pdf-export-progress-head svg {
  flex: 0 0 auto;
  animation: button-spin 0.9s linear infinite;
}
.pdf-export-progress-head span {
  color: #8a6200;
  font-size: 14px;
}
.pdf-export-progress-track {
  position: relative;
  height: 12px;
}
.pdf-export-progress-track span {
  min-width: 2%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f5b700, #ffd767, #f5b700);
  background-size: 200% 100%;
  transition: width 0.45s ease;
  animation: pdf-progress-shimmer 1.3s linear infinite;
}
.pdf-export-progress p {
  margin: 9px 0 0;
  color: var(--brand-muted);
  font-size: 11px;
  font-weight: 800;
}
@keyframes pdf-progress-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
@keyframes progress-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}
.create-progress {
  width: min(720px, 100%);
  margin: 16px auto 0;
  display: grid;
  gap: 10px;
  text-align: left;
}
.create-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  font-size: 13px;
  font-weight: 900;
}
.create-progress-head span {
  color: var(--brand-muted);
}
.create-progress-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.create-progress-steps span {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--brand-border);
  border-radius: 10px;
  color: var(--brand-muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.create-progress-steps span.done {
  color: var(--success);
  background: var(--success-soft);
  border-color: rgba(34, 168, 97, 0.22);
}
.create-progress p {
  margin: 0;
  text-align: center;
}
.bulk-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.bulk-button-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}
.bulk-credit {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: #8a6200;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
}
.bulk-workspace {
  max-width: 1180px;
  padding: 0;
  overflow: hidden;
  gap: 0;
}
.bulk-workspace-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 14px 0;
  border-bottom: 1px solid var(--brand-border);
  background: #fffdfa;
}
.bulk-workspace-tabs button {
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--brand-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
.bulk-workspace-tabs button.active {
  border-bottom-color: #d6a600;
  color: var(--brand-text);
}
.bulk-workspace-tabs button span {
  min-width: 22px;
  min-height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff0bd;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
}
.bulk-workspace-body {
  padding: 22px;
  display: grid;
  gap: 20px;
}
.bulk-workspace-body .bulk-layout > .card,
.bulk-workspace-body > .card {
  box-shadow: none;
}
.bulk-history-panel {
  display: grid;
  gap: 14px;
}
.bulk-history-search {
  min-height: 44px;
  padding-left: 13px;
  border: 1px solid var(--brand-border);
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-muted);
}
.bulk-history-search .input {
  min-height: 42px;
  padding-left: 0;
  border: 0;
  box-shadow: none;
}
.bulk-conflict-panel {
  width: 100%;
  padding: 14px;
  border: 1px solid #efb5b5;
  border-radius: 12px;
  background: #fff4f4;
  display: grid;
  gap: 12px;
  color: #9e3838;
}
.bulk-conflict-summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.bulk-conflict-summary div,
.bulk-conflict-row span {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.bulk-conflict-summary small,
.bulk-conflict-row small {
  color: #805252;
  font-weight: 700;
}
.bulk-conflict-panel details summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}
.bulk-conflict-list {
  max-height: 230px;
  margin-top: 10px;
  overflow: auto;
  border-top: 1px solid #edcccc;
}
.bulk-conflict-row {
  min-height: 52px;
  padding: 8px 0;
  border-bottom: 1px solid #edcccc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bulk-history-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.bulk-history-tabs button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  background: #fff;
  color: var(--brand-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.bulk-history-tabs button span {
  min-width: 22px;
  min-height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #f4eedf;
  color: var(--brand-text);
  display: inline-grid;
  place-items: center;
}
.bulk-history-tabs button.active {
  border-color: #dba900;
  background: var(--warning-soft);
  color: #765600;
}
.bulk-history-list {
  display: grid;
  gap: 8px;
}
.bulk-history-row {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 13px 14px 16px;
  overflow: hidden;
  border: 1px solid var(--brand-border);
  border-radius: 10px;
  background: #fffdfa;
  color: var(--brand-text);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  text-align: left;
  font: inherit;
}
.bulk-history-row:hover {
  border-color: #d9b84d;
  background: #fffaf0;
}
.bulk-history-row.active {
  border-color: #d6a600;
  box-shadow: 0 0 0 2px rgba(255, 190, 0, 0.12);
}
.bulk-history-open {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.bulk-history-delete {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #efc9c5;
  border-radius: 9px;
  background: #fff;
  color: #a63d32;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}
.bulk-history-delete:hover:not(:disabled) {
  border-color: #d96b60;
  background: #fff0ee;
}
.bulk-history-delete:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}
.bulk-history-delete svg {
  width: 17px;
  height: 17px;
}
.bulk-history-main,
.bulk-history-meta {
  min-width: 0;
  display: flex;
}
.bulk-history-main {
  flex-direction: column;
  gap: 3px;
}
.bulk-history-main strong,
.bulk-history-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bulk-history-main strong {
  font-size: 13px;
}
.bulk-history-main small,
.bulk-history-meta small {
  color: var(--brand-muted);
  font-size: 11px;
  font-weight: 700;
}
.bulk-history-meta {
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.bulk-history-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  background: #eee8da;
}
.bulk-history-progress span {
  height: 100%;
  display: block;
  background: var(--brand-yellow);
}
.bulk-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.bulk-stats span {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--brand-border);
  border-radius: 10px;
  background: rgba(255,255,255,0.72);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--brand-muted);
  font-size: 12px;
  font-weight: 900;
}
.table-wrap { overflow-x: auto; }
.bulk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.bulk-table th,
.bulk-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--brand-border);
  text-align: left;
  vertical-align: top;
}
.bulk-table th {
  color: var(--brand-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
}
.bulk-table td small {
  display: block;
  margin-top: 3px;
  color: var(--brand-muted);
  font-weight: 700;
}
.bulk-project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bulk-full-book-row-progress {
  display: grid;
  gap: 4px;
  min-width: 130px;
  margin-top: 8px;
  color: var(--brand-muted);
  font-size: 11px;
  font-weight: 800;
}
.bulk-full-book-row-progress .progress-track {
  height: 6px;
}
.bulk-full-book-complete { color: var(--success); }
.bulk-full-book-failed { color: #a63d32; }
.bulk-full-book-progress {
  max-width: 860px;
}
.activity-list { display: grid; }
.activity {
  min-height: 54px;
  display: grid;
  grid-template-columns: 28px minmax(0,1fr) auto;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--brand-border);
}
.activity:first-child { border-top: 0; }
.activity strong { display: block; font-size: 13px; }
.activity span, .activity time { color: var(--brand-muted); font-size: 12px; font-weight: 700; }

.side-stack { display: grid; gap: 18px; }
.stat-lines { display: grid; gap: 17px; }
.stat-line { display: flex; justify-content: space-between; font-weight: 800; font-size: 13px; }
.control-stack { display: grid; gap: 12px; }

.drive-status {
  display: grid;
  gap: 18px;
}
.drive-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}
.drive-identity {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
}
.drive-identity-copy {
  min-width: 0;
}
.drive-identity-copy .section-title {
  margin-bottom: 6px;
}
.drive-identity-copy p {
  max-width: 420px;
  margin: 0;
  line-height: 1.55;
}
.drive-status-actions {
  display: flex;
  flex: 2 1 520px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.drive-status-actions .btn {
  margin: 0;
  white-space: nowrap;
}
.drive-status-content {
  min-width: 0;
}
.drive-logo {
  flex: 0 0 auto;
  width: 58px;
  height: 52px;
  background: conic-gradient(from 60deg, #22a861, #f5b700, #3b82f6, #22a861);
  clip-path: polygon(50% 0,100% 90%,0 90%);
}
.drive-logo.inactive {
  filter: grayscale(1);
  opacity: 0.35;
}
.print-quality-assurance {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--brand-border);
  color: var(--brand-muted);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.55;
}
.print-quality-assurance-label {
  margin-right: 8px;
  color: #8b6a1b;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.print-quality-assurance strong {
  margin-right: 5px;
  color: var(--brand-text);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: -0.01em;
}
.print-quality-assurance-detail {
  color: var(--brand-muted);
}
.editor-canvas-panel > .print-quality-assurance {
  margin: 0 18px 14px;
  padding-top: 10px;
}
.scan-health {
  display: grid;
  gap: 3px;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid #b8dfc4;
  border-radius: 12px;
  background: #edf9f1;
  color: #277745;
  font-size: 12px;
}
.scan-health.warning {
  border-color: #e8c66c;
  background: #fff7dc;
  color: #855d08;
}
.scan-health span { font-weight: 700; }
.scan-diagnostics {
  max-width: 760px;
  font-size: 12px;
}
.scan-diagnostics > summary {
  cursor: pointer;
  font-weight: 900;
}
.scan-diagnostics-grid {
  display: grid;
  grid-template-columns: minmax(140px, auto) minmax(220px, 1fr);
  gap: 7px 12px;
  margin-top: 12px;
}
.scan-diagnostics-grid > span { color: var(--brand-muted); font-weight: 800; }
.scan-diagnostics code { overflow-wrap: anywhere; }
.scan-diagnostics p { margin: 10px 0 0; line-height: 1.55; }
.image-coverage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.coverage-card {
  min-height: 104px;
  align-content: center;
  gap: 8px;
}
.coverage-card span:not(.step-icon) {
  color: var(--brand-muted);
  font-size: 12px;
  font-weight: 800;
}
.coverage-card strong {
  font-size: 26px;
  line-height: 1;
}
.image-slots-panel {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}
.image-slots-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.image-slots-head .section-title {
  margin-bottom: 6px;
}
.image-slots-head p {
  max-width: 100%;
}
.image-slots-scroll {
  min-height: 900px;
  max-height: 1600px;
  height: clamp(1000px, 126vh, 1600px);
  overflow-y: auto;
  overflow-x: hidden;
  overflow-anchor: none;
  overscroll-behavior-y: auto;
  scroll-behavior: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding-right: 10px;
  scrollbar-gutter: stable;
}
.image-slots-scroll::-webkit-scrollbar {
  width: 10px;
}
.image-slots-scroll::-webkit-scrollbar-track {
  background: #fbf7ee;
  border-radius: 999px;
}
.image-slots-scroll::-webkit-scrollbar-thumb {
  background: #dfd2b9;
  border: 2px solid #fbf7ee;
  border-radius: 999px;
}
.image-library-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
}
.image-library-actions > .form-message { grid-column: 1 / -1; }
.image-library-actions > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.image-library-actions > div:first-child strong {
  font-size: 15px;
}
.image-library-actions > div:first-child span {
  color: var(--brand-muted);
  font-size: 12px;
  font-weight: 800;
}
.image-library-action-buttons {
  display: grid;
  grid-template-columns: minmax(180px, auto);
  gap: 10px;
  align-items: center;
}
.image-library-action-buttons .btn {
  min-height: 44px;
  padding: 0 16px;
  justify-content: center;
  white-space: nowrap;
}
.credit-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(138, 98, 0, 0.22);
  color: #6f4f00;
  font-size: 11px;
  font-weight: 900;
}
.slot-group {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.slot-group:first-child {
  margin-top: 0;
}
.slot-group-head {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  background: #fffdfa;
}
.slot-group h3 {
  margin: 0;
  font-size: 16px;
}
.slot-group-head p {
  margin: 2px 0 0;
}
.slot-list {
  display: grid;
  gap: 8px;
}
.image-slot-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: center;
  min-height: 152px;
  padding: 14px;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background: #fffdfa;
}
.image-slot-row:has(.candidate-details[open]) {
  position: relative;
  z-index: 30;
}
.slot-thumb,
.slot-thumb img,
.slot-placeholder {
  width: 160px;
  height: 122px;
  border-radius: 8px;
}
.slot-thumb {
  position: relative;
  overflow: hidden;
  background: #f4eedf;
}
.slot-thumb .slot-thumbnail-placeholder,
.slot-thumb img {
  position: absolute;
  inset: 0;
}
.slot-thumb img {
  display: block;
  object-fit: cover;
  opacity: 0;
  transition: opacity 120ms ease-out;
}
.slot-thumb img.is-loaded {
  opacity: 1;
}
.slot-thumb.image-preview-unavailable::after {
  content: "Preview unavailable";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-bottom: 30px;
  background: rgba(255, 250, 238, 0.92);
  color: var(--brand-muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}
.image-preview-retry {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 13px;
  translate: -50% 0;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  background: #fff;
  padding: 5px 9px;
  color: var(--brand-text);
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.slot-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.selected-file-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px;
  max-width: 100%;
  overflow: hidden;
}
.selected-file-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}
.slot-title-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.slot-title-line strong {
  min-width: 0;
  max-width: 100%;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
  line-height: 1.15;
}
.slot-actions {
  width: 300px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  justify-self: end;
  align-items: stretch;
}
.slot-actions .btn,
.slot-actions summary.btn {
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
  font-size: 11px;
  white-space: nowrap;
  justify-content: center;
}
.slot-actions .btn svg,
.slot-actions summary.btn svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}
.slot-action-choose {
  grid-column: 1;
  grid-row: 2;
}
.slot-action-generate {
  grid-column: 2;
  grid-row: 2;
}
.candidate-details {
  min-width: 0;
  position: relative;
}
.candidate-details[open] {
  z-index: 40;
}
.candidate-details summary {
  list-style: none;
  cursor: pointer;
}
.candidate-details summary::-webkit-details-marker {
  display: none;
}
.candidate-menu {
  position: absolute;
  z-index: 20;
  right: 0;
  top: calc(100% + 8px);
  width: min(430px, 86vw);
  max-height: 420px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background: #fffdfa;
  box-shadow: 0 18px 40px rgba(40, 29, 10, 0.18);
}
.candidate-menu > p {
  grid-column: 1 / -1;
}
.candidate-option {
  width: 100%;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background: white;
  text-align: left;
  cursor: pointer;
}
.candidate-option.active {
  border-color: var(--warning);
  background: #fff7d6;
}
.candidate-option img,
.candidate-placeholder {
  width: 72px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
}
.candidate-option span {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.candidate-option strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}
.candidate-option small {
  color: var(--brand-muted);
  font-weight: 800;
}
.candidate-option.candidate-image-tile {
  position: relative;
  display: block;
  min-width: 0;
  aspect-ratio: 1;
  padding: 3px;
  overflow: hidden;
  background: #fff;
}
.candidate-option.candidate-image-tile:hover {
  border-color: color-mix(in srgb, var(--warning), #9b6a00 25%);
  box-shadow: 0 3px 10px rgba(40, 29, 10, 0.13);
}
.candidate-option.candidate-image-tile:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--warning), transparent 25%);
  outline-offset: 2px;
}
.candidate-option.candidate-image-tile:disabled {
  cursor: wait;
  opacity: 0.62;
}
.candidate-option.candidate-image-tile img,
.candidate-option.candidate-image-tile .candidate-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 5px;
  object-fit: cover;
  pointer-events: none;
}
.candidate-option.candidate-image-tile img:not([src]) {
  background:
    linear-gradient(110deg, #f4eedf 25%, #fffaf0 42%, #f4eedf 58%);
  background-size: 220% 100%;
  animation: candidate-image-loading 1.15s linear infinite;
}
.candidate-placeholder.image-preview-unavailable {
  display: grid;
  place-items: center;
  padding: 8px;
  color: var(--brand-muted);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}
@keyframes candidate-image-loading {
  to { background-position-x: -220%; }
}
.candidate-selected-mark {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--warning);
  color: #241900;
  box-shadow: 0 2px 8px rgba(40, 29, 10, 0.24);
}
.candidate-selected-mark svg {
  width: 13px;
  height: 13px;
  stroke-width: 3;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  color: #8b8b8b;
  font-size: 11px;
  text-transform: uppercase;
  padding: 12px 10px 12px 0;
  border-bottom: 1px solid var(--brand-border);
  white-space: nowrap;
}
.table td {
  padding: 12px 10px 12px 0;
  border-bottom: 1px solid var(--brand-border);
  vertical-align: middle;
  font-weight: 700;
}
.table tr:last-child td { border-bottom: 0; }
.manifest-table {
  min-width: 760px;
}
.manifest-table td {
  vertical-align: top;
  line-height: 1.25;
}
.recipe-cell { display: flex; align-items: center; gap: 12px; }
.food-thumb { width: 50px; height: 44px; border-radius: 8px; background-size: cover; background-position: center; }
.recipe-live-row { grid-template-columns: 54px minmax(0, 1fr) auto auto; }
.image-rules-panel {
  align-self: start;
  padding: 20px;
}
.image-rules-panel > .section-title { margin-bottom: 4px; }
.image-rules-panel > p { margin: 0; line-height: 1.3; }
.image-rules-panel .rule-list { margin-top: 12px; }
.rule-list { display: grid; gap: 10px; }
.rule {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) 42px;
  gap: 10px;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  text-align: left;
}
.rule:not(:disabled) { cursor: pointer; }
.rule:not(:disabled):hover strong { color: #8a6200; }
.rule span { min-width: 0; }
.rule strong,
.rule small {
  overflow-wrap: anywhere;
}
.image-rules-panel .rule .step-icon {
  width: 34px;
  height: 34px;
}
.toggle {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--warning);
  position: relative;
}
.toggle::after {
  content: "";
  width: 18px;
  height: 18px;
  position: absolute;
  right: 3px;
  top: 3px;
  background: #fff;
  border-radius: inherit;
}
.toggle.off { background: #ddd4c1; }
.rule.disabled { opacity: 0.72; }

.export-hero {
  display: grid;
  grid-template-columns: 126px 1fr 170px;
  align-items: center;
  gap: 24px;
  min-height: 190px;
}
.check-burst {
  width: 116px;
  height: 116px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, #fff 0 30%, #ffe9a6 31% 50%, transparent 51%);
  color: var(--warning);
}
.check-burst svg { width: 42px; height: 42px; }
.export-files-panel {
  display: grid;
  gap: 0;
}
.export-files-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.export-files-head .section-title {
  margin: 0;
}
.export-files-head > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-weight: 800;
}
.file-row {
  display: grid;
  grid-template-columns: 42px minmax(190px, 1fr) minmax(86px, auto) minmax(150px, auto) 132px;
  gap: 14px;
  align-items: center;
  min-height: 76px;
  padding: 12px 0;
  border-top: 1px solid var(--brand-border);
}
.export-files-head + .file-row { border-top: 0; }
.file-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  justify-self: start;
}
.file-icon.red { background: #ef4444; }
.file-icon.green { background: #22c55e; }
.file-icon.yellow { background: #fbbf24; }
.file-icon.purple { background: #8b5cf6; }
.file-icon.blue { background: #3b82f6; }
.file-primary {
  min-width: 0;
  display: grid;
  gap: 5px;
}
.file-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.file-title-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}
.file-primary small {
  color: var(--brand-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}
.file-metric {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.file-metric span {
  color: var(--brand-muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.file-metric strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.file-download {
  width: 100%;
  justify-content: center;
}
.file-unavailable {
  width: 132px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  padding: 0 12px;
  border-radius: 10px;
  background: #f5f2eb;
  color: var(--brand-muted);
  font-size: 12px;
  font-weight: 900;
}

.template-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.single-template-grid { grid-template-columns: minmax(320px, 520px); }
.template-card { padding: 14px; }
.modern-template-card { display: grid; gap: 10px; }
.template-preview {
  height: 160px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  margin-bottom: 14px;
}
.template-preview-image {
  height: 360px;
  background-color: #faf6ef;
  background-size: contain;
  background-repeat: no-repeat;
  border: 1px solid var(--brand-border);
}
.template-card h3 { margin: 0 0 6px; }
.template-card p { margin: 0; color: var(--brand-muted); font-size: 13px; font-weight: 700; }
.template-meta-list {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  color: var(--brand-muted);
  font-size: 13px;
  font-weight: 800;
}
.template-meta-list span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc-page { max-width: 1320px; }
.toc-summary {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) minmax(260px, auto);
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}
.toc-summary h2 { margin: 0 0 6px; }
.toc-grid {
  grid-template-columns: 320px minmax(0, 1fr) 320px;
  align-items: start;
}
.toc-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.toc-section-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 18px;
}
.toc-page-list { display: grid; gap: 12px; }
.toc-page-row {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--brand-border);
  border-radius: 10px;
  background: rgba(255,255,255,0.72);
}
.toc-copy {
  min-height: 180px;
}
.toc-chapter { display: grid; gap: 14px; }
.toc-chapter-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}
.toc-chapter-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.chapter-title-input {
  color: var(--brand-text);
  font-weight: 900;
}
.recipe-title-list { display: grid; gap: 8px; }
.recipe-title-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
}
.recipe-title-row > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--brand-yellow-light);
  color: #8a6200;
  font-size: 12px;
  font-weight: 900;
}

.editor-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "info"
    "setup";
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
}
.book-info {
  grid-area: info;
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 14px;
  overflow: hidden;
}
.book-info .thumb { width: 56px; height: 64px; }
.book-info > div {
  min-width: 0;
  max-width: 100%;
}
.book-info h2 {
  max-width: min(100%, 760px);
  margin: 0 0 6px;
  display: -webkit-box;
  overflow: hidden;
  font-size: 18px;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.book-info .meta {
  flex-wrap: wrap;
  gap: 6px 10px;
}
.book-setup-controls {
  grid-area: setup;
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(260px, 360px) auto;
  gap: 12px;
  align-items: end;
  justify-self: start;
  width: min(100%, 760px);
  min-width: 0;
}
.book-setup-controls .editor-field {
  gap: 5px;
}
.book-setup-controls #setup-dirty-message {
  grid-column: 1 / -1;
  min-height: 16px;
  color: #8a6200;
  font-weight: 800;
}
.editor-subtoolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr) 350px;
  align-items: center;
  gap: 22px;
  margin: 0 0 20px;
}
.editor-subtoolbar .editor-mode-tabs {
  grid-column: 1;
  margin: 0;
  width: 100%;
}
.editor-subtoolbar .view-toggle {
  grid-column: 2;
  justify-self: end;
}
.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background: #fffaf0;
}
.view-toggle button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}
.view-toggle button.active {
  background: var(--brand-yellow);
  color: #111;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.12);
}
.view-toggle svg {
  width: 18px;
  height: 18px;
}
.editor-zoom-control {
  grid-area: zoom;
  display: inline-flex;
  justify-self: end;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 10px;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background: #fffaf0;
  color: var(--brand-text);
  font-weight: 900;
}
.editor-zoom-control svg {
  width: 18px;
  height: 18px;
}
.editor-zoom-control .select {
  min-width: 92px;
  min-height: 36px;
  padding: 6px 28px 6px 10px;
  background-color: #fffefa;
}
.setup-select {
  min-width: 0;
  cursor: pointer;
  background: #fffefa;
  color: var(--brand-text);
  position: relative;
  z-index: 3;
}
.toolbar-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  max-width: 660px;
}
.design-controls {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(280px, 0.9fr) minmax(430px, 1.45fr);
  gap: 12px;
  align-items: stretch;
  padding: 16px;
  margin-bottom: 20px;
  border-radius: 12px;
}
.design-select-field,
.text-toolbar {
  min-height: 88px;
  padding: 12px;
  border: 1px solid var(--brand-border);
  border-radius: 10px;
  background: #fffefa;
}
.design-select-field > span,
.toolbar-label {
  color: #6d6048;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.design-select-field .select {
  min-height: 38px;
  margin-top: 8px;
  border-radius: 8px;
  background: #fff;
}
.design-select-field small {
  min-height: 14px;
  margin-top: 6px;
  color: var(--brand-muted);
  font-size: 11px;
  font-weight: 700;
}
.palette-field {
  position: relative;
}
.palette-swatches {
  display: flex;
  gap: 6px;
  margin-top: 9px;
}
.palette-swatches span {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(17,17,17,0.12);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.45);
}
.text-toolbar {
  display: grid;
  grid-template-columns: auto 42px 42px 72px 76px 96px;
  gap: 8px;
  align-items: end;
}
.editor-mode-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  margin: 0 0 20px;
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  background: rgba(255,255,255,0.9);
  box-shadow: var(--shadow);
}
.editor-mode-tabs button {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--brand-muted);
  font-weight: 900;
}
.editor-mode-tabs button.active {
  background: var(--brand-yellow);
  color: #111;
}
.template-assets-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  margin-bottom: 20px;
}
.template-assets-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.template-assets-head .section-title {
  margin-bottom: 4px;
}
.divider-active-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.divider-active-summary span {
  min-width: 0;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background: #fffefa;
  color: var(--brand-muted);
  font-size: 12px;
  font-weight: 800;
}
.divider-active-summary strong {
  color: var(--brand-text);
  font-size: 11px;
  text-transform: uppercase;
}
.asset-groups {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.asset-groups-scroll {
  max-height: 330px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scrollbar-gutter: stable;
}
.asset-groups-scroll::-webkit-scrollbar {
  width: 10px;
}
.asset-groups-scroll::-webkit-scrollbar-track {
  background: #fbf7ee;
  border-radius: 999px;
}
.asset-groups-scroll::-webkit-scrollbar-thumb {
  background: #dfd2b9;
  border: 2px solid #fbf7ee;
  border-radius: 999px;
}
.asset-group {
  min-width: 0;
}
.asset-group h3 {
  margin: 0 0 8px;
  color: #6d6048;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.asset-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 8px;
}
.asset-icon-button {
  display: grid;
  place-items: center;
  min-height: 62px;
  padding: 6px;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background: #fffefa;
  cursor: pointer;
}
.divider-choice-card {
  cursor: default;
}
.asset-icon-button:hover {
  border-color: var(--warning);
  background: var(--brand-yellow-light);
}
.asset-icon-button.active {
  border-color: var(--warning);
  background: var(--brand-yellow-light);
  box-shadow: inset 0 0 0 1px var(--warning);
}
.asset-icon-button img {
  max-width: 34px;
  max-height: 28px;
  object-fit: contain;
}
.asset-group-dividers .asset-icon-grid {
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  align-items: stretch;
}
.asset-group-dividers .asset-icon-button {
  min-height: 128px;
}
.asset-group-dividers .divider-choice-card {
  place-items: stretch;
  gap: 8px;
  padding: 10px;
}
.divider-preview {
  height: 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.asset-group-dividers .divider-preview img {
  width: 152px;
  max-width: 100%;
  max-height: 34px;
  object-fit: contain;
}
.divider-name {
  min-width: 0;
  overflow: hidden;
  color: var(--brand-text);
  font-size: 11px;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.divider-choice-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}
.divider-choice-actions button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-muted);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}
.divider-choice-actions button span {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  margin: 0;
  border-radius: 999px;
  background: #f5f2eb;
  color: inherit;
  font-size: 10px;
  line-height: 1;
}
.divider-choice-actions button:hover,
.divider-choice-actions button.active {
  border-color: var(--warning);
  background: var(--warning);
  color: #111;
}
.divider-choice-actions button.active span {
  background: rgba(255,255,255,0.62);
}
.asset-icon-button > span {
  width: 100%;
  margin-top: 4px;
  overflow: hidden;
  color: var(--brand-muted);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn.icon-only {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: #fff;
}
.btn.icon-only.active {
  border-color: var(--warning);
  background: var(--warning);
  color: #111;
}
.compact-field {
  min-width: 0;
}
.align-field {
  min-width: 0;
}
.compact-field .input,
.compact-field .select,
.align-field .select {
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
}
.compact-field .input {
  text-align: center;
}
.pages-panel {
  max-height: calc(100vh - 170px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.page-strip-list {
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}
.page-strip {
  display: grid;
  grid-template-columns: 30px 70px minmax(0,1fr) 24px;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid var(--brand-border);
  background: transparent;
  color: inherit;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}
.page-strip:hover { background: rgba(255, 233, 166, 0.45); }
.page-strip.active { outline: 1px solid var(--warning); outline-offset: -1px; background: var(--brand-yellow-light); }
.page-strip em {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  background: #fffaf0;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}
.page-mini { width: 56px; height: 70px; border-radius: 6px; background-size: cover; background-position: center; }
.page-mini-image {
  overflow: hidden;
  border: 1px solid var(--brand-border);
  background: var(--brand-paper);
}
.pages-image-actions {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--brand-border);
}
.pages-image-actions .pages-image-count {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--brand-yellow-light);
  color: #6f4f00;
  font-weight: 900;
}
.pages-image-actions .pages-image-count strong {
  font-size: 20px;
  line-height: 1;
}
.pages-image-actions .pages-image-count span {
  font-size: 12px;
}
.pages-image-actions .btn {
  min-height: 42px;
  justify-content: center;
}
.image-batch-progress {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #f0ddaa;
  border-radius: 8px;
  background: #fffaf0;
}
.image-batch-progress > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--brand-ink);
  font-size: 12px;
  font-weight: 900;
}
.image-batch-progress > div:first-child span {
  color: var(--muted);
  white-space: nowrap;
}
.image-batch-progress p {
  margin: 0;
}
.page-mini-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.book-canvas {
  min-height: 655px;
  padding: 36px;
  background: #f4ead7;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  overflow: auto;
  overflow-anchor: none;
}
.canvas-toolbar {
  display: flex;
  width: 100%;
  justify-content: flex-end;
}
.canvas-toolbar .editor-zoom-control {
  grid-area: auto;
  justify-self: auto;
  box-shadow: 0 8px 22px rgba(17,17,17,0.08);
}
.canvas-stage {
  display: grid;
  width: 100%;
  min-height: 560px;
  place-items: center;
}
.template-page {
  width: min(520px, 100%);
  max-height: 620px;
  border-radius: 8px;
  box-shadow: 16px 20px 45px rgba(17,17,17,0.18);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(17,17,17,0.08);
  font-family: var(--font-body, Arial, sans-serif);
}
.single-page-frame {
  --editor-zoom-scale: 1;
  position: relative;
  display: grid;
  width: calc(520px * var(--editor-zoom-scale));
  min-width: calc(520px * var(--editor-zoom-scale));
  height: calc(620px * var(--editor-zoom-scale));
}
.single-page-frame .template-page {
  width: 520px;
  max-width: none;
  max-height: 620px;
  transform: scale(var(--editor-zoom-scale));
  transform-origin: top left;
}
.book-spread {
  --editor-zoom-scale: 1;
  width: max-content;
  max-width: none;
  display: grid;
  grid-template-columns: calc(520px * var(--editor-zoom-scale)) 22px calc(520px * var(--editor-zoom-scale));
  align-items: start;
  position: relative;
  filter: drop-shadow(18px 24px 38px rgba(17,17,17,0.18));
}
.spread-side {
  position: relative;
  display: grid;
  width: calc(520px * var(--editor-zoom-scale));
  min-width: calc(520px * var(--editor-zoom-scale));
  height: calc(620px * var(--editor-zoom-scale));
}
.spread-side .template-page {
  width: 520px;
  max-width: none;
  max-height: 620px;
  box-shadow: none;
  transform: scale(var(--editor-zoom-scale));
  transform-origin: top left;
}
.spread-side-left .template-page {
  border-radius: 8px 3px 3px 8px;
  box-shadow: -10px 14px 24px rgba(17,17,17,0.10);
}
.spread-side-right .template-page {
  border-radius: 3px 8px 8px 3px;
  box-shadow: 10px 14px 24px rgba(17,17,17,0.10);
}
.spread-gutter {
  position: relative;
  z-index: 4;
  background: linear-gradient(90deg, rgba(0,0,0,0.13), rgba(255,255,255,0.25) 42%, rgba(0,0,0,0.10));
}
.spread-side.active::after {
  content: "";
  position: absolute;
  inset: -4px;
  z-index: 6;
  pointer-events: none;
  border: 2px solid rgba(22, 133, 255, 0.65);
  border-radius: 10px;
  opacity: 0;
}
.layout-editing .spread-side.active::after,
.image-inspecting .spread-side.active::after {
  opacity: 1;
}
.spread-side-badge {
  position: absolute;
  top: 10px;
  z-index: 7;
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(17,17,17,0.12);
  border-radius: 999px;
  background: rgba(255,255,255,0.82);
  color: #6d6a60;
  font-size: 10px;
  font-weight: 900;
}
.spread-side-left .spread-side-badge { left: 10px; }
.spread-side-right .spread-side-badge { right: 10px; }
.blank-spread-page {
  display: grid;
  place-items: center;
  background: #fffdf6;
  color: rgba(109,106,96,0.55);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}
.layout-zone {
  position: absolute;
  overflow: hidden;
  word-break: normal;
  overflow-wrap: break-word;
}
.zone-label {
  display: none;
}
.layout-editing .layout-zone {
  outline: 1px dashed rgba(22, 133, 255, 0.42);
  outline-offset: -1px;
  cursor: pointer;
}
.layout-editing .layout-zone:hover {
  outline-color: #1685ff;
  background: rgba(22, 133, 255, 0.045);
}
.layout-editing .layout-zone.selected-layout-zone {
  outline: 2px solid #1685ff;
  background: rgba(22, 133, 255, 0.075);
}
.layout-editing .layout-zone .zone-label {
  position: absolute;
  top: 2px;
  left: 2px;
  z-index: 4;
  display: inline-flex;
  max-width: calc(100% - 4px);
  min-height: 16px;
  align-items: center;
  padding: 0 5px;
  border-radius: 5px;
  background: #1685ff;
  color: #fff;
  font-family: Manrope, Arial, sans-serif;
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.layout-editing .inline-editable {
  cursor: pointer;
}
.layout-zone h2 {
  margin: 0;
  font-family: var(--font-display, inherit);
  font-size: clamp(18px, calc(var(--heading-size, 38px) * 0.72), 34px);
  line-height: 1.03;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.template-page:not(.recipe-page) .title-zone h2 {
  font-size: var(--page-title-render-size, clamp(18px, calc(var(--heading-size, 38px) * 0.72), 34px));
  line-height: 1.08;
}
.chapter-title-page {
  background: var(--template-paper, #fffdf6) !important;
  color: var(--template-text, #1f1f1f);
  font-family: var(--font-body, Arial, sans-serif);
}
.chapter-label-zone,
.chapter-title-zone,
.chapter-footer-zone {
  display: grid;
  place-items: center;
  text-align: center;
}
.chapter-label-zone h3 {
  margin: 0;
  color: var(--template-text, #1f1f1f);
  font-family: var(--font-body, Arial, sans-serif);
  font-size: clamp(24px, 4.4vw, 40px);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: 0;
}
.chapter-title-zone h2 {
  max-width: 100%;
  margin: 0;
  color: var(--template-primary, #1f7a8c);
  font-family: var(--font-display, Georgia, serif);
  font-size: var(--chapter-title-render-size, clamp(22px, 3.8vw, 34px));
  font-weight: 900;
  line-height: 1.08;
  text-align: center;
  overflow-wrap: anywhere;
}
.chapter-title-zone {
  place-items: start center;
  box-sizing: border-box;
}
.chapter-footer-zone span {
  color: var(--template-primary, #1f7a8c);
  font-family: var(--font-body, Arial, sans-serif);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
}
.book-toc-page {
  background: #fff !important;
  color: var(--template-text, #1f1f1f) !important;
  border-radius: 0;
  box-shadow: 10px 16px 30px rgba(17,17,17,0.12);
}
.toc-heading-zone h2 {
  margin: 0;
  color: var(--template-primary, #1f7a8c);
  font-family: var(--font-display, Manrope, sans-serif);
  font-size: clamp(20px, 3.4vw, 30px);
  font-weight: 800;
  line-height: 0.98;
}
.toc-entries-zone {
  overflow: hidden;
}
.toc-entry-list {
  column-count: 2;
  column-gap: 24px;
  color: var(--template-text, #1f1f1f);
  font-family: var(--font-body, Manrope, sans-serif);
  font-size: 8.7px;
  line-height: 1.12;
}
.book-toc-continuation-page .toc-entry-list {
  column-count: 2;
  max-width: none;
  margin-top: 0;
}
.toc-entry {
  break-inside: avoid;
  margin: 0 0 2px;
  overflow-wrap: anywhere;
}
.toc-entry.chapter-entry {
  margin: 9px 0 5px;
  font-weight: 900;
}
.toc-entry.chapter-entry:first-child {
  margin-top: 0;
}
.toc-page-number-zone {
  color: var(--template-muted, #6d6a60);
  font-size: 9px;
  font-weight: 700;
}
.copyright-page,
.thank-you-page {
  padding: 34px 46px 28px;
  background:
    radial-gradient(circle at 20% 18%, rgba(246,134,52,0.06), transparent 24%),
    radial-gradient(circle at 82% 12%, rgba(14,107,125,0.08), transparent 22%),
    #fffdf8 !important;
  color: #1f1f1f;
  border-radius: 6px;
}
.copyright-top-ornament,
.thank-you-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 18px;
}
.copyright-top-ornament img,
.thank-you-ornament img {
  max-width: 42px;
  max-height: 20px;
  object-fit: contain;
}
.copyright-top-ornament span,
.thank-you-ornament span {
  width: 44px;
  border-top: 1px solid var(--template-primary);
}
.copyright-page h1,
.thank-you-page h1 {
  margin: 12px 0 0;
  color: var(--template-primary);
  font-family: var(--font-display, Georgia, serif);
  font-size: clamp(34px, 7.4vw, 46px);
  font-weight: 900;
  line-height: 0.96;
  letter-spacing: 0;
  text-align: center;
}
.copyright-page h2,
.thank-you-page h2 {
  margin: 8px 0 0;
  color: var(--template-accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.2em;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
}
.copyright-divider,
.thank-you-divider {
  display: grid;
  place-items: center;
  height: 18px;
  margin: 9px auto 12px;
}
.copyright-divider img,
.thank-you-divider img {
  max-width: 220px;
  max-height: 16px;
  object-fit: contain;
}
.copyright-intro {
  width: 58%;
  margin: 0 0 10px;
  font-size: 9.2px;
  font-weight: 700;
  line-height: 1.25;
}
.copyright-sections {
  display: grid;
  width: 58%;
  gap: 7px;
}
.copyright-section {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  padding-top: 7px;
  border-top: 1px dotted var(--template-accent);
}
.copyright-section-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--template-primary), white 86%);
  color: var(--template-primary);
  font-size: 13px;
  font-weight: 900;
}
.copyright-section-icon-img {
  max-width: 24px;
  max-height: 24px;
  object-fit: contain;
}
.copyright-section h3 {
  margin: 0 0 3px;
  color: var(--template-primary);
  font-size: 9.2px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.copyright-section p {
  margin: 0;
  font-size: 8.4px;
  font-weight: 650;
  line-height: 1.24;
}
.copyright-side-card {
  position: absolute;
  right: 46px;
  top: 174px;
  width: 30%;
  height: 46%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 16px;
  border: 1px dashed var(--template-primary);
  border-radius: 10px;
  background: color-mix(in srgb, var(--template-primary), white 94%);
  text-align: center;
}
.copyright-side-card img {
  max-width: 42px;
  max-height: 42px;
  object-fit: contain;
}
.copyright-side-card strong {
  color: var(--template-primary);
  font-family: var(--font-display, Georgia, serif);
  font-size: 16px;
  line-height: 1.12;
}
.copyright-side-card span {
  color: var(--template-primary);
  font-size: 7.6px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}
.copyright-footer,
.thank-you-footer {
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--template-primary);
  font-size: 11px;
  font-weight: 900;
}
.copyright-footer img,
.thank-you-footer img {
  width: 108px;
  max-height: 12px;
  object-fit: contain;
}
.copyright-simple-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 62px 72px 54px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(250,250,247,0.98)),
    #fff !important;
  color: #111;
  text-align: center;
}
.copyright-simple-page .copyright-kicker {
  margin: 0 0 9px;
  color: #595959;
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.2em;
  line-height: 1.15;
  text-transform: uppercase;
}
.copyright-simple-page h1 {
  max-width: 390px;
  margin: 0;
  color: #111;
  font-family: var(--font-display, Georgia, serif);
  font-size: var(--copyright-title-size, 42px);
  font-weight: 900;
  line-height: 0.96;
  letter-spacing: 0;
  text-align: center;
  overflow-wrap: anywhere;
}
.copyright-simple-page h2 {
  margin: 8px 0 18px;
  color: #2f2f2f;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.24em;
  line-height: 1.1;
  text-transform: uppercase;
}
.copyright-rule {
  width: 150px;
  height: 1px;
  margin: 0 auto clamp(10px, calc(var(--copyright-title-size, 42px) * 0.42), 20px);
  background: #111;
}
.copyright-simple-page .copyright-publisher {
  margin: 0 0 7px;
  color: #111;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 1.1;
  text-transform: uppercase;
}
.copyright-simple-page .copyright-year {
  margin: 0 0 clamp(10px, calc(var(--copyright-title-size, 42px) * 0.38), 18px);
  color: #555;
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.copyright-simple-page .copyright-intro {
  width: 100%;
  max-width: 360px;
  margin: 0 auto clamp(10px, calc(var(--copyright-title-size, 42px) * 0.38), 18px);
  color: #111;
  font-size: 8.8px;
  font-weight: 400;
  line-height: 1.3;
}
.copyright-simple-page .copyright-legal-lines {
  width: 100%;
  max-width: 360px;
  display: grid;
  gap: 5px;
  padding-top: 14px;
  border-top: 1px solid rgba(17,17,17,0.18);
}
.copyright-simple-page .copyright-legal-lines p {
  margin: 0;
  color: #333;
  font-size: 7.8px;
  font-weight: 400;
  line-height: 1.22;
}
.thank-you-body {
  width: 78%;
  margin: 0 auto;
  text-align: center;
}
.thank-you-body p {
  margin: 0 auto 10px;
  color: #1f1f1f;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.28;
}
.thank-you-body p + p::before {
  content: "";
  display: block;
  width: 62px;
  margin: 0 auto 10px;
  border-top: 1px solid var(--template-accent);
}
.thank-you-callout {
  position: absolute;
  left: 16%;
  right: 16%;
  bottom: 48px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 82px;
  padding: 12px 16px;
  border: 1px dashed var(--template-primary);
  border-radius: 10px;
  background: color-mix(in srgb, var(--template-primary), white 94%);
}
.callout-art {
  display: grid;
  place-items: center;
  gap: 4px;
}
.callout-art img {
  max-width: 48px;
  max-height: 30px;
  object-fit: contain;
}
.thank-you-callout h3 {
  margin: 0 0 4px;
  color: var(--template-primary);
  font-family: var(--font-display, Georgia, serif);
  font-size: 16px;
  line-height: 1.08;
}
.thank-you-callout p {
  margin: 0 0 4px;
  font-size: 9.2px;
  line-height: 1.24;
}
.thank-you-callout strong {
  color: var(--template-primary);
  font-size: 10.5px;
}
.thank-you-callout strong span {
  color: var(--template-accent);
}
.continuation-page {
  background: #fff !important;
  border-radius: 0;
}
.continuation-body-zone {
  overflow: hidden;
  padding-top: 2px;
}
.continuation-body-zone p {
  color: #1f1f1f;
  font-size: min(var(--body-size, 12px), 10.5px);
  line-height: 1.34;
  text-align: justify;
  white-space: pre-line;
}
.continuation-image-zone {
  border: 0;
  background:
    radial-gradient(circle at 35% 35%, rgba(246,134,52,0.42), transparent 28%),
    linear-gradient(135deg, color-mix(in srgb, var(--template-accent), white 45%), color-mix(in srgb, var(--template-primary), white 62%));
}
.layout-zone h4 {
  margin: 0 0 6px;
  color: var(--template-primary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
}
.layout-zone p,
.layout-zone li {
  margin: 0 0 5px;
  font-size: min(var(--body-size, 11px), 10.5px);
  line-height: min(var(--body-line-height, 1.45), 1.36);
  text-align: var(--body-align, left);
  font-weight: var(--body-weight, 400);
  font-style: var(--body-style, normal);
}
.layout-zone ul {
  margin: 0;
  padding-left: 16px;
}
.recipe-page .title-zone h2 {
  font-size: calc(var(--recipe-title-render-size, 25px) * var(--title-zone-scale, 1));
  line-height: 1.08;
  overflow-wrap: anywhere;
  word-break: normal;
}
.recipe-page .layout-zone h4 {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-bottom: var(--recipe-section-gap, 8px);
  font-size: calc(var(--recipe-body-size, 11px) + 1px);
}
.recipe-page .template-asset-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
  flex: 0 0 auto;
}
.recipe-meta-icons {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px 6px;
  align-items: center;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.recipe-meta-icons img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex: 0 0 14px;
}
.recipe-meta-icons span {
  font-size: 8px;
  font-weight: 800;
  line-height: 1.1;
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
}
.recipe-page .layout-zone p,
.recipe-page .layout-zone li {
  margin-bottom: 4px;
  font-size: min(var(--recipe-body-size, 11px), 10px);
  line-height: min(var(--recipe-line-height, 1.35), 1.3);
}
.recipe-page [data-zone-name="descriptionZone"] p {
  font-size: calc(min(var(--recipe-body-size, 11px), 10px) * var(--description-zone-scale, 1));
  line-height: min(var(--recipe-line-height, 1.35), 1.3);
}
.recipe-page [data-zone-name="titleZone"],
.recipe-page [data-zone-name="descriptionZone"],
.recipe-page [data-zone-name="ingredientsZone"],
.recipe-page [data-zone-name="directionsZone"],
.recipe-page [data-zone-name="tipsZone"] {
  overflow: hidden;
}
.recipe-page [data-zone-name="ingredientsZone"] h4 {
  font-size: calc((var(--recipe-body-size, 11px) + 1px) * var(--ingredients-zone-scale, 1));
}
.recipe-page [data-zone-name="ingredientsZone"] li {
  font-size: calc(min(var(--recipe-body-size, 11px), 10px) * var(--ingredients-zone-scale, 1));
  line-height: min(var(--recipe-line-height, 1.35), 1.3);
}
.recipe-page [data-zone-name="directionsZone"] h4 {
  font-size: calc((var(--recipe-body-size, 11px) + 1px) * var(--directions-zone-scale, 1));
}
.recipe-page .directions-zone .direction-step {
  margin-bottom: 3px;
  font-size: calc(min(calc(var(--recipe-body-size, 11px) - 1px), 8.8px) * var(--directions-zone-scale, 1));
  line-height: 1.18;
}
.direction-step-label {
  display: block;
  margin-bottom: 1px;
  color: color-mix(in srgb, var(--template-primary), #000 16%);
  font-size: calc(7.5px * var(--directions-zone-scale, 1));
  font-weight: 900;
  line-height: 1;
}
.direction-step-text {
  display: block;
  color: color-mix(in srgb, var(--template-muted), #000 12%);
}
.recipe-page .text-zone {
  border-top: 0;
  padding-top: 0;
}
.recipe-page .image-zone {
  transform: scaleY(var(--recipe-image-scale, 1));
  transform-origin: top;
  overflow: hidden;
  background: transparent;
}
.recipe-page.fit-dense .macro-zone p,
.recipe-page.fit-overflow .macro-zone p {
  font-size: 8px;
  line-height: 1.15;
}
.recipe-page.fit-dense .tips-zone,
.recipe-page.fit-overflow .tips-zone {
  padding-left: 5px;
}
.image-zone {
  display: grid;
  place-items: center;
  border: 1px dashed color-mix(in srgb, var(--template-primary), transparent 35%);
  background: linear-gradient(135deg, color-mix(in srgb, var(--template-accent), white 78%), color-mix(in srgb, var(--template-primary), white 82%));
  color: #8a6200;
  font-weight: 900;
}
.selected-slot-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: var(--image-crop-x, 50%) var(--image-crop-y, 50%);
  transform: scale(var(--image-crop-zoom, 1)) rotate(var(--image-crop-rotation, 0deg));
  transform-origin: var(--image-crop-x, 50%) var(--image-crop-y, 50%);
  touch-action: none;
  user-select: none;
}
.selected-slot-image.dragging { cursor: grabbing; }
.image-zone .selected-slot-image { cursor: grab; }
.recipe-page .selected-slot-image {
  object-position: var(--image-crop-x, 50%) var(--image-crop-y, 100%);
}
.recipe-page .image-zone > .selected-slot-image {
  position: absolute;
  right: 0;
  bottom: 0;
  object-fit: cover;
  object-position: var(--image-crop-x, 50%) var(--image-crop-y, 100%);
}
.image-slot-empty {
  display: grid;
  gap: 4px;
  place-items: center;
  padding: 12px;
  color: #8a6200;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}
.image-slot-empty span {
  color: color-mix(in srgb, var(--template-muted), #000 12%);
  font-size: 9px;
  font-weight: 800;
}
.image-inspector {
  display: grid;
  gap: 12px;
}
.image-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.image-panel-head .section-title {
  margin: 0;
}
.current-image-preview {
  position: relative;
  min-height: 178px;
  overflow: hidden;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(17,17,17,0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(17,17,17,0.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(17,17,17,0.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(17,17,17,0.035) 75%),
    #faf7ee;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}
.current-image-preview img {
  width: 100%;
  height: 190px;
  display: block;
  object-fit: contain;
}
.image-preview-meta {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  padding: 4px 6px;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 8px;
  background: rgba(255,255,255,0.86);
  color: #3d3d3d;
  font-size: 11px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}
.image-preview-meta > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.image-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.image-action-grid .btn {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
}
.image-crop-controls {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background: #fffaf0;
}
.image-crop-controls h3 {
  margin: 0;
  font-size: 14px;
}
.image-crop-controls .slider-line {
  grid-template-columns: 44px minmax(0, 1fr) 52px;
  gap: 8px;
}
.image-crop-controls input[type="range"] {
  min-width: 0;
  accent-color: var(--brand-yellow);
}
.image-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.image-meta-grid div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background: rgba(255,255,255,0.66);
}
.image-meta-grid span {
  display: block;
  margin-bottom: 3px;
  color: var(--brand-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.image-meta-grid strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--brand-text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.candidate-gallery {
  display: grid;
  gap: 8px;
  max-height: 310px;
  overflow: auto;
  padding-right: 2px;
}
.candidate-gallery h3 {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0;
  padding: 4px 0;
  background: color-mix(in srgb, var(--brand-card), transparent 8%);
  font-size: 12px;
  text-transform: uppercase;
}
.library-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.library-search-box svg {
  width: 18px;
  height: 18px;
  color: var(--brand-muted);
  flex: 0 0 auto;
}
.library-search-box .input {
  min-width: 0;
  height: 40px;
  padding: 0 12px;
}
.candidate-image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.candidate-gallery .candidate-option img,
.candidate-gallery .candidate-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 6px;
}
.macro-zone {
  border-top: 1px solid color-mix(in srgb, var(--template-primary), transparent 70%);
  border-bottom: 1px solid color-mix(in srgb, var(--template-primary), transparent 70%);
  display: flex;
  align-items: center;
  overflow: hidden;
}
.macro-zone p {
  font-size: 9px;
  font-weight: 800;
}
.text-zone {
  border-top: 3px solid var(--template-primary);
  padding-top: 8px;
}
.recipe-section-divider {
  width: 100%;
  height: 9px;
  margin: 0 0 6px;
  border-top: 3px solid var(--template-primary);
}
.recipe-section-divider:has(.recipe-divider-asset-img) {
  border-top: 0;
}
.recipe-divider-asset-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}
.tips-zone {
  border-left: 0;
  padding-left: 0;
}
.recipe-page [data-zone-name="tipsZone"] h4 {
  font-size: calc((var(--recipe-body-size, 11px) + 1px) * var(--tips-zone-scale, 1));
}
.recipe-page [data-zone-name="tipsZone"] p {
  font-size: calc(8.2px * var(--tips-zone-scale, 1));
  line-height: 1.22;
}
.recipe-page [data-overflow="true"] {
  outline: 1px dashed #f04438;
  outline-offset: 2px;
}
.divider-zone {
  background: repeating-linear-gradient(
    to bottom,
    var(--template-accent),
    var(--template-accent) 4px,
    transparent 4px,
    transparent 9px
  );
  opacity: 0.9;
}
.divider-zone:has(.divider-asset-img) {
  display: grid;
  place-items: center;
  background: transparent;
  opacity: 1;
  overflow: visible;
}
.divider-asset-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.vertical-divider-asset {
  width: 280px;
  max-width: none;
  height: auto;
  transform: rotate(90deg);
  transform-origin: center;
}
.doodle-zone {
  display: grid;
  place-items: center;
  color: var(--template-accent);
  font-size: 24px;
  font-weight: 900;
}
.underline-zone {
  display: grid;
  place-items: center;
  border-top: 0;
  border-radius: 0;
  overflow: visible;
}
.underline-zone:empty {
  border-top: 3px solid var(--template-accent);
  border-radius: 999px;
}
.decorative-image-zone:empty::before {
  content: "";
  width: 100%;
  height: 100%;
  display: block;
  background: linear-gradient(180deg, color-mix(in srgb, var(--template-primary), white 86%), color-mix(in srgb, var(--template-accent), white 84%));
}
.page-number-zone {
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 900;
}
.body-zone p {
  margin: 0 0 10px;
  text-indent: 1.35em;
  white-space: normal;
}
.body-zone h4 {
  margin: 8px 0 4px;
  color: var(--template-primary);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.body-zone ul {
  margin: 0 0 9px 1.2em;
  padding: 0;
}
.body-zone li {
  margin: 0 0 4px;
}
.recipe-page .body-zone p,
.recipe-page .tips-zone p {
  text-indent: 0;
  margin-bottom: 0;
}
.inline-editable {
  display: block;
  max-width: 100%;
  min-width: 0;
  border-radius: 3px;
  outline: 1px dashed transparent;
  cursor: text;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.inline-editable:hover {
  outline-color: color-mix(in srgb, var(--template-accent), transparent 35%);
  background: color-mix(in srgb, var(--template-accent), transparent 90%);
}
.inline-editable:focus {
  outline: 1px dashed var(--template-accent);
  background: rgba(255, 255, 255, 0.56);
}
.inline-page-heading,
.inline-recipe-title {
  white-space: normal;
}
.inline-flow-body {
  min-height: 32px;
  color: inherit;
  font-size: min(var(--body-size, 11px), 10.5px);
  font-style: var(--body-style, normal);
  font-weight: var(--body-weight, 400);
  line-height: min(var(--body-line-height, 1.45), 1.36);
  text-align: var(--body-align, left);
  text-indent: 0;
}
.continuation-body-zone .inline-flow-body {
  color: #1f1f1f;
  line-height: 1.34;
  text-align: justify;
}
.inline-flow-body p {
  margin: 0 0 10px;
  font-size: inherit;
  line-height: inherit;
  text-align: inherit;
  text-indent: 1.35em;
  white-space: normal;
}
.inline-flow-body ul {
  margin: 0 0 10px 1.2em;
  padding: 0;
}
.inline-flow-body li {
  margin: 0 0 4px;
  font-size: inherit;
  line-height: inherit;
  text-indent: 0;
}
.continuation-body-zone .inline-flow-body p {
  text-align: justify;
}
.recipe-page .inline-editable {
  text-indent: 0;
}
.recipe-page .inline-recipe-description,
.recipe-page .inline-recipe-tip {
  font-size: min(var(--recipe-body-size, 11px), 10px);
  line-height: min(var(--recipe-line-height, 1.35), 1.3);
}
.recipe-page .inline-recipe-description {
  font-style: italic;
}
.recipe-page .inline-recipe-tip {
  font-style: italic;
}
.teaser-zone {
  border-top: 1px solid color-mix(in srgb, var(--template-primary), transparent 75%);
  padding-top: 8px;
}
.spread {
  width: 720px;
  height: 480px;
  background: #fffaf0;
  border-radius: 4px 14px 14px 4px;
  box-shadow: 16px 20px 45px rgba(17,17,17,0.18);
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.spread::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, rgba(0,0,0,0.13), transparent 55%, rgba(0,0,0,0.08));
  transform: translateX(-50%);
  z-index: 2;
}
.spread-left {
  background-size: cover;
  background-position: center;
}
.spread-page { padding: 24px 24px 18px 30px; position: relative; }
.selected {
  border: 2px dashed #1685ff;
  border-radius: 8px;
  position: relative;
}
.selected::after {
  content: "";
  width: 12px;
  height: 12px;
  position: absolute;
  bottom: -7px;
  left: 50%;
  background: #1685ff;
  border: 2px solid #fff;
  border-radius: 999px;
}
.hero-food {
  height: 160px;
  margin-bottom: 12px;
}
.recipe-title {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 8px;
}
.recipe-columns { display: grid; grid-template-columns: 1fr 1.2fr; gap: 14px; }
.recipe-box {
  border: 2px dashed #1685ff;
  border-radius: 8px;
  padding: 10px;
  font-size: 10px;
  line-height: 1.55;
}
.recipe-box h4 {
  display: inline-block;
  margin: -20px 0 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #1685ff;
  color: #fff;
}
.editor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
}

.export-render-body {
  background: #fff;
}
.export-render-body .topbar,
.export-render-body .sidebar {
  display: none;
}
.export-render-body .app-shell {
  display: block;
  min-height: auto;
}
.export-render-body .main {
  display: block;
  padding: 0;
}
.export-document {
  display: block;
  width: max-content;
  margin: 0;
  padding: 0;
  background: #fff;
}
.export-document .template-page {
  width: 520px;
  height: calc(520px * 11 / 8.5);
  max-height: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: none;
  zoom: 1.56923077;
  background: #fff !important;
}
.export-document .template-page[style*="8 / 10"] {
  width: 520px;
  height: 650px;
  zoom: 1.47692308;
}
.export-document .layout-zone,
.export-document .image-zone,
.export-document .decorative-image-zone,
.export-document .recipe-box {
  border: 0;
  outline: 0;
  background: transparent;
}
.export-document .zone-label {
  display: none;
}
.export-render-status {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 40px;
  background: #fff;
  color: #111;
  text-align: center;
}
.export-render-status h1 {
  margin: 0;
  font-size: 24px;
}
.export-render-status p {
  max-width: 620px;
  margin: 0;
  color: #555;
}
.export-render-status.error p {
  color: #b42318;
}

@page {
  size: 8.5in 11in;
  margin: 0;
}

@media print {
  html,
  body {
    margin: 0;
    padding: 0;
    background: #fff;
  }

  * {
    box-sizing: border-box;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .export-render-body .main {
    padding: 0;
  }

  .export-document .template-page {
    width: 520px;
    height: calc(520px * 11 / 8.5);
    max-height: none;
    box-shadow: none;
    transform: none;
    zoom: 1.56923077;
    background: #fff !important;
    break-after: page;
    page-break-after: always;
    overflow: hidden;
  }

  .export-document .template-page[style*="8 / 10"] {
    width: 520px;
    height: 650px;
    zoom: 1.47692308;
  }

  .export-document .template-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }
}
.settings-panel .setting-group {
  padding: 18px 0;
  border-top: 1px solid var(--brand-border);
}
.settings-panel .setting-group:first-child { border-top: 0; padding-top: 0; }
.editor-form {
  display: grid;
  gap: 14px;
}
.editor-field {
  display: grid;
  gap: 7px;
  font-size: 12px;
  font-weight: 900;
}
.layout-inspector {
  display: grid;
  gap: 14px;
}
.selected-zone-name {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--brand-border);
  border-radius: 10px;
  background: var(--brand-yellow-light);
  color: #111;
  font-weight: 900;
}
.layout-number-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.layout-number-grid .input {
  min-height: 38px;
  padding: 8px 10px;
  color: var(--brand-text);
}
.layout-inspector-actions {
  display: grid;
  gap: 10px;
}
.zone-list {
  display: grid;
  gap: 8px;
}
.zone-list button {
  min-height: 36px;
  border: 1px solid var(--brand-border);
  border-radius: 9px;
  background: #fffefa;
  color: var(--brand-text);
  font-weight: 900;
  text-align: left;
  padding: 0 12px;
}
.zone-list button:hover {
  border-color: var(--warning);
  background: var(--brand-yellow-light);
}
.textarea {
  min-height: 116px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.45;
  color: var(--brand-text);
}
.textarea.compact { min-height: 74px; }
.mono {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  font-weight: 600;
}
.recipe-title-input {
  min-height: 48px;
  font-size: 18px;
  font-weight: 900;
  color: var(--brand-text);
}
.slider-line {
  display: grid;
  grid-template-columns: 110px 1fr 54px;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 800;
}
.slider-line input { accent-color: var(--warning); }
.save-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  margin-top: 18px;
  background: rgba(255,253,246,0.95);
  border: 1px solid var(--brand-border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.autosave-bar {
  position: static;
  padding: 10px 14px;
}

.system-ok {
  color: var(--success);
  background: var(--success-soft);
  border-radius: 8px;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
}
.muted { color: var(--brand-muted); }
.small { font-size: 12px; font-weight: 700; }
.mt-16 { margin-top: 16px; }
.mt-22 { margin-top: 22px; }
.center { text-align: center; }

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
  }
  .topbar {
    grid-column: 1;
    padding: 14px 20px;
    gap: 18px;
    flex-wrap: wrap;
  }
  .sidebar {
    grid-column: 1;
    grid-row: 2;
    position: static;
    height: auto;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--brand-border);
  }
  .nav-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .nav-list a {
    flex: 0 0 auto;
  }
  .sidebar-bottom {
    display: none;
  }
  .main {
    grid-column: 1;
    grid-row: 3;
    padding: 28px 20px 36px;
  }
  .grid.two,
  .grid.projects,
  .grid.editor,
  .toc-grid,
  .metric-row,
  .template-grid {
    grid-template-columns: 1fr;
  }
  .panel-head,
  .bulk-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .bulk-button-row {
    justify-content: flex-start;
  }
  .bulk-history-open {
    grid-template-columns: minmax(0, 1fr);
  }
  .bulk-history-meta {
    justify-content: flex-start;
  }
  .bulk-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .editor {
    max-width: 100%;
  }
  .editor-toolbar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "info"
      "setup";
    align-items: stretch;
  }
  .editor-subtoolbar {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }
  .editor-subtoolbar .editor-mode-tabs,
  .editor-subtoolbar .view-toggle {
    grid-column: 1;
  }
  .book-setup-controls {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }
  .view-toggle {
    width: fit-content;
  }
  .canvas-toolbar {
    justify-content: flex-start;
  }
  .design-controls {
    grid-template-columns: 1fr;
  }
  .text-toolbar {
    flex-wrap: wrap;
  }
  .template-page {
    width: min(480px, 100%);
  }
  .spread {
    width: min(720px, 100%);
    aspect-ratio: 3 / 2;
    height: auto;
  }
  .book-spread {
    width: max-content;
    grid-template-columns: 520px 18px 520px;
  }
  .book-canvas {
    min-height: auto;
    padding: 20px;
  }
  .canvas-stage {
    min-height: 420px;
  }
  .automation-summary {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .automation-summary > div {
    display: grid;
    grid-template-columns: 52px 1fr;
    align-items: center;
    column-gap: 12px;
  }
  .automation-summary .step-icon {
    grid-row: span 2;
    margin: 0;
  }
  .create-progress-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .create-progress-steps span {
    white-space: normal;
  }
  .arrow {
    display: none;
  }
  .project-row,
  .file-row,
  .export-hero,
  .toc-summary,
  .pipeline-card,
  .drive-status {
    grid-template-columns: 1fr;
  }
  .drive-status-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .drive-identity,
  .drive-status-actions {
    flex: 0 1 auto;
    width: 100%;
  }
  .drive-status-actions {
    justify-content: flex-start;
  }
  .image-coverage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .image-library-actions {
    grid-template-columns: 1fr;
  }
  .image-library-action-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .file-row {
    grid-template-columns: 42px minmax(180px, 1fr) minmax(80px, auto) 132px;
  }
  .file-row .file-metric:nth-of-type(3) {
    grid-column: 2 / 4;
  }
  .file-download,
  .file-unavailable {
    grid-column: 4;
    grid-row: 1 / 3;
  }
  .image-slots-head {
    flex-direction: column;
  }
  .image-slots-scroll {
    min-height: 720px;
    height: 1100px;
    max-height: 1320px;
  }
  .image-slot-row {
    grid-template-columns: 120px minmax(0, 1fr);
  }
  .slot-thumb,
  .slot-thumb img,
  .slot-placeholder {
    width: 120px;
    height: 92px;
  }
  .slot-actions {
    grid-column: 1 / -1;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-self: stretch;
  }
  .slot-action-choose,
  .slot-action-generate {
    grid-column: auto;
    grid-row: auto;
  }
  .slot-actions .btn,
  .slot-actions summary.btn {
    min-height: 34px;
  }
  .toolbar-actions,
  .editor-footer,
  .save-bar,
  .searchbar,
  .filterbar {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .bulk-workspace-tabs {
    padding-inline: 8px;
  }
  .bulk-workspace-tabs button {
    flex: 1 1 0;
    justify-content: center;
    padding-inline: 8px;
    font-size: 12px;
  }
  .bulk-workspace-body {
    padding: 12px;
  }
  .bulk-conflict-row {
    align-items: stretch;
    flex-direction: column;
  }
  .bulk-conflict-row .btn {
    width: fit-content;
  }
  .image-coverage-grid {
    grid-template-columns: 1fr;
  }
  .template-assets-head,
  .divider-active-summary {
    grid-template-columns: 1fr;
  }
  .template-assets-head {
    flex-direction: column;
  }
  .asset-group-dividers .asset-icon-grid {
    grid-template-columns: 1fr;
  }
  .image-library-action-buttons {
    grid-template-columns: 1fr;
  }
  .export-files-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .file-row {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px 12px;
  }
  .file-icon {
    width: 34px;
    height: 34px;
  }
  .file-primary,
  .file-metric,
  .file-row .file-metric:nth-of-type(3),
  .file-download,
  .file-unavailable {
    grid-column: 2;
  }
  .file-download,
  .file-unavailable {
    grid-row: auto;
    width: fit-content;
    min-width: 132px;
  }
  .slot-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .candidate-menu {
    position: static;
    width: 100%;
    box-shadow: none;
    margin-top: 8px;
  }
  .topbar-actions {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }
  .credit-pill {
    padding: 0 12px;
    font-size: 13px;
  }
  .page-title h1 {
    font-size: 30px;
  }
  .field,
  .choice-row,
  .book-setup-controls,
  .recipe-columns,
  .toc-chapter-head,
  .toc-chapter-title,
  .recipe-title-row,
  .slider-line {
    grid-template-columns: 1fr;
  }
  .spread {
    grid-template-columns: 1fr;
  }
  .book-spread {
    grid-template-columns: 1fr;
    gap: 18px;
    filter: none;
  }
  .book-spread .spread-gutter {
    display: none;
  }
  .book-spread .spread-side:not(.active) {
    display: none;
  }
  .spread-side .template-page {
    width: min(480px, 100%);
  }
  .spread-left {
    display: none;
  }
  .spread::before {
    display: none;
  }
}
