:root {
  --ink: #173a35;
  --ink-2: #28544d;
  --cream: #f7f3eb;
  --paper: #fffdf9;
  --line: #d9ded8;
  --muted: #697873;
  --accent: #d66b3d;
  --accent-dark: #a74824;
  --mint: #dcece5;
  --good: #276d50;
  --warn: #9b5d14;
  --bad: #9c3930;
  --shadow: 0 12px 34px rgba(23,58,53,.08);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--cream); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.45; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
input, textarea, select { width: 100%; border: 1px solid #cbd3cd; border-radius: 9px; background: #fff; color: var(--ink); padding: 10px 12px; outline: none; transition: .15s border, .15s box-shadow; }
input:focus, textarea:focus, select:focus { border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(40,84,77,.12); }
textarea { resize: vertical; }
label { display: grid; gap: 6px; color: var(--ink-2); font-size: 13px; font-weight: 700; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: Georgia, serif; font-size: clamp(22px, 3vw, 30px); font-weight: 600; letter-spacing: -.02em; }
h2 { margin-bottom: 5px; font-family: Georgia, serif; font-size: 25px; font-weight: 600; letter-spacing: -.015em; }
h3 { margin-bottom: 4px; font-size: 16px; }
.eyebrow { margin-bottom: 3px; color: var(--accent-dark); font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; padding: 12px clamp(18px, 4vw, 56px); color: #fff; background: var(--ink); box-shadow: 0 5px 18px rgba(0,0,0,.15); }
.brand-lockup, .header-actions, .section-heading, .summary-strip, .filter-row, .modal-head, .modal-actions, .asset-picker-head, .preview-toolbar, .preview-actions { display: flex; align-items: center; }
.brand-lockup { gap: 13px; }
.brand-lockup .eyebrow { color: #b8d5c9; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; font-family: Georgia, serif; font-size: 15px; }
.header-actions { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.privacy-pill { padding: 7px 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; color: #d3e3dd; font-size: 12px; }
.privacy-pill span { color: #69b78e; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 8px 13px; border: 1px solid transparent; border-radius: 9px; font-weight: 800; font-size: 13px; cursor: pointer; transition: .15s transform, .15s background; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--accent); }
.button.primary:hover { background: var(--accent-dark); }
.button.ghost { border-color: #cbd3cd; background: transparent; }
.topbar .button.ghost { border-color: rgba(255,255,255,.28); color: #fff; }
.button.danger-link { color: var(--bad); background: transparent; }
.button.danger { color: #fff; background: var(--bad); }
.button.danger:hover { background: #7f2f28; }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.app-shell { max-width: 1440px; margin: auto; padding: 22px clamp(16px, 3vw, 40px) 70px; }
.local-data-note { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid #bcd1c7; border-radius: 11px; color: var(--ink-2); background: #edf6f1; font-size: 12px; }
.local-data-note strong, .local-data-note span { display: block; }
.local-data-note strong { margin-bottom: 2px; color: var(--ink); font-size: 13px; }
.example-label { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; color: var(--ink); background: #d7e9e1; font-weight: 800; white-space: nowrap; }
.step-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.step { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 800; cursor: pointer; }
.step span { display: grid; place-items: center; width: 21px; height: 21px; border: 1px solid #b9c4be; border-radius: 50%; font-size: 11px; }
.step.active { color: var(--ink); background: var(--mint); }
.step.active span { color: #fff; border-color: var(--ink); background: var(--ink); }
.save-state { margin-left: auto; color: var(--muted); font-size: 12px; }
.panel { border: 1px solid var(--line); border-radius: 15px; background: var(--paper); box-shadow: var(--shadow); }
.event-panel { padding: 24px; margin-bottom: 18px; }
.section-heading { justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-heading.compact { margin-bottom: 14px; }
.event-score { flex: 0 0 auto; min-width: 150px; padding: 10px 12px; border-radius: 10px; background: var(--mint); text-align: center; font-size: 13px; font-weight: 800; }
.event-grid, .form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.span-2 { grid-column: span 2; }
.span-4 { grid-column: 1 / -1; }
.form-divider { margin-top: 5px; padding-top: 16px; border-top: 1px solid var(--line); }
.form-divider h3, .form-divider p { margin: 0; }
.form-divider p { color: var(--muted); font-size: 12px; }
.workspace { display: grid; grid-template-columns: minmax(0, .92fr) minmax(520px, 1.08fr); gap: 18px; align-items: stretch; }
.inventory-panel, .package-panel { display: flex; flex-direction: column; min-width: 0; height: 820px; padding: 20px; overflow: hidden; }
.summary-strip { gap: 0; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.summary-stat { flex: 1; padding: 10px 12px; border-right: 1px solid var(--line); }
.summary-stat:last-child { border-right: 0; }
.summary-stat strong { display: block; font-size: 16px; }
.summary-stat span { color: var(--muted); font-size: 11px; }
.filter-row { gap: 10px; margin-bottom: 12px; }
.search-box { flex: 1; }
.filter-row select { width: 160px; }
.inventory-list, .package-list { display: grid; flex: 1; min-height: 0; grid-auto-rows: max-content; gap: 10px; align-content: start; overflow: auto; padding: 0 3px 3px 0; }
.inventory-card { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; }
.inventory-card:hover { border-color: #9eafa7; }
.inventory-title { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.inventory-title h3 { margin: 0; }
.tag { display: inline-flex; padding: 3px 7px; border-radius: 999px; background: #edf2ef; color: var(--ink-2); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.tag.lead { background: #f7ddcf; color: #87411f; }
.inventory-card p { margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.inventory-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--ink-2); font-size: 11px; font-weight: 700; }
.allocation { min-width: 72px; text-align: right; }
.allocation strong { display: block; font-size: 14px; }
.allocation .over { color: var(--bad); }
.meter { width: 70px; height: 5px; margin-top: 5px; overflow: hidden; border-radius: 99px; background: #e6ebe7; }
.meter span { display: block; height: 100%; background: var(--good); }
.meter span.over { background: var(--bad); }
.view-tabs { display: inline-flex; margin-bottom: 12px; padding: 3px; border-radius: 9px; background: #eef1ed; }
.view-tab { padding: 7px 12px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 800; cursor: pointer; }
.view-tab.active { color: var(--ink); background: #fff; box-shadow: 0 2px 7px rgba(23,58,53,.09); }
.package-card { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.package-card-top { display: flex; justify-content: space-between; gap: 12px; padding: 15px; cursor: pointer; }
.package-card h3 { margin-bottom: 3px; font-family: Georgia, serif; font-size: 19px; }
.package-fit { margin: 0; color: var(--muted); font-size: 12px; }
.price { white-space: nowrap; font-size: 18px; font-weight: 900; }
.package-metrics { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fafbf9; }
.package-metrics div { padding: 9px 12px; border-right: 1px solid var(--line); }
.package-metrics div:last-child { border: 0; }
.package-metrics strong, .package-metrics span { display: block; }
.package-metrics span { color: var(--muted); font-size: 10px; }
.score-good { color: var(--good); }
.score-warn { color: var(--warn); }
.package-insight { padding: 11px 14px; font-size: 12px; }
.package-insight.good { color: var(--good); background: #edf6f1; }
.package-insight.warn { color: #79490f; background: #fff7e6; }
.package-insight.bad { color: var(--bad); background: #fff0ee; }
.package-actions { display: flex; gap: 8px; padding: 11px 14px; }
.package-actions .button { flex: 1; }
.empty-state { padding: 30px 18px; border: 1px dashed #b9c4be; border-radius: 11px; text-align: center; color: var(--muted); }
.empty-state h3 { color: var(--ink); }
.compare-wrap { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.compare-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 14px 14px 12px; border-bottom: 1px solid var(--line); }
.compare-heading h3, .compare-heading p { margin: 0; }
.compare-heading p { color: var(--muted); font-size: 11px; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 12px; background: #fff; }
.compare-table th, .compare-table td { padding: 11px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare-table tr > *:last-child { border-right: 0; }
.compare-table tbody tr:last-child > * { border-bottom: 0; }
.compare-table thead th { background: var(--ink); color: #fff; }
.compare-table tbody th { min-width: 125px; background: #f5f7f4; }
.compare-table ul { margin: 0; padding-left: 17px; }
.modal, .preview-modal { width: min(760px, calc(100vw - 28px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 16px; color: var(--ink); background: var(--paper); box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.package-modal { width: min(900px, calc(100vw - 28px)); }
.modal::backdrop, .preview-modal::backdrop { background: rgba(15,35,31,.68); backdrop-filter: blur(3px); }
.modal form { padding: 22px; }
.confirm-modal { width: min(540px, calc(100vw - 28px)); }
.confirm-content { padding: 22px; }
.confirm-content > p { margin: 16px 0 0; color: var(--muted); }
.modal-head, .asset-picker-head, .preview-toolbar { justify-content: space-between; gap: 20px; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 23px; cursor: pointer; }
.form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.modal-actions { gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.spacer { flex: 1; }
.asset-picker-head { margin: 19px 0 10px; }
.selection-value { min-width: 150px; text-align: right; font-size: 12px; }
.selection-value strong { display: block; font-size: 17px; }
.asset-picker { display: grid; gap: 7px; max-height: 330px; overflow: auto; padding: 2px; }
.asset-option { display: grid; grid-template-columns: auto 1fr 80px; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.asset-option input[type="checkbox"] { width: 18px; height: 18px; }
.asset-option input[type="number"] { padding: 7px; }
.asset-option strong, .asset-option span { display: block; }
.asset-option span { color: var(--muted); font-size: 11px; }
.preview-modal { width: min(1100px, calc(100vw - 28px)); background: #e8ece8; }
.preview-toolbar { position: sticky; top: 0; z-index: 2; padding: 14px 18px; background: var(--paper); border-bottom: 1px solid var(--line); }
.preview-toolbar .eyebrow { margin-bottom: 5px; }
.preview-toolbar select { min-width: 260px; }
.preview-actions { gap: 8px; }
.preview-actions label { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.preview-actions input { width: 175px; }
.sponsor-preview { width: min(820px, calc(100% - 30px)); margin: 24px auto; padding: 54px; background: #fff; box-shadow: 0 8px 28px rgba(23,58,53,.12); }
.preview-brand { display: flex; align-items: center; justify-content: space-between; padding-bottom: 24px; border-bottom: 2px solid var(--ink); }
.preview-brand-mark { font-family: Georgia, serif; font-size: 20px; font-weight: 700; }
.preview-kicker { color: var(--accent-dark); font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.sponsor-preview h2 { margin: 36px 0 9px; max-width: 650px; font-size: 43px; line-height: 1.08; }
.preview-lead { max-width: 650px; color: var(--ink-2); font-family: Georgia, serif; font-size: 20px; line-height: 1.5; }
.audience-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 28px 0; }
.audience-stat { padding: 14px; border-radius: 10px; background: var(--mint); }
.audience-stat strong, .audience-stat span { display: block; }
.audience-stat strong { font-size: 23px; }
.audience-stat span { color: var(--muted); font-size: 11px; }
.preview-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 28px; align-items: start; }
.benefit-list { display: grid; gap: 10px; }
.benefit-item { padding: 13px 0; border-bottom: 1px solid var(--line); }
.benefit-item strong { display: block; }
.benefit-item span { color: var(--muted); font-size: 12px; }
.offer-box { padding: 22px; color: #fff; border-radius: 12px; background: var(--ink); }
.offer-box .price-big { margin: 5px 0 17px; font-family: Georgia, serif; font-size: 36px; }
.offer-box p { font-size: 12px; }
.contact-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.25); }
.contact-block h3 { margin-bottom: 12px; color: #fff; font-size: 14px; line-height: 1.35; }
.contact-detail { display: block; margin-top: 7px; color: #fff; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.contact-detail strong { display: block; color: #bdd8cf; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.contact-warning { margin: 0; padding: 10px; border-radius: 8px; color: var(--ink); background: #fff4d8; font-size: 11px; font-weight: 800; }
.preview-footer { margin-top: 34px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 60; transform: translateY(20px); padding: 11px 14px; border-radius: 9px; color: #fff; background: var(--ink); opacity: 0; pointer-events: none; transition: .2s; box-shadow: var(--shadow); }
.toast.show { transform: translateY(0); opacity: 1; }
.system-guide { margin-top: 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); box-shadow: var(--shadow); overflow: hidden; }
.system-guide summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 24px; cursor: pointer; list-style: none; }
.system-guide summary::-webkit-details-marker { display: none; }
.system-guide summary h2, .system-guide summary p { margin-bottom: 0; }
.system-guide summary > div > p:last-child { margin-top: 4px; color: var(--muted); font-size: 13px; }
.guide-toggle { flex: 0 0 auto; min-width: 104px; padding: 9px 13px; border: 1px solid #bdc9c3; border-radius: 9px; text-align: center; font-size: 12px; font-weight: 800; }
.guide-close-label { display: none; }
.system-guide details[open] .guide-open-label { display: none; }
.system-guide details[open] .guide-close-label { display: inline; }
.system-guide details[open] summary { border-bottom: 1px solid var(--line); background: #fafbf9; }
.guide-content { padding: 24px; }
.guide-intro { max-width: 900px; margin-bottom: 22px; }
.guide-intro p { margin: 5px 0 0; color: var(--muted); }
.guide-steps { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.guide-steps li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.guide-step-number { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; background: var(--ink); font-size: 13px; font-weight: 900; }
.guide-steps h3, .guide-steps p { margin: 0; }
.guide-steps p { margin-top: 5px; color: var(--muted); font-size: 12px; }
.guide-reference { display: grid; grid-template-columns: 1.35fr .65fr; gap: 22px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.guide-definitions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin: 12px 0 0; }
.guide-definitions div { padding: 12px; border-radius: 9px; background: #f3f6f3; }
.guide-definitions dt { font-size: 12px; font-weight: 900; }
.guide-definitions dd { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.guide-checklist { padding: 18px; border-radius: 11px; color: #fff; background: var(--ink); }
.guide-checklist h3 { color: #fff; }
.guide-checklist ul { margin: 10px 0 0; padding-left: 18px; }
.guide-checklist li { margin-top: 7px; font-size: 12px; }
.guide-backup { margin-top: 18px; padding: 12px 14px; border-radius: 9px; color: var(--ink-2); background: var(--mint); font-size: 12px; }
.site-footer { display: flex; justify-content: space-between; gap: 18px; margin-top: 22px; padding: 16px 2px 0; border-top: 1px solid #ccd4cf; color: var(--muted); font-size: 11px; }
.site-footer a { color: var(--ink-2); font-weight: 800; }
@media (max-width: 980px) {
  .topbar { position: static; align-items: flex-start; }
  .workspace { grid-template-columns: 1fr; }
  .inventory-panel, .package-panel { height: auto; overflow: visible; }
  .event-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .inventory-list, .package-list { flex: none; max-height: none; overflow: visible; }
  .compare-wrap { flex: none; max-height: none; }
  .guide-reference { grid-template-columns: 1fr; }
  .privacy-pill { display: none; }
}
@media (max-width: 680px) {
  .topbar, .section-heading, .preview-toolbar { align-items: stretch; flex-direction: column; }
  .header-actions { justify-content: flex-start; }
  .header-actions .button { flex: 1; }
  .local-data-note, .site-footer { align-items: flex-start; flex-direction: column; }
  .system-guide summary { align-items: stretch; flex-direction: column; padding: 19px; }
  .guide-toggle { align-self: flex-start; }
  .guide-content { padding: 19px; }
  .guide-steps, .guide-definitions { grid-template-columns: 1fr; }
  .step-nav { overflow-x: auto; }
  .step { white-space: nowrap; }
  .save-state { display: none; }
  .event-grid, .form-grid { grid-template-columns: 1fr; }
  .span-2, .span-4 { grid-column: span 1; }
  .event-score { align-self: flex-start; }
  .filter-row { align-items: stretch; flex-direction: column; }
  .filter-row select { width: 100%; }
  .package-metrics { grid-template-columns: 1fr; }
  .package-metrics div { border-right: 0; border-bottom: 1px solid var(--line); }
  .asset-option { grid-template-columns: auto 1fr 62px; }
  .preview-actions { align-items: stretch; flex-wrap: wrap; }
  .preview-actions label { width: 100%; }
  .preview-actions input { width: 100%; }
  .sponsor-preview { padding: 28px 22px; }
  .sponsor-preview h2 { font-size: 32px; }
  .audience-row, .preview-grid { grid-template-columns: 1fr; }
}
@media print {
  body * { visibility: hidden; }
  #sponsorPreview, #sponsorPreview * { visibility: visible; }
  #sponsorPreview { position: absolute; inset: 0; width: 100%; margin: 0; padding: 36px; box-shadow: none; }
  @page { margin: 0.4in; }
}
