:root {
  color-scheme: light;
  --ink: #17323d;
  --ink-soft: #68777d;
  --navy: #103746;
  --ocean: #0b7285;
  --ocean-dark: #075b6a;
  --sand: #f4efe6;
  --paper: #fffdf9;
  --line: #ddd7cc;
  --coral: #c75b43;
  --gold: #b98722;
  --danger: #9f3b31;
  --danger-soft: #fbe9e5;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--sand); color: var(--ink); }
button, textarea { font: inherit; }

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(20px, 5vw, 72px);
  background: var(--navy);
  color: white;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.42); border-radius: 50%; font-family: Georgia, serif; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.brand small { margin-top: 2px; color: rgba(255,255,255,.68); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.offline-badge { color: rgba(255,255,255,.76); font-size: 13px; }
.offline-badge span { margin-right: 6px; color: #73d4b3; }

main { width: min(1240px, calc(100% - 28px)); margin: 0 auto; padding: clamp(46px, 7vw, 82px) 0 52px; }
.intro { max-width: 800px; margin-bottom: 34px; }
.eyebrow, .quote-kicker { margin: 0 0 8px; color: var(--coral); font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 16px; font-family: Georgia, serif; font-size: clamp(40px, 6vw, 68px); font-weight: 500; line-height: 1; letter-spacing: -.035em; }
.intro > p:last-child { max-width: 700px; margin-bottom: 0; color: var(--ink-soft); font-size: 18px; line-height: 1.6; }

.surface { margin-top: 24px; padding: clamp(22px, 3vw, 34px); border: 1px solid var(--line); border-radius: 24px; background: var(--paper); box-shadow: 0 18px 48px rgba(23,50,61,.09); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(27px, 4vw, 38px); font-weight: 500; }
.section-note { margin: 8px 0 0; color: var(--ocean); font-size: 13px; font-weight: 750; }

.picker-frame { overflow-x: auto; padding: 4px 0 10px; text-align: center; }
#price-calendar { min-width: min(100%, 320px); }

.quote-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 22px 42px; margin-top: 24px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: #f8f5ef; }
.quote-panel.empty { color: var(--ink-soft); }
.quote-panel.ineligible { border-color: #dba79f; background: #fff7f5; }
.quote-panel h3 { margin-bottom: 7px; font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.quote-panel p { margin-bottom: 0; color: var(--ink-soft); line-height: 1.5; }
.quote-total { min-width: 265px; text-align: right; }
.quote-total span, .quote-total small { display: block; color: var(--ink-soft); font-size: 12px; }
.quote-total strong { display: block; margin: 4px 0; font-family: Georgia, serif; font-size: clamp(38px, 5vw, 54px); font-weight: 500; }
.quote-breakdown { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, 1fr); margin: 0; border: 1px solid var(--line); border-radius: 12px; }
.quote-breakdown div { padding: 16px 18px; }
.quote-breakdown div + div { border-left: 1px solid var(--line); }
.quote-breakdown dt { color: var(--ink-soft); font-size: 12px; }
.quote-breakdown dd { margin: 4px 0 0; font-size: 18px; font-weight: 800; }
.restriction { grid-column: 1 / -1; padding: 13px 15px; border-left: 4px solid var(--danger); background: var(--danger-soft); color: var(--danger); font-weight: 700; line-height: 1.45; }
.rule-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.rule-chips span { padding: 5px 8px; border-radius: 999px; background: #e8f2f3; color: var(--ocean-dark); font-size: 11px; font-weight: 700; }

.chart-heading { align-items: flex-end; margin-bottom: 12px; }
.chart-copy, .editor-copy { max-width: 820px; color: var(--ink-soft); font-size: 14px; line-height: 1.55; }
.chart-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 14px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.legend-item.active { color: var(--ink); font-weight: 850; }
.legend-swatch { width: 24px; height: 4px; border-radius: 999px; }
.chart-viewport { overflow-x: auto; overscroll-behavior-inline: contain; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.chart-viewport:focus-visible, #price-chart:focus-visible { outline: 3px solid rgba(11,114,133,.25); outline-offset: 2px; }
.chart-stage { position: relative; min-height: 380px; }
#price-chart { display: block; }
.chart-tooltip { position: absolute; z-index: 2; min-width: 156px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--navy); color: white; box-shadow: 0 8px 24px rgba(16,55,70,.2); font-size: 11px; line-height: 1.5; pointer-events: none; white-space: pre-line; }
.chart-foot { display: flex; justify-content: space-between; gap: 16px; margin-top: 10px; color: var(--ink-soft); font-size: 11px; }

.primary-button { min-height: 46px; padding: 0 20px; border: 0; border-radius: 9px; background: var(--ocean); color: white; cursor: pointer; font-weight: 800; }
.primary-button:hover { background: var(--ocean-dark); }
.primary-button:disabled { cursor: wait; opacity: .6; }
.primary-button:focus-visible, textarea:focus-visible { outline: 3px solid rgba(11,114,133,.25); outline-offset: 2px; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.editor-field > span { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 13px; font-weight: 800; }
.editor-field small { color: var(--ink-soft); font-weight: 500; }
.editor-field textarea { width: 100%; height: 360px; resize: vertical; padding: 14px; border: 1px solid #bdb5aa; border-radius: 10px; background: #fbfaf7; color: var(--ink); font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; line-height: 1.5; tab-size: 2; }
.input-status { margin-top: 14px; padding: 11px 13px; border-radius: 9px; background: #e8f3ef; color: #24654f; font-size: 12px; line-height: 1.5; }
.input-status.error { background: var(--danger-soft); color: var(--danger); }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px clamp(20px, 5vw, 72px); color: #6b777c; font-size: 12px; }
[hidden] { display: none !important; }

@media (max-width: 760px) {
  .offline-badge { display: none; }
  main { width: min(100% - 18px, 680px); }
  .section-heading, .chart-heading { display: block; }
  .section-note, .chart-legend { justify-content: flex-start; margin-top: 14px; }
  .quote-panel { grid-template-columns: 1fr; }
  .quote-total { min-width: 0; text-align: left; }
  .quote-breakdown { grid-column: auto; grid-template-columns: 1fr; }
  .quote-breakdown div + div { border-top: 1px solid var(--line); border-left: 0; }
  .restriction, .rule-chips { grid-column: auto; }
  .editor-grid { grid-template-columns: 1fr; }
  .primary-button { margin-top: 15px; }
  .chart-foot { display: block; }
  .chart-foot span { display: block; margin-top: 4px; }
}

@media (max-width: 480px) {
  .brand small { display: none; }
  .surface { padding: 19px 14px; border-radius: 17px; }
  h1 { font-size: 40px; }
  .quote-panel { padding: 18px; }
  .editor-field > span { display: block; }
  .editor-field small { display: block; margin-top: 3px; }
  footer { display: block; }
  footer span { display: block; margin-top: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
