/* The newer free tools: mileage claims, locum take-home, rota and pay checker. Builds on tax.css (cards, tabs,
   rows, notes, reading sections), so every calculator looks like one family. */

/* a block the page hides stays hidden, whatever display its class gives it (the results before a rota, say) */
[hidden] { display: none !important; }

/* a big number box with its unit after it ("1,200 miles") */
.money-field--unit span { order: 2; font-family: var(--sans); font-size: 18px; letter-spacing: 0; }
.tabs--four label { flex: 1 1 0; min-width: 0; }
.tabs--four span { padding-left: 8px; padding-right: 8px; }
.sub-field .pound { margin-top: 0; }
.sub-field--row .sub-label { flex: 0 0 auto; }
.pound input[type="text"] { width: 96px; height: auto; margin: 0; padding: 0; border: 0; box-shadow: none; }
.pound--wide input[type="text"] { width: 140px; }

/* a reading card with a paragraph and no table: body text, not the small note under a table */
.tcard h3 + p { margin-top: 0; font-size: 15px; line-height: 1.55; }

/* ---------- Mileage: journeys ---------- */
.trips { margin-top: 6px; }
.trip {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px 8px; align-items: end;
  margin-top: 12px; padding: 12px; border: 1px solid var(--hair); border-radius: 16px; background: #fff;
}
.trip-f { display: grid; gap: 5px; min-width: 0; font-size: 12.5px; color: var(--ink-70); }
.trip-f .sel { width: 100%; padding-right: 30px; background-position: right 10px center; }
.trip-f .pound { width: 100%; }
.trip-f .pound input[type="text"] { width: 100%; min-width: 0; }
.trip-sum { grid-column: 1 / 4; font-size: 14px; font-weight: 500; }
.trip-del { grid-column: 4 / 6; justify-self: end; font-size: 13.5px; color: var(--ink-70); border-bottom: 1px solid var(--ink-30); }
.trip-del:hover { color: var(--ink); }
.trip-add { margin-top: 12px; padding: 9px 16px; border-radius: 999px; border: 1.5px dashed var(--ink-30); font-size: 14px; font-weight: 500; }
.trip-add:hover { border-style: solid; }
.trip-total:empty { display: none; }
.trip-total { margin-top: 12px; font-size: 14.5px; font-weight: 500; color: var(--green); }

@media (max-width: 560px) {
  .money-field--unit span { font-size: 16px; }
  /* four choices don't fit a phone's width in one row: two rows of two */
  .tabs--four { flex-wrap: wrap; border-radius: 20px; }
  .tabs--four label { flex: 1 1 calc(50% - 2px); }
  .tabs--four span { padding: 9px 4px; font-size: 13.5px; }
  .trip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trip-f:last-of-type { grid-column: 1 / 3; }
  .trip-sum { grid-column: 1 / 2; }
  .trip-del { grid-column: 2 / 3; }
}

/* ---------- Locum take-home ---------- */
/* the sixth donut colour, for costs taken before pay (umbrella fee and employer's NI, business costs,
   corporation tax): the brand's amber, checked with the dataviz validator beside the other five */
.calc { --c-cost: #9a5b12; }
.cost { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 14px; font-weight: 500; color: var(--ink); }   /* as the take-home form's field labels */
.cost .pound { width: 100%; }
.cost .pound input[type="text"] { flex: 1; width: auto; min-width: 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 4px; }
.q-sub { margin-top: 20px; }
.q-inline { margin: 0; }
.route-sub { margin-top: 16px; }
.ttable--routes th, .ttable--routes td { padding: 13px 16px; vertical-align: top; font-size: 14.5px; line-height: 1.45; }
.ttable--routes tbody th { font-weight: 500; white-space: nowrap; }

@media (max-width: 560px) {
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid3 .cost:first-child { grid-column: 1 / 3; }
  .ttable--routes { min-width: 720px; }
}

/* ---------- Rota and pay checker: four step cards in one column ---------- */
.tool { display: grid; gap: 20px; max-width: 1120px; margin: 56px auto 0; padding: 0 16px; }
.tcard-step {
  min-width: 0; padding: 30px 34px 30px; background: var(--surface); border: 1px solid var(--hair); border-radius: 26px;
  box-shadow: 0 30px 60px -36px rgba(39, 37, 30, .35); scroll-margin-top: 90px;
}
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.step-n { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: var(--canvas); font: 600 14px/1 var(--sans); }
.step-head h2 { font-family: var(--serif); font-weight: 400; font-size: 24px; letter-spacing: -.02em; }   /* as the take-home card's heading */
.tcard-step .out-empty { margin-top: 0; }

.drop { display: grid; justify-items: center; gap: 14px; padding: 34px 20px; border: 1.5px dashed var(--ink-30); border-radius: 20px; background: var(--canvas); text-align: center; transition: border-color .2s, background .2s; }
.drop.over { border-color: var(--navy); background: var(--canvas-2); }
.drop--small { padding: 24px 20px; }
.drop-lead { display: grid; gap: 4px; }
.drop-lead b { font-family: var(--serif); font-weight: 400; font-size: 22px; letter-spacing: -.01em; }
.drop-lead span { font-size: 14.5px; color: var(--ink-70); }
.drop-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.btn-sm { padding: 11px 20px; font-size: 15px; }
.drop .btn-ghost { padding: 11px 16px; border-radius: 999px; font-size: 15px; font-weight: 500; color: var(--ink); border: 1.5px solid var(--hair); background: var(--surface); }
.drop .btn-ghost:hover { border-color: var(--ink-30); }
.drop-note { font-size: 13px; color: var(--muted); }
.drop-status:empty { display: none; }
.drop-status { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--slate-bg); font-size: 14.5px; line-height: 1.5; }
.drop-status.ok { background: var(--green-bg); }
.drop-status.warn { background: var(--amber-bg); }
.drop-status.bad { background: #f6dfe2; color: #7c1d2c; }

.review { margin-top: 22px; }
.review-h { margin-top: 26px; font-family: var(--serif); font-weight: 400; font-size: 21px; letter-spacing: -.01em; }
.codes-wrap, .grid-wrap { margin-top: 12px; overflow-x: auto; border: 1px solid var(--hair); border-radius: 16px; background: #fff; }
.codes { width: 100%; border-collapse: collapse; font-size: 14px; }
.codes th, .codes td { padding: 9px 10px; text-align: left; vertical-align: middle; border-top: 1px solid var(--hair); }
.codes thead th { border-top: 0; font-size: 11.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.codes .c-days { white-space: nowrap; }
.codes tbody th small { display: block; margin-top: 3px; font-size: 12px; font-weight: 400; color: var(--muted); }
.codes tr.need { background: var(--amber-bg); }
.codes input[type="time"] { height: 38px; padding: 0 8px; border: 1.5px solid var(--hair); border-radius: 10px; background: #fff; font: 15px var(--sans); color: var(--ink); }
.codes input[type="time"]:focus, .oc input[type="text"]:focus { outline: none; border-color: var(--navy); }
.sel--sm { height: 38px; font-size: 14px; padding-right: 32px; background-position: right 10px center; }
.oc { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; color: var(--ink-70); }
.oc input[type="text"] { width: 52px; height: 34px; padding: 0 8px; border: 1.5px solid var(--hair); border-radius: 9px; font: 14px var(--sans); color: var(--ink); }
.oc-check { display: inline-flex; gap: 5px; align-items: center; }
.oc-check input { accent-color: var(--navy); }

.chip { display: inline-block; padding: 3px 9px; border-radius: 999px; font-weight: 600; font-size: 13px; background: var(--canvas-2); white-space: nowrap; }
.chip--shift { background: #e3ecf8; color: #23446e; }
.chip--oncall { background: #efe3f5; color: #5b2c74; }
.chip--off { background: var(--canvas-2); color: var(--ink-70); }
.chip--leave { background: var(--green-bg); color: var(--green); }
.chip--unknown { background: var(--amber-bg); color: var(--amber); }

.rgrid { width: 100%; min-width: 520px; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.rgrid th { font-size: 12px; font-weight: 500; color: var(--muted); }
.rgrid thead th { padding: 6px 0 2px; letter-spacing: .06em; text-transform: uppercase; }
.rgrid tbody th { width: 34px; text-align: left; padding-left: 4px; }
.rgrid thead th:first-child { width: 34px; }
.rgrid td { padding: 0; border-radius: 9px; background: var(--canvas); }
.rgrid td.t-shift { background: #e3ecf8; }
.rgrid td.t-oncall { background: #efe3f5; }
.rgrid td.t-leave { background: var(--green-bg); }
.rgrid td.t-unknown { background: var(--amber-bg); }
.rgrid input { width: 100%; height: 38px; padding: 0 6px; border: 1.5px solid transparent; border-radius: 9px; background: transparent; font: 600 13.5px var(--sans); color: var(--ink); text-align: center; text-overflow: ellipsis; }
.rgrid input:focus { outline: none; border-color: var(--navy); background: #fff; }
.grid-tools { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 14.5px; color: var(--ink-70); }
.grid-tools b { min-width: 20px; text-align: center; color: var(--ink); }
.round { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--hair); background: var(--surface); font-size: 18px; line-height: 1; }
.round:hover { border-color: var(--ink-30); }

.you-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 14px; }
.you-grid .sel { width: 100%; }
.you-ltft { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--hair); }
.you-ltft .you-grid { margin-top: 12px; }
.you .more { margin-top: 18px; }

.results { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.res-h { font-family: var(--serif); font-weight: 400; font-size: 22px; letter-spacing: -.01em; }
.res-verdict { margin-top: 12px; padding: 12px 14px; border-radius: 14px; font-weight: 500; font-size: 15.5px; }
.res-verdict.pass { background: var(--green-bg); color: var(--green); }
.res-verdict.warn { background: var(--amber-bg); color: var(--amber); }
.res-verdict.fail { background: #f6dfe2; color: #7c1d2c; }
.rules { list-style: none; margin-top: 10px; }
.rule { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 12px 0; border-top: 1px solid var(--hair); }
.rule .rule-i { display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; font: 700 12px/1 var(--sans); color: #fff; background: var(--green); }
.rule.fail .rule-i { background: #b4233c; }
.rule.warn .rule-i { background: var(--amber); }
.rule b { display: block; font-weight: 500; font-size: 15px; }
.rule div > span { display: block; margin-top: 3px; font-size: 14px; line-height: 1.45; color: var(--ink-70); }
.rule small { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.hours { margin-top: 18px; display: grid; gap: 8px; font-size: 13.5px; }
.hours div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; }
.hours dt { color: var(--muted); }
.hours dd { color: var(--ink-70); }
.hours .warnline { padding: 10px 12px; border-radius: 12px; background: var(--amber-bg); }
.results .p87-link { margin-top: 16px; }
.res-actions { margin-top: 20px; }
.res-actions .btn-ghost { padding: 10px 16px; border-radius: 999px; border: 1.5px solid var(--hair); font-weight: 500; color: var(--ink); }

.facts { margin-top: 18px; }
.facts h4 { font-family: var(--serif); font-weight: 400; font-size: 19px; }
.facts-table td, .facts-table th { font-size: 13.5px; }
.facts-table .same { color: var(--green); font-weight: 500; }
.facts-table .less { color: #b4233c; font-weight: 500; }
.facts-table .more { color: var(--amber); font-weight: 500; }
.payslip { margin-top: 18px; }
.payslip-read { display: grid; gap: 12px; margin-bottom: 18px; }
.payslip-meta { font-size: 14px; color: var(--ink-70); }
.payslip-lines td { font-variant-numeric: tabular-nums; }
.payslip-read .res-verdict { margin-top: 0; }
.payslip-read .rules { margin-top: 0; }
.payslip-table .pound { height: 38px; }
.payslip-table .pound input[type="text"] { width: 90px; }
.payslip-table tr.under td:last-child { color: #b4233c; font-weight: 600; }
.payslip-table tr.over td:last-child { color: var(--amber); font-weight: 600; }
.payslip-table tr.ok td:last-child { color: var(--green); }
.payslip-verdict { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--slate-bg); font-size: 15px; line-height: 1.5; }
.payslip-verdict.ok { background: var(--green-bg); }
.payslip-verdict.bad { background: #f6dfe2; }

@media (max-width: 900px) {
  .results { grid-template-columns: minmax(0, 1fr); }
  .you-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .tool { margin-top: 40px; gap: 16px; }
  .tcard-step { padding: 22px 16px 22px; border-radius: 22px; }
  .step-head h2 { font-size: 23px; }
  .drop { padding: 24px 14px; }
  .you-grid { grid-template-columns: minmax(0, 1fr); }
  .rgrid { min-width: 0; border-spacing: 2px; }
  .rgrid tbody th, .rgrid thead th:first-child { width: 24px; padding-left: 0; font-size: 11px; }
  .rgrid thead th { font-size: 10.5px; letter-spacing: .02em; }
  .rgrid input { height: 34px; font-size: 11.5px; padding: 0 1px; }
  /* the shifts table as one card per code on a phone */
  .codes-wrap:has(#codes) { border: 0; background: none; overflow: visible; }
  #codes, #codes tbody, #codes tr, #codes td, #codes th { display: block; }
  #codes thead { display: none; }
  #codes tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-top: 10px; padding: 12px; border: 1px solid var(--hair); border-radius: 16px; background: #fff; }
  #codes tr.need { background: var(--amber-bg); }
  #codes th, #codes td { padding: 0; border: 0; }
  #codes th { grid-column: 1 / 2; }
  #codes td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  #codes td.c-days { grid-column: 2 / 3; justify-self: end; align-self: center; font-size: 13px; color: var(--muted); }
  #codes td.c-type, #codes td.c-oc { grid-column: 1 / 3; }
  #codes td.c-type .sel { width: 100%; }
  #codes td:empty { display: none; }
  #codes input[type="time"] { width: 100%; }
  .hours div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* a summary to save or print: the results, without the page around them */
@media print {
  .nav-wrap, .a-hero .a-jump, #stepRota .drop, #stepSlip .drop, .pitch, .tsec, footer, .app-promo, .res-actions, .grid-tools { display: none !important; }
  body { background: #fff; }
  .tcard-step { box-shadow: none; break-inside: avoid; }
  .codes-wrap, .grid-wrap { overflow: visible; }
}
