/* Days Between Days: shared styles. Mobile first, no external requests. */

@font-face {
  font-family: "Overpass";
  src: url("../fonts/overpass-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Overpass";
  src: url("../fonts/overpass-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #F6F7FA;
  --surface: #FFFFFF;
  --text: #14213D;
  --muted: #4A5570;
  --primary: #C8102E;
  --primary-dark: #A30D25;
  --highlight: #FFD43B;
  --border: #7C869C;
  --line: #E2E6EF;
  --line-strong: #CDD3DD;
  --tint: #EEF1F6;
  --font-head: "Overpass", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-code: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --container: 1120px;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
a { color: var(--primary); }
a:hover { color: var(--text); }
::selection { background: var(--highlight); color: var(--text); }

:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--text);
  color: #FFFFFF;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 12px; color: #FFFFFF; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Header */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 24px;
  padding-top: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand-mark { width: 46px; height: 21px; flex: none; }
.brand-name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.375rem;
  letter-spacing: -0.035em;
  line-height: 1;
  padding-top: 3px;
}

.site-nav {
  flex-basis: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav ul {
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
}
.site-nav a {
  display: inline-block;
  padding: 12px 0 10px;
  border-bottom: 2px solid transparent;
  color: var(--text);
  font-size: 0.9375rem;
  text-decoration: none;
}
.site-nav a:hover { border-bottom-color: var(--border); }
.site-nav a[aria-current="page"] {
  border-bottom-color: var(--primary);
  font-weight: 700;
}

/* Hero */

.hero {
  background: var(--bg);
  padding: 28px 0 36px;
}

.hero-head { max-width: 60rem; }

.hero h1 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 2rem;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.lede {
  max-width: 36em;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1.0625rem;
}

/* Calculator */

.calc {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.calc-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 18px 20px 0;
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  margin-bottom: 4px;
}
.field-head label {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.875rem;
}

.today {
  margin: -10px -2px -10px 0;
  padding: 12px 2px 12px 16px;
  border: 0;
  background: none;
  color: var(--primary);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 20px;
  cursor: pointer;
}
.today:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

.date-input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 48px;
}
.date-input::-webkit-date-and-time-value { text-align: left; }
.date-input:hover { border-color: var(--text); }
.date-input:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-color: var(--text); }
.date-input[aria-invalid="true"] { border-color: var(--primary); }

.echo {
  min-height: 1.5em;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.swap {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 2px 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.swap .icon { transform: rotate(90deg); }
.swap:hover { background: var(--tint); }

.toggle {
  position: relative;
  margin-top: 6px;
}
.toggle input {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 44px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.toggle label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 0.9375rem;
  cursor: pointer;
}
.toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.toggle input:checked + label .toggle-track { background: var(--primary); border-color: var(--primary); }
.toggle input:checked + label .toggle-track::after { transform: translateX(16px); background: #FFFFFF; }
.toggle input:focus-visible + label .toggle-track { outline: 2px solid var(--text); outline-offset: 2px; }

/* Result */

.calc-result {
  margin-top: 14px;
  padding: 20px;
  border-top: 1px solid var(--line);
}

.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #FFF4C2;
  font-size: 0.875rem;
}
.notice .btn-link {
  padding: 12px 0;
  margin: -12px 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.total {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin: 0;
}
.total-num {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 3.5rem;
  line-height: 0.92;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.total-unit {
  color: var(--muted);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.25rem;
}
.alt {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
}
.sentence {
  max-width: 32em;
  margin: 10px 0 0;
  font-size: 0.9375rem;
}

.breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.breakdown > div:nth-child(-n+2) { grid-column: 1 / -1; }
.breakdown--3 > div:nth-child(2) { grid-column: auto; }

.result-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.result-weekday {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9375rem;
}
.result-date {
  margin: 2px 0 0;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 2.125rem;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.breakdown dt {
  color: var(--muted);
  font-size: 0.8125rem;
}
.breakdown dd {
  margin: 2px 0 0;
  font-weight: 700;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.leap {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  margin: 14px 0 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--highlight);
  font-weight: 700;
  font-size: 0.8125rem;
}
.leap .icon { width: 16px; height: 16px; }

.calc-foot {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.formula { min-width: 0; }
.formula-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.8125rem;
}
.formula-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.formula code {
  min-width: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--tint);
  color: var(--text);
  font-family: var(--font-code);
  font-size: 0.8125rem;
  white-space: normal;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.icon-btn:hover { background: var(--tint); }
.icon-btn .icon { width: 18px; height: 18px; }

.actions {
  display: flex;
  gap: 8px;
}

.btn {
  display: inline-flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9375rem;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover { border-color: var(--text); background: var(--tint); }
.btn .icon { width: 18px; height: 18px; }

.result-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.noscript {
  margin: 12px 0 0;
  font-size: 0.9375rem;
}

/* Form parts used by the date and business days calculators */

.field-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.field-label {
  margin: 0 0 4px;
  padding: 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 30px;
}

.segmented {
  display: flex;
  width: 100%;
  padding: 2px;
  border-radius: 12px;
  background: var(--tint);
}
.segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}
.segmented label {
  display: inline-flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}
.segmented label:hover { color: var(--text); }
.segmented input:checked + label {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--line-strong), 0 1px 2px rgba(20, 33, 61, 0.1);
}
.segmented input:focus-visible + label { outline: 2px solid var(--text); outline-offset: 2px; }

.calc-modes {
  min-width: 0;
  margin: 0;
  padding: 18px 20px 6px;
  border: 0;
}
.segmented--modes label { font-size: 0.875rem; }

.calc-inputs--date,
.calc-inputs--add { row-gap: 12px; }

.amount-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}
.amount label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 30px;
}
.num-input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-variant-numeric: tabular-nums;
}
.num-input:hover { border-color: var(--text); }
.num-input:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-color: var(--text); }

.calc-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 24px;
  padding: 6px 20px 0;
}
.calc-options .toggle { margin-top: 0; }

.select-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.select-field label { font-size: 0.9375rem; }
.select {
  height: 44px;
  padding: 0 38px 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314213D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.select:hover { border-color: var(--text); }
.select:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.holiday-list {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg);
}
.holiday-list-title {
  margin: 0 0 6px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.8125rem;
}
.holiday-list ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

/* Breadcrumbs */

.breadcrumb { margin: 0 0 14px; font-size: 0.875rem; }
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.breadcrumb a {
  margin: -12px 0;
  padding: 12px 0;
  color: var(--muted);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--text); text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: 700; }
.icon-sm { width: 14px; height: 14px; }

/* About, contact, legal and error pages */

.container.narrow { max-width: calc(780px + 2 * var(--gutter)); }

.page-head {
  padding: 28px 0 32px;
  background: var(--bg);
}
.page-head h1 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.page-meta {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}
.page-head--center { text-align: center; }
.page-head--center .lede { margin-left: auto; margin-right: auto; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.875rem;
}

.page-body {
  padding-top: 36px;
  padding-bottom: 72px;
}
.prose { max-width: none; }
.prose section:not(:first-child) { margin-top: 44px; }
.legal h2 { font-size: 1.25rem; }
.legal h2 + p { font-size: inherit; line-height: inherit; }
.conspicuous { font-weight: 700; }

.legal-toc {
  margin: 0 0 36px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.legal-toc-title { margin: 0 0 6px; font-weight: 700; }
.article .legal-toc ol {
  margin: 0;
  padding-left: 1.3em;
  columns: 2 240px;
  column-gap: 32px;
  font-size: 0.9375rem;
}
.article .legal-toc li { margin: 4px 0; break-inside: avoid; }
.legal-toc a { color: var(--text); text-decoration: none; }
.legal-toc a:hover { color: var(--primary); text-decoration: underline; }

.section-title {
  margin: 0 0 16px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.375rem;
  line-height: 1.2;
}
.back-home { margin: 28px 0 0; text-align: center; }
.page-body--center .section-title { text-align: center; }

.tool-links {
  display: grid;
  gap: 12px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}
.article ul.tool-links { padding-left: 0; }
.article .tool-links li { margin: 0; }
.tool-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.tool-link:hover { border-color: var(--text); color: var(--text); }
.tool-link-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.0625rem;
}
.tool-link-text {
  grid-column: 1;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.45;
}
.tool-link .icon {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--primary);
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 36px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}
.contact-card .icon { width: 24px; height: 24px; flex: none; color: var(--primary); }
.contact-label { display: block; color: var(--muted); font-size: 0.8125rem; }
.contact-card a { font-weight: 700; overflow-wrap: anywhere; }

.footer-links a[aria-current="page"] { font-weight: 700; }

/* Ad slots: invisible until ad code is pasted inside */

.ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  margin: 32px auto;
}
.ad-slot::before {
  content: "Advertisement";
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.75rem;
}
.ad-slot:empty { display: none; }
.ad-slot--wide { max-width: 970px; }

/* Guide */

.guide {
  display: grid;
  gap: 28px;
  padding-top: 36px;
  padding-bottom: 64px;
}

.toc {
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 0.9375rem;
}
.toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary .icon { transition: transform 0.15s ease; }
.toc details[open] summary .icon { transform: rotate(180deg); }
.toc ol {
  margin: 0;
  padding: 0 16px 12px;
  list-style: none;
}
.toc li a {
  display: block;
  padding: 8px 0;
  color: var(--muted);
  text-decoration: none;
}
.toc li a:hover { color: var(--text); }
.toc li a[aria-current="true"] { color: var(--text); font-weight: 700; }
.toc-title { display: none; }

.article {
  min-width: 0;
  max-width: 720px;
}

.article section:not(:first-child) { margin-top: 56px; }

.article h2 {
  margin: 0 0 12px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

/* The first paragraph under each heading is the direct answer */
.article h2 + p {
  font-size: 1.125rem;
  line-height: 1.55;
}

.article h3 {
  margin: 0 0 6px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.3;
}

.article p { margin: 0 0 14px; }
.article p:last-child { margin-bottom: 0; }

.article ol,
.article ul {
  margin: 0 0 14px;
  padding-left: 1.4em;
}
.article li { margin: 6px 0; }
.article li::marker { color: var(--muted); font-weight: 700; }

.article code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--tint);
  font-family: var(--font-code);
  font-size: 0.85em;
  white-space: nowrap;
}

.sum { font-weight: 700; }

.table-wrap {
  margin: 22px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.table-wrap--narrow { max-width: 520px; }
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.table-wrap caption {
  padding: 12px 16px 0;
  color: var(--muted);
  font-size: 0.8125rem;
  text-align: left;
}
.table-wrap th,
.table-wrap td {
  padding: 11px 14px;
  text-align: left;
  vertical-align: top;
}
.table-wrap thead th {
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}
.table-wrap tbody tr + tr td,
.table-wrap tbody tr + tr th { border-top: 1px solid var(--line); }
.table-wrap tbody th { font-weight: 700; }
.table-wrap .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap td.num { white-space: nowrap; }
.yes { font-weight: 700; }

.figure {
  margin: 24px 0;
  padding: 20px 14px 16px;
  border-radius: 16px;
  background: var(--bg);
}
.fig-svg {
  display: block;
  width: 100%;
  max-width: 440px;
  height: auto;
  margin: 0 auto;
}
.fig-svg text { fill: var(--text); font-family: var(--font-body); }
.fig-svg .b { font-weight: 700; }
.fig-svg .m { fill: var(--muted); }
.fig-svg .r { fill: var(--primary); }
.fig-svg .w { fill: #FFFFFF; }
.fig-svg .fs13 { font-size: 13px; }
.fig-svg .fs14 { font-size: 14px; }
.fig-svg .fs15 { font-size: 15px; }
.fig-svg .fs16 { font-size: 16px; }
.fig-svg .fs17 { font-size: 17px; }
.fig-svg .fs20 { font-size: 20px; }
.fig-svg .fs24 { font-size: 24px; }
.fig-svg .fs34 { font-size: 34px; }
.figure figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

.faq-item {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item p { margin: 0; }
.article h2 + .faq-item { margin-top: 18px; }

/* Footer */

.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 32px 0;
}
.footer-inner { display: grid; gap: 14px; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links a {
  display: inline-block;
  padding: 8px 0;
  color: var(--text);
  font-size: 0.9375rem;
}
.footer-links a:hover { color: var(--primary); }
.footer-meta { margin: 0; color: var(--muted); font-size: 0.875rem; }
.footer-meta a { color: var(--text); }

/* Toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--text);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.9375rem;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Tablet */

@media (min-width: 720px) {
  :root { --gutter: 24px; }
  .hero { padding: 40px 0 48px; }
  .hero h1 { font-size: 2.5rem; }
  .lede { font-size: 1.125rem; }
  .calc { margin-top: 28px; }
  .calc-inputs {
    grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
    padding: 22px 24px 0;
  }
  .swap { margin: 34px 0 0; }
  .swap .icon { transform: none; }
  .calc-inputs > .toggle { grid-column: 1 / -1; margin-top: 2px; }
  .calc-result { padding: 24px; }
  .result-body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    column-gap: 32px;
  }
  .breakdown {
    align-self: start;
    margin: 0;
    padding: 0 0 0 28px;
    border-top: 0;
    border-left: 1px solid var(--line);
  }
  .breakdown > div:nth-child(-n+2) { grid-column: auto; }
  .total-num { font-size: 4rem; }
  .calc-foot {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
  }
  .formula { display: flex; align-items: center; gap: 4px 10px; }
  .formula-label { margin: 0; white-space: nowrap; }
  .actions .btn { flex: 0 0 auto; }
  .article { font-size: 1.125rem; }
  .article h2 { font-size: 1.75rem; }
  .article h2 + p { font-size: 1.25rem; }
  .article section:not(:first-child) { margin-top: 64px; }
  .figure { padding: 28px 24px 18px; }
  .footer-inner { grid-template-columns: auto 1fr; align-items: center; column-gap: 40px; }
  .footer-links { justify-content: flex-end; }
  .footer-meta { grid-column: 1 / -1; }
  .calc-modes { padding: 22px 24px 6px; }
  .segmented--modes { max-width: 460px; }
  .calc-inputs--date { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px; }
  .calc-inputs--date .amounts { grid-column: 1 / -1; }
  .amount-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .calc-inputs--add { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 0.8fr); column-gap: 16px; }
  .calc-options { padding: 6px 24px 0; }
  .result-date { font-size: 2.5rem; }
  .holiday-list ul { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  .page-head { padding: 40px 0 44px; }
  .page-head h1 { font-size: 2.5rem; }
  .page-body { padding-top: 48px; padding-bottom: 88px; }
}

/* Desktop */

@media (min-width: 1000px) {
  .header-inner { flex-wrap: nowrap; padding-top: 0; min-height: 68px; }
  .site-nav { flex-basis: auto; overflow: visible; }
  .site-nav a { padding: 22px 0 20px; }
  .hero { padding: 52px 0 64px; }
  .hero h1 { font-size: 3rem; }
  .lede { font-size: 1.1875rem; }
  .calc { margin-top: 32px; }
  .calc-inputs {
    grid-template-columns: minmax(0, 300px) 44px minmax(0, 300px) minmax(0, 1fr);
    padding: 26px 28px 0;
  }
  .calc-inputs > .toggle { grid-column: auto; justify-self: end; margin-top: 36px; }
  .calc-result { padding: 26px 28px 28px; }
  .result-body {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr);
    column-gap: 40px;
  }
  .breakdown { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-left: 36px; gap: 18px 24px; }
  .total-num { font-size: 4.5rem; }
  .guide {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 64px;
    padding-top: 56px;
    padding-bottom: 88px;
  }
  .toc { position: sticky; top: 24px; align-self: start; border: 0; border-radius: 0; }
  .toc summary { display: none; }
  .toc-title { display: block; margin: 0 0 10px; font-weight: 700; }
  .toc ol { padding: 0; border-left: 1px solid var(--line); }
  .toc li a { margin-left: -1px; padding: 7px 0 7px 16px; border-left: 2px solid transparent; }
  .toc li a[aria-current="true"] { border-left-color: var(--primary); }
  .calc-modes { padding: 26px 28px 6px; }
  .calc-inputs--date { grid-template-columns: minmax(0, 280px) minmax(0, 220px) minmax(0, 1fr); column-gap: 24px; }
  .calc-inputs--date .amounts { grid-column: auto; }
  .calc-inputs--add { grid-template-columns: minmax(0, 300px) minmax(0, 220px) minmax(0, 160px); column-gap: 24px; }
  .calc-options { padding: 8px 28px 0; }
  .result-date { font-size: 2.875rem; }
  .breakdown--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .page-head { padding: 52px 0 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .toggle-track, .toggle-track::after, .toast, .toc summary .icon { transition: none; }
}
