:root {
  --bg: #f5f3f0;
  --paper: #fffdf8;
  --paper-soft: #f0f5f8;
  --ink: #1c1b21;
  --muted: #6a6872;
  --line: #ddd9d2;
  --coral: #c85c4a;
  --navy: #20394f;
  --teal: #19747a;
  --gold: #c59645;
  --violet: #73556f;
  --shadow: 0 20px 60px rgba(28, 27, 33, .12);
  --radius: 8px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(200, 92, 74, .14), transparent 34%),
    linear-gradient(315deg, rgba(25, 116, 122, .14), transparent 42%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}
button, input, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 24px;
  background: rgba(255, 253, 248, .9);
  border-bottom: 1px solid rgba(28, 27, 33, .12);
  backdrop-filter: blur(16px);
}
.brand, .top-actions, .stats-strip { display: flex; align-items: center; gap: 10px; }
.brand { color: inherit; text-decoration: none; }
.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--coral), var(--navy));
  color: white;
  font-size: 13px;
  font-weight: 950;
}
.brand strong, .brand small { display: block; }
.brand small, .block-heading p, .intro-panel p:not(.product-line), .preview-toolbar p, small, .muted { color: var(--muted); }
.workspace {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 52px;
  display: grid;
  grid-template-columns: minmax(350px, 460px) minmax(0, 1fr);
  gap: 28px;
}
.control-panel { display: grid; gap: 14px; align-self: start; }
.intro-panel, .panel-block {
  background: rgba(255, 253, 248, .9);
  border: 1px solid rgba(28, 27, 33, .1);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(28, 27, 33, .08);
}
.intro-panel { padding: 28px; }
.product-line { margin: 0 0 10px; color: var(--coral); font-size: 12px; font-weight: 950; text-transform: uppercase; letter-spacing: .08em; }
.intro-panel h1 { margin: 0; max-width: 13ch; font-size: 38px; line-height: 1; letter-spacing: 0; overflow-wrap: anywhere; }
.panel-block { padding: 20px; }
.block-heading { margin-bottom: 14px; }
.block-heading h2 { margin: 0; font-size: 17px; }
.field-grid, .section-list, .script-list, .rate-list { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 780; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 11px;
  background: white;
  color: var(--ink);
}
.interface-switch { display: inline-grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 4px; background: #ebe6e0; border-radius: 8px; }
.ui-segment {
  min-width: 42px;
  min-height: 32px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.ui-segment.active { background: white; color: var(--coral); box-shadow: 0 6px 14px rgba(28, 27, 33, .1); }
.primary-button, .ghost-button, .tiny-button {
  min-height: 40px;
  border-radius: 7px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 850;
}
.primary-button { background: var(--navy); color: white; }
.ghost-button, .tiny-button { background: white; color: var(--ink); border: 1px solid var(--line); }
.compact { min-height: 34px; padding: 0 12px; }
.toggle-row, .rate-row {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
}
.rate-row { grid-template-columns: 1fr 110px; align-items: center; }
.toggle-row span span, .rate-row small { display: block; color: var(--muted); font-size: 12px; font-weight: 520; }
.script-card, .print-page, .info-card, .outcome-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.script-card { padding: 14px; }
.script-card h3 { margin: 0 0 8px; font-size: 15px; }
.preview-stage { min-width: 0; }
.preview-toolbar {
  position: sticky;
  top: 75px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(28, 27, 33, .1);
  border-radius: 8px;
  background: rgba(255, 253, 248, .9);
  box-shadow: 0 12px 34px rgba(28, 27, 33, .08);
}
.preview-toolbar p { margin: 0; font-size: 12px; font-weight: 850; }
.stats-strip span { display: grid; text-align: right; }
.stats-strip b { font-size: 18px; }
.print-pages { display: grid; gap: 18px; }
.print-page {
  min-height: 960px;
  padding: 46px;
  box-shadow: var(--shadow);
}
.page-meta { margin: 0 0 18px; color: var(--coral); font-size: 12px; font-weight: 950; text-transform: uppercase; letter-spacing: .08em; }
.print-page h2 { margin: 0 0 18px; font-size: 32px; }
.hero-card { padding: 28px; border-radius: 8px; background: linear-gradient(145deg, var(--coral), var(--navy)); color: white; }
.hero-card h3 { margin: 0; font-size: 38px; }
.outcome-card { padding: 16px; margin-bottom: 14px; background: #fff7ef; border-color: rgba(200, 92, 74, .22); }
.outcome-card strong { display: block; color: var(--coral); }
.outcome-card p { margin-bottom: 0; }
.detail-grid, .rate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.info-card { padding: 14px; }
.hero-card .info-card { background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.24); }
.hero-card .info-card p { color: rgba(255,255,255,.82); }
.timeline-list { display: grid; gap: 12px; }
.timeline-list article { display: grid; grid-template-columns: 90px 1fr; gap: 14px; padding: 14px; border-radius: 8px; background: var(--paper-soft); border: 1px solid var(--line); }
.script-print { display: grid; gap: 12px; }
.checklist { display: grid; gap: 12px; padding-left: 20px; }
.form-sheet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-sheet span { display: block; min-height: 52px; border-bottom: 1px solid var(--line); }
.brand-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.brand-grid span { padding: 10px; border-radius: 8px; background: var(--paper-soft); border: 1px solid var(--line); font-weight: 760; }
@media (max-width: 900px) {
  .topbar, .preview-toolbar { align-items: stretch; flex-direction: column; }
  .workspace { width: min(100% - 24px, 720px); grid-template-columns: 1fr; }
  .detail-grid, .rate-grid, .form-sheet, .brand-grid { grid-template-columns: 1fr; }
  .print-page { min-height: auto; padding: 26px; }
  .intro-panel h1 { max-width: 100%; font-size: 32px; line-height: 1.05; }
}
@media print {
  body { background: white; }
  .topbar, .control-panel, .preview-toolbar { display: none; }
  .workspace { display: block; width: 100%; padding: 0; }
  .print-page { min-height: 100vh; box-shadow: none; border: 0; page-break-after: always; }
}
