:root {
  --bg: #f6f1ec;
  --paper: #fffdfa;
  --paper-soft: #fbf4ef;
  --ink: #241f24;
  --muted: #6f6670;
  --line: #e4d8d0;
  --rose: #b84f6b;
  --rose-dark: #73364f;
  --plum: #3b2744;
  --teal: #19747a;
  --gold: #c59a48;
  --green: #4d8062;
  --shadow: 0 24px 70px rgba(59, 39, 68, 0.13);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(184, 79, 107, 0.15), transparent 28rem),
    radial-gradient(circle at 92% 10%, rgba(25, 116, 122, 0.13), transparent 30rem),
    linear-gradient(135deg, #f8f1ec 0%, #f6f2e9 48%, #eef5f3 100%);
  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;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 24px;
  background: rgba(255, 253, 250, 0.9);
  border-bottom: 1px solid rgba(59, 39, 68, 0.11);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--rose-dark), var(--plum));
  color: #fff9ef;
  font-size: 14px;
  font-weight: 950;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18), 0 12px 28px rgba(115, 54, 79, 0.24);
}

.brand strong {
  display: block;
  font-size: 15px;
  line-height: 1.1;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.top-actions,
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.interface-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(59, 39, 68, 0.14);
  border-radius: 8px;
  background: #eee4dc;
}

.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: var(--paper);
  color: var(--rose-dark);
  box-shadow: 0 6px 14px rgba(59, 39, 68, 0.12);
}

.primary-button,
.ghost-button {
  min-height: 40px;
  border-radius: 7px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
}

.primary-button {
  background: var(--plum);
  color: #fffdf8;
  box-shadow: 0 10px 24px rgba(59, 39, 68, 0.22);
}

.ghost-button {
  background: rgba(255, 253, 250, 0.82);
  color: var(--ink);
  border: 1px solid rgba(59, 39, 68, 0.14);
}

.compact {
  min-height: 34px;
  padding: 0 12px;
}

.planner-layout {
  display: grid;
  grid-template-columns: minmax(350px, 450px) minmax(0, 1fr);
  gap: 28px;
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 52px;
}

.control-panel {
  align-self: start;
  display: grid;
  gap: 14px;
}

.intro-panel,
.panel-block {
  background: rgba(255, 253, 250, 0.88);
  border: 1px solid rgba(59, 39, 68, 0.1);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(59, 39, 68, 0.08);
}

.intro-panel {
  position: relative;
  overflow: hidden;
  padding: 28px;
  background:
    linear-gradient(145deg, rgba(255, 253, 250, 0.94), rgba(252, 239, 236, 0.9)),
    var(--paper);
}

.intro-panel::after {
  content: "";
  position: absolute;
  right: -44px;
  top: -44px;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(184, 79, 107, 0.18);
  border-radius: 50%;
}

.product-line {
  margin: 0 0 10px;
  color: var(--rose);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro-panel h1 {
  margin: 0;
  max-width: 12ch;
  font-size: 39px;
  line-height: 0.98;
  letter-spacing: 0;
}

.intro-panel p:not(.product-line),
.block-heading p {
  margin: 10px 0 0;
  color: var(--muted);
}

.panel-block {
  padding: 20px;
}

.block-heading {
  margin-bottom: 14px;
}

.block-heading h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.15;
}

.block-heading p {
  font-size: 13px;
}

.field-grid,
.mini-grid {
  display: grid;
  gap: 12px;
}

.mini-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 780;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(59, 39, 68, 0.18);
  border-radius: 7px;
  background: #fffefa;
  color: var(--ink);
  padding: 10px 11px;
  font-size: 14px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(184, 79, 107, 0.12);
}

.section-list,
.budget-list,
.message-tool-list {
  display: grid;
  gap: 10px;
}

.toggle-row,
.budget-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(59, 39, 68, 0.11);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.7);
}

.toggle-row input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--rose);
}

.toggle-row strong,
.budget-row strong {
  display: block;
  font-size: 13px;
}

.toggle-row span,
.budget-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.budget-row {
  grid-template-columns: 1fr 118px;
  align-items: center;
}

.budget-row input {
  text-align: right;
}

.message-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(59, 39, 68, 0.11);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.75);
}

.message-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.message-card h3 {
  margin: 0;
  font-size: 13px;
}

.message-card textarea {
  min-height: 110px;
  color: #4f4750;
  line-height: 1.45;
}

.message-card-actions {
  display: flex;
  gap: 8px;
}

.tiny-button {
  min-height: 32px;
  border-radius: 6px;
  padding: 0 10px;
  background: #fffdf8;
  border: 1px solid rgba(59, 39, 68, 0.14);
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.preview-stage {
  min-width: 0;
}

.preview-toolbar {
  position: sticky;
  top: 75px;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: rgba(255, 253, 250, 0.9);
  border: 1px solid rgba(59, 39, 68, 0.1);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(59, 39, 68, 0.1);
  backdrop-filter: blur(18px);
}

.preview-toolbar p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview-toolbar strong {
  font-size: 14px;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 10px;
}

.stats-strip span {
  min-width: 92px;
  padding: 8px 10px;
  border-radius: 7px;
  background: #f5ece6;
}

.stats-strip b {
  display: block;
  font-size: 16px;
  line-height: 1.1;
}

.stats-strip small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.planner-pages {
  display: grid;
  justify-content: center;
  gap: 18px;
}

.print-page {
  width: min(860px, 100%);
  min-height: 1020px;
  padding: 52px 58px;
  background: var(--paper);
  border: 1px solid rgba(59, 39, 68, 0.12);
  box-shadow: var(--shadow);
}

.page-meta {
  margin: 0 0 10px;
  color: var(--rose);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.print-page h2 {
  margin: 0 0 18px;
  color: var(--plum);
  font-size: 34px;
  line-height: 1.04;
  letter-spacing: 0;
}

.print-page h3 {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.print-page p {
  margin: 0 0 12px;
}

.muted {
  color: var(--muted);
}

.hero-card {
  min-height: 520px;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 42px;
  border: 1px solid rgba(184, 79, 107, 0.2);
  background:
    linear-gradient(150deg, rgba(255, 248, 242, 0.96), rgba(251, 233, 232, 0.92)),
    var(--paper-soft);
}

.hero-card .date {
  color: var(--gold);
  font-size: 18px;
  font-weight: 900;
}

.detail-grid,
.card-grid,
.timeline-list,
.run-list {
  display: grid;
  gap: 12px;
}

.detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-card,
.budget-card,
.vendor-card,
.guest-card {
  min-height: 120px;
  padding: 18px;
  border: 1px solid rgba(59, 39, 68, 0.13);
  border-radius: 8px;
  background: #fffefa;
}

.info-card strong,
.budget-card strong,
.vendor-card strong,
.guest-card strong {
  display: block;
  margin-bottom: 5px;
}

.budget-total {
  margin-bottom: 16px;
  padding: 18px;
  border-radius: 8px;
  background: var(--plum);
  color: #fffdf8;
}

.budget-total b {
  display: block;
  font-size: 32px;
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(59, 39, 68, 0.12);
}

.progress span {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  background: linear-gradient(90deg, var(--rose), var(--gold));
}

.timeline-item,
.run-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item b,
.run-item b {
  color: var(--rose-dark);
}

.checklist {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
}

.checklist li::before {
  content: "";
  width: 13px;
  height: 13px;
  margin-top: 4px;
  border: 1.5px solid var(--rose);
  border-radius: 3px;
}

.script-box {
  padding: 18px;
  border: 1px dashed rgba(59, 39, 68, 0.28);
  border-radius: 8px;
  background: #fffdf8;
  white-space: pre-wrap;
}

.empty-state {
  padding: 44px;
  text-align: center;
  border: 1px dashed rgba(59, 39, 68, 0.24);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.8);
}

@media (max-width: 1050px) {
  .topbar,
  .top-actions {
    align-items: stretch;
  }

  .topbar {
    position: static;
    flex-direction: column;
  }

  .top-actions {
    flex-wrap: wrap;
  }

  .planner-layout {
    grid-template-columns: 1fr;
  }

  .preview-toolbar {
    position: static;
    grid-template-columns: 1fr;
  }

  .stats-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .planner-layout {
    width: min(100% - 24px, 1500px);
    padding-top: 18px;
  }

  .top-actions,
  .toolbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .interface-switch {
    grid-column: 1 / -1;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .intro-panel h1 {
    font-size: 34px;
  }

  .mini-grid,
  .detail-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .print-page {
    min-height: auto;
    padding: 34px 22px;
  }

  .print-page h2 {
    font-size: 28px;
  }

  .timeline-item,
  .run-item {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: white;
  }

  .topbar,
  .control-panel,
  .preview-toolbar {
    display: none !important;
  }

  .planner-layout {
    display: block;
    width: auto;
    padding: 0;
  }

  .planner-pages {
    display: block;
  }

  .print-page {
    width: auto;
    min-height: 100vh;
    margin: 0;
    padding: 0.55in;
    border: 0;
    box-shadow: none;
    page-break-after: always;
  }
}
