/* NextHome brand (Branding Guidelines p.5, p.25-26):
   primary  NextHome Orange #FF6C2C (never modified), NextHome Gray #959499
   secondary Blue #236A95, Green #357D57, Yellow #FFCF41 / #FFDD7F, Purple #825CA7
   fonts    Libre Baskerville (headlines), Work Sans (body)
   Orange text on white is low-contrast, so orange is used for fills and accents with dark
   text on it; body text is near-black for readability outdoors. Red is used ONLY for errors. */
:root {
  --orange: #FF6C2C; --gray: #959499;
  --bg: #FFFFFF; --card: #fff; --soft: #F4F4F5; --ink: #231F20; --muted: #5E5D63; --line: #E1E1E4;
  --brand: #FF6C2C; --brand-ink: #231F20;
  --ok: #357D57; --ok-bg: #E3EFE8; --warn: #6B4E00; --warn-bg: #FFF1C7; --bad: #B3261E; --bad-bg: #FDE8E7;
  --info: #236A95; --info-bg: #E2EDF4; --radius: 12px;
  --tap: 48px;
  --head: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --body: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 var(--body);
  padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
a { color: var(--info); }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid rgba(255,108,44,.45); outline-offset: 1px; }
.demo-banner { background: #825CA7; color: #fff; text-align: center; font-weight: 700; font-size: 14px; padding: 6px 12px; }
header.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  background: #fff; color: var(--ink); padding: calc(8px + env(safe-area-inset-top)) 16px 8px; border-bottom: 3px solid var(--orange); }
header.top a { color: var(--ink); text-decoration: none; }
.brand { display: block; padding: 6px 4px; } /* clear space around the logo */
.brand img { display: block; height: 44px; width: auto; }
.login-logo { display: block; width: 220px; max-width: 70%; height: auto; margin: 12px auto 20px; }
footer.site { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 16px 8px; line-height: 1.6; }
footer.site b { color: var(--ink); font-weight: 600; }
.bell { padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 15px; font-weight: 600; }
.bell b { background: var(--orange); color: var(--ink); border-radius: 999px; padding: 0 7px; margin-left: 4px; }
main { max-width: 980px; margin: 0 auto; padding: 12px 16px 24px; }
h1 { font-family: var(--head); font-weight: 700; font-size: 23px; margin: 8px 0 12px; }
h2 { font-family: var(--head); font-weight: 700; font-size: 17px; margin: 0; }
h2.sec { font-family: var(--body); margin: 22px 0 8px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.back { display: inline-block; margin: 4px 0; text-decoration: none; font-size: 16px; min-height: 32px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; }
.card.warn { border-color: var(--orange); }
.card-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
nav.tabs a { flex: 1; text-align: center; padding: 16px 2px; min-height: 56px; text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
nav.tabs a.on { color: var(--ink); box-shadow: inset 0 3px 0 var(--orange); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; margin: 4px 4px 4px 0; }
.btn.primary { background: var(--orange); color: var(--ink); border-color: var(--orange); }
.btn.primary:active { filter: brightness(.95); }
.btn.ghost { background: transparent; }
.btn.big { width: 100%; font-size: 18px; min-height: 56px; }
.btn.sm { min-height: 38px; padding: 6px 12px; font-size: 15px; }
form.inline { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 15px; }
label small { font-weight: 400; color: var(--muted); }
input, select, textarea { font: inherit; font-size: 17px; padding: 11px 12px; min-height: var(--tap); border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); width: 100%; }
input.short { width: 110px; display: inline-block; }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; padding: 6px 0; }
label.check input { width: 24px; height: 24px; min-height: 24px; flex: none; margin-top: 2px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
legend { font-weight: 700; padding: 0 6px; }
details { margin: 8px 0; }
summary { cursor: pointer; font-weight: 600; min-height: 40px; padding: 8px 0; color: var(--info); }
.flash { padding: 12px 14px; border-radius: 10px; margin: 10px 0; background: var(--info-bg); }
.flash.ok { background: var(--ok-bg); } .flash.warn { background: var(--warn-bg); } .flash.bad { background: var(--bad-bg); }
.note { color: var(--muted); font-size: 15px; }
.muted { color: var(--muted); }
.bad-t { color: var(--bad); }
.empty { color: var(--muted); font-style: italic; }
.badge { display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--info-bg); color: var(--info); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.muted { background: var(--line); color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; text-decoration: none; color: var(--ink); min-height: 84px; }
.stat-v { font-size: 24px; font-weight: 800; } .stat-l { font-size: 14px; color: var(--muted); }
.stat.warn { border-color: var(--orange); } .stat.bad { border-color: var(--bad); } .stat.bad .stat-v { color: var(--bad); }
.stat.est .stat-v, .est { font-style: italic; color: var(--muted); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { border-bottom: 1px solid var(--line); }
.list li a { display: block; padding: 12px 2px; text-decoration: none; color: var(--ink); min-height: var(--tap); }
.list.big li a { font-size: 18px; padding: 16px 4px; }
.list li.unread a { font-weight: 600; }
.picks li { display: flex; gap: 8px; align-items: center; }
.picks li a { flex: 1; }
.sticky-actions { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); background: var(--bg); padding: 8px 0; }
.kv { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 6px 12px; margin: 0; }
.kv dt { color: var(--muted); font-size: 15px; } .kv dd { margin: 0; overflow-wrap: anywhere; }
.kv ul { margin: 0; padding-left: 18px; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); padding: 8px 6px; }
.tbl td { border-bottom: 1px solid var(--line); padding: 10px 6px; vertical-align: top; }
@media (max-width: 700px) {
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .tbl td { border: 0; padding: 3px 0; }
  .tbl td[data-l]:not(:first-child)::before { content: attr(data-l) ": "; color: var(--muted); font-size: 13px; }
  .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 8px; }
}
.search { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.search input[type=search] { flex: 1 1 260px; }
.search label { flex: 1 1 140px; }
.chip { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); margin: 2px; min-height: 40px; }
.chip.on { background: var(--orange); color: var(--ink); border-color: var(--orange); }
.timeline { list-style: none; padding: 0; margin: 0; } .timeline li { border-left: 3px solid var(--line); padding: 6px 0 10px 12px; }
pre.agreement { white-space: pre-wrap; font: 15px/1.5 ui-monospace, Menlo, Consolas, monospace; background: var(--soft); padding: 12px; border-radius: 10px; max-height: 38vh; overflow: auto; }
.calc { font-size: 17px; line-height: 1.7; }
textarea.copy { font: 15px/1.5 ui-monospace, Menlo, monospace; }
code { background: var(--soft); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
