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

:root {
  --color-primary: #6c47ff;
  --color-primary-dark: #5536d4;
  --color-bg: #faf9ff;
  --color-surface: #ffffff;
  --color-text: #1a1523;
  --color-muted: #6b6680;
  --color-border: #e4e1f0;
  --color-success: #16a34a;
  --color-error: #dc2626;
  --color-warning: #d97706;
  --radius: 10px;
  --shadow: 0 1px 4px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 16px;
}

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

/* ===== LAYOUT ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.page-narrow { max-width: 680px; margin: 0 auto; padding: 2.5rem 1.25rem; }
.text-center { text-align: center; }

/* ===== NAV ===== */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand { font-weight: 700; font-size: 1.1rem; color: var(--color-text); }
.nav-brand:hover { text-decoration: none; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .55rem 1.2rem;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s, opacity .15s;
  text-decoration: none;
}
.btn:hover { opacity: .88; text-decoration: none; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-secondary { background: var(--color-border); color: var(--color-text); }
.btn-lg { padding: .75rem 1.75rem; font-size: 1.05rem; }
.btn-sm { padding: .35rem .85rem; font-size: .85rem; }
.btn-full { width: 100%; }

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, #f0ecff 0%, #fff8f0 100%);
  padding: 5rem 1.5rem 4rem;
  text-align: center;
}
.hero-content { max-width: 640px; margin: 0 auto; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; line-height: 1.15; margin-bottom: 1rem; }
.hero-sub { font-size: 1.15rem; color: var(--color-muted); margin-bottom: 2rem; }

/* ===== FEATURES ===== */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  padding: 3.5rem 1.25rem;
}
.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  text-align: center;
}
.feature-icon { font-size: 2.2rem; margin-bottom: .75rem; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.feature-card p { color: var(--color-muted); font-size: .95rem; }

/* ===== HOMEPAGE SECTIONS ===== */
.section { padding: 4.5rem 0; }
.section-light { background: #faf8ff; }

.section-header { text-align: center; margin-bottom: 2.75rem; }
.section-header h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); font-weight: 800; margin-bottom: .6rem; }
.section-sub { color: var(--color-muted); font-size: 1.05rem; max-width: 520px; margin: 0 auto; }

/* ── Hero extras ── */
.hero-eyebrow {
  display: inline-block;
  background: #ede9fe;
  color: #6d28d9;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .3rem .85rem;
  border-radius: 100px;
  margin-bottom: 1.25rem;
}
.hero h1 em { font-style: normal; color: var(--color-primary); }
.hero-actions { display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.hero-note { font-size: .85rem; color: var(--color-muted); }
.hero-price { margin-top: .5rem; font-size: .95rem; font-weight: 600; color: var(--color-accent, #7c5cbf); letter-spacing: .01em; }
.order-price-note { text-align: center; font-size: .95rem; font-weight: 600; color: var(--color-accent, #7c5cbf); margin-bottom: .75rem; }

/* ── What's Included ── */
.included-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.1rem;
}
.included-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
}
.included-card-notice {
  background: #fffbeb;
  border-color: #fde68a;
}
.included-icon { font-size: 1.6rem; flex-shrink: 0; line-height: 1; margin-top: .15rem; }
.included-card strong { display: block; font-size: .97rem; margin-bottom: .3rem; }
.included-card p { color: var(--color-muted); font-size: .9rem; margin: 0; line-height: 1.55; }

/* ── How It Works ── */
.steps-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  justify-content: center;
}
.step-card {
  flex: 1;
  max-width: 300px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
}
.step-number {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}
.step-card h3 { font-size: 1.05rem; margin-bottom: .6rem; }
.step-card p { color: var(--color-muted); font-size: .92rem; line-height: 1.6; }
.step-divider {
  font-size: 1.5rem;
  color: var(--color-border);
  flex-shrink: 0;
  margin-top: 3.5rem;
  font-weight: 300;
}

/* ── Personalization Examples ── */
.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.example-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.example-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--color-muted);
  margin-bottom: .35rem;
}
.example-tag {
  display: inline-block;
  background: #ede9fe;
  color: #5b21b6;
  font-size: .85rem;
  padding: .3rem .7rem;
  border-radius: 6px;
  line-height: 1.45;
}
.example-arrow { color: var(--color-primary); font-size: 1.25rem; text-align: center; }
.example-output { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: .85rem 1rem; }
.example-quote { font-style: italic; font-size: .93rem; color: #166534; line-height: 1.6; margin: 0; }

/* ── Delivery ── */
.delivery-box {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  background: linear-gradient(135deg, #f0ecff 0%, #fff8f0 100%);
  border: 1px solid #e0d9ff;
  border-radius: 14px;
  padding: 2.5rem 2.75rem;
  max-width: 800px;
  margin: 0 auto;
}
.delivery-icon { font-size: 3rem; flex-shrink: 0; margin-top: .25rem; }
.delivery-body h2 { font-size: 1.5rem; margin-bottom: .65rem; }
.delivery-body p { color: var(--color-muted); margin-bottom: 1rem; line-height: 1.65; }
.delivery-list { list-style: none; display: flex; flex-direction: column; gap: .45rem; }
.delivery-list li { font-size: .95rem; color: var(--color-text); }

/* ── FAQ ── */
.faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: .6rem; }
.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.faq-item summary {
  padding: 1.1rem 1.4rem;
  font-weight: 600;
  font-size: .97rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.25rem; color: var(--color-primary); flex-shrink: 0; font-weight: 300; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { padding: 0 1.4rem 1.2rem; color: var(--color-muted); font-size: .93rem; line-height: 1.65; margin: 0; }

/* ── Final CTA ── */
.cta-final { background: var(--color-primary); }
.cta-final-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 3.5rem 1.25rem;
}
.cta-final-text h2 { font-size: clamp(1.3rem, 3vw, 1.85rem); font-weight: 800; color: #fff; margin-bottom: .5rem; }
.cta-final-text p { color: rgba(255,255,255,.75); font-size: 1rem; }
.cta-final-btn { background: #fff; color: var(--color-primary); font-weight: 700; white-space: nowrap; }
.cta-final-btn:hover { opacity: .92; }

/* ── Footer ── */
.site-footer {
  background: var(--color-text);
  color: rgba(255,255,255,.65);
  padding: 2.5rem 1.25rem;
}
.footer-inner { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: .9rem; text-align: center; }
.footer-brand { color: #fff; font-weight: 700; font-size: 1rem; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: rgba(255,255,255,.6); font-size: .88rem; }
.footer-links a:hover { color: #fff; }
.footer-copy { font-size: .8rem; max-width: 560px; line-height: 1.55; }

/* ── Legal pages ── */
.legal-page h1 { font-size: 2rem; font-weight: 800; margin-bottom: .4rem; }
.legal-updated { color: var(--color-muted); font-size: .88rem; margin-bottom: 2rem; }
.legal-page h2 { font-size: 1.1rem; font-weight: 700; margin: 2rem 0 .6rem; }
.legal-page p, .legal-page li { color: var(--color-muted); font-size: .95rem; line-height: 1.7; margin-bottom: .6rem; }
.legal-page ul { padding-left: 1.4rem; margin-bottom: .75rem; }
.legal-page ul li { list-style: disc; }
.legal-page a { color: var(--color-primary); }

/* ===== CTA SECTION (legacy) ===== */
.cta-section {
  text-align: center;
  padding: 3rem 1.25rem 5rem;
}
.cta-section h2 { font-size: 1.75rem; margin-bottom: 1.25rem; }

/* ===== FORM ===== */
.page-title { font-size: 1.9rem; font-weight: 800; margin-bottom: .4rem; }
.page-subtitle { color: var(--color-muted); margin-bottom: 2rem; }

.story-form { display: flex; flex-direction: column; gap: 1.5rem; }
fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--color-surface);
}
legend {
  font-weight: 700;
  font-size: .95rem;
  padding: 0 .5rem;
  color: var(--color-primary);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: .35rem; margin-top: .75rem; }
.form-group:first-child { margin-top: 0; }
.form-group label { font-size: .9rem; font-weight: 600; color: var(--color-text); }
.label-optional { font-weight: 400; color: var(--color-muted); font-size: .85rem; }

.form-group input,
.form-group select,
.form-group textarea {
  padding: .55rem .85rem;
  border: 1.5px solid var(--color-border);
  border-radius: 7px;
  font-size: .95rem;
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color .15s;
  width: 100%;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* ===== ALERTS ===== */
.alert {
  border-radius: var(--radius);
  padding: .9rem 1.1rem;
  margin-bottom: 1.25rem;
  font-size: .93rem;
}
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: var(--color-error); }
.alert ul { padding-left: 1.2rem; }

/* ===== SUCCESS PAGE ===== */
.success-icon { font-size: 3.5rem; margin-bottom: 1rem; }
h1 { font-size: 2rem; margin-bottom: .75rem; }
.success-sub { font-size: 1.05rem; color: var(--color-muted); margin-bottom: 2rem; }
.order-card {
  background: var(--color-surface);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem auto;
  max-width: 380px;
}
.order-label { font-size: .85rem; font-weight: 600; color: var(--color-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .25rem; }
.order-code { font-size: 1.6rem; font-weight: 800; color: var(--color-primary); letter-spacing: .05em; margin-bottom: .5rem; font-family: monospace; }
.order-hint { font-size: .85rem; color: var(--color-muted); }
.success-next { margin: 1.25rem 0 2rem; color: var(--color-muted); }
.payment-badge {
  display: inline-block;
  border-radius: 8px;
  padding: .7rem 1.2rem;
  font-size: .93rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}
.payment-badge-paid { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.payment-badge-pending { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }

/* ===== FOOTER ===== */
.site-footer {
  text-align: center;
  padding: 2rem 1.25rem;
  color: var(--color-muted);
  font-size: .88rem;
  border-top: 1px solid var(--color-border);
  margin-top: 4rem;
}

/* ===== ADMIN LAYOUT ===== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}
.admin-sidebar {
  width: 210px;
  flex-shrink: 0;
  background: #1a1523;
  color: #e4e1f0;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
}
.sidebar-brand { font-weight: 800; font-size: 1.05rem; color: #fff; margin-bottom: 2rem; padding-left: .25rem; }
.sidebar-nav { display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.sidebar-nav a {
  color: #b0abc8;
  padding: .6rem .75rem;
  border-radius: 7px;
  font-size: .92rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.sidebar-nav a:hover,
.sidebar-nav a.active { background: rgba(108,71,255,.25); color: #fff; }
.sidebar-logout { margin-top: 1rem; }
.btn-logout {
  background: none;
  border: 1px solid #3d3654;
  color: #b0abc8;
  padding: .5rem .9rem;
  border-radius: 7px;
  cursor: pointer;
  font-size: .88rem;
  width: 100%;
  transition: background .15s;
}
.btn-logout:hover { background: rgba(255,255,255,.05); }

.admin-main { flex: 1; padding: 2rem; overflow-x: auto; }
.admin-header { margin-bottom: 1.75rem; }
.admin-header h1 { font-size: 1.6rem; font-weight: 800; }
.back-link { display: inline-block; color: var(--color-muted); font-size: .9rem; margin-bottom: .75rem; }
.header-badges { display: flex; gap: .5rem; margin-top: .5rem; }

/* ===== STATS ===== */
.stats-row { display: flex; gap: .75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.stats-row-6 .stat-card { flex: 1 1 120px; min-width: 100px; }
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
  text-align: center;
}
.stat-card-link {
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
  cursor: pointer;
}
.stat-card-link:hover { border-color: #a5b4fc; box-shadow: 0 0 0 3px #eef2ff; }
.stat-card-active  { border-color: #6366f1 !important; box-shadow: 0 0 0 3px #e0e7ff !important; }
.stat-number { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.stat-label  { font-size: .76rem; color: var(--color-muted); text-transform: uppercase; letter-spacing: .04em; margin-top: .25rem; text-align: center; }

.stat-new      .stat-number { color: #6366f1; }
.stat-pending  .stat-number { color: #d97706; }
.stat-paid     .stat-number { color: #0284c7; }
.stat-revision .stat-number { color: #b45309; }
.stat-pdf      .stat-number { color: #7c3aed; }
.stat-complete .stat-number { color: var(--color-success); }
.stat-cancelled .stat-number { color: #9ca3af; }

/* ── Search bar ── */
.search-bar {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}
.search-input-wrap {
  position: relative;
  flex: 1 1 260px;
  min-width: 200px;
}
.search-icon {
  position: absolute;
  left: .7rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: .9rem;
  pointer-events: none;
  line-height: 1;
}
.search-input {
  width: 100%;
  box-sizing: border-box;
  padding: .45rem .75rem .45rem 2.1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: .9rem;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color .15s, box-shadow .15s;
}
.search-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px #e0e7ff;
}
.btn-search  { background: #6366f1; color: #fff; white-space: nowrap; }
.btn-search:hover { background: #4f46e5; }
.search-clear { white-space: nowrap; }

/* header total */
.header-total { font-size: .9rem; font-weight: 400; }

/* ── Error Log page ── */
.errlog-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 3rem 1.5rem;
  color: var(--color-muted);
}
.errlog-empty-icon { font-size: 2rem; }

.errlog-list { display: flex; flex-direction: column; gap: .6rem; }

.errlog-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.errlog-card-error { border-left: 3px solid #ef4444; }
.errlog-card-warn  { border-left: 3px solid #f59e0b; }
.errlog-card-info  { border-left: 3px solid #3b82f6; }

.errlog-card-top {
  display: grid;
  grid-template-columns: 68px 1fr auto;
  gap: .75rem;
  align-items: start;
  padding: .75rem 1rem;
}

.errlog-level {
  font-size: .72rem;
  font-weight: 700;
  padding: .2rem .45rem;
  border-radius: 5px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.errlog-level-error { background: #fee2e2; color: #991b1b; }
.errlog-level-warn  { background: #fef3c7; color: #92400e; }
.errlog-level-info  { background: #dbeafe; color: #1e40af; }

.errlog-message {
  font-size: .88rem;
  color: var(--color-text);
  word-break: break-word;
  line-height: 1.5;
}
.errlog-time {
  font-size: .78rem;
  white-space: nowrap;
  padding-top: .05rem;
}

.errlog-context {
  border-top: 1px solid var(--color-border);
  padding: .6rem 1rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  background: #fafafa;
}
.errlog-ctx-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: .5rem;
  font-size: .8rem;
  line-height: 1.45;
}
.errlog-ctx-key {
  font-family: monospace;
  color: var(--color-muted);
  font-size: .77rem;
  padding-top: .05rem;
}
.errlog-ctx-val {
  font-family: monospace;
  color: #334155;
  word-break: break-all;
  font-size: .77rem;
}
.errlog-redacted {
  color: #9ca3af;
  font-style: italic;
}

/* ===== ADMIN TABLE ===== */
.table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: .93rem;
  box-shadow: var(--shadow);
}
.admin-table th {
  background: #f4f2fc;
  text-align: left;
  padding: .75rem 1rem;
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-muted);
  border-bottom: 1px solid var(--color-border);
}
.admin-table td {
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #f9f8ff; }
.nowrap { white-space: nowrap; }
.td-email { font-size: .85rem; color: var(--color-muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-theme { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; color: var(--color-muted); }

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 100px;
  font-size: .78rem;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}

/* Payment badges */
.badge-pay-pending   { background: #fef9c3; color: #713f12; }
.badge-pay-paid      { background: #dcfce7; color: #166534; }
.badge-pay-refunded  { background: #fee2e2; color: #991b1b; }

/* Production status badges */
.badge-ps { text-transform: capitalize; }
.badge-ps-new                { background: #ede9ff; color: #5536d4; }
.badge-ps-pending_payment    { background: #fef9c3; color: #92400e; }
.badge-ps-paid_awaiting_story{ background: #e0f2fe; color: #075985; }
.badge-ps-outline_generated  { background: #dbeafe; color: #1e40af; }
.badge-ps-story_drafted      { background: #ede9ff; color: #6d28d9; }
.badge-ps-checks_passed      { background: #d1fae5; color: #065f46; }
.badge-ps-needs_revision     { background: #fef3c7; color: #92400e; }
.badge-ps-pdf_generated      { background: #e0e7ff; color: #3730a3; }
.badge-ps-approved           { background: #dcfce7; color: #166534; }
.badge-ps-delivered          { background: #dcfce7; color: #14532d; }
.badge-ps-cancelled          { background: #f3f4f6; color: #6b7280; }

/* ===== ADMIN LOGIN ===== */
.admin-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f2fc;
}
.admin-login-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
}
.admin-login-box h1 { font-size: 1.5rem; margin-bottom: 1.5rem; }
.admin-login-box .form-group { margin-top: 1rem; }

/* ===== DETAIL PAGE ===== */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.full-width { grid-column: 1 / -1; }
.detail-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.detail-section h2 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; color: var(--color-primary); text-transform: uppercase; letter-spacing: .04em; font-size: .82rem; }
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: .3rem .75rem; font-size: .93rem; }
dt { font-weight: 600; color: var(--color-muted); }
dd { color: var(--color-text); }

.version-card { border: 1px solid var(--color-border); border-radius: 7px; padding: 1rem; margin-bottom: 1rem; }
.version-header { display: flex; justify-content: space-between; margin-bottom: .75rem; }
.story-content { white-space: pre-wrap; font-family: inherit; font-size: .9rem; line-height: 1.65; }
.version-notes { font-size: .88rem; margin-top: .5rem; color: var(--color-muted); }

.pdf-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.pdf-icon { margin-right: .4rem; }

/* ===== FORM VALIDATION ===== */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
  border-color: #ef4444;
  background: #fff5f5;
}
.form-group.has-error input:focus,
.form-group.has-error select:focus,
.form-group.has-error textarea:focus {
  outline-color: #ef4444;
  border-color: #ef4444;
}
.field-error {
  color: #dc2626;
  font-size: .82rem;
  margin-top: .3rem;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.field-error::before { content: "⚠ "; font-size: .78rem; }

.muted { color: var(--color-muted); font-size: .85rem; }
code { font-family: monospace; background: #f4f2fc; padding: .1em .35em; border-radius: 4px; font-size: .88rem; }

.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--color-muted);
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px dashed var(--color-border);
}

/* ===== ORDER DETAIL ===== */
.order-title-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.order-title-row h1 { margin: 0; }

.control-form { margin-top: .75rem; }
.control-form:first-child { margin-top: 0; }
.control-label { display: block; font-size: .85rem; font-weight: 600; color: var(--color-muted); margin-bottom: .4rem; }
.control-row { display: flex; gap: .6rem; align-items: center; }
.control-select {
  flex: 1;
  padding: .5rem .75rem;
  border: 1.5px solid var(--color-border);
  border-radius: 7px;
  font-size: .9rem;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: inherit;
}
.control-select:focus { outline: none; border-color: var(--color-primary); }
.control-select:disabled { opacity: .55; cursor: not-allowed; }
.control-hint { font-size: .8rem; color: var(--color-muted); }
.control-divider { border: none; border-top: 1px solid var(--color-border); margin: 1rem 0; }

.notes-textarea {
  width: 100%;
  padding: .75rem;
  border: 1.5px solid var(--color-border);
  border-radius: 7px;
  font-size: .93rem;
  font-family: inherit;
  background: var(--color-bg);
  color: var(--color-text);
  resize: vertical;
  line-height: 1.6;
}
.notes-textarea:focus { outline: none; border-color: var(--color-primary); }
.notes-footer { margin-top: .75rem; display: flex; justify-content: flex-end; }
.notes-text { white-space: pre-wrap; line-height: 1.55; }

/* Flash message */
.flash-success {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
  border-radius: var(--radius);
  padding: .75rem 1.1rem;
  margin-bottom: 1.25rem;
  font-size: .93rem;
  font-weight: 500;
}

/* ===== REVIEWER / PREVIEW UI ===== */
.reviewer-notice {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: var(--radius);
  padding: .65rem 1rem;
  margin-bottom: 1.25rem;
  font-size: .88rem;
  font-weight: 500;
}

.viewer-only-badge {
  font-size: .78rem;
  color: var(--color-muted);
  padding: .25rem .6rem;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  white-space: nowrap;
}

.notes-readonly {
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: .93rem;
  color: var(--color-text);
  min-height: 3rem;
}

.header-badges { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

.badge-demo {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .15rem .5rem;
  border-radius: 100px;
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #c4b5fd;
  vertical-align: middle;
  margin-left: .35rem;
}

/* ── Filter tabs ── */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1.25rem;
}
.filter-tab {
  display: inline-block;
  padding: .38rem .85rem;
  border-radius: 100px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--color-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  text-decoration: none;
  transition: background .12s, color .12s, border-color .12s;
}
.filter-tab:hover { background: #f0ecff; color: var(--color-primary); border-color: #c4b5fd; text-decoration: none; }
.filter-tab.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ── Stripe IDs ── */
.stripe-id {
  display: block;
  font-size: .78rem;
  word-break: break-all;
  color: var(--color-muted);
  background: #f5f4fc;
  padding: .2rem .45rem;
  border-radius: 4px;
  max-width: 100%;
}
.stripe-id-short {
  font-size: .78rem;
  color: var(--color-muted);
  cursor: default;
}
.td-stripe { font-size: .82rem; }

/* ── Dashboard misc ── */
.muted-sm { font-size: .8rem; color: var(--color-muted); }
.order-code-cell { font-size: .82rem; }
.currency-tag { font-size: .78rem; color: var(--color-muted); font-weight: 600; }
.table-count { font-size: .82rem; color: var(--color-muted); margin-top: .75rem; padding: 0 .25rem; }

/* ── Dev-only payment override ── */
.dev-override-box {
  margin-top: 1.1rem;
  border: 1.5px dashed #f59e0b;
  background: #fffbeb;
  border-radius: var(--radius);
  padding: .85rem 1rem;
}
.dev-override-label {
  font-size: .76rem;
  font-weight: 700;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .6rem;
}
.btn-dev {
  background: #f59e0b;
  color: #fff;
  border: none;
}
.btn-dev:hover { opacity: .85; }

/* Preview banner (shown on all /ai-review preview pages) */
.preview-banner {
  position: sticky;
  top: 0;
  z-index: 200;
  background: #1e1b30;
  color: #c4b5fd;
  text-align: center;
  font-size: .82rem;
  font-weight: 600;
  padding: .45rem 1rem;
  letter-spacing: .01em;
}

/* ── Flash error ── */
.flash-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  padding: .75rem 1.1rem;
  margin-bottom: 1.1rem;
  font-size: .9rem;
  font-weight: 500;
}

/* ── AI generation section ── */
.ai-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.1rem;
}
.ai-section-header h2 { margin-bottom: 0; }

.ai-gen-controls {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.btn-ai-outline {
  background: #7c3aed;
  color: #fff;
  border: none;
}
.btn-ai-outline:hover { background: #6d28d9; }

.btn-ai-story {
  background: #0369a1;
  color: #fff;
  border: none;
}
.btn-ai-story:hover { background: #075985; }

.ai-empty-state {
  color: var(--color-muted);
  font-size: .9rem;
  padding: .5rem 0;
}

.ai-card {
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.25rem;
}
.ai-card-outline {
  background: #faf5ff;
  border: 1.5px solid #e9d5ff;
}
.ai-card-story {
  background: #f0f9ff;
  border: 1.5px solid #bae6fd;
}

.ai-card-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-muted);
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.ai-version-meta {
  font-weight: 400;
  font-size: .72rem;
  text-transform: none;
  letter-spacing: 0;
}

.ai-story-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e1b4b;
  margin: 0 0 1rem;
}

.outline-fields { display: flex; flex-direction: column; gap: .75rem; }
.outline-field { display: grid; grid-template-columns: 110px 1fr; gap: .5rem; align-items: start; }
.outline-field-label {
  font-size: .8rem;
  font-weight: 600;
  color: #6d28d9;
  padding-top: .1rem;
  white-space: nowrap;
}
.outline-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: .9rem;
}
.outline-list li { margin-bottom: .25rem; }

.story-prose {
  font-size: .95rem;
  line-height: 1.75;
  color: var(--color-text);
  white-space: pre-wrap;
  font-family: Georgia, 'Times New Roman', serif;
}

/* ── Version type badges ── */
.version-type-badge {
  font-size: .7rem;
  font-weight: 600;
  padding: .15rem .55rem;
  border-radius: 20px;
  background: #e5e7eb;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.version-type-outline { background: #ede9fe; color: #5b21b6; }
.version-type-story { background: #e0f2fe; color: #0c4a6e; }

@media (max-width: 640px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; flex-direction: row; align-items: center; padding: .75rem 1rem; }
  .sidebar-brand { margin-bottom: 0; margin-right: 1rem; }
  .sidebar-nav { flex-direction: row; flex: 1; }
  .sidebar-logout { margin-top: 0; margin-left: auto; }
  .outline-field { grid-template-columns: 1fr; }
  .ai-section-header { flex-direction: column; align-items: flex-start; }
}

/* ── New AI action buttons ── */
.btn-ai-review {
  background: #0f766e;
  color: #fff;
  border: none;
}
.btn-ai-review:hover { background: #0d6461; }

.btn-ai-revise {
  background: #b45309;
  color: #fff;
  border: none;
}
.btn-ai-revise:hover { background: #92400e; }

/* ── Story edit (manual) section ── */
.story-edit-section {
  margin-top: 1.5rem;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius);
  overflow: hidden;
}
.story-edit-header {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  background: #f8fafc;
  padding: .75rem 1.1rem;
  border-bottom: 1px solid #e2e8f0;
}
.story-edit-title {
  font-size: .82rem;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.story-edit-hint {
  font-size: .78rem;
  color: var(--color-muted);
}
.story-edit-textarea {
  width: 100%;
  box-sizing: border-box;
  display: block;
  border: none;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 0;
  padding: 1rem 1.1rem;
  font-size: .93rem;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.7;
  resize: vertical;
  color: var(--color-text);
  background: #fff;
  outline: none;
}
.story-edit-textarea:focus { background: #fafff5; }
.story-edit-footer {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1rem;
  background: #f8fafc;
  flex-wrap: wrap;
}
.story-edit-notes-input {
  flex: 1;
  min-width: 180px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius);
  padding: .4rem .75rem;
  font-size: .84rem;
  color: var(--color-text);
  background: #fff;
}
.story-edit-notes-input:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.story-readonly-box {
  padding: 1rem 1.1rem;
  white-space: pre-wrap;
}

/* ── Review checks ── */
.review-checks-section {
  margin-top: 1.75rem;
}
.review-checks-title {
  font-size: .88rem;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 0 0 .85rem;
}
.review-checks-count {
  font-weight: 400;
  text-transform: none;
  color: var(--color-muted);
  letter-spacing: 0;
}
.review-checks-list {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.review-check-card {
  border-radius: var(--radius);
  padding: .85rem 1.1rem;
  border: 1.5px solid #e2e8f0;
}
.review-check-card.check-passed {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.review-check-card.check-failed {
  background: #fff1f2;
  border-color: #fecdd3;
}
.review-check-header {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}
.review-check-type {
  font-size: .82rem;
  font-weight: 700;
  text-transform: capitalize;
  color: #334155;
}
.badge-pass {
  font-size: .72rem;
  font-weight: 700;
  padding: .15rem .6rem;
  border-radius: 20px;
  background: #dcfce7;
  color: #15803d;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-fail {
  font-size: .72rem;
  font-weight: 700;
  padding: .15rem .6rem;
  border-radius: 20px;
  background: #ffe4e6;
  color: #be123c;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.review-check-meta {
  font-size: .75rem;
  color: var(--color-muted);
  margin-left: auto;
}
.review-check-notes {
  font-size: .87rem;
  line-height: 1.6;
  color: #475569;
  white-space: pre-wrap;
  padding-top: .25rem;
}

/* ── Version history collapsible ── */
.version-history-details {
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  overflow: hidden;
}
.version-history-summary {
  padding: .75rem 1.1rem;
  background: #f8fafc;
  font-size: .85rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.version-history-summary::-webkit-details-marker { display: none; }
.version-history-summary::before { content: '▶ '; font-size: .7rem; }
details[open] .version-history-summary::before { content: '▼ '; }
.version-history-body { padding: 1rem 1.1rem; }
.version-note-tag {
  font-size: .72rem;
  background: #f1f5f9;
  color: #64748b;
  padding: .15rem .55rem;
  border-radius: 20px;
}

/* ── PDF buttons ── */
.btn-pdf          { background: #854d0e; color: #fff; }
.btn-pdf:hover    { background: #7c3f0c; }
.btn-pdf-download { background: #0369a1; color: #fff; text-decoration: none; display: inline-block; }
.btn-pdf-download:hover { background: #0284c7; }
.btn-approve      { background: #15803d; color: #fff; }
.btn-approve:hover { background: #166534; }
.btn-deliver      { background: #7c3aed; color: #fff; }
.btn-deliver:hover { background: #6d28d9; }
.btn-send-email      { background: #0e7490; color: #fff; }
.btn-send-email:hover { background: #0c687e; }
.btn-copy         { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
.btn-copy:hover   { background: #e2e8f0; }

/* ── PDF file list ── */
.pdf-section-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .9rem;
}
.pdf-section-header h2 { margin: 0; }
.pdf-section-count {
  font-size: .8rem;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 20px;
  padding: .15rem .6rem;
  font-weight: 600;
}
.pdf-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .75rem; }

/* ── PDF card (replaces old flat list item) ── */
.pdf-list-item-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.pdf-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem 1rem;
  gap: .75rem;
  flex-wrap: wrap;
}
.pdf-list-meta {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.pdf-icon { font-size: 1.1rem; }
.pdf-version-badge {
  font-size: .75rem;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
  padding: .1rem .4rem;
  font-family: monospace;
}
.pdf-filename {
  font-size: .85rem;
  color: #334155;
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 28ch;
}
.pdf-date { font-size: .78rem; color: #94a3b8; white-space: nowrap; }
.pdf-status-tag {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-radius: 20px;
  padding: .12rem .5rem;
}
.pdf-status-approved { background: #dcfce7; color: #15803d; }
.pdf-status-expired  { background: #fee2e2; color: #991b1b; }

/* ── Token / customer download link row ── */
.pdf-token-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .6rem 1rem;
  background: #f0fdf4;
  border-top: 1px solid #bbf7d0;
  flex-wrap: wrap;
}
.pdf-token-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #15803d;
  white-space: nowrap;
}
.pdf-token-input {
  flex: 1;
  min-width: 12rem;
  font-family: monospace;
  font-size: .78rem;
  color: #1e293b;
  background: #fff;
  border: 1px solid #86efac;
  border-radius: 5px;
  padding: .3rem .55rem;
  cursor: pointer;
}
.pdf-token-input:focus { outline: none; border-color: #15803d; }
.pdf-expiry-note {
  font-size: .75rem;
  color: #64748b;
  white-space: nowrap;
}

/* ── PDF card action buttons row ── */
.pdf-card-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1rem;
  border-top: 1px solid #f1f5f9;
  background: #fafafa;
  flex-wrap: wrap;
}

/* ── Email sent banner ── */
.email-sent-banner {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: .75rem;
  padding: .6rem .9rem;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: 7px;
  font-size: .85rem;
  color: #065f46;
}
.email-sent-icon { font-size: 1rem; }
.email-sent-text { line-height: 1.4; }

/* ── Mark Delivered / Send Email row ── */
.pdf-deliver-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: 1rem;
  padding: .75rem 1rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  flex-wrap: wrap;
}
.pdf-deliver-hint {
  font-size: .82rem;
  color: #64748b;
  flex: 1;
  min-width: 12rem;
}

/* ── Revision section ── */
.revision-section {
  margin-top: 1.5rem;
  border: 1.5px solid #c7d2fe;
  border-radius: 10px;
  background: #f5f3ff;
  overflow: hidden;
}
.revision-section-header {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  padding: .85rem 1.1rem .6rem;
  border-bottom: 1px solid #ddd6fe;
  flex-wrap: wrap;
}
.revision-section-title {
  font-weight: 700;
  font-size: .97rem;
  color: #4f46e5;
  white-space: nowrap;
}
.revision-section-hint {
  font-size: .8rem;
  color: #6b7280;
  line-height: 1.4;
}
.revision-notes-textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: none;
  border-bottom: 1px solid #ddd6fe;
  border-radius: 0;
  background: #fff;
  padding: .9rem 1.1rem;
  font-size: .9rem;
  font-family: inherit;
  line-height: 1.55;
  resize: vertical;
  color: #1e293b;
  outline: none;
}
.revision-notes-textarea::placeholder { color: #9ca3af; }
.revision-notes-textarea:focus { background: #fefce8; }
.revision-section-footer {
  display: flex;
  justify-content: flex-end;
  padding: .65rem 1rem;
}

/* ── Version history (always visible) ── */
.version-history-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}
.version-history-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}
.version-history-count {
  font-size: .8rem;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 20px;
  padding: .15rem .6rem;
  font-weight: 600;
}
.version-history-body {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.version-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: .85rem 1rem;
}
.version-card-latest {
  border-color: #a5b4fc;
  background: #faf9ff;
}
.version-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .4rem .75rem;
  margin-bottom: .5rem;
}
.version-card-meta {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}
.version-card-right {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.version-number-badge {
  font-weight: 700;
  font-size: .85rem;
  color: #334155;
  background: #f1f5f9;
  border-radius: 4px;
  padding: .1rem .45rem;
  font-family: monospace;
}
.version-latest-tag {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #4f46e5;
  background: #ede9fe;
  border-radius: 20px;
  padding: .1rem .5rem;
}
.version-note-tag {
  font-size: .78rem;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: .1rem .45rem;
  max-width: 34ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.version-card-date {
  font-size: .77rem;
  color: #94a3b8;
  white-space: nowrap;
}
.version-excerpt {
  font-size: .84rem;
  color: #475569;
  line-height: 1.55;
  border-top: 1px solid #f1f5f9;
  padding-top: .55rem;
  margin-top: .1rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Severity badges ── */
.severity-badge {
  font-size: .7rem;
  font-weight: 700;
  padding: .15rem .55rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.severity-none   { background: #dcfce7; color: #15803d; }
.severity-low    { background: #fef9c3; color: #854d0e; }
.severity-medium { background: #fed7aa; color: #9a3412; }
.severity-high   { background: #fee2e2; color: #991b1b; }

/* ── Check detail blocks (issues / fixes) ── */
.check-detail-block {
  margin-top: .65rem;
  padding-top: .65rem;
  border-top: 1px solid rgba(0,0,0,.07);
}
.check-detail-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #64748b;
  margin-bottom: .35rem;
}
.check-fixes-block .check-detail-label {
  color: #0369a1;
}
.check-detail-list {
  margin: 0;
  padding-left: 1.3rem;
  font-size: .87rem;
  line-height: 1.55;
  color: #334155;
}
.check-detail-list li { margin-bottom: .25rem; }
.check-issues-list li::marker { color: #dc2626; }
.check-fixes-list  li::marker { color: #0369a1; }

@media (max-width: 640px) {
  .story-edit-footer { flex-direction: column; align-items: stretch; }
  .story-edit-notes-input { min-width: 0; }
  .review-check-meta { margin-left: 0; width: 100%; }
}
