/* The rental desk: this page's own pieces. Colours and the shared parts come from ../site.css;
   the page sits under .line-property, so --c, --c-ink and --tint are property green. */

.desk-intro { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 24px; padding-top: 20px; padding-bottom: 14px; }
.desk-intro h1 { font-size: clamp(26px, 3vw, 34px); }
.desk-intro .lede { margin-top: 4px; color: var(--ink-2); font-size: 15.5px; }
.desk-intro .lede a { color: var(--c-ink); font-weight: 600; }
.desk-intro .site-note { white-space: nowrap; }
/* on the desk, the same small "Tools" eyebrow as the project desk. The eyebrow, the heading and the
   short note share one band and the line under them runs full width, so the eyebrow and the group labels
   below cost the open tool no height */
.desk-intro:not(.plain) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 24px; padding-top: 14px; padding-bottom: 10px; }
.desk-intro:not(.plain) > div { display: contents; }
.desk-intro .eyebrow { grid-column: 1; font-size: 13px; line-height: 1.2; }
.desk-intro:not(.plain) h1 { grid-column: 1; grid-row: 2; margin-top: 4px; }
.desk-intro:not(.plain) .lede { grid-column: 1 / -1; grid-row: 3; }
.desk-intro:not(.plain) .site-note { grid-column: 2; grid-row: 2; align-self: end; padding-bottom: 4px; }

/* thirteen tools in three labelled groups, in the project desk's look (a pale pill per group, a small
   capital label); the label sits above its pill so the three groups still fit one row on a laptop.
   Under 600px a picker stands in for the strip. */
.desk-nav { margin-bottom: 10px; }
.desk .tabs { background: transparent; padding: 16px 0 0; border-radius: 0; overflow: visible; flex-wrap: wrap; gap: 24px 8px; }
.desk .tab-group { position: relative; display: inline-flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; background: var(--field); }
.desk .tab-cap { position: absolute; left: 14px; bottom: 100%; margin-bottom: 3px; font-size: 11px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-2); white-space: nowrap; line-height: 1.2; }
.tool-pick, .tool-pick[hidden], .desk .tabs[hidden] { display: none; }
.desk .tool { padding: 18px 24px 14px; }
.desk .tool h2 { font-size: 24px; margin-top: 0; }
.desk .tool-one { margin-top: 3px; }
.desk .split { margin-top: 14px; }
.desk .fields { margin-top: 0; align-content: start; }
.desk .fields.one { grid-template-columns: minmax(0, 1fr); }
.desk .field.wide { grid-column: 1 / -1; }
.desk .input input, .desk .input select { padding: 9px 11px; }
.desk .answer { padding: 12px 16px; }
.desk .sum { font-size: 14px; }
.desk .sum .line { padding: 4px 0; }
.desk .sum .line:last-child { border-bottom: 0; }
/* every answer leads with a short label and the big number, then the sum that produced it */
.desk .answer .verdict + .sum { margin-top: 6px; padding-top: 2px; border-top: 1px solid color-mix(in srgb, var(--c) 30%, transparent); }
.desk .ans-big.words { font-size: 19px; letter-spacing: -0.01em; line-height: 1.3; }
.desk .tool-foot { margin-top: 12px; padding-top: 10px; }
.desk .how { margin-top: 10px; padding-top: 8px; }
.desk .how p sup { font-size: 70%; }
.left-out { margin-top: 14px; }
.needs-script { color: var(--ink-2); font-size: 14px; }

/* buttons */
.btn.small { padding: 5px 11px; font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.desk .btn { padding: 9px 16px; font-size: 14px; }
.desk .btn.small { padding: 5px 11px; font-size: 13px; }
.btn.btn-ghost { background: transparent; }

/* the record-keeping tools: form and answer on the left, the rows in a box that scrolls on the right */
.rec, .mv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 18px; margin-top: 14px; align-items: start; }
.rec { grid-template-areas: "form side" "keep side"; grid-template-rows: auto 1fr; }
.rec-form { grid-area: form; }
.rec-side { grid-area: side; min-width: 0; }
.rec .keep { grid-area: keep; margin-top: 0; align-self: start; }
.rec-side .scroller { margin-top: 10px; }
.rec-list { min-width: 0; }
.scroller { max-height: 190px; overflow: auto; border-radius: 14px; background: var(--field); padding: 4px 10px 8px; }
.scroller.tall { max-height: 300px; }
.empty { color: var(--ink-2); font-size: 14px; padding: 10px 0; }
.keep { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.keep .hint { flex: 1 1 14rem; }
.status { min-height: 1.2em; font-size: 12.5px; color: var(--ink-2); }
/* the line under the Word file and PDF buttons takes no room until it has something to say */
.status.save:empty { display: none; }
.print-only { display: none; }

.more-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.more-table th, .more-table td { text-align: left; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.more-table thead th { position: sticky; top: 0; background: var(--field); font-size: 12.5px; color: var(--ink-2); font-weight: 650; }
.more-table .num { text-align: right; white-space: nowrap; }
.more-table td.act { white-space: nowrap; text-align: right; padding-right: 0; }
.more-table .btn { background: transparent; color: var(--c-ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 55%, transparent); }
.more-table td:first-child { white-space: nowrap; }
/* a date or a unit never breaks across two lines */
.more-table td[data-label="Fixed"], .more-table td[data-label="Unit"] { white-space: nowrap; }
.more-table td.act .btn + .btn { margin-left: 6px; }

/* move-in checklist */
.room { margin-top: 10px; border-top: 2px solid var(--c); padding-top: 6px; font-size: 14px; }
.room:first-child { margin-top: 4px; }
.room-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.room-head .cell { flex: 1 1 10rem; }
.room-name input { font-weight: 650; }
.items { list-style: none; margin: 6px 0; padding: 0; }
.item { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; padding: 3px 0; border-bottom: 1px dotted var(--line); }
.item .item-name { flex: 1 1 8rem; }
.item .item-note { flex: 2 1 11rem; }
.item.labels { color: var(--ink-2); font-size: 12.5px; border-bottom: 1px solid var(--line); }
.item.labels span:first-child { flex: 1 1 8rem; }
.item.labels span:last-child { flex: 2 1 11rem; }
.cell input { width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1.5px solid transparent; border-radius: 9px; padding: 5px 8px; min-width: 0; }
.cell input:focus { border-color: var(--focus); outline: none; }
/* inside the rooms, the add and remove buttons are outlined, as Remove is on the other record tools */
.room .btn { background: transparent; color: var(--c-ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 55%, transparent); }
.sigs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 18px; }
.sig-who { font-weight: 650; margin-bottom: 4px; font-size: 14px; }
.sig-line { height: 2.2rem; border-bottom: 1px solid var(--ink-2); display: flex; align-items: flex-end; }
.sig-line span { font-size: 12px; color: var(--ink-2); }
.printline { display: none; }

/* thirteen tabs fit one strip on a laptop; a little tighter, to make room for the group gaps */
.desk .tab { padding: 8px 9px; font-size: 13.5px; }

/* the deal analyser: fields and the month picture on the left, the verdict and six figures on the right */
.split.deal { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.desk .fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; }
.desk .fields.three .input input { padding: 5px 9px; font-size: 15.5px; }
.desk .fields.three .field { gap: 2px; font-size: 12.5px; }
.fall-box { margin-top: 12px; border-radius: 16px; background: var(--field); padding: 10px 14px 8px; }
.fall-box .ans-label { color: var(--ink-2); font-size: 12.5px; }
.fall { display: grid; gap: 1px; margin-top: 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.fall-row { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) 4.6rem; gap: 10px; align-items: center; }
.fall-name { color: var(--ink-2); }
.fall-val { text-align: right; font-weight: 600; }
.fall-track { position: relative; height: 13px; }
.fall-track i { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: color-mix(in srgb, var(--ink-2) 45%, transparent); }
.fall-track .zero { position: absolute; top: -3px; bottom: -3px; width: 1.5px; background: var(--ink-2); }
.k-in i, .k-sub i { background: var(--c); }
.k-sub .fall-name, .k-neg .fall-name { color: var(--ink); font-weight: 600; }
.k-neg i { background: var(--bad); }
/* Light --bad is under 4.5 to 1 here. Ink clears 4.5 and is not another line's colour. */
.k-neg .fall-val, .verdict.neg .verdict-num, .verdict.neg .ans-big { color: var(--ink); }
.deal-answer { justify-content: flex-start; padding: 14px 16px; }
.verdict { display: grid; gap: 1px; }
.verdict-num, .desk .ans-big { font-family: var(--display); font-size: clamp(30px, 3.4vw, 42px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1;
  color: var(--c-ink); font-variant-numeric: tabular-nums; }
.verdict-one { font-size: 13px; color: var(--ink-2); }
.figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.fig { display: grid; align-content: start; background: var(--surface); border-radius: 12px; padding: 8px 11px; }
.fig-name { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.fig-val { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.fig-one { font-size: 12px; color: var(--ink-2); line-height: 1.3; }

/* deposit itemisation */
.scroller.short { margin-top: 10px; max-height: 150px; }
.edit-table { min-width: 0; }
.edit-table td.cell { padding: 3px 6px 3px 0; }
.edit-table .cell input, .edit-table .cell select { width: 100%; min-width: 0; font: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--surface); border: 1.5px solid transparent; border-radius: 8px; padding: 4px 6px; font-variant-numeric: tabular-nums; }
.edit-table .cell input:focus, .edit-table .cell select:focus { border-color: var(--focus); outline: none; }
.edit-table .num input { text-align: right; }
.edit-table td.c-amount, .edit-table td.c-charge, .edit-table td.c-payment, .edit-table td.c-cost { width: 7.5rem; }
.edit-table td.c-date, .edit-table td.c-reported { width: 9rem; }
.edit-table td.c-unit { width: 5.5rem; }
.edit-table td.c-category { width: 8.5rem; }
.edit-table td:first-child { white-space: normal; }
.statement .answer { justify-content: flex-start; }
.print-title { font-size: 22px; font-weight: 700; }
.statement .print-only { display: none; }

/* vacancy cost */
.stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin: 10px 0 6px; background: var(--field); }
.stack i { display: block; height: 100%; }
.p1 { --dot: var(--c); }
.p2 { --dot: color-mix(in srgb, var(--c) 55%, var(--ink-2)); }
.p3 { --dot: var(--build); }
.p4 { --dot: var(--study); }
.stack i { background: var(--dot); }
.sum.key .line span:first-child::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 7px; background: var(--dot); }
.compare { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); font-size: 15px; font-weight: 600; line-height: 1.4; }

/* year-end summary: the page on top, the rows underneath */
.ye-answer { margin-top: 12px; padding: 14px 18px; }
.ye-out { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.ye-net { display: grid; }
.ye-net .sum { margin-top: 4px; margin-bottom: 8px; font-size: 13px; }
.ye-net .sum .line, .ye-side .sum .line { padding: 2px 0; }
.ye-net .verdict-num { font-size: clamp(28px, 3vw, 36px); }
.ye-net.neg .verdict-num { color: var(--ink); }
.ye-left { margin-top: 6px; font-size: 12.5px; color: var(--ink-2); }
.ye-h { display: block; font-size: 13px; font-weight: 600; color: var(--c-ink); margin-bottom: 6px; }
.ye-side .sum { font-size: 13px; }
.ye-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ye-m { display: grid; grid-template-columns: auto 1fr; gap: 0 6px; align-items: baseline; background: var(--surface); border-radius: 10px; padding: 6px 8px 7px;
  font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ye-mn { color: var(--ink-2); font-weight: 600; }
.ye-mv { text-align: right; font-weight: 600; }
.ye-m i { grid-column: 1 / -1; display: block; height: 5px; margin-top: 4px; border-radius: 3px; background: var(--c); min-width: 2px; }
.ye-months .ye-grid + .ye-h { margin-top: 10px; }
.ye-units { display: grid; grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); gap: 6px; }
.ye-u { display: grid; background: var(--surface); border-radius: 10px; padding: 5px 8px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ye-un { color: var(--ink-2); font-weight: 600; }
.ye-uv { font-size: 15px; font-weight: 700; }
.ye-u.neg .ye-uv { color: var(--bad); }
.ye-rows { margin-top: 12px; }
.ye-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; }
.ye-year { display: flex; align-items: center; gap: 8px; }
.ye-year .input { width: 5.5rem; }
.ye-year .input input { padding: 5px 9px; font-size: 15px; }
.seg { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--field); }
.desk .seg .btn { box-shadow: none; color: var(--ink-2); }
.desk .seg .btn[aria-pressed="true"] { background: var(--surface); color: var(--c-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.ye-rows .scroller { margin-top: 8px; max-height: 150px; }

@media (max-width: 980px) {
  .split.deal { grid-template-columns: minmax(0, 1fr); }
  .ye-out { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ye-months { grid-column: 1 / -1; order: 3; }
}

@media (max-width: 700px) {
  .desk-intro { padding-top: 12px; padding-bottom: 8px; }
  .desk-intro h1 { font-size: 24px; }
  .desk-nav { margin-bottom: 8px; }
  .desk-intro .site-note { white-space: normal; }
  .desk-intro:not(.plain) .site-note { grid-column: 1 / -1; grid-row: 4; margin-top: 4px; padding-bottom: 0; }
  .desk-intro:not(.plain) .lede { display: none; }
  .desk .tool { padding: 14px 14px 12px; }
  .desk .tool h2 { font-size: 21px; }
  .desk .tool-one { font-size: 14.5px; }
  .desk .split { margin-top: 10px; }
  .desk .input input, .desk .input select { padding: 8px 8px; }
  .desk .answer { padding: 8px 12px; }
  /* the label and the big number stay tight, so a long sum still ends inside the first screen */
  .desk .answer .verdict .ans-label { line-height: 1.25; }
  .verdict-num, .desk .ans-big { font-size: 28px; }
  .desk .answer .verdict + .sum { margin-top: 4px; padding-top: 0; }
  .desk .tool { padding-top: 12px; }
  .desk .tool-head { display: block; }
  .desk .example-tag { position: absolute; top: 14px; right: 14px; font-size: 11px; padding: 2px 8px; }
  .desk .sum { font-size: 12.5px; }
  .desk .sum .line span:first-child { flex-basis: 8rem; }
  .desk .sum .line { padding: 2px 0; gap: 0 10px; }
  .desk .fields { gap: 6px 8px; }
  .desk .field { gap: 3px; font-size: 12.5px; }
  .rec, .mv { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 10px; }
  .rec { grid-template-areas: none; grid-template-rows: none; }
  .rec-form, .rec-side, .rec .keep { grid-area: auto; }
  .scroller, .scroller.tall { max-height: 190px; }
  .sigs { grid-template-columns: minmax(0, 1fr); }
  .desk .tool-foot { font-size: 12.5px; }
  .desk .fields.three { gap: 5px 6px; }
  .desk .fields.three .input input { padding: 6px 6px; font-size: 15px; }
  .desk .fields.three .input .pre { padding-left: 6px; font-size: 14px; }
  .desk .fields.three .field { font-size: 11.5px; }
  .deal-answer { order: -1; }
  .figs { gap: 6px; margin-top: 8px; }
  .fig { padding: 6px 9px; }
  .fig-val { font-size: 17px; }
  .fig-one { font-size: 11.5px; }
  .figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fall-row { grid-template-columns: 6.2rem minmax(0, 1fr) 4.2rem; gap: 8px; }
  .ye-out { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ye-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .edit-table { min-width: 520px; }
  #dp-lines .edit-table { min-width: 0; }
  #dp-lines .edit-table td.c-amount { width: 5.5rem; }
  /* two and a half lines show, so the balance to return still fits the first screen of a phone */
  .scroller.short { max-height: 104px; }
  .desk .fields.dp-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dp-fields .field:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 600px) {
  .desk .tabs { display: none; }
  .tool-pick:not([hidden]) { display: flex; align-items: center; gap: 10px; width: 100%; font-size: 13px; font-weight: 650; color: var(--ink-2); }
  .tool-pick select { flex: 1; min-width: 0; appearance: none; -webkit-appearance: none; font: inherit; font-size: 16px; font-weight: 650;
    color: var(--c-ink); background-color: var(--field); border: 1.5px solid transparent; border-radius: 999px; padding: 9px 36px 9px 16px; outline: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--c-ink) 50%), linear-gradient(135deg, var(--c-ink) 50%, transparent 50%);
    background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
  .tool-pick select:focus { border-color: var(--focus); }
  /* seven fields and a four-line sum do not both fit a phone's first screen; the answer comes first, as the
     deal analyzer's does */
  #p-vacancy .answer { order: -1; }
  /* the year-end sheet is the answer. On a phone the whole sheet is in the first screen:
     tighter gaps, months stay three across so the amounts fit, costs sit in two columns.
     The type sizes are unchanged, and nothing scrolls inside the box. */
  #p-year-end { padding-top: 8px; }
  #p-year-end h2, #p-year-end .tool-one { margin: 0; }
  #p-year-end .tool-one { line-height: 1.3; }
  #p-year-end .ye-answer { max-height: none; overflow: visible; justify-content: flex-start; margin-top: 2px; padding: 2px 8px 0; }
  #p-year-end .ye-out { gap: 3px; }
  #p-year-end .ye-net .sum { margin-top: 2px; margin-bottom: 0; }
  #p-year-end .ye-net .sum .line { padding-top: 0; padding-bottom: 0; }
  /* one column, so "Advertising (1)" and "$1,600.00" share a line. Two columns
     left about 160px, and the 8rem label basis pushed every amount onto a line of its own. */
  #p-year-end .ye-side .sum { display: grid; grid-template-columns: minmax(0, 1fr); }
  #p-year-end .ye-side .sum .line { flex-wrap: nowrap; padding-top: 0; padding-bottom: 0; gap: 0 8px; }
  #p-year-end .ye-side .sum .line span:first-child { flex: 1 1 auto; flex-basis: auto; min-width: 0; }
  #p-year-end .ye-side .sum .line span:last-child { white-space: nowrap; overflow-wrap: normal; flex: 0 0 auto; }
  #p-year-end .ye-h { margin-bottom: 2px; }
  #p-year-end .ye-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  #p-year-end .ye-m { padding: 2px 4px 3px; }
  #p-year-end .ye-m i { height: 3px; margin-top: 1px; }
  #p-year-end .ye-months .ye-grid + .ye-h { margin-top: 4px; }
  #p-year-end .ye-units { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  #p-year-end .ye-u { padding: 1px 4px; min-width: 0; }
  /* the minus stays on the figure (DESIGN.md). A narrow unit tile was breaking "−$8,300.00" after the sign. */
  #p-year-end .ye-uv { white-space: nowrap; }
  /* cash-on-cash: seven sum lines end just past the first screen; tighter gaps, the text stays the same size */
  #p-cash-on-cash .fields { gap: 3px 8px; }
  #p-cash-on-cash .split { gap: 6px; }
  #p-cash-on-cash .sum .line { padding-top: 1px; padding-bottom: 1px; }
  /* the move-in list is the answer. It leads, in one column, and the whole list is visible: no box scrolls inside the page.
     Two columns left about 75px beside Remove, which clipped the example names, and a half-width note clipped the longer lines. */
  #p-move-in { padding-top: 8px; }
  #p-move-in h2, #p-move-in .tool-one { margin: 0; }
  #p-move-in .tool-one { line-height: 1.3; }
  #p-move-in .mv { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
  #p-move-in .rec-list { order: -1; }
  #p-move-in .scroller, #p-move-in .scroller.tall { max-height: none; overflow: visible; background: transparent; padding: 0; }
  #mv-list { display: flex; flex-direction: column; gap: 0; align-items: stretch; }
  /* Add item sits on the room-name row, so four extra rows do not push the list past the screen */
  #p-move-in .room { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; column-gap: 4px; margin-top: 0; padding-top: 0; border-top: 0; }
  #p-move-in .room-head { display: contents; }
  #p-move-in .room-head .cell { grid-column: 1; grid-row: 1; min-width: 0; }
  #p-move-in .room-head .btn { grid-column: 2; grid-row: 1; padding: 0 6px; line-height: 1.2; }
  #p-move-in .room > .btn { grid-column: 3; grid-row: 1; margin: 0; padding: 0 6px; line-height: 1.2; }
  #p-move-in .items { grid-column: 1 / -1; grid-row: 2; margin: 0; }
  #p-move-in .item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(3.2rem, 5.5rem) auto; gap: 0 4px; align-items: center; padding: 0; border-bottom: 0; }
  #p-move-in .item .item-name,
  #p-move-in .item .item-note { order: 0; flex: none; min-width: 0; width: auto; }
  #p-move-in .item .btn { order: 0; flex: none; padding: 0 6px; line-height: 1.2; }
  /* a typed note takes the whole width on its own line, so a sentence is not cut off */
  #p-move-in .item.has-note { grid-template-columns: minmax(0, 1fr) auto; }
  #p-move-in .item.has-note .item-note { grid-column: 1 / -1; grid-row: 2; }
  #p-move-in .cell input { width: 100%; min-width: 0; padding: 0 4px; line-height: 1.15;
    background: var(--field); border-color: var(--ink-2); }
  #p-move-in .item.labels { display: none; }
  /* as the project desk's logs: each ledger and maintenance row becomes a small card with a caption over each
     value, so nothing scrolls sideways; the balance is on every card and the total leads the answer above */
  .rec .more-table, .rec .more-table tbody { display: block; min-width: 0; }
  .rec .more-table thead { display: none; }
  .rec .more-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; margin-top: 8px; padding: 8px 10px;
    border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); }
  .rec .more-table td { display: block; min-width: 0; padding: 0; border: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
  .rec .more-table td::before { content: attr(data-label); display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 1px; }
  .rec .more-table td.num { white-space: nowrap; }
  .rec .more-table td.act { grid-column: 2 / -1; grid-row: 1; justify-self: end; align-self: start; }
  .rec .more-table td.act::before { display: none; }
  .rec .more-table td:nth-child(2), .rec .more-table td[data-label="What was wrong"] { grid-column: 1 / -1; }
  #lg-table td[data-label="Balance"] { font-weight: 700; }
  #mt-table td[data-label="Reported"] { grid-column: 1; grid-row: 1; }
  #mt-table td[data-label="What was wrong"] { grid-column: 1 / 3; grid-row: 2; }
  #mt-table td[data-label="Unit"] { grid-column: 3; grid-row: 2; }
  .rec .scroller { max-height: 300px; padding: 0 8px 8px; }
}

/* Dark --bad already clears 4.5, so dark keeps the warning colour. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(
    .k-neg .fall-val, .verdict.neg .verdict-num, .verdict.neg .ans-big, .ye-net.neg .verdict-num
  ) { color: var(--bad); }
}
:root[data-theme="dark"] :is(
  .k-neg .fall-val, .verdict.neg .verdict-num, .verdict.neg .ans-big, .ye-net.neg .verdict-num
) { color: var(--bad); }

@media print {
  body { background: #fff; color: #000; }
  /* the sheet, its sums and the closing line share one left edge */
  .wrap { max-width: none; padding-left: 0; padding-right: 0; }
  .desk .answer { padding: 0; }
  .masthead, .tabs, .desk-nav, .desk-intro, .site-foot, .noprint, .example-tag, .btn, .keep, .how, .tool-foot, .left-out, .more-table .act { display: none !important; }
  .printline { display: block; margin-top: 16px; font-size: 12px; color: #444; }
  .desk .tool { box-shadow: none; border: 0; padding: 0; }
  .split, .rec, .mv { display: block; }
  .answer { background: none; padding: 0; margin: 8px 0; }
  .scroller, .scroller.tall { max-height: none; overflow: visible; background: none; padding: 0; }
  .ye-answer { max-height: none; overflow: visible; }
  .more-table { min-width: 0; }
  .more-table thead th { position: static; background: none; color: #000; }
  .print-only { display: block; }
  span.print-only { display: inline; }
  .print-meta { margin-bottom: 10px; }
  .cell input { display: none; }
  .cell .print-only { display: inline; }
  .room { break-inside: avoid; border-top: 1px solid #000; }
  .room-name .print-only { font-weight: 700; }
  .item { border-bottom: 1px solid #999; flex-wrap: nowrap; }
  .item .item-name { flex: 0 0 30%; }
  .item .item-note { flex: 1 1 auto; }
  .sigs { break-inside: avoid; }
  .sig-line { border-bottom-color: #000; }
  /* the deposit statement and the year-end page print as plain black on white */
  .statement .answer, .ye-answer { border: 0; }
  .statement .sum .line, .ye-out .sum .line { border-bottom-color: #999; }
  .print-head { margin-bottom: 8px; }
  .statement .print-only { display: block; }
  .statement .sigs.print-only { display: grid; }
  #p-deposit .tool-head { display: none; }
  /* on paper the deposit statement reads top to bottom, the lines first and the balance last */
  #dp-out { display: flex; flex-direction: column-reverse; }
  #dp-out .verdict { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; padding-top: 4px; border-top: 1px solid #000; }
  #dp-out .ans-label { font-size: 12pt; font-weight: 700; }
  #dp-out .ans-big { font-size: 16pt; }
  .desk .answer .verdict + .sum { border-top: 0; margin-top: 0; }
  .ye-out { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ye-months { grid-column: 1 / -1; order: 3; }
  .ye-m, .ye-u, .fig, .compare { background: none; border: 1px solid #999; }
  .ye-m i { background: #444; }
  .verdict-num, .ans-big, .ye-h, .ans-label, .desk .answer .verdict .ans-big { color: #000; }
  .k-neg .fall-val, .verdict.neg .verdict-num, .verdict.neg .ans-big, .ye-net.neg .verdict-num { color: #000 !important; }
}
