/* Tools: the only new stylesheet in this prototype. It builds on the site's own tokens.css, styles.css, landing.css,
   guides.css and site.css, which are copied unchanged into assets/bearing. Same surface, same hairlines, same
   track-and-ball controls; no new colours. See README.md for what each part is for. */

/* ---------- Page furniture ---------- */
.proto-note {
  position: relative; padding: 11px 0 11px 22px; font-size: 13px; line-height: 1.55; color: var(--graphite-dim);
  border-bottom: 1px solid var(--hairline); text-wrap: pretty;
}
.proto-note::before { content: ""; position: absolute; left: 0; top: 17px; width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--graphite); }
.proto-note a, .tool-section a:not(.track-link):not(.race) { color: var(--graphite); text-decoration: underline; text-decoration-color: var(--track); text-underline-offset: 3px; }
.proto-note a:hover, .tool-section a:not(.track-link):not(.race):hover { text-decoration-color: var(--graphite); }

.tool-page .guide-head { padding-top: clamp(28px, 4vw, 56px); padding-bottom: clamp(28px, 3.4vw, 44px); }
.tool-page .guide-head .standfirst + .standfirst { margin-top: 12px; font-size: 16px; color: var(--graphite-dim); }

/* A section that opens on the ruled line with end ticks, like every section on the site. */
.tool-section { position: relative; margin-top: clamp(56px, 7vw, 104px); padding-top: clamp(32px, 4.2vw, 56px); }
.tool-section::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 7px;
  border-left: 1px solid var(--hairline); border-right: 1px solid var(--hairline);
  background: linear-gradient(var(--hairline), var(--hairline)) center / 100% 1px no-repeat;
}
.guide-head + .tool-section { margin-top: 0; }
.tool-section > h2, .tool-h2 { font-family: var(--serif); font-weight: 300; font-size: clamp(28px, 3vw, 42px); line-height: 1.1; letter-spacing: -0.015em; text-wrap: balance; max-width: 18em; }
.tool-lede { margin-top: 16px; max-width: 40em; font-size: 16.5px; line-height: 1.65; color: var(--graphite-dim); text-wrap: pretty; }
.mono-label { font-family: var(--mono); font-size: 11px; line-height: 1.5; letter-spacing: 0.08em; text-transform: uppercase; color: var(--graphite-dim); }
.small-print { max-width: 46em; font-size: 13.5px; line-height: 1.6; color: var(--graphite-dim); text-wrap: pretty; }
.small-print + .small-print { margin-top: 8px; }
[hidden] { display: none !important; }

/* Two columns on the site's 4:7 grid: the questions beside what they produce. */
.bench { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); column-gap: clamp(40px, 6vw, 96px); align-items: start; }
@media (max-width: 959px) { .bench { grid-template-columns: minmax(0, 1fr); row-gap: 48px; } }

/* ---------- Controls: a switch and a choice, both a ball on a track ---------- */
.switch { position: relative; display: flex; align-items: center; gap: 16px; min-height: 48px; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch-track { position: relative; flex: none; width: 30px; height: 7px; border-left: 1px solid var(--track); border-right: 1px solid var(--track); background: linear-gradient(var(--track), var(--track)) center / 100% 1px no-repeat; transition: border-color .3s; }
.switch-track::after { content: ""; position: absolute; left: 0; right: 0; top: 3px; height: 1px; background: var(--graphite); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.switch-track .ball { top: -1px; left: -5px; transition: left .5s var(--ease), transform .5s var(--ease), box-shadow .3s; }
.switch-text { font-family: var(--serif); font-size: 20px; line-height: 1.25; color: var(--graphite-dim); transition: color .3s; }
.switch input:checked ~ .switch-track { border-color: var(--graphite); }
.switch input:checked ~ .switch-track::after { transform: scaleX(1); }
.switch input:checked ~ .switch-track .ball { left: calc(100% - 4px); transform: rotate(360deg); }
.switch input:checked ~ .switch-text, .switch:hover .switch-text { color: var(--graphite); }
.switch input:focus-visible ~ .switch-track .ball { box-shadow: 0 0 0 2.5px var(--surface, var(--studio)), 0 0 0 3.5px var(--graphite); }
.switch input:focus-visible ~ .switch-track::after { height: 2px; top: 2.5px; transform: scaleX(1); }
.switch.is-small { min-height: 44px; gap: 14px; }
.switch.is-small .switch-text { font-family: var(--sans); font-size: 15px; }

.choice, .ask-group { min-width: 0; border: 0; }
.choice legend, .ask-group legend, .ask-q { padding: 0; font-size: 13.5px; line-height: 1.5; color: var(--graphite-dim); }
.choice-options { position: relative; display: flex; flex-wrap: wrap; column-gap: 22px; }
.choice label { position: relative; display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice label span { position: relative; padding: 9px 1px 12px; font-size: 15px; line-height: 1.4; color: var(--graphite-dim); transition: color .3s; }
.choice label span::before { content: ""; position: absolute; left: 0; right: 0; bottom: 5px; height: 1px; background: var(--track); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease), background .3s; }
.choice label:hover span, .choice input:checked + span { color: var(--graphite); }
.choice label:hover span::before { transform: scaleX(1); }
.choice input:checked + span::before { transform: scaleX(1); background: var(--graphite); }
.choice input:focus-visible + span::before { transform: scaleX(1); height: 2px; background: var(--graphite); }
/* One ball per group, rolled to the chosen option by tools.js. Without the script the drawn track marks the choice. */
.choice-ball { top: 0; left: 0; width: 7px; height: 7px; opacity: 0; pointer-events: none; transform: translate(var(--bx, 0px), var(--by, 0px)); transition: transform .7s var(--ease), opacity .3s; }
.choice-options.has-ball .choice-ball { opacity: 1; }
.choice-options:has(input:focus-visible) .choice-ball { box-shadow: 0 0 0 2.5px var(--surface, var(--studio)), 0 0 0 3.5px var(--graphite); }

/* ---------- The question sheet: one framed piece on the lifted surface ---------- */
.ask { --surface: var(--panel); background: var(--panel); border: 1px solid var(--hairline); padding: 22px clamp(18px, 2.2vw, 28px) 18px; }
.ask-title { padding-bottom: 12px; border-bottom: 1px solid var(--hairline); }
.ask-item { border-bottom: 1px solid var(--hairline); padding: 4px 0; }
.ask-more { padding: 2px 0 16px 46px; }
.ask-more > * + * { margin-top: 12px; }
.ask-more .field label { font-family: var(--sans); font-size: 13.5px; letter-spacing: 0; text-transform: none; }
.ask-more .field select, .ask-more .field input { font-size: 18px; }
.ask-pair { display: grid; grid-template-columns: minmax(0, 5rem) minmax(0, 1fr); column-gap: 16px; align-items: end; }
.ask-pair.has-last { grid-template-columns: minmax(0, 7.4rem) minmax(0, 1fr); }
.ask-group + .ask-group { margin-top: 14px; }
.ask-pair .field-choice::after { top: 16px; }
.ask-more .field-choice::after { top: 32px; }
.ask-more .ask-pair .field-choice::after { top: 16px; }
.ask-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 20px; padding-top: 10px; }
.ask-live { padding-top: 14px; font-size: 14px; line-height: 1.55; color: var(--graphite); text-wrap: pretty; }
.ask .track-link:focus-visible .ball { box-shadow: 0 0 0 2.5px var(--panel), 0 0 0 3.5px var(--graphite); }
@media (max-width: 759px) {
  .ask { margin: 0 calc(-1 * var(--pad-x) + 8px); padding: 20px 16px 14px; }
  .ask-more { padding-left: 0; }
}

/* ---------- The year on one line ---------- */
.yl-basis { max-width: 46em; font-size: 14.5px; line-height: 1.55; color: var(--graphite-dim); text-wrap: pretty; }
.yl-basis .mono-label { margin-right: 10px; color: var(--graphite); }
.yl-readout { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 32px; align-items: end; margin-top: 14px; }
.yl-date { font-family: var(--serif); font-weight: 300; font-size: clamp(36px, 5.4vw, 76px); line-height: 1.02; letter-spacing: -0.022em; font-variant-numeric: lining-nums; }
.yl-date small { font-size: 0.42em; letter-spacing: 0; color: var(--graphite-dim); white-space: nowrap; }
.yl-what { margin-top: 12px; max-width: 34em; font-size: 17px; line-height: 1.5; color: var(--graphite); text-wrap: pretty; }
.yl-away { margin-top: 4px; font-size: 14.5px; line-height: 1.5; color: var(--graphite-dim); }
.yl-step { display: flex; column-gap: 20px; }
.yl-text { min-height: 9.4em; }

.yl-track { position: relative; height: 96px; margin-top: 20px; cursor: pointer; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.yl-rule { position: absolute; left: 0; right: 0; top: 43px; height: 7px; border-left: 1px solid var(--track); border-right: 1px solid var(--track); background: linear-gradient(var(--track), var(--track)) center / 100% 1px no-repeat; }
.yl-progress { position: absolute; left: 0; top: 46px; width: var(--to, 0%); height: 1px; background: var(--graphite); pointer-events: none; transition: width .7s var(--ease); }
.yl-today { position: absolute; left: 0; top: 12px; }
.yl-beat { position: absolute; left: var(--x); top: 33px; width: 1px; height: 7px; margin-left: -0.5px; background: var(--track); }
.yl-month { position: absolute; left: var(--x); top: 50px; width: 1px; height: 6px; margin-left: -0.5px; background: var(--track); }
.yl-month > span { position: absolute; top: 12px; left: 4px; white-space: nowrap; }
.yl-month > b { position: absolute; top: 28px; left: 4px; font-weight: 400; }
.yl-month .yl-m1 { display: none; }
.yl-stop { position: absolute; left: var(--x); top: 22px; width: 24px; height: 48px; margin-left: -12px; padding: 0; border-radius: 0; }
.yl-stop .ball { left: 7.5px; top: 20px; transition: box-shadow .3s, transform .3s var(--ease); }
.yl-stop[data-lift="1"] .ball { top: 7px; }
.yl-stop[data-lift="2"] .ball { top: -6px; }
.yl-stop.is-mark .ball { background: var(--studio); box-shadow: inset 0 0 0 1px var(--graphite); }
.yl-stop:hover .ball { transform: scale(1.3); }
.yl-stop[aria-current="true"] .ball { transform: scale(1.22); box-shadow: 0 0 0 3px var(--studio), 0 0 0 4px var(--graphite); }
.yl-stop.is-mark[aria-current="true"] .ball { box-shadow: inset 0 0 0 1px var(--graphite), 0 0 0 3px var(--studio), 0 0 0 4px var(--graphite); }
.yl-stop:focus-visible { outline: none; }
.yl-track:has(.yl-stop:focus-visible) .yl-progress { height: 2px; top: 45.5px; }
.yl-stop:focus-visible .ball { box-shadow: 0 0 0 2.5px var(--studio), 0 0 0 4.5px var(--graphite); }
@keyframes yl-arrive { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@keyframes yl-fade { from { opacity: 0; } to { opacity: 1; } }
.yl-stop.is-new .ball { animation: yl-arrive .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.yl-beat.is-new { animation: yl-fade .5s ease both; }
.yl-key { display: flex; flex-wrap: wrap; gap: 6px 28px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hairline); font-size: 13px; line-height: 1.5; color: var(--graphite-dim); }
.yl-key span { position: relative; padding-left: 18px; }
.yl-key .k-hint { margin-left: auto; padding-left: 0; }
.yl-key i { position: absolute; left: 0; top: 5px; }
.yl-key .k-ball { width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 32% 30%, #fff 0 12%, #c9ccd2 34%, #6b7078 78%, #3a3e44 100%); }
.yl-key .k-mark { width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--graphite); }
.yl-key .k-beat { left: 4px; top: 4px; width: 1px; height: 9px; background: var(--track); }
@media (max-width: 759px) {
  .yl-readout { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .yl-text { min-height: 11.6em; }
  .yl-step { justify-content: space-between; }
  .yl-key { flex-direction: column; gap: 4px; margin-top: 14px; }
  .yl-key .k-hint { margin-left: 0; margin-top: 4px; }
  .yl-what { font-size: 16px; }
  .yl-month > span, .yl-month > b { left: 2px; font-size: 10px; letter-spacing: 0.02em; }
  .yl-month .yl-m3 { display: none; }
  .yl-month .yl-m1 { display: inline; }
}

/* ---------- The dates, month by month ---------- */
.dates-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; }
.dates-count { font-size: 14.5px; color: var(--graphite-dim); }
.dates-month { margin-top: 40px; }
.dates-month:first-of-type { margin-top: 28px; }
.dates-month > h3 { padding-bottom: 10px; border-bottom: 1px solid var(--track); font-weight: 400; }
.dates-list { list-style: none; }
.due { position: relative; display: grid; grid-template-columns: 5rem minmax(0, 1fr); column-gap: 20px; padding: 20px 0 14px; border-bottom: 1px solid var(--hairline); scroll-margin-top: 28px; }
.due-when { display: flex; flex-direction: column; }
.due-day { font-family: var(--serif); font-weight: 300; font-size: 40px; line-height: 0.95; letter-spacing: -0.02em; font-variant-numeric: lining-nums; }
.due-dow { margin-top: 8px; }
.due h4 { font-family: var(--serif); font-weight: 400; font-size: 21px; line-height: 1.25; letter-spacing: -0.005em; text-wrap: balance; }
.due-to { margin-top: 4px; font-size: 13.5px; line-height: 1.5; color: var(--graphite-dim); }
.due-payby { margin-top: 6px; font-size: 15px; line-height: 1.5; font-weight: 500; color: var(--graphite); }
.due-covers { margin-top: 8px; max-width: 36em; font-size: 15px; line-height: 1.6; color: var(--graphite-dim); text-wrap: pretty; }
.due-note { margin-top: 10px; max-width: 36em; padding-left: 14px; border-left: 1px solid var(--graphite); font-size: 14px; line-height: 1.55; color: var(--graphite); text-wrap: pretty; }
.due.is-mark h4 { font-weight: 300; font-style: italic; }
.due.is-mark .due-day { color: var(--graphite-dim); }
.due::before {
  content: ""; position: absolute; left: -24px; top: 34px; width: 9px; height: 9px; border-radius: 50%; opacity: 0; transform: translateX(-12px);
  background: radial-gradient(circle at 32% 30%, #fff 0 12%, #c9ccd2 34%, #6b7078 78%, #3a3e44 100%); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: opacity .3s, transform .6s var(--ease);
}
.due.is-picked::before { opacity: 1; transform: none; }
.workings { margin-top: 2px; }
.workings summary { list-style: none; cursor: pointer; }
.workings summary::-webkit-details-marker { display: none; }
.workings[open] summary { color: var(--graphite); }
.workings[open] summary::before { transform: scaleX(1); }
.workings dl { max-width: 36em; margin: 2px 0 12px; border-bottom: 1px solid var(--hairline); }
.workings dl > div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); column-gap: 16px; padding: 8px 0; border-top: 1px solid var(--hairline); }
.workings dt { padding-top: 3px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--graphite-dim); }
.workings dd { font-size: 14.5px; line-height: 1.55; color: var(--graphite-dim); }
.workings dd a { overflow-wrap: anywhere; }

.routine-list { list-style: none; }
.routine-list li { display: grid; grid-template-columns: 5rem minmax(0, 1fr); column-gap: 20px; padding: 16px 0 18px; border-bottom: 1px solid var(--hairline); }
.routine-day { font-family: var(--serif); font-weight: 300; font-size: 26px; line-height: 1.1; letter-spacing: -0.01em; }
.routine-list h4 { font-family: var(--serif); font-weight: 400; font-size: 19px; line-height: 1.3; }
.routine-list p { margin-top: 4px; max-width: 36em; font-size: 15px; line-height: 1.6; color: var(--graphite-dim); }
.left-out { list-style: none; margin-top: 36px; }
.left-out li { position: relative; max-width: 40em; padding: 0 0 10px 18px; font-size: 14px; line-height: 1.6; color: var(--graphite-dim); }
.left-out li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 8px; height: 1px; background: var(--track); }
.dates-empty { margin-top: 28px; max-width: 30em; font-family: var(--serif); font-weight: 300; font-size: 24px; line-height: 1.3; color: var(--graphite); }
.take { display: flex; flex-wrap: wrap; align-items: center; gap: 0 28px; margin-top: 28px; }
.take-said { flex-basis: 100%; min-height: 1.6em; font-size: 13.5px; line-height: 1.6; color: var(--graphite-dim); }

@media (max-width: 759px) {
  /* On a phone the list is the line turned on its side: a track down the left, a ball at each date. */
  .dates-list { position: relative; padding-left: 30px; }
  .dates-list::before { content: ""; position: absolute; left: 4px; top: 22px; bottom: 16px; width: 1px; background: var(--track); }
  .due { grid-template-columns: minmax(0, 1fr); row-gap: 6px; }
  .due-when { flex-direction: row; align-items: baseline; gap: 10px; }
  .due-day { font-size: 30px; }
  .due-dow { margin-top: 0; }
  .due::before { left: -30px; top: 30px; opacity: 1; transform: none; transition: box-shadow .3s; }
  .due.is-mark::before { background: var(--studio); box-shadow: inset 0 0 0 1px var(--graphite); }
  .due.is-picked::before { box-shadow: 0 0 0 3px var(--studio), 0 0 0 4px var(--graphite); }
  .workings dl > div, .routine-list li { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
}

/* ---------- The note to take away ---------- */
.note-dialog { margin: auto; padding: 0; width: min(calc(100vw - 32px), 620px); max-height: calc(100dvh - 24px); overflow: auto; border: 1px solid var(--hairline); background: var(--panel); color: var(--graphite); --surface: var(--panel); }
.note-dialog[open] { animation: film-in .45s var(--ease); }
.note-dialog::backdrop { background: rgba(30, 33, 36, 0.22); backdrop-filter: blur(2px); }
.note-inner { padding: 20px clamp(20px, 4vw, 32px) 24px; }
.note-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 12px; }
.note-head h2 { padding-top: 6px; font-family: var(--serif); font-weight: 300; font-size: clamp(24px, 3.4vw, 30px); line-height: 1.12; letter-spacing: -0.012em; text-wrap: balance; }
.note-text { display: block; width: 100%; min-height: 240px; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--hairline); border-radius: 0; background: var(--studio); color: var(--graphite); font-family: var(--mono); font-size: 12.5px; line-height: 1.6; resize: vertical; }
.note-text:focus-visible { outline-offset: 2px; }
.note-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0 28px; margin-top: 8px; }
.note-dialog .race:focus-visible .ball, .note-dialog .track-link:focus-visible .ball { box-shadow: 0 0 0 2.5px var(--panel), 0 0 0 3.5px var(--graphite); }

/* ---------- Making Tax Digital check ---------- */
.mtd-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(20px, 3vw, 40px); row-gap: 18px; margin-top: 18px; }
.money-in { position: relative; display: block; }
.money-in::before { content: "£"; position: absolute; left: 0; top: 8px; font-family: var(--serif); font-size: 20px; line-height: 1.35; color: var(--graphite-dim); }
.field .money-in input { padding-left: 0.85em; font-variant-numeric: lining-nums tabular-nums; }
.mtd-total { margin-top: 18px; font-size: 14.5px; line-height: 1.55; color: var(--graphite-dim); }
.mtd-total strong { font-weight: 500; color: var(--graphite); font-variant-numeric: tabular-nums; }
@media (max-width: 559px) { .mtd-fields { grid-template-columns: minmax(0, 1fr); } }

.thr { position: relative; height: 104px; margin-top: clamp(36px, 5vw, 56px); }
.thr-rule { position: absolute; left: 0; right: 0; top: 45px; height: 7px; border-left: 1px solid var(--track); border-right: 1px solid var(--track); background: linear-gradient(var(--track), var(--track)) center / 100% 1px no-repeat; }
.thr-fill { position: absolute; left: 0; top: 48px; width: var(--pos, 0%); height: 1px; background: var(--graphite); transition: width .9s var(--ease); }
.thr-band { position: absolute; top: 8px; left: var(--x); width: 25%; padding: 0 4px; text-align: center; transition: color .4s; }
.thr-band.is-on { color: var(--graphite); }
.thr-mark { position: absolute; left: var(--x); top: 40px; width: 1px; height: 17px; margin-left: -0.5px; background: var(--track); }
.thr-mark span { position: absolute; top: 26px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-variant-numeric: lining-nums; }
.thr-ball { top: 42px; left: var(--pos, 0%); width: 13px; height: 13px; margin-left: -6.5px; transform: rotate(var(--turn, 0deg)); transition: left .9s var(--ease), transform .9s var(--ease); }
@media (max-width: 559px) { .thr-band, .thr-mark span { font-size: 10px; letter-spacing: 0.03em; } }

.answer { margin-top: clamp(28px, 4vw, 44px); }
.answer-lead { font-family: var(--serif); font-weight: 300; font-size: clamp(34px, 4.6vw, 64px); line-height: 1.04; letter-spacing: -0.02em; text-wrap: balance; font-variant-numeric: lining-nums; }
.answer-lead em { color: var(--graphite-dim); }
.answer-why { margin-top: 18px; max-width: 38em; font-size: 17px; line-height: 1.6; color: var(--graphite); text-wrap: pretty; }
.answer-why + .answer-why { margin-top: 10px; font-size: 15.5px; color: var(--graphite-dim); }

/* Four updates on one track: the same stations as the site's engagement line. */
.quarters { position: relative; list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: clamp(20px, 3vw, 44px); margin-top: clamp(28px, 4vw, 44px); }
.quarters::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 1px; background: var(--track); }
.quarter { position: relative; padding-top: 32px; }
.quarter .ball { top: 0; left: 0; }
.quarter.is-next .ball { box-shadow: 0 0 0 3px var(--studio), 0 0 0 4px var(--graphite); }
.quarter.is-past .ball { background: var(--studio); box-shadow: inset 0 0 0 1px var(--track); }
.quarter.is-past .quarter-date, .quarter.is-past p { color: var(--graphite-dim); }
.quarter-date { margin-top: 6px; font-family: var(--serif); font-weight: 400; font-size: clamp(20px, 1.9vw, 25px); line-height: 1.2; letter-spacing: -0.008em; font-variant-numeric: lining-nums; }
.quarter p { margin-top: 8px; font-size: 14.5px; line-height: 1.55; color: var(--graphite-dim); }
@media (max-width: 759px) {
  .quarters { grid-template-columns: minmax(0, 1fr); row-gap: 26px; padding-left: 30px; }
  .quarters::before { left: 4px; right: auto; top: 6px; bottom: 6px; width: 1px; height: auto; }
  .quarter { padding-top: 0; }
  .quarter .ball { left: -30px; top: 3px; }
}

/* Ruled lists used on every tool page. */
.ruled { list-style: none; max-width: 46em; margin-top: 24px; border-bottom: 1px solid var(--hairline); }
.ruled > li { padding: 14px 0 16px; border-top: 1px solid var(--hairline); font-size: 15.5px; line-height: 1.6; color: var(--graphite-dim); text-wrap: pretty; }
.ruled > li strong { font-weight: 500; color: var(--graphite); }
.fees { width: 100%; max-width: 46em; margin-top: 24px; border-collapse: collapse; font-size: 15px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.fees caption { caption-side: top; padding-bottom: 10px; text-align: left; font-size: 13.5px; color: var(--graphite-dim); }
.fees th, .fees td { padding: 11px 16px 11px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--hairline); font-weight: 400; }
.fees thead th { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--graphite-dim); border-bottom-color: var(--track); vertical-align: bottom; }
.fees .num { text-align: right; }
.fees td.num { white-space: nowrap; }
.fees th[scope="row"] { min-width: 6.5em; }
.fees th:last-child, .fees td:last-child { padding-right: 0; }

/* ---------- What's taking too long ---------- */
.jobs { list-style: none; counter-reset: job; }
.job { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1.3fr) minmax(0, 1.5fr) auto; column-gap: clamp(14px, 2vw, 28px); align-items: end; padding: 14px 0 10px; border-bottom: 1px solid var(--hairline); }
.job .field label { font-size: 11px; }
.job .field input, .job .field select { font-size: 18px; }
.job-time { display: grid; grid-template-columns: minmax(0, 3.2rem) minmax(0, 1fr); column-gap: 10px; align-items: end; }
.job-time > label { grid-column: 1 / -1; }
.job .field-choice::after { top: 30px; }
.job .job-time .field-choice::after { top: 16px; }
.job-remove { align-self: end; }
.jobs-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 28px; padding-top: 10px; }
.ask.is-wide { padding-top: 18px; }
@media (max-width: 899px) {
  .job { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: 12px; padding: 18px 0 8px; }
  .job-name { grid-column: 1 / -1; }
  .job-remove { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 479px) {
  .job { grid-template-columns: minmax(0, 1fr); }
}

.tally-total { font-family: var(--serif); font-weight: 300; font-size: clamp(34px, 4.6vw, 64px); line-height: 1.04; letter-spacing: -0.02em; text-wrap: balance; font-variant-numeric: lining-nums; }
.tally-total em { color: var(--graphite-dim); }
.tally-sub { margin-top: 16px; max-width: 36em; font-size: 17px; line-height: 1.6; color: var(--graphite); text-wrap: pretty; }
.tally { list-style: none; margin-top: clamp(32px, 4vw, 48px); border-bottom: 1px solid var(--hairline); }
.tally li { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); column-gap: clamp(28px, 5vw, 72px); align-items: center; padding: 18px 0 20px; border-top: 1px solid var(--hairline); }
.tally-name { font-family: var(--serif); font-size: clamp(19px, 1.7vw, 22px); line-height: 1.25; text-wrap: balance; }
.tally-who { display: block; margin-top: 4px; font-family: var(--sans); font-size: 13.5px; line-height: 1.5; color: var(--graphite-dim); }
.tally-run { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 20px; align-items: center; }
.tally-bar { position: relative; height: 9px; }
.tally-bar::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 1px; background: var(--hairline); }
.tally-bar::after { content: ""; position: absolute; left: 0; top: 4px; width: var(--w, 0%); height: 1px; background: var(--graphite); transition: width .9s var(--ease); }
.tally-bar .ball { top: 0; left: var(--w, 0%); margin-left: -4.5px; transition: left .9s var(--ease); }
.tally-hours { min-width: 7.5em; text-align: right; font-size: 15px; line-height: 1.4; color: var(--graphite); font-variant-numeric: tabular-nums; }
.tally-hours small { display: block; font-size: 13px; color: var(--graphite-dim); }
.tally-pick { margin-top: 2px; }
.tally li.is-first .tally-pick { color: var(--graphite); }
.tally li.is-first .tally-pick::before { transform: scaleX(1); }
.tally li.is-first .tally-bar .ball { box-shadow: 0 0 0 3px var(--studio), 0 0 0 4px var(--graphite); }
@media (max-width: 759px) {
  .tally li { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
  .tally-hours { min-width: 6.4em; }
}

/* ---------- Hub ---------- */
.tool-rows .row-text .track-link, .tool-rows .row-text .race { margin-top: 6px; }
.rows.tool-rows h3 a:not(.track-link):not(.race) { color: inherit; text-decoration: none; }
.rows.tool-rows h3 a:not(.track-link):not(.race):hover { text-decoration: underline; text-decoration-color: var(--track); text-underline-offset: 4px; }
.rows.tool-rows .status { margin-top: 10px; padding-left: 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--graphite-dim); }
.rows.tool-rows > li:first-child { border-top: 0; }
.tool-need { display: block; margin-top: 10px; font-size: 13.5px; line-height: 1.5; color: var(--graphite-dim); }

/* On the hub the first section opens on the year line itself: the same ruled line with end ticks, carrying the
   example year's dates. A still made from the real thing; it isn't interactive. */
.tool-section.has-line::before { display: none; }
.tool-section.has-line { padding-top: clamp(20px, 2.6vw, 32px); }
.hub-line { position: absolute; left: 0; right: 0; top: -13px; height: 30px; }
.hub-line .yl-rule { top: 10px; border-color: var(--hairline); background-image: linear-gradient(var(--hairline), var(--hairline)); }
.hub-line .yl-beat { top: 2px; height: 6px; background: var(--hairline); }
.hub-line i { position: absolute; left: var(--x); top: 9px; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: radial-gradient(circle at 32% 30%, #fff 0 12%, #c9ccd2 34%, #6b7078 78%, #3a3e44 100%); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }

/* Parts that only work with scripts stay out of the way without them; the written rule or a plain sentence is shown
   instead. flag.js, loaded in the head, adds the class before anything is drawn. */
html:not(.js) .needs-js { display: none !important; }

/* While a page sets itself up from its address, nothing rolls: the first state is simply shown. */
.is-setting .ball, .is-setting .switch-track, .is-setting .switch-track::after, .is-setting .switch-text,
.is-setting .yl-progress, .is-setting .choice label span, .is-setting .choice label span::before { transition: none !important; }

/* ---------- Small helpers, so no page needs a style attribute (the site's policy is style-src 'self') ---------- */
.gap-0 { margin-top: 0; }
.gap-s { margin-top: 12px; }
.gap-m { margin-top: 20px; }
.gap-l { margin-top: 28px; }
.at-0 { --x: 0%; }
.at-25 { --x: 25%; }
.at-50 { --x: 50%; }
.at-75 { --x: 75%; }
.wide-note { max-width: 46em; }
.push-left { margin-left: 16px; }

/* ---------- Print: the dates as a sheet of paper ---------- */
@media print {
  @page { margin: 16mm 14mm; }
  html, body { background: #fff !important; }
  /* Browsers leave backgrounds out of print, and the line is drawn with them, so the sheet prints the list only. */
  .site-header, .site-menu, .skip-link, .proto-note, .ask, .take, .yl-readout, .yl-track, .yl-key, .thr, .footer-index, .footer-contact, .guide-enquiry, .note-dialog, .no-print { display: none !important; }
  .tally-bar { display: none; }
  .tally-run { display: block; }
  .tally-hours { text-align: left; }
  .jobs-foot, .job-remove { display: none !important; }
  .tally-pick { display: none; }
  .tally li.is-first .tally-name::after { content: " (the one to look at first)"; font-family: var(--sans); font-size: 13.5px; color: var(--graphite-dim); }
  .guide-page main { padding: 0; }
  .guide-head { padding: 0 0 16px; }
  .guide-head .crumbs { display: none; }
  .bench { display: block; }
  .tool-section { margin-top: 20px; padding-top: 16px; }
  .yl-text { min-height: 0; }
  .due { break-inside: avoid; padding: 12px 0 10px; }
  .due::before { display: none; }
  .dates-month > h3 { break-after: avoid; }
  .workings summary { display: none; }
  .site-footer { margin-top: 24px; }
}

/* ---------- Follow the money across month end: one real payout, drawn to scale ----------
   Every bar shares one scale (the amount owed at the close is the full width). An outlined part is still open;
   a filled part has been matched. The widths below are the published figures; monthend.js sets the same values. */
.mm-draw { --a: 13.5976%; --b: 41.9438%; --c: 44.4586%; --next: 13.9943%; margin-top: 8px; }
.mm-row + .mm-row { margin-top: 26px; }
.mm-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; padding-bottom: 10px; }
.mm-fig { font-family: var(--serif); font-size: clamp(19px, 1.9vw, 24px); line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; }
.mm-bar { position: relative; display: flex; align-items: flex-end; height: 30px; padding-top: 18px; }
.mm-seg { position: relative; flex: none; height: 12px; box-shadow: inset 0 0 0 1px var(--track); transition: background-color .6s var(--ease), box-shadow .6s var(--ease); }
.mm-seg + .mm-seg { margin-left: -1px; }
.mm-seg.is-a { width: var(--a); }
.mm-seg.is-b { width: calc(var(--b) + 1px); }
.mm-seg.is-c { width: calc(var(--c) + 1px); }
.mm-seg.is-on { background-color: #3d4247; box-shadow: inset 0 0 0 1px #3d4247; }
.mm-seg > i, .mm-sliver > i { position: absolute; left: 0; top: -18px; font-family: var(--mono); font-size: 11px; font-style: normal; line-height: 1; color: var(--graphite-dim); }
.mm-sliver { position: relative; flex: none; width: 1px; height: 22px; margin-left: 9px; background: var(--track); transition: background-color .6s var(--ease); }
.mm-sliver.is-on { background: var(--graphite); }
.mm-sliver > i { top: -8px; left: 6px; }
/* Once everything is matched, the reserve still held is divided into its two published parts. */
.mm-split { position: absolute; left: var(--next); top: -4px; bottom: -4px; width: 1px; background: var(--graphite); opacity: 0; transition: opacity .6s ease .5s; }
.mm-draw.is-done .mm-split { opacity: 1; }
.mm-under { display: flex; gap: 16px; padding-top: 8px; font-size: 13px; line-height: 1.5; color: var(--graphite-dim); font-variant-numeric: lining-nums; }
.mm-under .is-a { flex: none; min-width: var(--a); white-space: nowrap; }
.mm-under .is-b { flex: none; min-width: calc(var(--b) - 16px); white-space: nowrap; }
.mm-bench { margin-top: clamp(36px, 5vw, 60px); }
.mm-letter { display: inline-block; min-width: 1.5em; font-family: var(--mono); font-size: 12px; color: var(--graphite-dim); }
.mm-sub { padding: 0 0 12px 46px; font-size: 13.5px; line-height: 1.55; color: var(--graphite-dim); text-wrap: pretty; }
.mm-rest { margin-top: clamp(28px, 3.6vw, 40px); }
.answer-lead.is-small { font-size: clamp(26px, 3vw, 38px); }
.own-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(16px, 2.4vw, 32px); row-gap: 18px; padding-top: 4px; }
.own-fields .field label { font-size: 11px; }
.ask + .answer { margin-top: clamp(24px, 3vw, 36px); }
.answer + .mm-draw { margin-top: 24px; }
@media (max-width: 759px) {
  .mm-sub { padding-left: 0; }
  .own-fields { grid-template-columns: minmax(0, 1fr); }
  .mm-under { flex-direction: column; gap: 0; }
}
@media print {
  .mm-row.needs-js { display: none; }
}

/* The two bars as one figure: what was owed above, the payout directly beneath, joined by short projection lines
   at each boundary, the way a drawing carries a dimension from one view to the next. */
.mm-pair .mm-bar.is-bottom { height: 26px; padding-top: 14px; }
.mm-pair .mm-bar.is-bottom .mm-seg::before, .mm-pair .mm-bar.is-bottom .mm-seg::after {
  content: ""; position: absolute; bottom: 100%; width: 1px; height: 14px; background: var(--track); transition: background-color .6s var(--ease);
}
.mm-pair .mm-bar.is-bottom .mm-seg::before { left: 0; }
.mm-pair .mm-bar.is-bottom .mm-seg::after { right: 0; }
.mm-pair .mm-bar.is-bottom .mm-seg.is-b::before { display: none; }
.mm-pair .mm-bar.is-bottom .mm-seg.is-on::before, .mm-pair .mm-bar.is-bottom .mm-seg.is-on::after { background: #3d4247; }
.mm-pair .mm-bar.is-bottom .mm-sliver { height: 12px; margin-left: 9px; }
.mm-pair .mm-bar.is-bottom .mm-sliver > i { top: 0; left: 7px; }
.mm-row-head.is-below { padding: 10px 0 0; }
.mm-key { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 28px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hairline); font-size: 13px; line-height: 1.5; color: var(--graphite-dim); font-variant-numeric: lining-nums; }
.mm-key b { display: inline-block; min-width: 1.4em; font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--graphite); }
.mm-pair + .mm-row { margin-top: 34px; }
.mm-behind { margin-top: 10px; max-width: 38em; font-size: 15px; line-height: 1.6; color: var(--graphite-dim); text-wrap: pretty; }
.mm-field { display: flex; flex-wrap: wrap; gap: 5px 4px; margin-top: 16px; max-width: 46em; }
.mm-field i { width: 2px; height: 8px; background: rgba(30, 33, 36, 0.6); }
@keyframes mm-mark { from { opacity: 0; } to { opacity: 1; } }
.mm-rest:not([hidden]) .mm-field i { animation: mm-mark .25s ease both; animation-delay: calc(var(--n) * 1.1ms); }
@media (max-width: 759px) {
  .mm-key { flex-direction: column; gap: 2px; }
}

/* ---------- Match the paperwork: a small model of the bookkeeping workflow (made-up data) ---------- */
.bench-stations .quarter p + p { margin-top: 8px; font-size: 14.5px; line-height: 1.5; color: var(--graphite); font-variant-numeric: lining-nums; }
.bench-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0 28px; margin-top: clamp(28px, 4vw, 44px); }
.bench-say { min-height: 3.2em; margin-top: 10px; max-width: 44em; font-size: 16.5px; line-height: 1.6; color: var(--graphite); text-wrap: pretty; }
.bench-lists { margin-top: clamp(20px, 3vw, 32px); grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.bench-head { padding-bottom: 10px; border-bottom: 1px solid var(--track); font-weight: 400; }
.bench-list { list-style: none; }
.bench-paper, .bench-pay { position: relative; display: grid; column-gap: 14px; row-gap: 2px; align-items: baseline; padding: 13px 0 14px; border-bottom: 1px solid var(--hairline); }
.bench-paper { grid-template-columns: minmax(0, 1fr) auto; }
.bench-paper > .mono-label { grid-column: 1 / -1; }
.bench-pay { grid-template-columns: 18px 3.6rem minmax(0, 1fr) auto; }
.bench-what { font-size: 15.5px; line-height: 1.45; color: var(--graphite); text-wrap: pretty; }
.bench-amount { font-size: 15.5px; line-height: 1.45; color: var(--graphite); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.bench-mark { position: relative; align-self: center; width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--track); }
.bench-mark .ball { top: 0; left: 0; }
.bench-pay.is-matched .bench-mark, .bench-pay.is-transfer .bench-mark { box-shadow: none; }
.bench-pay.is-person .bench-mark, .bench-pay.is-chase .bench-mark { box-shadow: inset 0 0 0 1px var(--graphite), 0 0 0 3px var(--studio), 0 0 0 4px var(--graphite); }
.bench-state { grid-column: 3 / -1; font-size: 13px; line-height: 1.5; color: var(--graphite-dim); }
.bench-paper .bench-state { grid-column: 1 / -1; }
.bench-pay.is-person .bench-state, .bench-pay.is-chase .bench-state { color: var(--graphite); font-weight: 500; }
.bench-attached { grid-column: 3 / -1; margin-top: 6px; padding: 6px 0 0 12px; border-left: 1px solid var(--graphite); font-size: 13.5px; line-height: 1.5; color: var(--graphite-dim); font-variant-numeric: lining-nums; }
.bench-paper.is-refused .bench-what, .bench-paper.is-refused .bench-amount { color: var(--graphite-dim); text-decoration: line-through; text-decoration-color: var(--track); }
.bench-empty { padding: 13px 0 14px; border-bottom: 1px solid var(--hairline); font-size: 15px; color: var(--graphite-dim); }
@keyframes bench-in { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.is-new > .bench-attached, .is-new > .bench-state { animation: bench-in .5s var(--ease) both; }
.bench-queue { list-style: none; border-bottom: 1px solid var(--hairline); }
.bench-case { padding: 18px 0 16px; border-top: 1px solid var(--hairline); }
.bench-ask { max-width: 34em; font-family: var(--serif); font-size: clamp(19px, 1.8vw, 22px); line-height: 1.3; text-wrap: balance; font-variant-numeric: lining-nums; }
.bench-actions { display: flex; flex-wrap: wrap; gap: 0 28px; margin-top: 6px; }
.bench-actions [aria-pressed="true"] { color: var(--graphite); }
.bench-actions [aria-pressed="true"]::before { transform: scaleX(1); background: var(--graphite); }
.bench-outcome { max-width: 38em; margin-top: 8px; padding-left: 14px; border-left: 1px solid var(--graphite); font-size: 15px; line-height: 1.6; color: var(--graphite); text-wrap: pretty; }
.bench-end { margin-top: 20px; max-width: 38em; font-size: 15.5px; line-height: 1.6; color: var(--graphite-dim); text-wrap: pretty; }
@media (max-width: 959px) { .bench-lists { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 479px) {
  .bench-pay { grid-template-columns: 18px minmax(0, 1fr) auto; }
  .bench-date { grid-column: 2 / -1; }
  .bench-pay .bench-what { grid-column: 2; }
  .bench-pay .bench-state, .bench-pay .bench-attached { grid-column: 2 / -1; }
}
