[hidden] { display: none !important; }
.flush { margin-top: 0; }
.card p.small { font-size: 13px; }
.alert { background: var(--surface); border: 2px solid var(--warn); color: var(--warn); border-radius: 10px; padding: 10px 12px; margin: 0 0 16px; font-weight: 600; overflow-wrap: anywhere; }
.notice { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--warn); border-radius: 10px; background: var(--surface); overflow-wrap: anywhere; }
.notice p { margin: 0 0 8px; }
.jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.jump a { display: inline-flex; align-items: center; min-height: 32px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: 14px; }
section { margin-bottom: 8px; }
h2 { scroll-margin-top: 12px; }

/* forms */
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 10px 12px; margin: 0 0 10px; }
.fgrid > * { min-width: 0; }
.f.wide { grid-column: 1 / -1; }
.f label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 2px; }
.f textarea { resize: vertical; }
.card .row { margin-bottom: 4px; }
.row > label.small { flex: 0 0 auto; }
.row > select { max-width: 100%; }
label.btn { display: inline-flex; align-items: center; }
#import-file:focus-visible + label.btn { outline: 3px solid var(--accent); outline-offset: 2px; }
h3.flush { margin: 0 0 8px; }
form.card { margin-top: 12px; }

/* lists */
.list { list-style: none; padding: 0; margin: 12px 0 0; }
.list li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; align-items: start; }
.list .t { font-weight: 600; overflow-wrap: anywhere; }
.list .meta { grid-column: 1 / -1; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.list .notes { grid-column: 1 / -1; font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.list .acts { display: flex; gap: 4px; align-items: start; flex-wrap: wrap; justify-content: flex-end; }
.list .acts button { min-height: 32px; padding: 2px 8px; font-size: 13px; }
.list .pk { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 13px; color: var(--muted); }
.list .pk .pill { margin: 0; }
.list .amt, .list .meta .amt { color: var(--ink); font-weight: 600; }
.pill.flag { border: 1px solid var(--warn); font-weight: 700; }
.pill.ok { background: var(--accent); color: var(--accent-ink); }
.list li[data-late="true"] { border-left: 4px solid var(--warn); }
.place { margin-top: 12px; }
.place-head { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }
.place-head h3 { overflow-wrap: anywhere; min-width: 0; }
.place-head .acts { display: flex; gap: 4px; flex-wrap: wrap; }
.place-head .acts button { min-height: 32px; padding: 2px 8px; font-size: 13px; }
.place .list { margin-top: 8px; }
.place .list li:last-child { margin-bottom: 0; }
.card.late { margin-top: 12px; }
.card.late:not([hidden]) { border-left: 4px solid var(--warn); }
.card.late .list { margin-top: 8px; }
#bk-calc { margin: 0 0 6px; font-weight: 600; overflow-wrap: anywhere; }
#bk-calc:empty { display: none; }
#bk-hint:empty { display: none; }

/* statement: also what gets printed */
.statement { margin-top: 16px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); }
.st-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.st-biz { font-size: 20px; font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
.st-title { font-size: 20px; font-weight: 700; }
.st-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px 16px; margin: 0 0 14px; }
.st-meta > div { min-width: 0; }
.st-meta dt, .st-totals dt { font-size: 12px; color: var(--muted); }
.st-meta dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.st-totals { margin: 0 0 12px; max-width: 420px; }
.st-totals > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.st-totals dt { font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.st-totals dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.st-totals .due { font-size: 18px; border-bottom: 2px solid var(--ink); }
.st-totals .due dt { color: var(--ink); font-weight: 700; font-size: 16px; }
.statement p.st-flag { color: var(--warn); font-weight: 600; font-size: 14px; margin: 0 0 12px; overflow-wrap: anywhere; }
.statement p.st-note { font-size: 14px; margin: 10px 0 0; overflow-wrap: anywhere; }
.statement p.st-foot { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; margin: 12px 0 0; }
.st-lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.st-lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "d a" "x x" "b b" "k k"; gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.st-lines li[data-later="true"] { color: var(--muted); }
.il-d { grid-area: d; font-size: 13px; color: var(--muted); }
.il-x { grid-area: x; overflow-wrap: anywhere; }
.il-a { grid-area: a; text-align: right; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.il-b { grid-area: b; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.st-lines .acts { grid-area: k; display: flex; gap: 4px; flex-wrap: wrap; }
.st-lines .acts button { min-height: 32px; padding: 2px 8px; font-size: 13px; }
@media (min-width: 560px) {
  .st-lines li { grid-template-columns: 10.5em minmax(0, 1fr) 8em 8em; grid-template-areas: "d x a b" "k k k k"; }
  .il-b { text-align: right; }
}

/* calendar: one row per night, one column per unit; only this box may scroll sideways */
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.key { display: inline-block; width: 14px; height: 14px; border: 1px solid var(--line); border-radius: 3px; vertical-align: -2px; }
.key.booked { background: var(--accent); border-color: var(--accent); }
.key.free { background: var(--surface); }
.cal-scroll { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin: 8px 0; }
.cal { width: 100%; border-collapse: separate; border-spacing: 0; }
.cal th, .cal td { padding: 3px 6px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); font-size: 13px; line-height: 1.3; height: 28px; text-align: left; vertical-align: middle; }
.cal thead th { font-weight: 600; min-width: 84px; overflow-wrap: anywhere; }
.cal thead th .sub { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.cal th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); white-space: nowrap; min-width: 4.5em; }
.cal tbody tr:last-child th, .cal tbody tr:last-child td { border-bottom: 0; }
.cal th:last-child, .cal td:last-child { border-right: 0; }
.cal tr.today th:first-child { box-shadow: inset 3px 0 0 var(--accent); font-weight: 700; }
.cal td[data-state="booked"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; overflow-wrap: anywhere; }
.cal td[data-state="booked"].first { box-shadow: inset 0 3px 0 var(--surface); }
.occ-sum { font-weight: 600; margin: 0 0 8px; overflow-wrap: anywhere; }
.tbl { margin: 0 0 8px; }
.tbl th, .tbl td { font-size: 14px; overflow-wrap: anywhere; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.total th, .tbl tr.total td { font-weight: 700; border-top: 2px solid var(--line); }
.tbl .sub { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }

/* print: only the statement, always dark ink on white, whatever the screen theme is */
@media print {
  @page { margin: 14mm; }
  :root { --bg: #fff; --surface: #fff; --ink: #000; --muted: #333; --line: #999; --accent: #000; --warn: #000; --chip: #eee; }
  html, body { background: #fff; color: #000; }
  body { font-size: 12pt; }
  .wrap { max-width: none; padding: 0; }
  .wrap > :not(#ledger-sec) { display: none !important; }
  #ledger-sec .no-print { display: none !important; }
  #ledger-sec { margin: 0; }
  .statement { margin: 0; padding: 0; border: 0; background: #fff; }
  .st-lines li { break-inside: avoid; }
  .st-lines .acts, #st-empty-lines { display: none !important; }
  a { color: #000; }
}
