/* Construction Cloud: shared styles. Self-hosted fonts (Poppins for headings, Open Sans for text, as on mill-court.com) and images only; no external requests. */

@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/poppins-700.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 300 800; font-stretch: 100%; font-display: swap; src: url("fonts/open-sans.woff2") format("woff2"); }

:root {
  --navy: #2a3044;
  --navy-deep: #1e2333;
  --slate: #424b73;
  --green: #5ca547;
  --green-ink: #3d7a2e;      /* green dark enough for text and links on white (5.2:1) */
  --green-tint: #e6f3e1;
  --green-light: #a8d99a;    /* green for text on navy */
  --mist: #eef1f6;
  --line: #d9dce4;
  --ink: #2a3044;
  --muted: #545b73;
  --on-dark: #e8eaf2;
  --on-dark-muted: #b9c0d6;
  --white: #ffffff;
  --amber: #e0a526;
  --warn-bg: #fff6dc;
  --warn-line: #d9a925;
  --error: #a4231b;
  --display: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --text: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: 16px;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(30, 35, 51, 0.06), 0 12px 32px -8px rgba(30, 35, 51, 0.22);
  color-scheme: light;
}
@media (min-width: 640px) { :root { --gutter: 24px; } }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

a { color: var(--green-ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--green-ink); outline-offset: 2px; }

h1, h2, h3, h4 { text-wrap: balance; font-family: var(--display); line-height: 1.15; margin: 0 0 0.5em; color: var(--navy); font-weight: 700; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.4rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2.1rem); }
h3 { font-size: 1.25rem; font-weight: 500; letter-spacing: -0.005em; }
h4 { font-size: 1.0625rem; font-weight: 500; letter-spacing: 0; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: 70ch; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 50;
  background: var(--white); color: var(--navy); padding: 8px 12px; border-radius: var(--radius); font-weight: 600;
}
.skip:focus { top: 8px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Header ---------- */

.site-header {
  position: relative; z-index: 30;
  background: var(--navy-deep); color: var(--white);
}
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 6px 28px; padding-top: 14px; padding-bottom: 12px;
}
/* With JavaScript the header floats over the dark page hero, then turns solid once you scroll. */
.js .site-header { position: absolute; left: 0; right: 0; top: 0; background: transparent; }
@media (min-width: 900px) {
  .js .site-header {
    position: fixed;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    transition: background-color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  }
  .js .site-header .header-inner { transition: padding 0.25s ease; padding-top: 22px; padding-bottom: 22px; }
  .js .site-header.is-stuck { background: rgba(30, 35, 51, 0.96); border-bottom-color: transparent; box-shadow: 0 6px 24px -10px rgba(0, 0, 0, 0.5); }
  .js .site-header.is-stuck .header-inner { padding-top: 12px; padding-bottom: 12px; }
}

.wordmark { display: inline-flex; align-items: center; gap: 12px; color: var(--white); text-decoration: none; }
.wordmark svg { width: 38px; height: 38px; flex: none; }
.wm-text { display: flex; flex-direction: column; line-height: 1.1; }
.wm-name { font-family: var(--display); font-weight: 700; font-size: 1.1875rem; letter-spacing: -0.01em; }
.wm-by { font-size: 0.8125rem; color: var(--green-light); letter-spacing: 0.01em; margin-top: 2px; }
.wordmark:hover .wm-name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }

.site-header :focus-visible, .site-footer :focus-visible, .dark :focus-visible { outline-color: var(--white); }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 26px; }
.site-nav a {
  display: inline-block; padding: 8px 0; color: var(--white); text-decoration: none;
  font-family: var(--display); font-weight: 500; font-size: 0.9375rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--on-dark-muted); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--green); }
.site-nav .nav-cta a {
  padding: 9px 16px; border: 0; border-radius: var(--radius);
  background: var(--green); color: var(--navy-deep); font-weight: 700;
}
.site-nav .nav-cta a:hover { background: var(--green-light); }
@media (max-width: 639px) { .site-nav .nav-cta { display: none; } }

/* ---------- Dark bands: page heroes and the help band ---------- */

.dark { position: relative; color: var(--on-dark); background: var(--navy-deep); isolation: isolate; }
.dark h1, .dark h2, .dark h3 { color: var(--white); }
.dark a:not(.btn) { color: var(--white); }
.band-bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-color: var(--navy-deep);
  background-image:
    linear-gradient(100deg, rgba(30, 35, 51, 0.97) 0%, rgba(30, 35, 51, 0.9) 38%, rgba(30, 35, 51, 0.62) 100%),
    url("img/site-aerial.jpg");
  background-size: cover; background-position: center 40%;
}

.page-hero { padding: 132px 0 120px; }
@media (min-width: 900px) { .page-hero { padding: 148px 0 132px; } }
.page-hero h1 { max-width: 20ch; margin-bottom: 0.35em; }
.page-hero .lede { font-size: 1.1875rem; max-width: 62ch; color: var(--on-dark); }
.hero-note {
  max-width: 78ch; margin: 22px 0 0; padding: 2px 0 2px 16px;
  border-left: 3px solid var(--green); color: var(--on-dark-muted); font-size: 0.9375rem;
}
.hero-note strong { color: var(--white); font-weight: 600; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px;
  padding: 11px 20px; border-radius: var(--radius); border: 2px solid var(--navy);
  background: var(--navy); color: var(--white);
  font-family: var(--display); font-size: 0.9375rem; font-weight: 700; letter-spacing: 0.01em; line-height: 1.2;
  cursor: pointer; text-decoration: none; transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--slate); border-color: var(--slate); }
.btn-green { background: var(--green); border-color: var(--green); color: var(--navy-deep); }
.btn-green:hover { background: var(--green-light); border-color: var(--green-light); color: var(--navy-deep); }
.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, 0.7); color: var(--white); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--white); }
.btn-quiet { background: var(--white); color: var(--navy); border-color: var(--line); }
.btn-quiet:hover { background: var(--mist); color: var(--navy); border-color: var(--navy); }
.btn-small { min-height: 38px; padding: 7px 13px; font-size: 0.875rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

/* ---------- Home hero ---------- */

.hero-home { padding: 128px 0 56px; }
@media (min-width: 900px) { .hero-home { padding: 138px 0 72px; } }
.hero-home .band-bg {
  background-image:
    linear-gradient(100deg, rgba(30, 35, 51, 0.97) 0%, rgba(30, 35, 51, 0.88) 42%, rgba(30, 35, 51, 0.55) 100%),
    linear-gradient(0deg, rgba(30, 35, 51, 0.9) 0%, rgba(30, 35, 51, 0) 45%),
    url("img/site-aerial.jpg");
}
.hero-copy { max-width: 920px; }
.hero-home h1 { font-size: clamp(2.3rem, 1.2rem + 3.6vw, 3.9rem); line-height: 1.06; margin-bottom: 0.45em; text-wrap: balance; }
.hero-home .lede { font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem); max-width: 56ch; color: var(--on-dark); }
.hero-home .actions { margin-top: 26px; gap: 12px; }

/* The live programme: what the Scheme timetable would be if a period ended today */
.live {
  margin: 40px 0 0; padding: 20px 18px 16px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 6px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
@media (min-width: 640px) { .live { padding: 24px 28px 18px; } }
.live-cap { margin: 0 0 4px; }
.live-cap strong { display: block; font-family: var(--display); font-weight: 500; font-size: 1.125rem; color: var(--white); }
.live-cap span { color: var(--on-dark-muted); font-size: 0.9375rem; }
.live-note, .live-foot { margin: 10px 0 0; font-size: 0.875rem; color: var(--on-dark-muted); }
.live-foot a { font-weight: 600; }

.strip { list-style: none; margin: 18px 0 4px; padding: 0; position: relative; }
.strip::before { /* the rail, drawn down the left on narrow screens */
  content: ""; position: absolute; left: 10px; top: 12px; bottom: 12px; width: 2px; background: var(--green);
  transform-origin: top;
}
.strip li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 0 14px; padding: 6px 0; }
.strip .dm {
  width: 14px; height: 14px; margin: 6px 0 0 4px; transform: rotate(45deg);
  background: var(--green); border: 2px solid var(--navy-deep); border-radius: 2px; box-shadow: 0 0 0 2px var(--green);
}
.strip .start .dm { background: var(--navy-deep); box-shadow: 0 0 0 2px var(--white); }
.strip .lab { display: block; font-size: 0.875rem; color: var(--on-dark-muted); line-height: 1.35; }
.strip .dt { display: block; font-weight: 600; color: var(--white); font-variant-numeric: tabular-nums; white-space: nowrap; }

.gantt { display: none; }
.gantt-key { display: none; }

@media (min-width: 1000px) {
  .gantt {
    display: grid; gap: 2px; margin: 22px 0 0;
    font-size: 0.6875rem; font-variant-numeric: tabular-nums; color: var(--on-dark-muted); text-align: center;
  }
  .gantt .gd { position: relative; height: 40px; padding-top: 22px; background: rgba(255, 255, 255, 0.045); border-radius: 2px; line-height: 1; }
  .gantt .gd .gm { position: absolute; left: 0; right: 0; top: 6px; font-weight: 600; color: var(--white); }
  .gantt .wk { background: rgba(255, 255, 255, 0.11); }
  .gantt .x { background: repeating-linear-gradient(135deg, rgba(224, 165, 38, 0.7) 0 2px, rgba(224, 165, 38, 0.08) 2px 6px); color: var(--white); }
  .gantt .on { background: rgba(92, 165, 71, 0.35); color: var(--white); font-weight: 600; }

  .gantt-key { display: flex; flex-wrap: wrap; gap: 4px 18px; list-style: none; margin: 12px 0 0; padding: 0; font-size: 0.8125rem; color: var(--on-dark-muted); }
  .gantt-key li { display: inline-flex; align-items: center; gap: 7px; }
  .gantt-key .sw { width: 14px; height: 14px; border-radius: 2px; background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(255, 255, 255, 0.2); }
  .gantt-key .sw-wk { background: rgba(255, 255, 255, 0.16); }
  .gantt-key .sw-x { background: repeating-linear-gradient(135deg, rgba(224, 165, 38, 0.8) 0 2px, transparent 2px 5px); }
  .gantt-key .sw-on { background: rgba(92, 165, 71, 0.5); }

  .strip { height: 104px; margin: 0; }
  .strip::before { left: 0; right: 0; top: 13px; bottom: auto; width: auto; height: 3px; transform-origin: left; }
  .strip li { position: absolute; top: 0; display: block; padding: 0; width: 170px; transform: translateX(-50%); text-align: center; }
  .strip li.first { transform: translateX(-12px); text-align: left; }
  .strip li.last { transform: translateX(calc(-100% + 12px)); text-align: right; }
  .strip .dm { display: inline-block; margin: 7px 5px 12px; }
  .strip .dt { font-size: 1.0625rem; }
}

/* One orchestrated moment: the programme draws itself once, left to right. */
@media (prefers-reduced-motion: no-preference) {
  .live.play .strip::before { animation: draw-down 1.3s cubic-bezier(0.25, 0.7, 0.2, 1) both; }
  .live.play .strip li { animation: pop 0.45s cubic-bezier(0.2, 0.8, 0.3, 1.2) both; animation-delay: calc(var(--t, 0) * 1.05s + 0.15s); }
  .live.play .gantt .on { animation: glow 0.6s ease both; animation-delay: calc(var(--t, 0) * 1.05s + 0.15s); }
}
@media (prefers-reduced-motion: no-preference) and (min-width: 1000px) {
  .live.play .strip::before { animation-name: draw-across; }
}
@keyframes draw-down { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes draw-across { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pop { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }
@keyframes glow { from { background-color: rgba(255, 255, 255, 0.045); } to { background-color: rgba(92, 165, 71, 0.35); } }

/* ---------- Home sections ---------- */

.section { padding: 64px 0; }
@media (min-width: 900px) { .section { padding: 96px 0; } }
.section-mist { background: var(--mist); }
.section-head { max-width: 62ch; margin-bottom: 40px; }
.section-head p { color: var(--muted); font-size: 1.125rem; margin: 0; }

.feature { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: center; }
.feature + .feature { margin-top: 72px; }
@media (min-width: 900px) {
  .feature { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; }
  .feature-flip .feature-copy { order: 2; }
}
.feature-copy h3 { font-family: var(--display); font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.9rem); font-weight: 700; margin-bottom: 0.4em; }
.feature-copy > p { color: var(--muted); font-size: 1.0625rem; }
.ticks { list-style: none; margin: 0 0 24px; padding: 0; }
.ticks li { position: relative; padding: 5px 0 5px 26px; }
.ticks li::before {
  content: ""; position: absolute; left: 3px; top: 0.85em; width: 9px; height: 9px;
  background: var(--green); transform: rotate(45deg); border-radius: 1px;
}

/* Specimens: small worked examples of what each calculator gives you */
.specimen {
  margin: 0; background: var(--white); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow);
  padding: 22px 20px 18px;
}
@media (min-width: 640px) { .specimen { padding: 28px 30px 22px; } }
.specimen figcaption { font-size: 0.8125rem; color: var(--muted); margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.spec-title { font-family: var(--display); font-weight: 500; font-size: 1.0625rem; color: var(--navy); margin: 0 0 16px; }

.adj { margin: 6px 0 4px; }
.adj-bar { display: grid; gap: 3px; height: 34px; }
.adj-bar span { border-radius: 2px; }
.adj-bar .a1 { background: var(--slate); }
.adj-bar .a2 { background: var(--green); }
.adj-bar .a3 { background: repeating-linear-gradient(135deg, var(--green) 0 3px, var(--green-tint) 3px 7px); }
.adj-legend { display: grid; gap: 3px; margin-top: 10px; font-size: 0.875rem; line-height: 1.35; }
.adj-legend strong { display: block; font-family: var(--display); font-weight: 700; font-size: 1.375rem; color: var(--navy); letter-spacing: -0.01em; }
.adj-legend span { color: var(--muted); }
.adj-bar, .adj-legend { grid-template-columns: 7fr 28fr 14fr; }
.adj-legend > div { padding-right: 8px; }

.proof { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; list-style: none; margin: 0; padding: 0; }
@media (min-width: 800px) { .proof { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; } }
.proof li { border-top: 3px solid var(--navy); padding-top: 18px; }
.proof h3 { font-weight: 700; font-size: 1.1875rem; margin-bottom: 0.4em; }
.proof p { margin: 0; color: var(--muted); }

/* ---------- Help band ---------- */

.help-band { padding: 72px 0; }
@media (min-width: 900px) { .help-band { padding: 96px 0; } }
.help-band .band-bg { background-position: center 70%; }
.help-inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: end; }
@media (min-width: 900px) { .help-inner { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; } .help-inner .actions { justify-content: flex-end; } }
.help-band h2 { max-width: 24ch; }
.help-band p { max-width: 60ch; margin: 0; color: var(--on-dark); }
.help-band .actions { margin: 0; gap: 12px; }

/* ---------- Calculator pages ---------- */

.tool-wrap { margin-top: -72px; position: relative; z-index: 2; }
.tool { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; padding-bottom: 40px; }
@media (min-width: 960px) { .tool { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 28px; } }

.panel, .results { background: var(--white); border-radius: 6px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.panel { padding: 22px 18px; }
.results { padding: 22px 18px 24px; min-height: 160px; }
@media (min-width: 480px) { .panel { padding: 28px 26px; } .results { padding: 28px 30px 30px; } }

form fieldset { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
form legend { font-family: var(--display); font-weight: 500; color: var(--navy); padding: 0; margin-bottom: 10px; font-size: 1.0625rem; }
.fieldset-optional { border-top: 1px solid var(--line) !important; padding-top: 18px !important; }
.fieldset-optional legend { float: left; width: 100%; margin-bottom: 6px; }
.fieldset-optional legend + * { clear: both; }

.field { margin: 0 0 20px; }
.field > label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 0.96875rem; }
.hint { margin: 0 0 8px; color: var(--muted); font-size: 0.90625rem; line-height: 1.45; }

input[type="date"], input[type="number"], select {
  display: block; width: 100%; max-width: 100%; min-height: 48px; padding: 9px 12px;
  border: 1px solid #8a90a6; border-radius: var(--radius); background: var(--white); color: var(--ink);
  font: inherit; font-variant-numeric: tabular-nums;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="date"]:hover, input[type="number"]:hover, select:hover { border-color: var(--navy); }
input[type="number"] { max-width: 10rem; }
input:focus-visible, select:focus-visible { outline: none; border-color: var(--green-ink); box-shadow: 0 0 0 3px rgba(92, 165, 71, 0.35); }

.choice {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; margin-bottom: 8px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.choice:hover { border-color: #8a90a6; }
.choice:has(input:checked) { border-color: var(--green-ink); background: #f5faf3; box-shadow: inset 3px 0 0 var(--green); }
.choice input { margin: 3px 0 0; width: 20px; height: 20px; flex: none; accent-color: var(--green-ink); }
.choice strong { display: block; font-weight: 600; }
.choice .hint { display: block; margin: 2px 0 0; }

.check { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 2px 10px; align-items: start; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--green-ink); }
.check label { font-weight: 600; }
.check .hint { grid-column: 2; margin: 0; }

.panel .actions { margin-top: 6px; }
.panel .actions .btn:first-child { flex: 1 1 100%; }

.form-errors {
  border: 2px solid var(--error); border-radius: var(--radius); background: var(--white);
  padding: 12px 14px; margin-bottom: 18px; color: var(--error);
}
.form-errors p { margin: 0 0 4px; font-weight: 600; }
.form-errors ul { margin: 0; padding-left: 20px; color: var(--ink); }

/* ---------- Results ---------- */

.results:focus { outline: none; }
.results-empty { display: grid; place-items: center; text-align: center; min-height: 260px; color: var(--muted); padding: 12px; }
.results-empty p { margin: 0; max-width: 40ch; }
.results-empty::before {
  content: ""; display: block; width: 180px; height: 34px; margin: 0 auto 18px;
  background:
    linear-gradient(var(--line), var(--line)) center 16px / 100% 2px no-repeat,
    radial-gradient(circle, var(--line) 0 5px, transparent 6px) 0 8px / 45px 18px repeat-x;
}
.results-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.results-head h2 { margin: 0; font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem); }
.results-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.results-summary { color: var(--muted); margin-bottom: 20px; }
.group-title { margin: 28px 0 12px; font-size: 1.1875rem; font-weight: 500; }
.group-intro { margin: -4px 0 14px; color: var(--muted); max-width: 68ch; }

.callout-warn {
  background: var(--warn-bg); border-left: 4px solid var(--warn-line);
  padding: 12px 14px; margin: 0 0 14px; border-radius: 0 var(--radius) var(--radius) 0;
}
.callout-warn p { margin: 0; }

/* The programme: milestones down a rail, as on a construction programme */
.programme { list-style: none; margin: 0; padding: 0; position: relative; }
.programme::before {
  content: ""; position: absolute; left: 15px; top: 14px; bottom: 14px; width: 2px; background: var(--green);
}
.ms { position: relative; padding: 0 0 24px 52px; }
.ms:last-child { padding-bottom: 4px; }
.marker {
  position: absolute; left: 4px; top: 4px; width: 24px; height: 24px; transform: rotate(45deg);
  background: var(--navy); border: 2px solid var(--navy); border-radius: 3px; box-shadow: 0 0 0 4px var(--white);
}
.marker span {
  display: block; transform: rotate(-45deg); color: var(--white); font-weight: 600; font-size: 0.75rem;
  line-height: 20px; text-align: center; font-variant-numeric: tabular-nums;
}
.ms-input .marker { background: var(--white); border-color: var(--slate); }
.ms-input .marker span { color: var(--navy); }
.ms-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; }
.ms-title { margin: 0; font-family: var(--text); font-size: 1rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.ms-date {
  margin: 0; font-family: var(--display); font-size: 1.5rem; font-weight: 700; color: var(--navy);
  font-variant-numeric: tabular-nums; letter-spacing: -0.015em; white-space: nowrap; line-height: 1.2;
}
.ms-head { flex-direction: column; align-items: flex-start; }
.ms-input .ms-date { font-size: 1.125rem; font-weight: 500; color: var(--slate); }
.ms-action { margin: 6px 0 8px; max-width: 68ch; }
.ms-rule {
  margin: 0 0 4px; font-size: 0.90625rem; color: var(--ink); max-width: 72ch;
  background: var(--mist); border-radius: var(--radius); padding: 10px 12px;
}
.ms-rule .cite { font-weight: 600; }
.ms-rule .calc { display: block; color: var(--muted); }
.ms-rule .src { display: block; margin-top: 2px; }
.ms-note { margin: 4px 0 0; font-size: 0.90625rem; color: var(--muted); max-width: 72ch; }
.ms-alt { margin: 4px 0 0; font-size: 0.90625rem; max-width: 72ch; }
.ms-alt strong { font-variant-numeric: tabular-nums; }

/* New results arrive one milestone at a time, in programme order (only after "Work out the dates"). */
@media (prefers-reduced-motion: no-preference) {
  .is-new .ms { animation: rise 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
}
@keyframes rise { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }

.result-notes { margin: 22px 0 0; padding: 0; list-style: none; max-width: 72ch; }
.result-notes li { padding: 8px 0 8px 14px; border-left: 3px solid var(--line); margin-bottom: 8px; font-size: 0.90625rem; }
.result-foot { margin: 18px 0 0; font-size: 0.875rem; color: var(--muted); max-width: 72ch; }

/* Calendar */
.cal-wrap { margin-top: 32px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; padding: 0; list-style: none; font-size: 0.8125rem; color: var(--muted); }
.cal-legend li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 3px; border: 1px solid var(--line); }
.swatch.s-ms { background: var(--green-tint); border: 2px solid var(--green); }
.swatch.s-in { background: var(--white); border: 2px dashed var(--slate); }
.swatch.s-x { background: repeating-linear-gradient(135deg, rgba(224, 165, 38, 0.75) 0 2px, #fff 2px 6px); }
.swatch.s-wk { background: var(--mist); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; max-width: 580px; }
.cal-dow { font-size: 0.75rem; font-weight: 600; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cal-day {
  position: relative; min-height: 48px; padding: 4px 5px; border-radius: 3px; background: var(--white);
  border: 1px solid var(--line); font-size: 0.8125rem; font-variant-numeric: tabular-nums; line-height: 1.2;
}
.cal-day .mon { display: block; font-size: 0.6875rem; font-weight: 600; color: var(--slate); }
.cal-day.wk { background: var(--mist); }
.cal-day.out { opacity: 0.4; }
.cal-day.x { background: repeating-linear-gradient(135deg, rgba(224, 165, 38, 0.6) 0 2px, #fff 2px 6px); color: var(--ink); }
.cal-day.in { border: 2px dashed var(--slate); }
.cal-day.ms { background: var(--green-tint); border: 2px solid var(--green); font-weight: 600; }
.cal-day .badges { position: absolute; right: 2px; bottom: 2px; display: flex; flex-wrap: wrap-reverse; justify-content: flex-end; gap: 1px; max-width: 100%; }
.cal-day .badge {
  display: inline-block; min-width: 15px; height: 15px; padding: 0 2px; border-radius: 8px; background: var(--navy); color: var(--white);
  font-size: 0.625rem; line-height: 15px; text-align: center; font-weight: 600;
}
.cal-day.in .badge { background: var(--white); color: var(--navy); border: 1px solid var(--slate); line-height: 13px; }

/* ---------- Reference sections on the calculator pages ---------- */

.ref { padding: 56px 0; }
@media (min-width: 900px) { .ref { padding: 72px 0; } }
.ref + .ref { border-top: 1px solid var(--line); }
.ref-mist { background: var(--mist); }
.ref-mist + .ref, .ref + .ref-mist { border-top: 0; }
.ref-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 48px; }
@media (min-width: 900px) {
  .ref-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
  .ref-grid > h2 { position: sticky; top: 96px; align-self: start; }
}
.ref-grid > h2 { font-size: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem); }
.ref-body { max-width: 72ch; }
.ref-body > p:last-child { margin-bottom: 0; }

.rules { margin: 0; padding: 0; }
.rules > div { padding: 16px 0; border-top: 1px solid var(--line); }
.rules > div:last-child { border-bottom: 1px solid var(--line); }
.rules dt { font-family: var(--display); font-weight: 500; color: var(--navy); margin-bottom: 2px; }
.rules dd { margin: 0; }

.bullets { padding-left: 1.2em; }
.bullets li { margin-bottom: 8px; }

/* ---------- Simple pages (privacy, not found) ---------- */

.page-body { padding: 56px 0 72px; }
.page-body h2 { font-size: 1.375rem; margin-top: 1.6em; }
.page-body h2:first-child { margin-top: 0; }

/* ---------- Footer ---------- */

.site-footer { background: var(--navy-deep); color: var(--on-dark-muted); font-size: 0.9375rem; border-top: 4px solid var(--green); }
.site-footer a { color: var(--white); text-decoration-color: rgba(255, 255, 255, 0.4); }
.site-footer a:hover { text-decoration-color: var(--white); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 56px; padding-bottom: 40px; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 3fr) minmax(0, 3fr); gap: 48px; } }
.footer-about p { margin: 16px 0 0; max-width: 46ch; }
.footer-about .wordmark { text-decoration: none; }
.footer-h { margin: 0 0 10px; font-family: var(--display); font-weight: 500; color: var(--white); font-size: 1rem; }
.footer-list { list-style: none; margin: 0; padding: 0; }
.footer-list li { margin: 0 0 8px; }
.footer-base { border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: 18px; padding-bottom: 28px; font-size: 0.8125rem; }
.footer-base p { margin: 0 0 6px; max-width: 100ch; }

/* ---------- Print ---------- */

@media print {
  .site-header, .site-nav, .site-footer, .help-band, form, .results-tools, .skip, .no-print, .band-bg { display: none !important; }
  .page-hero { padding: 0 0 12px; background: none; color: var(--ink); }
  .page-hero h1, .page-hero .lede, .hero-note, .hero-note strong { color: var(--ink); }
  .tool-wrap { margin-top: 0; }
  .tool { display: block; }
  .results, .panel { box-shadow: none; border: 0; padding: 0; }
  body { font-size: 11pt; }
  .ms { break-inside: avoid; }
  a { color: inherit; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
.proof-foot { margin: 40px 0 0; color: var(--muted); font-size: 0.9375rem; max-width: 80ch; }
.page-hero-short { padding-bottom: 64px; }
@media (min-width: 900px) { .page-hero-short { padding-bottom: 72px; } }
@media (prefers-reduced-motion: no-preference) {
  .live:not(.play) .strip li, .live:not(.play) .strip::before { opacity: 0; }
  .live:not(.play) .gantt .on { background: rgba(255, 255, 255, 0.045); }
}
@media (max-width: 559px) {
  .adj-legend { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 14px; }
  .adj-legend > div { display: flex; align-items: baseline; gap: 10px; padding: 0 0 0 10px; border-left: 4px solid var(--slate); }
  .adj-legend > div:nth-child(2) { border-left-color: var(--green); }
  .adj-legend > div:nth-child(3) { border-left-color: var(--green-light); }
  .adj-legend strong { flex: none; min-width: 2.4em; }
}
/* Headings that receive focus from script (results, errors) do not need a visible ring. */
[tabindex="-1"]:focus { outline: none; }