/* Realty Desk. Mobile first (375 px), light and dark, prints cleanly. */
:root {
  --accent: #1f5f8b; --accent-ink: #ffffff; --accent2: #a8481f;
  --bg: #f3f5f7; --card: #ffffff; --text: #182028; --muted: #5a6672; --line: #dbe1e7;
  --ok: #1e7a46; --ok-bg: #e5f4ea; --miss: #b3261e; --miss-bg: #fdecea; --warn: #8a5a00; --warn-bg: #fff4dc; --info: #1f4e79; --info-bg: #e8f0f8;
  --link: #1f5f8b;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #7fb8e6; --accent-ink: #0b1620; --accent2: #f0a07a;
    --bg: #11161c; --card: #1a2129; --text: #ecf1f5; --muted: #a3afba; --line: #2c3540;
    --ok: #7fd6a2; --ok-bg: #173323; --miss: #ffb4ab; --miss-bg: #3b1d1a; --warn: #f2c66d; --warn-bg: #352a12; --info: #9cc3ec; --info-bg: #182736;
    --link: #9cc8f0;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.45 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--link); }
h1 { font-size: 1.45rem; margin: 6px 0 12px; overflow-wrap: anywhere; }
h2 { font-size: .9rem; margin: 0 0 8px; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
h3 { font-size: 1rem; margin: 12px 0 6px; }
p { margin: 6px 0; overflow-wrap: anywhere; }
ul, ol { margin: 6px 0; padding-left: 22px; } li { margin: 4px 0; overflow-wrap: anywhere; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; } .mt { margin-top: 12px; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .err { color: var(--miss); font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent2); outline-offset: 2px; }

/* top bar and tabs */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { font-size: 1.1rem; font-weight: 700; white-space: nowrap; text-decoration: none; color: var(--text); }
.grow { flex: 1 1 auto; }
.hb { flex: 0 0 auto; display: inline-flex; align-items: center; background: var(--card); color: var(--accent); border: 1px solid var(--line); border-radius: 20px; padding: 6px 14px; font-weight: 600; min-height: 40px; text-decoration: none; }
.hb.lang { font-size: .85rem; padding: 6px 12px; }
.yearpick select { width: auto; min-height: 40px; padding: 6px 28px 6px 10px; border-radius: 20px; font-weight: 600; background: var(--card); }
main { padding: 12px 16px calc(96px + env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { padding: 8px 0 6px; min-height: 56px; font-size: .72rem; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; }
.tabs a span { font-size: 1.3rem; line-height: 1; }
.tabs a.on { color: var(--accent); font-weight: 700; }
.banner { padding: 10px 16px; font-weight: 600; }
.danger-bg { background: var(--miss-bg); color: var(--miss); }

/* cards, buttons, lists */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin: 0 0 12px; display: block; width: 100%; text-align: left; min-width: 0; }
.warnbox { border-color: var(--warn); background: var(--warn-bg); }
.hero { background: var(--accent); color: var(--accent-ink); border: 0; }
.hero .muted-on, .muted-on { opacity: .85; margin: 0; }
.hero .lede { font-size: 1.05rem; margin: 6px 0 0; }
.big-number { font-size: 2.1rem; font-weight: 800; margin: 2px 0 8px; letter-spacing: -.01em; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.stats div { display: flex; flex-direction: column; min-width: 0; }
.stats b { font-size: 1.02rem; overflow-wrap: anywhere; } .stats small { opacity: .85; font-size: .75rem; }
.btn, button.btn, a.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 12px; padding: 10px 16px; min-height: 44px; font-weight: 600; text-decoration: none; text-align: center; cursor: pointer; }
.ghost, .btn.ghost, button.ghost, a.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; min-height: 44px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
button.ghost.small { padding: 4px 10px; min-height: 36px; font-size: .8rem; }
.danger { color: var(--miss) !important; }
.wide { display: flex; width: 100%; margin: 4px 0 14px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.row.end { margin: 12px 0 4px; }
.flash { background: var(--ok-bg); color: var(--ok); border-radius: 12px; padding: 10px 14px; font-weight: 600; }
.empty { padding: 6px 0; }
.list { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; text-decoration: none; color: var(--text); text-align: left; width: 100%; cursor: pointer; }
.item b { grid-column: 1; overflow-wrap: anywhere; } .item small { grid-column: 1; color: var(--muted); overflow-wrap: anywhere; }
.item .amt { grid-column: 2; grid-row: 1 / span 2; font-weight: 700; white-space: nowrap; }
.item.prop .mini { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8rem; color: var(--muted); margin-top: 4px; }
.item.prop .mini b { color: var(--text); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.tile { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; text-decoration: none; color: var(--text); min-height: 118px; min-width: 0; }
.tile .ti { font-size: 1.5rem; } .tile b { font-size: .95rem; overflow-wrap: anywhere; } .tile small { color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.seg { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 12px; padding-bottom: 4px; scrollbar-width: thin; }
.seg a { flex: 0 0 auto; padding: 7px 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; font-size: .88rem; font-weight: 600; }
.seg a.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* pills, review badge, bars, strips */
.pill { display: inline-block; font-size: .72rem; font-weight: 700; border-radius: 10px; padding: 2px 8px; vertical-align: middle; white-space: nowrap; }
.pill.ok { color: var(--ok); background: var(--ok-bg); } .pill.warn { color: var(--warn); background: var(--warn-bg); }
.pill.miss { color: var(--miss); background: var(--miss-bg); } .pill.info { color: var(--info); background: var(--info-bg); }
.review { display: inline-block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--warn); background: var(--warn-bg); border: 1px solid var(--warn); border-radius: 8px; padding: 1px 6px; vertical-align: middle; }
.bar { height: 10px; border-radius: 6px; background: var(--line); overflow: hidden; margin: 6px 0 4px; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.strip { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin: 8px 0; }
.strip .cell { font-size: .62rem; text-align: center; border-radius: 4px; padding: 3px 0; background: var(--line); color: var(--muted); }
.cell.s-paid { background: var(--ok-bg); color: var(--ok); font-weight: 700; } .cell.s-paidLate, .cell.s-partial, .cell.s-grace { background: var(--warn-bg); color: var(--warn); font-weight: 700; }
.cell.s-late { background: var(--miss-bg); color: var(--miss); font-weight: 700; } .cell.s-upcoming { background: var(--info-bg); color: var(--info); }

/* tables */
.kv { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: .92rem; }
.kv th { text-align: left; font-weight: 500; color: var(--muted); padding: 5px 8px 5px 0; vertical-align: top; overflow-wrap: anywhere; }
.kv td { text-align: right; padding: 5px 0; white-space: nowrap; vertical-align: top; }
.kv tr + tr th, .kv tr + tr td { border-top: 1px solid var(--line); }
.kv tr.total th, .kv tr.total td { color: var(--text); font-weight: 700; }
.tablewrap { overflow-x: auto; max-width: 100%; }
.t { width: 100%; border-collapse: collapse; font-size: .82rem; }
.t th, .t td { padding: 6px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.t .r { text-align: right; white-space: nowrap; } .t tfoot th { font-weight: 700; }
.t tr.hl td { background: var(--info-bg); font-weight: 700; }

/* forms */
.form .field, .card .field { display: block; margin: 0 0 12px; min-width: 0; }
.lab { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 4px; }
.req { color: var(--miss); }
input[type=text], input[type=tel], input[type=email], input[type=date], input[type=month], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); max-width: 100%; }
textarea { min-height: 80px; resize: vertical; }
input[aria-invalid=true] { border-color: var(--miss); }
.hint { display: block; color: var(--muted); font-size: .78rem; margin-top: 3px; }
.affixed { display: flex; align-items: center; gap: 6px; } .affixed input { flex: 1 1 auto; min-width: 0; } .affix { color: var(--muted); font-weight: 600; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; } .check input { width: 22px; height: 22px; flex: 0 0 auto; margin-top: 2px; }
.checks { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; margin: 0 0 12px; } .checks legend { font-size: .85rem; font-weight: 600; padding: 0 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; } .grid2 .field { min-width: 0; }
.preview { background: var(--bg); border-radius: 12px; padding: 4px 12px; margin: 6px 0 10px; }
.preview:empty { display: none; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--bg); display: flex; align-items: center; justify-content: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; } .thumb button { position: absolute; top: 2px; right: 2px; background: var(--card); }
.pdficon { font-weight: 800; text-decoration: none; }
.filebtn { cursor: pointer; }
.chipsrow { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { border: 1px solid var(--line); border-radius: 18px; padding: 7px 14px; background: var(--card); cursor: pointer; font-weight: 600; font-size: .9rem; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.q { border: 0; padding: 0; margin: 12px 0; } .q legend { font-weight: 700; padding: 0; }

/* guides */
.calc { background: var(--bg); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.calc h3 { margin-top: 2px; }
.result { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 8px 12px; margin: 8px 0; }
.result span { font-size: .85rem; color: var(--muted); } .result b { font-size: 1.05rem; }
.result.big { border-left-width: 6px; } .result.big.ok { border-left-color: var(--ok); } .result.big.warn { border-left-color: var(--warn); } .result.big.info { border-left-color: var(--info); }
.legal { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 8px 12px; font-weight: 600; }
.sources { margin-top: 10px; font-size: .82rem; } .sources ul { margin: 2px 0; } .src { overflow-wrap: anywhere; }
.srclist li { font-size: .85rem; }
details.card summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.foot { margin-top: 18px; padding: 0 6px; }

/* real estate professional hours: headline card, quick logger, month chart, material participation tests */
.headline { border: 2px solid var(--accent); }
.headline h2 { font-size: 1rem; }
.repline + .repline { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.repline p { margin: 4px 0; }
b.num { font-size: 1.6rem; font-weight: 800; letter-spacing: -.01em; }
.quick .chipsrow { margin: 4px 0 10px; }
.quick .q { margin: 4px 0 6px; }
.mchart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; align-items: end; margin: 6px 0 10px; }
.mc { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.mc .v { font-size: .6rem; color: var(--muted); min-height: .9rem; }
.mc .b { display: flex; align-items: flex-end; width: 100%; height: 64px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.mc .b i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; }
.mc small { font-size: .62rem; color: var(--muted); }
.mprop { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.mprop h3 { margin: 4px 0; overflow-wrap: anywhere; }
.tests { list-style: none; padding: 0; margin: 6px 0; }
.tests .ts { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; line-height: 1.3; }
.tests .ts b { font-weight: 600; font-size: .92rem; }
.tests .tk { flex: 0 0 24px; height: 24px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; background: var(--line); color: var(--muted); }
.ts-met .tk { background: var(--ok-bg); color: var(--ok); } .ts-no .tk { background: var(--miss-bg); color: var(--miss); }
.ts-maybe .tk, .ts-need .tk { background: var(--warn-bg); color: var(--warn); }
.ts-na { opacity: .7; }
details.mpq { background: var(--bg); border-radius: 10px; padding: 8px 10px; margin: 6px 0; }
details.mpq summary { cursor: pointer; font-weight: 600; color: var(--accent); }

@media (max-width: 360px) { .tiles { grid-template-columns: 1fr; } .stats { grid-template-columns: 1fr 1fr; } }
@media print {
  .top, .tabs, .row, .btn, .ghost, .seg { display: none !important; }
  body, html { background: #fff; color: #000; } .card { border-color: #bbb; break-inside: avoid; } main { padding: 0; }
}
