:root {
  --ink: #111a29;
  --ink-2: #1a2435;
  --paper: #f2ede3;
  --paper-2: #e9e2d6;
  --cream: #fffaf0;
  --muted: #68707c;
  --rose: #caa9a6;
  --red: #a9263d;
  --line: rgba(17, 26, 41, .16);
  --serif: "Libre Caslon Display", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); }
button, input, select { font: inherit; }
a { color: inherit; }

.site-header {
  min-height: 112px; padding: 18px clamp(24px, 6vw, 84px); display: grid;
  grid-template-columns: 1fr auto 1fr; align-items: center; background: var(--ink);
  color: var(--cream); border-bottom: 1px solid rgba(255,255,255,.16);
}
.brand { display: inline-flex; flex-direction: column; width: 64px; text-decoration: none; line-height: .73; }
.brand span { font-family: Georgia, serif; font-size: 25px; letter-spacing: .03em; }
.brand small { margin-top: 8px; border-top: 1px solid currentColor; padding-top: 3px; font-size: 6px; letter-spacing: .12em; }
.header-copy { text-align: center; display: grid; gap: 3px; }
.header-copy span { color: #aeb4bf; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.header-copy strong { font-family: var(--serif); font-size: 19px; font-weight: 400; }
.back-link { justify-self: end; text-decoration: none; text-transform: uppercase; letter-spacing: .12em; font-size: 11px; padding: 15px 18px; border: 1px solid rgba(255,255,255,.3); }

.hero { min-height: 410px; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .45fr); gap: 8vw; align-items: end; padding: 72px clamp(24px, 7vw, 108px); color: var(--cream); background: radial-gradient(circle at 78% 44%, rgba(119,44,58,.38), transparent 27%), linear-gradient(120deg, #0e1724, #151d2c); }
.hero-copy { max-width: 850px; }
.eyebrow { margin: 0 0 22px; color: var(--red); text-transform: uppercase; letter-spacing: .18em; font-size: 11px; font-weight: 600; }
.hero .eyebrow { color: #d9b8b3; }
.hero h1 { margin: 0; font: 400 clamp(48px, 6.2vw, 94px)/.98 var(--serif); letter-spacing: -.035em; }
.hero h1 em { color: var(--rose); font-weight: 400; }
.hero-copy > p:last-child { max-width: 670px; margin: 30px 0 0; color: #c7c8ca; font-size: 16px; line-height: 1.7; }
.hero-note { border-left: 2px solid var(--red); padding: 16px 0 16px 22px; margin-bottom: 8px; }
.hero-note span { font-size: 10px; text-transform: uppercase; letter-spacing: .17em; color: #e4c7c3; }
.hero-note p { color: #c7c8ca; font-size: 13px; line-height: 1.55; margin: 8px 0 0; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.13fr) minmax(360px, .87fr); gap: 26px; padding: 54px clamp(24px, 7vw, 108px) 76px; }
.calculator-card, .result-card { background: #fbf7ef; border: 1px solid var(--line); padding: clamp(24px, 4vw, 48px); box-shadow: 0 14px 50px rgba(30,31,35,.05); }
.card-heading { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; border-bottom: 1px solid var(--line); padding-bottom: 26px; margin-bottom: 30px; }
.card-heading > div, .section-heading > div { display: flex; gap: 13px; align-items: center; }
.card-heading > div span, .section-heading > div span { color: var(--red); font-size: 12px; }
.card-heading p, .section-heading p { margin: 0; }
.card-heading > div p, .section-heading > div p { font-size: 11px; letter-spacing: .15em; text-transform: uppercase; }
.card-heading > p { color: var(--muted); font-size: 12px; line-height: 1.55; }

label { display: grid; gap: 9px; margin: 0 0 22px; }
label > span { font-size: 12px; font-weight: 600; letter-spacing: .035em; }
label small { color: var(--muted); font-size: 11px; line-height: 1.45; }
input, select { width: 100%; min-height: 52px; padding: 0 15px; background: #fffdf8; color: var(--ink); border: 1px solid #cfc8bc; border-radius: 0; }
input:focus, select:focus, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.check-field { grid-template-columns: auto 1fr; align-items: start; padding: 16px; border: 1px solid var(--line); background: #f4eee5; }
.check-field input { width: 18px; min-height: auto; height: 18px; accent-color: var(--red); }
.check-field > span { display: grid; gap: 5px; }
.check-field strong { font-size: 12px; }
.suspension-panel { margin: 7px 0 26px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.suspension-panel summary { cursor: pointer; display: flex; justify-content: space-between; padding: 17px 0; font-size: 12px; font-weight: 600; }
.suspension-panel[open] { padding-bottom: 20px; }
.secondary-button { border: 1px solid var(--ink); background: transparent; padding: 12px 15px; cursor: pointer; }
.chip-list { display: grid; gap: 8px; margin-top: 14px; }
.chip { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 10px 12px; background: var(--paper-2); font-size: 11px; }
.chip button { border: 0; background: none; color: var(--red); cursor: pointer; }
.form-error { padding: 12px 14px; background: #f6dfe2; color: #74182a; font-size: 12px; }
.calculate-button { width: 100%; display: flex; justify-content: space-between; border: 0; background: var(--ink); color: white; padding: 18px 20px; cursor: pointer; text-transform: uppercase; letter-spacing: .13em; font-size: 11px; }

.result-card { background: var(--ink); color: var(--cream); min-height: 520px; }
.empty-result { height: 100%; display: flex; flex-direction: column; justify-content: center; }
.empty-result span { color: var(--rose); font-size: 12px; }
.empty-result h2 { font: 400 clamp(34px, 4vw, 54px)/1.04 var(--serif); margin: 22px 0; }
.empty-result p { color: #b7bcc5; line-height: 1.7; max-width: 390px; }
.result-overline { margin: 0; color: var(--rose); text-transform: uppercase; letter-spacing: .16em; font-size: 10px; }
.deadline-date { margin: 18px 0 6px; font: 400 clamp(55px, 7vw, 82px)/.95 var(--serif); color: var(--cream); }
.deadline-weekday { color: var(--rose); font: 400 25px var(--serif); }
.result-rule { border: 0; border-top: 1px solid rgba(255,255,255,.18); margin: 30px 0; }
.result-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(255,255,255,.15); }
.result-facts div { background: var(--ink); padding: 18px 0; }
.result-facts small { display: block; color: #9299a5; font-size: 9px; text-transform: uppercase; letter-spacing: .13em; }
.result-facts strong { display: block; margin-top: 8px; font-size: 13px; font-weight: 500; }
.basis { margin: 25px 0; padding-left: 16px; border-left: 2px solid var(--red); color: #b8bdc6; font-size: 12px; line-height: 1.6; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.result-actions button { background: transparent; color: white; border: 1px solid rgba(255,255,255,.35); padding: 11px 14px; cursor: pointer; font-size: 11px; }

.memory-section, .method-section { padding: 64px clamp(24px, 7vw, 108px) 80px; background: #fbf7ef; border-top: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: 1fr 2fr; gap: 30px; align-items: start; margin-bottom: 38px; }
.section-heading h2 { margin: 0; max-width: 760px; font: 400 clamp(37px, 4.5vw, 60px)/1.04 var(--serif); }
.legend { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 18px; font-size: 11px; color: var(--muted); }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; }
.dot.counted { background: #39745a; }.dot.weekend { background: #9da2a8; }.dot.holiday { background: #b77736; }.dot.suspension { background: var(--red); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--paper-2); text-transform: uppercase; font-size: 9px; letter-spacing: .14em; }
tbody tr:last-child td { border-bottom: 0; }
.status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.method-section { background: var(--paper-2); }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.method-grid article { padding: 28px; border-left: 1px solid var(--line); }
.method-grid article:last-child { border-right: 1px solid var(--line); }
.method-grid span { color: var(--red); font-family: var(--serif); font-size: 34px; }
.method-grid h3 { font: 400 26px var(--serif); margin: 42px 0 12px; }
.method-grid p { color: var(--muted); font-size: 13px; line-height: 1.65; }
.legal-note { display: grid; grid-template-columns: 1fr 1fr; gap: 8vw; padding: 72px clamp(24px, 7vw, 108px); background: var(--ink-2); color: var(--cream); }
.legal-note h2 { margin: 0; font: 400 clamp(34px, 4vw, 52px)/1.05 var(--serif); }
.legal-copy > p { color: #b8bdc6; line-height: 1.8; font-size: 14px; }
.source-links { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 24px; }
.source-links span { width: 100%; color: var(--rose); font-size: 9px; text-transform: uppercase; letter-spacing: .15em; }
.source-links a { color: var(--cream); font-size: 11px; text-underline-offset: 4px; }
footer { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end; padding: 35px clamp(24px, 7vw, 108px); background: var(--ink); color: #a9afb9; font-size: 11px; }
footer p:last-child { text-align: right; }
.footer-brand { color: var(--cream); }

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr 1fr; }
  .header-copy { display: none; }
  .hero, .workspace, .legal-note { grid-template-columns: 1fr; }
  .hero { min-height: 530px; }
  .workspace { padding-top: 28px; }
  .result-card { min-height: 420px; }
  .section-heading { grid-template-columns: 1fr; }
  .method-grid { grid-template-columns: 1fr; }
  .method-grid article, .method-grid article:last-child { border: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 580px) {
  .site-header { min-height: 88px; padding: 14px 20px; }
  .back-link { border: 0; padding: 0; }
  .hero { padding: 54px 24px; }
  .hero h1 { font-size: 51px; }
  .workspace { padding-inline: 14px; }
  .calculator-card, .result-card { padding: 24px 20px; }
  .card-heading, .field-row, .result-facts, .legal-note, footer { grid-template-columns: 1fr; }
  .section-heading h2 { font-size: 40px; }
  footer { gap: 25px; align-items: start; }
  footer p:last-child { text-align: left; }
}

@media print {
  .site-header, .hero, .calculator-card, .method-section, .legal-note, footer, .result-actions { display: none !important; }
  body, .workspace, .memory-section, .result-card { background: white; color: black; }
  .workspace { display: block; padding: 0; }
  .result-card { min-height: 0; box-shadow: none; border: 0; padding: 20px 0; }
  .memory-section { padding: 20px 0; }
  .basis, .result-overline, .deadline-weekday { color: #333; }
  .result-facts { background: #ddd; }
  .result-facts div { background: white; }
}
