/* Apartment App styles. Colours are tokens with a dark-mode set below. */
:root {
  --bg: #EDF1F0; --surface: #FFFFFF; --surface-2: #F4F7F6; --ink: #14242B; --muted: #56676D; --line: #D7E0DE;
  --accent: #0C6A5E; --accent-ink: #FFFFFF; --accent-soft: #DDEFEA;
  --lit: #F2B33A; --lit-soft: #FCEFD2; --lit-text: #7A4E00;
  --lit-2: #FFD983; --glow: rgba(242, 179, 58, .55);
  --facade: #C8D3D0; --facade-dark: #97A9A5; --win-dark: #31444B;
  --footer-bg: #14242B; --footer-ink: #DCE6E4; --footer-line: rgba(220, 230, 228, .18);
  --ok: #157A3A; --ok-soft: #DCF2E3; --warn: #A84B08; --warn-soft: #FBE9D9;
  --scrim: rgba(12, 22, 26, .45);
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s-avg: #97A9A5;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D1518; --surface: #142026; --surface-2: #1A2830; --ink: #E3ECEB; --muted: #94A6AA; --line: #25373D;
    --accent: #4CC2AD; --accent-ink: #04211C; --accent-soft: #16352F;
    --lit: #F2B33A; --lit-soft: #3A2C10; --lit-text: #F7C86A;
    --lit-2: #FFD983; --glow: rgba(242, 179, 58, .6);
    --facade: #1B292E; --facade-dark: #283A40; --win-dark: #0A1114;
    --footer-bg: #081012; --footer-ink: #C9D5D6; --footer-line: rgba(201, 213, 214, .15);
    --ok: #5BD68A; --ok-soft: #12301F; --warn: #F2A15F; --warn-soft: #3A2414;
    --scrim: rgba(0, 0, 0, .6);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s-avg: #5D7177;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }

.app { max-width: 1040px; margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 64px max(16px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 16px; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Header */
.bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.brand { font-family: var(--f-display); font-weight: 700; font-size: 20px; flex: none; }
.bar-right { display: flex; gap: 8px; align-items: center; min-width: 0; flex: 1 1 230px; justify-content: flex-end; }
.switch { min-height: 40px; min-width: 0; max-width: 100%; flex: 1 1 auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); padding: 0 10px; font-weight: 600; }
.avatar { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--accent-soft); color: var(--accent); font-weight: 700; flex: none; }


.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--warn); color: #fff; font-size: 12px; line-height: 20px; margin-left: 4px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card.soft { background: var(--accent-soft); border-color: transparent; }
.card.alert { background: var(--warn-soft); border-color: var(--warn); }
.card h1 { font-family: var(--f-display); font-size: 28px; line-height: 1.15; margin: 0; }
.card h2 { font-family: var(--f-display); font-size: 19px; line-height: 1.25; margin: 0; }
.card h3 { font-size: 16px; margin: 0; }
.card p { margin: 0; }
.muted, .note { color: var(--muted); }
.note { font-size: 13px; }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.code-big { font-family: var(--f-display); font-size: 34px; font-weight: 700; letter-spacing: .06em; }

/* Buttons and chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; text-align: center; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--warn); border-color: var(--warn); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn.big { min-height: 52px; font-size: 16px; }
.btn:disabled { opacity: .55; cursor: default; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.btn:focus-visible, .mitem:focus-visible, .burger:focus-visible, .linkbtn:focus-visible, .avatar:focus-visible, .switch:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.acc { background: var(--accent-soft); color: var(--accent); }
.chip.lit { background: var(--lit-soft); color: var(--lit-text); }
.tchip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; min-height: 36px; }

/* Forms */
form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.input { min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); color: var(--ink); width: 100%; }
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.role-pick { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.role-pick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.role-pick span { display: flex; flex-direction: column; gap: 1px; }
.role-pick small { color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.4; }
.err { color: var(--warn); font-size: 13px; font-weight: 600; margin: 0; }

/* Lists */
.list { display: flex; flex-direction: column; }
.li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.li:first-child { border-top: 0; padding-top: 0; }
.li .t { font-weight: 600; }
.li .m { color: var(--muted); font-size: 13px; }
.li .full { grid-column: 1 / -1; }

/* Notices */
.notice { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.notice.pin { border-color: var(--warn); background: var(--warn-soft); }
.notice h3 { font-family: var(--f-display); font-size: 17px; margin: 0; line-height: 1.3; }
.notice .when { font-weight: 600; font-size: 14px; }
.notice p { margin: 0; white-space: pre-wrap; }
.ntop { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }

/* Tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td .person { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
th.r, td.r { text-align: right; white-space: nowrap; }
tfoot td { border-bottom: 0; background: var(--surface-2); }
tr.cancelled td:not(:last-child) { text-decoration: line-through; color: var(--muted); }
tr.cancelled td:last-child { white-space: normal; max-width: 220px; text-align: left; }
.month-pick { width: auto; min-height: 38px; padding: 6px 10px; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 12px 0 4px; }
.stat { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat .v small { font-size: 12px; font-weight: 500; color: var(--muted); }
.li .num { text-align: right; font-variant-numeric: tabular-nums; }
.stats.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.accounts { background: var(--accent-soft); border-radius: 10px; padding: 4px 12px; margin: 10px 0 4px; font-variant-numeric: tabular-nums; }
.accounts .arow { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.accounts .arow > span:first-child { display: flex; flex-direction: column; }
.accounts .arow small { color: var(--muted); font-size: 12px; }
.accounts .arow > span:last-child { white-space: nowrap; text-align: right; }
.accounts .arow.total { border-bottom: 0; font-weight: 700; font-size: 16px; }
.income-line { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } .stats.three .v { font-size: 16px; } }
#flats-card .input.sz { min-height: 32px; padding: 4px 8px; width: 96px; text-align: right; }
table.readings .input.rd { min-height: 34px; padding: 4px 8px; width: 120px; text-align: right; font-variant-numeric: tabular-nums; }
table.readings td { vertical-align: middle; }
table.readings tr.bad td { background: var(--warn-soft); }
table.readings tr.bad .rd-used { color: var(--warn); font-weight: 600; }
@media (max-width: 640px) {
  /* Readings as compact rows on phones: flat and charge on top, From and To boxes below. */
  table.readings, table.readings tbody { display: block; }
  table.readings thead { display: none; }
  table.readings tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  table.readings td { border: 0; padding: 0; background: none; }
  table.readings .rd-flat { grid-column: 1; grid-row: 1; }
  table.readings .rd-charge { grid-column: 2; grid-row: 1; text-align: right; font-weight: 600; }
  table.readings .rd-from { grid-column: 1; grid-row: 2; text-align: left; }
  table.readings .rd-to { grid-column: 2; grid-row: 2; }
  table.readings .rd-used { grid-column: 1 / -1; grid-row: 3; text-align: left; color: var(--muted); }
  table.readings .rd-used:not(:empty)::before { content: "Used: "; }
  table.readings .input.rd { width: 100%; }
  table.readings .rd-from:not(:has(input))::before { content: "From "; color: var(--muted); }
}
.sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 6px; }
.size { display: flex; align-items: center; gap: 8px; }
.size span { min-width: 44px; font-weight: 600; font-size: 14px; }
.size .input { min-height: 38px; padding: 6px 10px; }
#sizes-form { margin-top: 10px; }
.hint-box.warnbox { background: var(--warn-soft); }
.hint-box.warnbox p { color: var(--warn); }
.bill { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0 12px; }
.bill h3 { margin: 0; font-size: 16px; }
.bill .bill-due { margin: 4px 0 6px; }
.bline { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.bline > span:first-child { display: flex; flex-direction: column; }
.bline small { color: var(--muted); font-size: 12px; }
.bline > span:last-child { white-space: nowrap; text-align: right; }
.bline.total { font-weight: 700; border-bottom-style: solid; }
.bline.due { border-bottom: 0; font-weight: 700; font-size: 16px; padding-top: 10px; }
.bline.cancelled > span { text-decoration: line-through; color: var(--muted); }
.list.stmt .li { align-items: flex-start; }
.list.stmt .li .num { white-space: nowrap; }
.list.stmt .li.cancelled b, .list.stmt .li.cancelled .num { text-decoration: line-through; color: var(--muted); }
.stmt-wrap { margin-top: 6px; }
.payboard { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 6px; margin-top: 8px; }
.payboard.floor + .payboard.floor { margin-top: 14px; }
.pb { border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; gap: 1px; font-variant-numeric: tabular-nums; }
.pb b { font-size: 14px; }
.pb span { font-size: 11px; font-weight: 600; }
.pb.paid { background: var(--ok-soft); color: var(--ok); }
.pb.pending { background: var(--warn-soft); color: var(--warn); }
.pb.excluded { background: var(--surface-2); color: var(--muted); }
h3.day { font-size: 13px; color: var(--muted); font-weight: 600; margin: 16px 0 4px; }
.li.act { flex-direction: column; align-items: flex-start; gap: 2px; }
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Tankers as compact cards on phones: time and price, vendor and per-litre, litres and actions. */
  table.water, table.water tbody, table.water tfoot { display: block; }
  table.water thead { display: none; }
  table.water tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  table.water tfoot tr { border-bottom: 0; background: var(--surface-2); }
  table.water td { border: 0; padding: 0; background: none; text-align: left; }
  table.water .w-when { grid-column: 1; grid-row: 1; font-weight: 600; }
  table.water .w-amt { grid-column: 2; grid-row: 1; text-align: right; font-weight: 600; }
  table.water .w-vendor { grid-column: 1; grid-row: 2; }
  table.water .w-rate { grid-column: 2; grid-row: 2; text-align: right; }
  table.water .w-l { grid-column: 1; grid-row: 3; color: var(--muted); }
  table.water .w-l::after { content: " litres"; }
  table.water .w-act { grid-column: 2; grid-row: 3; text-align: right; }
  table.water tr.cancelled .w-act { grid-column: 1 / -1; grid-row: 4; max-width: none; }
  /* Income as compact cards on phones: date and amount, kind and who paid, then the buttons. */
  table.income, table.income tbody, table.income tfoot { display: block; }
  table.income thead { display: none; }
  table.income tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  table.income tfoot tr { border-bottom: 0; background: var(--surface-2); }
  table.income td { border: 0; padding: 0; background: none; text-align: left; }
  table.income .i-date { grid-column: 1; grid-row: 1; font-weight: 600; }
  table.income .i-amt { grid-column: 2; grid-row: 1; text-align: right; font-weight: 600; }
  table.income .i-kind { grid-column: 1; grid-row: 2; }
  table.income .i-from { grid-column: 1; grid-row: 3; color: var(--muted); }
  table.income .i-act { grid-column: 2; grid-row: 2 / span 2; text-align: right; align-self: center; }
  table.income tr.cancelled .i-act { grid-column: 1 / -1; grid-row: 4; max-width: none; text-align: left; }
}
.x-mini { border: 1px solid var(--line); background: var(--surface); color: var(--warn); border-radius: 6px; font-size: 12px; padding: 0 6px; min-height: 24px; cursor: pointer; }
.x-mini.edit { color: var(--accent); }
.quickfill { margin: 4px 0 12px; }
.quickfill summary { cursor: pointer; color: var(--accent); font-size: 14px; font-weight: 600; padding: 4px 0; }
.quickfill[open] summary { margin-bottom: 10px; }
.quickfill .row { margin-top: 10px; }
.hint-box { background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; margin: 4px 0 12px; display: flex; flex-direction: column; gap: 8px; }
.hint-box p { margin: 0; font-size: 14px; }

/* Role editor */
.role-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1.2fr) auto; gap: 8px; align-items: center; }
@media (max-width: 560px) { .role-row { grid-template-columns: minmax(0, 1fr) auto; grid-auto-flow: row dense; padding-bottom: 8px; border-bottom: 1px solid var(--line); } .role-row .covers, .role-row .holder { grid-column: 1 / -1; } }

/* Wider layouts on laptops */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.home-grid .stack { gap: 16px; }
@media (min-width: 900px) {
  .home-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
  .home-grid .side-col { position: sticky; top: 72px; }
}
/* Sign-in, join and setup screens stay a comfortable reading width */
.app > .card, .app > section.card { max-width: 760px; width: 100%; margin-left: auto; margin-right: auto; }

/* ---------- Public website ---------- */
.app.wide { max-width: 1160px; gap: 0; padding-top: 0; padding-bottom: 0; }
/* .band paints its background edge to edge while content stays in the column */
.band { border-image: conic-gradient(var(--band) 0 0) fill 0 / / 0 100vmax; }
.test-strip { --band: var(--warn-soft); border-image: conic-gradient(var(--band) 0 0) fill 0 / / 0 100vmax; color: var(--warn); font-size: 13px; font-weight: 600; padding: 6px 0; text-align: center; }
.site-header { --band: var(--surface); position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 12px 0;
  box-shadow: 0 0 0 100vmax var(--surface), 0 1px 0 100vmax var(--line); clip-path: inset(0 -100vmax -1px); }
.site-header .brand { color: var(--ink); text-decoration: none; display: inline-flex; gap: 8px; align-items: center; }
.site-nav { display: flex; gap: 4px; margin: 0 auto; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 8px; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.site-nav a:focus-visible, .site-footer a:focus-visible, .site-header .brand:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.head-actions { flex-wrap: nowrap; }
.burger.site-burger { display: none; }
@media (max-width: 760px) {
  .site-header { flex-wrap: wrap; }
  .site-header .chip { display: none; }
  .head-actions { margin-left: auto; }
  .burger.site-burger { display: flex; }
  .site-nav { display: none; order: 3; width: 100%; flex-direction: column; margin: 0; padding-top: 4px; }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px; }
}
.site-main { display: flex; flex-direction: column; }
.hero { --band: var(--surface); display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px; align-items: center; padding: 32px 0; }
.hero-title { font-family: var(--f-display); font-size: clamp(34px, 7vw, 48px); line-height: 1.04; letter-spacing: -.02em; margin: 8px 0 12px; text-wrap: balance; }
.lead { font-size: 17px; color: var(--muted); margin: 0 0 18px; max-width: 40ch; }
.invite { background: var(--accent-soft); color: var(--accent); border-radius: 10px; padding: 10px 12px; margin: 0 0 14px; }
.hero .note { margin: 12px 0 0; }
.building-art { background: var(--facade); border-radius: 10px 10px 0 0; padding: 0 14px; max-width: 260px; width: 100%; justify-self: center; }
.building-art .roof { height: 12px; background: var(--facade-dark); margin: 0 -14px 14px; border-radius: 10px 10px 0 0; }
.building-art .grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.building-art i { aspect-ratio: 1 / 1.15; border-radius: 5px 5px 2px 2px; background: var(--win-dark); }
.building-art i.on { background: linear-gradient(180deg, var(--lit-2), var(--lit)); box-shadow: 0 0 16px -4px var(--glow); animation: lightup .7s ease-out both; animation-delay: var(--d); }
@keyframes lightup { from { background: var(--win-dark); box-shadow: none; } }
.building-art .ground { height: 18px; background: var(--facade-dark); margin: 14px -14px 0; }
.section { padding: 40px 0 0; display: flex; flex-direction: column; gap: 16px; }
.section-title { font-family: var(--f-display); font-size: 26px; margin: 0; letter-spacing: -.01em; }
.page-head { padding: 44px 0 0; }
.page-head h1 { font-family: var(--f-display); font-size: clamp(32px, 6vw, 48px); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 8px; }
.page-head .lead { margin: 0; }
.whys { display: flex; flex-direction: column; gap: 10px; }
.why { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.why .was { color: var(--muted); }
.why .now { font-weight: 600; }
.why em { display: block; font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 2px; }
.why .was em { color: var(--muted); }
.why .now em { color: var(--accent); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tile h3 { font-family: var(--f-display); font-size: 18px; margin: 0; }
.tile p { margin: 0; color: var(--muted); font-size: 15px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot.warn { background: var(--warn); } .dot.lit { background: var(--lit); } .dot.acc { background: var(--accent); } .dot.ok { background: var(--ok); }
.soon .chip { font-size: 13px; padding: 5px 12px; }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.steps li::before { content: counter(s); grid-row: 1 / 3; font-family: var(--f-display); font-weight: 700; font-size: 30px; line-height: 1; color: var(--lit); align-self: center; }
.steps li span { color: var(--muted); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.two-col.contact { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; color: var(--muted); }
.ticks li { display: flex; gap: 10px; align-items: baseline; }
.ticks li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; transform: translateY(-1px); }
.prose h3 { font-family: var(--f-display); font-size: 18px; margin: 22px 0 4px; }
.prose h3:first-child { margin-top: 0; }
.prose p { margin: 0; max-width: 65ch; }
.cta-band { --band: var(--accent); color: var(--accent-ink); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 40px 0; margin-top: 48px; }
.cta-band h2 { font-family: var(--f-display); font-size: 28px; margin: 0; letter-spacing: -.01em; }
.cta-band p { margin: 6px 0 0; opacity: .85; }
.cta-band .btn.primary { background: var(--accent-ink); color: var(--accent); border-color: var(--accent-ink); }
.site-footer { --band: var(--footer-bg); color: var(--footer-ink); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 32px; padding: 36px 0 28px; }
.cta-band + .site-footer, .site-main:has(> .cta-band:last-child) + .site-footer { margin-top: 0; }
.site-main + .site-footer { margin-top: 48px; }
.site-footer .brand { color: var(--footer-ink); font-size: 18px; }
.site-footer p { margin: 6px 0 0; opacity: .8; font-size: 14px; }
.site-footer nav { display: flex; gap: 8px 20px; flex-wrap: wrap; align-content: start; }
.site-footer a { color: var(--footer-ink); text-decoration: none; font-size: 14px; }
.site-footer a:hover { text-decoration: underline; }
.fine-print { grid-column: 1 / -1; font-size: 12px; opacity: .65; border-top: 1px solid var(--footer-line); padding-top: 14px; margin: 8px 0 0; }
@media (min-width: 900px) {
  .hero { padding: 64px 0; }
  .hero-title { font-size: 60px; }
  .lead { font-size: 19px; }
  .building-art { max-width: 340px; padding: 0 20px; }
  .building-art .roof { height: 16px; margin: 0 -20px 20px; }
  .building-art .grid { gap: 14px; }
  .building-art .ground { height: 26px; margin: 20px -20px 0; }
  .whys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .why { grid-template-columns: 1fr; gap: 12px; align-content: start; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tiles.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .switch { flex: 0 1 360px; }
}
@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; gap: 18px; padding: 24px 0 28px; }
  .building-art { order: -1; max-width: 132px; justify-self: start; padding: 0 9px; }
  .building-art .grid { gap: 6px; }
  .building-art .roof { height: 9px; margin: 0 -9px 9px; }
  .building-art .ground { height: 12px; margin: 9px -9px 0; }
  .why { grid-template-columns: 1fr; gap: 10px; }
  .tiles, .tiles.six, .two-col, .two-col.contact { grid-template-columns: 1fr; }
  .site-footer { grid-template-columns: 1fr; }
  .section, .page-head { padding-top: 28px; }
}


/* Home: hero preview, facts, five parts, views */
.hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.facts { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--muted); font-size: 14px; }
.facts li { display: flex; align-items: center; gap: 8px; }
.facts li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.mock { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 440px; justify-self: end;
  box-shadow: 0 1px 2px rgba(20, 36, 43, .05), 0 22px 44px -22px rgba(20, 36, 43, .3); }
.mock-top { display: flex; justify-content: space-between; align-items: center; font-family: var(--f-display); font-size: 17px; }
.mock-alert { background: var(--warn-soft); border: 1px solid var(--warn); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.mock-alert span { color: var(--muted); font-size: 13px; }
.mock-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mock-num { font-family: var(--f-display); font-weight: 700; font-size: 30px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.mock-sub { color: var(--muted); font-size: 13px; }
.mini-building { display: grid; grid-template-columns: repeat(6, 11px); gap: 4px; padding: 7px; background: var(--facade); border-radius: 4px 4px 0 0; flex: none; }
.mini-building i { width: 11px; height: 11px; border-radius: 2px; background: var(--win-dark); }
.mini-building i.on { background: var(--lit); animation: lightup .5s ease-out both; animation-delay: var(--d); }
.mock-bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.mock-bar span { display: block; height: 100%; width: 71%; background: var(--lit); border-radius: 99px; }
.mock-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.mock-list div { display: grid; grid-template-columns: minmax(0, 1fr) auto 84px; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; align-items: center; }
.mock-list b { font-variant-numeric: tabular-nums; }
.mock-list em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--warn); text-align: right; }
.mock-list em.ok { color: var(--ok); }
.mock-foot { display: flex; justify-content: space-between; align-items: center; }
.mock-ex { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.more { color: var(--accent); font-weight: 600; text-decoration: none; }
.more::after { content: " \2192"; }
.section-title .chip { vertical-align: middle; margin-left: 8px; font-family: var(--f-body); letter-spacing: 0; }
.pillars { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.pillar { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pillar-top { display: flex; justify-content: space-between; align-items: center; min-height: 22px; }
.pillar h3 { font-family: var(--f-display); font-size: 19px; margin: 0; }
.pillar p { margin: 0; color: var(--muted); font-size: 14px; }
.pillar .ticks { font-size: 14px; margin-top: 4px; }
.view-card h3 { font-family: var(--f-display); font-size: 20px; margin: 0; }
/* Features page */
.fgroups { gap: 0; }
.fgroup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 24px; padding: 28px 0; border-top: 1px solid var(--line); }
.fgroup:first-child { border-top: 0; padding-top: 0; }
.fgroup h2 { font-family: var(--f-display); font-size: 24px; margin: 0; }
.fgroup > div > p { margin: 4px 0 0; color: var(--muted); }
.flist { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.frow { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 16px; border-top: 1px solid var(--line); }
.frow:first-child { border-top: 0; }
.frow > div > b { display: block; }
.frow > div > span { color: var(--muted); font-size: 14px; }
.frow > .chip { flex: none; }
/* How it works: monthly routine */
.cycle { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cycle li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.cycle b { font-family: var(--f-display); font-size: 18px; color: var(--accent); }
.cycle span { color: var(--muted); }
@media (min-width: 900px) { .hero-title { font-size: 54px; } }
@media (max-width: 1100px) and (min-width: 641px) {
  .pillars { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cycle { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 640px) {
  .mock { justify-self: stretch; max-width: none; }
  .pillars, .cycle, .fgroup { grid-template-columns: 1fr; }
  .fgroup { gap: 12px; }
  .frow { align-items: flex-start; }
}

/* Sheet and toast */
.overlay { position: fixed; inset: 0; z-index: 20; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); color: var(--ink); width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 20px max(16px, env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 14px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sheet-head h3 { font-family: var(--f-display); font-size: 20px; margin: 0; }
.x { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); width: 36px; height: 36px; border-radius: 50%; font-size: 20px; line-height: 1; flex: none; }
@media (min-width: 640px) { .overlay { align-items: center; } .sheet { border-radius: 18px; padding: 24px; } }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 30; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; max-width: calc(100% - 32px); box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.toast.bad { background: var(--warn); color: #fff; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.logo { width: 28px; height: 28px; flex: none; }
.site-footer .logo { width: 24px; height: 24px; }

/* Charts (charts.js). Series colours are --s1…--s5; text stays in ink colours. */
.viz-fig { margin: 0; }
.viz { width: 100%; height: auto; display: block; max-width: 560px; overflow: visible; }
.viz .ax { font-size: 10px; fill: var(--muted); }
.viz .val { font-size: 11px; font-weight: 600; fill: var(--ink); }
.viz .grid { stroke: var(--line); stroke-dasharray: 2 3; }
.viz .baseline { stroke: var(--facade-dark); stroke-width: 1; }
.viz .s1 { fill: var(--s1); } .viz .s2 { fill: var(--s2); } .viz .s3 { fill: var(--s3); } .viz .s4 { fill: var(--s4); } .viz .s5 { fill: var(--s5); } .viz .avg { fill: var(--s-avg); }
.viz .ln { stroke: var(--s1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz .dot { fill: var(--s1); stroke: var(--surface); stroke-width: 2; }
.viz rect:hover, .viz .dot:hover { opacity: .8; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.sw.s1 { background: var(--s1); } .sw.s2 { background: var(--s2); } .sw.s3 { background: var(--s3); } .sw.s4 { background: var(--s4); } .sw.s5 { background: var(--s5); } .sw.avg { background: var(--s-avg); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.viz-h { font-size: 13px; font-weight: 600; margin: 16px 0 6px; color: var(--muted); }
.viz-table summary { font-size: 12px; color: var(--muted); cursor: pointer; margin-top: 6px; }
table.mini { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
table.mini th, table.mini td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; }
table.mini th { color: var(--muted); font-size: 12px; }
table.mini .num { text-align: right; font-variant-numeric: tabular-nums; }
.split-list { display: grid; gap: 6px; margin-top: 10px; font-size: 14px; }
.split-list div { display: grid; grid-template-columns: 12px 1fr auto 40px; gap: 8px; align-items: center; }
.split-list b { font-weight: 600; font-variant-numeric: tabular-nums; }
.split-list em { font-style: normal; color: var(--muted); text-align: right; font-size: 13px; }
.glance { display: flex; align-items: center; gap: 14px; margin: 10px 0 4px; }
.glance p { margin: 2px 0 0; }
.glance-v { font-weight: 700; font-size: 16px; }
svg.viz.ring { flex: none; width: 84px; height: 84px; max-width: none; }
.ring .track { stroke: var(--line); }
.ring .arc { stroke: var(--accent); }
.ring-t { font-size: 16px; font-weight: 700; fill: var(--ink); }
#chase-card .viz-fig { margin-top: 12px; }

/* Water nudge on My flat */
.nudge { border-radius: 12px; padding: 12px 14px; margin: 10px 0; border: 1px solid; }
.nudge b { display: block; }
.nudge p { margin: 4px 0 0; }
.nudge ul { margin: 6px 0 0; padding-left: 18px; }
.nudge.warn { background: var(--warn-soft); border-color: var(--warn); }
.nudge.warn b { color: var(--warn); }
.nudge.good { background: var(--ok-soft); border-color: var(--ok); }
.nudge.good b { color: var(--ok); }

/* App bar and ☰ menu */
.appbar { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 12px; background: var(--bg); padding: 8px 0; border-bottom: 1px solid var(--line); }
.appbar-title { margin: 0; font-family: var(--f-display); font-size: 18px; font-weight: 700; display: flex; align-items: center; justify-content: flex-start; gap: 8px; min-width: 0; }
.appbar-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.burger { position: relative; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; padding: 0; }
.burger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); }
.dot-badge { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.scrim { position: fixed; inset: 0; border: 0; padding: 0; background: rgba(10, 20, 24, .45); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(300px, 84vw); background: var(--surface); z-index: 50; transform: translateX(-102%); transition: transform .22s ease; display: flex; flex-direction: column; box-shadow: 8px 0 24px rgba(0, 0, 0, .15); padding: 14px 10px; gap: 8px; }
.drawer.open { transform: none; }
.drawer .switch { flex: none; width: 100%; }
.drawer-head { display: flex; flex-direction: column; gap: 12px; padding: 4px 6px 12px; border-bottom: 1px solid var(--line); }
.drawer-items { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; padding-top: 6px; }
.drawer-foot { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.mitem { display: flex; align-items: center; gap: 14px; min-height: 46px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font-size: 15px; font-weight: 600; text-align: left; width: 100%; }
.mitem svg { color: var(--muted); flex: none; }
.mitem[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.mitem[aria-current="page"] svg { color: var(--accent); }
.mitem .badge { margin-left: auto; }
.mitem.small { font-size: 14px; min-height: 40px; color: var(--muted); }
.steps { margin: 4px 0 12px; padding-left: 20px; }
.steps li { margin: 4px 0; }
.acct { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 8px; }
.acct dt { color: var(--muted); font-size: 13px; }
.acct dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 420px) { .acct { grid-template-columns: 1fr; gap: 2px; } .acct dd { margin-bottom: 8px; } }
