:root {
  --bg: #fbf6ee; --card: #ffffff; --ink: #2b2622; --muted: #6f655b; --line: #e8dccb;
  --primary: #a8481f; --on-primary: #ffffff; --accent: #3f6b54; --accent-soft: #e3efe7;
  --warn: #8a5a00; --warn-soft: #fbefd2; --bad: #a3271f; --bad-soft: #fbe3df; --soft: #f4ebdd;
  --radius: 16px; --shadow: 0 1px 2px rgba(60, 40, 20, .08);
}
:root[data-theme="dark"] {
  --bg: #1c1916; --card: #272320; --ink: #f2eadf; --muted: #b3a89b; --line: #3a342e;
  --primary: #e58f66; --on-primary: #1c1916; --accent: #8cc3a3; --accent-soft: #24332b;
  --warn: #f0c36a; --warn-soft: #3a2f16; --bad: #f2a199; --bad-soft: #3c211e; --soft: #302b26; --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1916; --card: #272320; --ink: #f2eadf; --muted: #b3a89b; --line: #3a342e;
    --primary: #e58f66; --on-primary: #1c1916; --accent: #8cc3a3; --accent-soft: #24332b;
    --warn: #f0c36a; --warn-soft: #3a2f16; --bad: #f2a199; --bad-soft: #3c211e; --soft: #302b26; --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-size: 18px; line-height: 1.5;
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px 48px; }
header.top { padding: 20px 0 8px; }
.house { font-size: 1.6rem; font-weight: 700; line-height: 1.2; margin: 0; overflow-wrap: anywhere; }
.sub { color: var(--muted); font-size: .95rem; margin: 2px 0 0; }
nav.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 12px; scrollbar-width: none; }
nav.tabs a { white-space: nowrap; padding: 10px 14px; border-radius: 999px; background: var(--soft); color: var(--ink);
  text-decoration: none; font-size: .95rem; min-height: 44px; display: inline-flex; align-items: center; }
nav.tabs a[aria-current="page"] { background: var(--ink); color: var(--bg); }
h1 { font-size: 1.45rem; margin: 20px 0 10px; line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 26px 0 8px; }
h3 { font-size: 1rem; margin: 14px 0 4px; }
p { margin: 8px 0; }
a { color: var(--primary); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; box-shadow: var(--shadow); }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 18px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.good { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.small { min-height: 44px; padding: 6px 14px; font-size: .95rem; }
.btn.wide { width: 100%; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=url], input[type=tel], input[type=date], input[type=number], input[type=password], input[type=search], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; font: inherit; color: var(--ink); background: var(--bg); }
textarea { min-height: 96px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; font-weight: 500; margin: 0; }
.check input { width: 24px; height: 24px; accent-color: var(--primary); flex: none; }
.hint { color: var(--muted); font-size: .88rem; margin: 4px 0 0; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; background: var(--soft); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.banner { border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; font-weight: 600; }
.banner.block { background: var(--bad-soft); color: var(--bad); border: 1.5px solid var(--bad); }
.banner.info { background: var(--accent-soft); color: var(--accent); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.flash { border-radius: 12px; padding: 12px 14px; margin: 10px 0; font-weight: 600; background: var(--accent-soft); color: var(--accent); }
.flash.err { background: var(--bad-soft); color: var(--bad); }
.money { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.big { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain > li { padding: 12px 0; border-top: 1px solid var(--line); }
ul.plain > li:first-child { border-top: 0; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.tbl th, table.tbl td { text-align: left; padding: 8px 4px; border-top: 1px solid var(--line); vertical-align: top; }
table.tbl th { color: var(--muted); font-weight: 600; font-size: .85rem; border-top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
progress { width: 100%; height: 14px; accent-color: var(--accent); }
.bar { height: 12px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.w0{width:0}.w5{width:5%}.w10{width:10%}.w15{width:15%}.w20{width:20%}.w25{width:25%}.w30{width:30%}.w35{width:35%}.w40{width:40%}
.w45{width:45%}.w50{width:50%}.w55{width:55%}.w60{width:60%}.w65{width:65%}.w70{width:70%}.w75{width:75%}.w80{width:80%}.w85{width:85%}.w90{width:90%}.w95{width:95%}.w100{width:100%}
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .85rem; }
.code { word-break: break-all; background: var(--soft); border-radius: 12px; padding: 12px; width: 100%; min-height: 110px; }
.qr { display: block; margin: 12px auto; width: 240px; height: 240px; background: #fff; border-radius: 12px; padding: 8px; }
details { margin: 10px 0; }
summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; gap: 8px; color: var(--primary); list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); flex: none; transition: transform .15s; }
details[open] > summary::before { transform: rotate(45deg); }
[hidden] { display: none !important; }
.math { background: var(--soft); border-radius: 12px; padding: 12px 14px; font-size: .95rem; }
.math p { margin: 4px 0; }
footer.foot { margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
footer.foot a { color: var(--muted); }
.link-box { word-break: break-all; font-size: .85rem; }
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: 1.9rem; }
@media (min-width: 700px) { .wrap { padding-top: 12px; } }
@media (prefers-reduced-motion: no-preference) { .btn { transition: transform .08s; } .btn:active { transform: scale(.98); } }

/* print: the "Acordo da casa" sheet on one clean page */
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; color: #000; font-size: 11pt; line-height: 1.35; }
  .wrap { max-width: none; padding: 0; }
  nav.tabs, nav.botnav, .me-btn, .tiles-wrap, footer.foot, .noprint, .flash, header.top .sub, #install-hint, #offline-note, .top-hint { display: none !important; }
  header.top { padding: 0; }
  header.top .house { font-size: 10pt; color: #555; }
  .sheet h1 { font-size: 17pt; margin: 0 0 4pt; }
  .sheet h2 { font-size: 11.5pt; margin: 8pt 0 2pt; }
  .sheet p { margin: 2pt 0; }
  .sheet section.rule { break-inside: avoid; border-top: .5pt solid #999; padding-top: 4pt; }
  .sheet .muted, .sheet .hint { color: #444; }
  table.tbl th, table.tbl td { padding: 3pt 4pt; border-color: #999; }
  a { color: #000; text-decoration: none; }
}

/* onboarding */
ol.steps { list-style: none; display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; margin: 8px 0; scrollbar-width: none; }
ol.steps a { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 12px; border-radius: 999px;
  background: var(--soft); color: var(--ink); text-decoration: none; font-size: .9rem; }
ol.steps a[aria-current="step"] { background: var(--ink); color: var(--bg); }
.row.pair > .grow { flex: 1 1 130px; min-width: 0; }
.code.msg { word-break: normal; overflow-wrap: anywhere; }
.navrow { margin-top: 18px; }
.center { text-align: center; }

/* member first visit, install hint */
ol.three { margin: 0; padding-left: 1.3rem; }
ol.three li { margin: 8px 0; }
.welcome { border-color: var(--accent); }
#install-hint, #offline-note { border-radius: var(--radius); padding: 12px 14px; margin: 10px 0; font-size: .95rem; background: var(--soft); }
#install-hint[hidden], #offline-note[hidden] { display: none; }
#install-hint .row { margin-top: 6px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 .big { font-size: 1.5rem; }
p.center a, footer.foot a, .noprint a { display: inline-flex; align-items: center; min-height: 44px; }

/* identity: avatars, crest, member cards, themes in themes.css */
.av { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; flex: none;
  font-size: 1.35rem; font-weight: 700; color: #fff; overflow: hidden; vertical-align: middle; }
.av.big { width: 72px; height: 72px; font-size: 2.2rem; }
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av-c0 { background: #a8481f; } .av-c1 { background: #1f5f8b; } .av-c2 { background: #2f6b3f; } .av-c3 { background: #7a5c00; }
.av-c4 { background: #6d3b8a; } .av-c5 { background: #a5254f; } .av-c6 { background: #3b4652; } .av-c7 { background: #6b4226; }
.av-c8 { background: #0e6b6b; } .av-c9 { background: #8a3f6a; } .av-c10 { background: #4a5a1f; } .av-c11 { background: #8a2f2f; }
.crest { width: 56px; height: 66px; flex: none; }
.house-head { display: flex; gap: 12px; align-items: center; }
.motto { font-style: italic; color: var(--muted); margin: 2px 0 0; }
.person { display: flex; gap: 12px; align-items: center; padding: 10px 0; }
.person + .person { border-top: 1px solid var(--line); }
.person .grow strong { display: block; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--accent-soft); color: var(--accent); margin-left: 6px; }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
fieldset.pick { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 12px 0; }
fieldset.pick legend { padding: 0 6px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label.chip { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--card); cursor: pointer; font-size: 1.4rem; padding: 0 8px; }
.chips input[type=radio], .chips input[type=checkbox] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips input:checked + span, .chips label.chip:has(input:checked) { border-color: var(--primary); background: var(--accent-soft); outline: 2px solid var(--primary); }
.chips input:focus-visible + span { outline: 3px solid var(--primary); }
.swatch { width: 28px; height: 28px; border-radius: 50%; display: block; }
.person .grow span { display: block; }
.person .grow strong .tag { display: inline-block; }

/* navigation: bottom bar, profile button, pinned tiles, catalogue */
.nowrap { flex-wrap: nowrap; }
.ic { width: 24px; height: 24px; flex: none; }
.block { display: block; }
body.has-nav { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
nav.botnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bar-in { max-width: 640px; margin: 0 auto; display: flex; }
nav.botnav a { flex: 1 1 0; min-width: 0; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: .78rem; font-weight: 600; }
nav.botnav a[aria-current="page"] { color: var(--primary); }
nav.botnav a[aria-current="page"] .ic { stroke-width: 2.3; }
.me-btn { flex: none; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--soft); color: var(--ink); margin-top: 6px; }
.me-btn.on { background: var(--primary); color: var(--on-primary); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 4px; }
.tile { position: relative; min-height: 84px; padding: 12px 6px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); color: var(--ink);
  text-decoration: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: .88rem; font-weight: 600; text-align: center; box-shadow: var(--shadow); }
.tile .ic { color: var(--primary); width: 28px; height: 28px; }
.tile.add { background: transparent; border-style: dashed; color: var(--muted); }
.tile.add .ic { color: var(--muted); }
.badge { background: var(--primary); color: var(--on-primary); border-radius: 999px; min-width: 22px; height: 22px; padding: 0 6px; font-size: .78rem; line-height: 22px; text-align: center; }
.tile .badge { position: absolute; top: 6px; right: 8px; }
.badge.inl { display: inline-block; }
.cat { list-style: none; padding: 0; margin: 0; }
.cat-item { display: flex; gap: 10px; align-items: center; padding: 12px; margin: 8px 0; }
.cat-main { display: flex; gap: 12px; align-items: center; flex: 1 1 auto; min-width: 0; color: var(--ink); text-decoration: none; }
.cat-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--soft); color: var(--primary); display: flex; align-items: center; justify-content: center; flex: none; }
.pinbtn { flex-direction: column; gap: 0; min-width: 64px; font-size: .74rem; padding: 4px 8px; }
.pinbtn .ic { width: 20px; height: 20px; }
.pinbtn.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.seg { display: flex; gap: 8px; }
.seg .btn { flex: 1; }
.seg .btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.me-btn img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.photo-hero { display: flex; justify-content: center; }
.photo-hero .av.big { width: 112px; height: 112px; font-size: 3rem; }
.photo-hero .av.big img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
label.btn { cursor: pointer; margin: 0; }
.in-android nav.botnav { bottom: var(--inset-b, 0px); }
.in-android.has-nav { padding-bottom: calc(76px + var(--inset-b, 0px)); }
.in-android nav.botnav::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: var(--inset-b, 0px); background: var(--card); }

/* desktop and tablet: a side rail instead of the bottom bar, a wider page, two columns where it helps */
@media (min-width: 960px) {
  body.has-nav { padding-bottom: 0; padding-left: 220px; }
  .wrap { max-width: 920px; padding: 0 32px 48px; }
  nav.botnav { top: 0; bottom: auto; right: auto; width: 220px; height: 100vh; border-top: 0; border-right: 1px solid var(--line); padding: 88px 12px 12px; border-radius: 0; }
  .bar-in { max-width: none; flex-direction: column; gap: 4px; }
  nav.botnav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 12px; font-size: 1rem; }
  nav.botnav a[aria-current="page"] { background: var(--soft); }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .cat { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .cat-item { margin: 0; }
  textarea.msg { max-width: 560px; }
  #install-hint { display: none !important; }
}

/* the monthly calendar: a grid on a wide screen, a plain list of the days with bills on a phone */
.cal-nav { margin: 8px 0; }
.cal { margin: 12px 0; }
.cal-head, .cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head { color: var(--muted); font-size: .85rem; text-align: center; margin-bottom: 4px; }
.cal-week { margin-bottom: 6px; }
.cal-day { min-height: 92px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day.off { background: transparent; border-style: dashed; opacity: .5; }
.cal-day.today { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary) inset; }
.cal-n { font-weight: 700; font-size: .9rem; }
.cal-mon { display: none; }
.cal-chip { display: block; border-radius: 8px; padding: 4px 6px; font-size: .74rem; line-height: 1.25; text-decoration: none; color: var(--ink); background: var(--soft); border-left: 4px solid var(--muted); overflow-wrap: anywhere; }
.cal-chip span { display: block; color: var(--muted); }
.cal-chip.paid { border-left-color: var(--accent); }
.cal-chip.said { border-left-color: var(--warn); }
.cal-chip.open, .cal-chip.late { border-left-color: var(--bad); }
.cal-chip.none { border-left-color: var(--primary); }
@media (max-width: 719px) {
  .cal-head, .cal-day.empty, .cal-day.off { display: none; }
  .cal-week { display: block; margin: 0; }
  .cal-day { min-height: 0; margin-bottom: 8px; padding: 10px; }
  .cal-mon { display: inline; color: var(--muted); font-weight: 500; }
  .cal-chip { font-size: .95rem; padding: 8px 10px; }
}
.seg a[aria-current="true"], .seg .btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg a.btn { text-decoration: none; }

/* home: a quiet row of links under the shortcuts, compact notices */
.quick { display: flex; gap: 6px 16px; flex-wrap: wrap; margin: 6px 0 2px; font-size: .95rem; }
.quick a { min-height: 44px; display: inline-flex; align-items: center; }
.card.slim { padding: 12px 16px; }
.more-rules { color: var(--muted); }
.check-row { background: var(--warn-soft); border-radius: 12px; padding: 12px; }
.card.house-head { align-items: center; }
.card.house-head .house { font-size: 1.3rem; }
.card.house-head .crest { width: 64px; height: 75px; }

/* "new ..." forms fold away behind a button-like summary; file pickers look like the app's buttons */
details.new > summary { justify-content: center; background: var(--primary); color: var(--on-primary); border-radius: 14px; min-height: 48px; padding: 0 18px; }
details.new[open] > summary { background: var(--soft); color: var(--ink); }
details.new > summary::before { display: none; }
input[type=file] { font: inherit; color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; min-height: 44px; padding: 8px 14px; margin-right: 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }

/* never wider than the screen; inside the phone apps the page does not zoom or pan sideways (it is an app, not a web page) */
html, body { overflow-x: clip; max-width: 100%; }
body.in-app { touch-action: pan-y; -webkit-text-size-adjust: 100%; }
.banner.block p { margin: 0; }
.banner.block details { margin: 4px 0 0; }
.banner.block summary { color: inherit; min-height: 36px; font-size: .9rem; }

/* list rows: settings and every "open this" list (UX audit 8.3) */
.group-label { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 24px 4px 8px; }
.rows { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.rowlink { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 16px; color: var(--ink); text-decoration: none; width: 100%; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.rowlink + .rowlink { border-top: 1px solid var(--line); }
.rowlink:active { background: var(--soft); }
.row-ic { width: 24px; height: 24px; color: var(--primary); flex: none; display: flex; }
.row-main { flex: 1 1 auto; min-width: 0; }
.row-t { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-s { display: block; font-size: 14px; color: var(--muted); }
.row-v { flex: 0 1 45%; text-align: right; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-v.warn { color: var(--warn); font-weight: 600; }
.row-chev { width: 8px; height: 8px; border-right: 2px solid var(--muted); border-top: 2px solid var(--muted); transform: rotate(45deg); flex: none; }
.row-check { color: var(--primary); font-weight: 800; visibility: hidden; }
.pickrow[aria-pressed="true"] .row-check, .pickrow[aria-current="true"] .row-check { visibility: visible; }
.me-card { display: flex; align-items: center; gap: 14px; padding: 8px 4px; color: var(--ink); text-decoration: none; }
.me-card .grow > * { display: block; }
.me-card .link { color: var(--primary); font-weight: 600; }
/* sub-pages: a back chevron and the title, nothing else (5.6) */
header.top.subtop { display: flex; align-items: center; gap: 4px; padding: 8px 0; min-height: 48px; }
header.subtop .back { width: 44px; height: 44px; margin-left: -12px; display: flex; align-items: center; justify-content: center; flex: none; }
header.subtop .back .row-chev { transform: rotate(-135deg); width: 10px; height: 10px; border-color: var(--ink); }
header.subtop .subtitle { font-size: 17px; font-weight: 700; margin: 0; }
header.subtop ~ main > h1:first-child { display: none; }
main { padding-inline: 0; }
.actions-sticky { position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); padding: 12px 0; background: linear-gradient(transparent, var(--bg) 30%); }
body:not(.has-nav) .actions-sticky { bottom: env(safe-area-inset-bottom); }
details.more > summary { color: var(--primary); font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.btn.text { background: none; border-color: transparent; color: var(--primary); }
.btn.text.danger { color: var(--bad); }
.empty { text-align: center; color: var(--muted); padding: 24px 0; }
input.switch { appearance: none; -webkit-appearance: none; flex: none; width: 48px; height: 28px; border-radius: 999px; background: var(--line); position: relative; margin: 0; cursor: pointer; transition: background .15s; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
input.switch:checked { background: var(--ok); }
input.switch:checked::after { transform: translateX(20px); }
/* status colours never follow the house theme (5.4) */
:root { --ok: #1f7a4d; --ok-soft: #e1f3ea; }
:root[data-theme="dark"] { --ok: #7fd1a3; --ok-soft: #1d3327; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ok: #7fd1a3; --ok-soft: #1d3327; } }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
label.rowlink .row-t { white-space: normal; }

/* alerts: one line, one action (5.1) */
.alert { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px 8px 16px; border-radius: 12px; font-size: .92rem; margin: 12px 0; text-decoration: none; }
.alert > .grow { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.alert.block { background: var(--bad-soft); color: var(--bad); border: 1.5px solid var(--bad); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.info { background: var(--soft); color: var(--ink); }
.alert .btn { min-height: 36px; padding: 4px 14px; flex: none; }
.alert .row-chev { border-color: currentColor; margin-right: 6px; }
/* item rows: a bill, a chore, a poll */
.card.items { padding: 4px 16px; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; color: var(--ink); text-decoration: none; }
.row-item + .row-item, .card.items > .total + .row-item { border-top: 1px solid var(--line); }
.row-item .row-t { color: var(--ink); text-decoration: none; }
.row-t.wrap { white-space: normal; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.row-s.late, .row-day.late { color: var(--bad); font-weight: 600; }
.row-s.soon, .row-day.soon { color: var(--warn); font-weight: 600; }
.row-day { flex: none; font-size: 14px; color: var(--muted); }
.total { margin: 12px 0 4px; }
.hero { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.pay { gap: 4px; }
.pay form { margin: 0; }
.tick-form { margin: 0; flex: none; }
.tick { width: 44px; height: 44px; margin: 0 -8px; border: 0; background: none; padding: 8px; cursor: pointer; }
.tick::before { content: ""; display: block; width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--muted); box-sizing: border-box; }
.tick:active::before { background: var(--ok); border-color: var(--ok); }
details.swap > summary { font-size: 14px; color: var(--muted); min-height: 28px; }
.rows.spaced { margin-top: 24px; }
.empty.big { font-size: 1.15rem; padding: 40px 0; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 16px; margin: 24px -16px 0; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-link { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--soft); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; }
.chip-link .ic { width: 18px; height: 18px; }
/* "it worked" is a toast above the tab bar: it takes no room on the page and leaves on its own */
.flash:not(.err) { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 30; margin: 0; padding: 10px 18px; border-radius: 999px; max-width: calc(100vw - 32px);
  background: var(--ink); color: var(--bg); font-size: .92rem; box-shadow: 0 4px 16px rgba(0,0,0,.25); animation: toast 5s forwards; }
body:not(.has-nav) .flash:not(.err) { bottom: calc(24px + env(safe-area-inset-bottom)); }
@keyframes toast { 0% { opacity: 0; } 4%, 90% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@media print { .flash { display: none; } }
.row-item.bill { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 6px 12px; }
.row-item.bill .row-side { display: contents; }
.row-item.bill .pay, .row-item.bill .row-side > .btn { grid-column: 1 / -1; justify-self: end; }
details.split { padding: 4px 16px; margin: 12px 0; }
details.split > summary { min-height: 56px; display: flex; align-items: center; }
details.split > summary .grow > * { display: block; }
.share-row { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.share-row label { flex: 1; margin: 0; }
.share-row input { width: 96px; flex: none; text-align: right; }
.money-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.money-top > div > * { display: block; }
.money.big { font-size: 1.3rem; }
.totals-more { margin: 6px 4px 0; }
.row-t.done { color: var(--ok); }
.done-today { margin-top: 12px; }
.row-side form { margin: 0; }
.row-item .row-s { white-space: normal; }
.btn.apple { background: #000; border-color: #000; color: #fff; }
:root[data-theme="dark"] .btn.apple { background: #fff; border-color: #fff; color: #000; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.apple { background: #fff; border-color: #fff; color: #000; } }
.share-line { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 8px 0; }
.share-line + .share-line { border-top: 1px solid var(--line); }
.share-line .bar { grid-column: 1 / -1; }
.share-line.mine .share-name { font-weight: 700; }
.share-n { color: var(--muted); font-size: 14px; }
.row-item.sched.mine .row-t { color: var(--primary); }
.period { margin: 8px 4px 0; }
.add-line { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.add-line .chips { margin: 0; }
.row-item.contact { align-items: flex-start; }
.tag.admin { background: var(--primary); color: var(--on-primary); }
h2 .tag { font-size: .7rem; vertical-align: middle; font-weight: 600; }
.me-card .tag { align-self: flex-start; display: inline-block; width: fit-content; }
.week-day .cal-chip { font-size: .92rem; padding: 10px 12px; margin-bottom: 6px; border-radius: 12px; }
.week-none { margin: 0 4px; }
.group-label.today { color: var(--primary); }
.cal-month { margin: 12px 0; }
.cal-month .cal-day { min-height: 56px; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); gap: 2px; }
.cal-month .mine-n { background: var(--primary); color: var(--on-primary); border-radius: 999px; min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; }
.cal-month .all-n { color: var(--muted); font-size: .72rem; }
/* the compact month: a real grid of days at any width, with a number where something is yours */
.cal-month .cal-head { display: grid !important; }
.cal-month .cal-week { display: grid !important; margin-bottom: 6px; }
.cal-month .cal-day, .cal-month .cal-day.off { display: flex !important; margin: 0; padding: 4px; }
.cal-month .cal-day.off { border: 0; }
.only-phone { display: none; }
@media (max-width: 719px) { .only-phone { display: block; } }
.add-line .chip > span { font-size: .92rem; padding: 6px 12px; min-height: 0; }

/* ---- the public page (landing) ---- */
body.lp { padding: 0; }
.lp-in { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.lp-top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.lp-top .lp-in { display: flex; align-items: center; justify-content: space-between; min-height: 60px; }
.lp-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--ink); text-decoration: none; }
.lp-brand img { border-radius: 9px; }
.lp-nav { display: flex; align-items: center; gap: 16px; font-size: .95rem; }
.lp-hero { padding: 48px 0 40px; }
.lp-two { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.lp-kicker { color: var(--primary); font-weight: 700; margin: 0 0 12px; }
.lp h1 { font-size: clamp(2rem, 5.4vw, 3.3rem); line-height: 1.08; margin: 0 0 18px; letter-spacing: -.02em; }
.lp h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); line-height: 1.15; margin: 0 0 18px; letter-spacing: -.01em; }
.lp h3 { font-size: 1.08rem; margin: 0 0 6px; }
.lp-lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; margin: 0 0 24px; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 14px; }
.lp-cta .btn { min-height: 52px; padding: 0 24px; font-size: 1.05rem; text-decoration: none; }
.lp-note { color: var(--muted); font-size: .92rem; margin: 0; }
.lp-phone { margin: 0; justify-self: center; width: min(300px, 78vw); border-radius: 34px; padding: 9px; background: var(--ink); box-shadow: 0 24px 60px rgba(0, 0, 0, .18); }
.lp-phone img { display: block; width: 100%; height: auto; border-radius: 26px; }
.lp-band { background: var(--soft); padding: 44px 0; }
.lp-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.lp-three p, .lp-grid p { color: var(--muted); margin: 0; }
.lp-feature { padding: 64px 0; }
.lp-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.lp-list li { padding-left: 30px; position: relative; color: var(--muted); }
.lp-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--ok); font-weight: 800; }
.lp-list strong { color: var(--ink); }
.lp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.lp-grid > div { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.lp-center { text-align: center; }
.lp-center .lp-lead { margin-inline: auto; }
.lp-center .lp-cta { justify-content: center; }
.lp-final { padding: 72px 0; }
.lp-foot { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: .9rem; text-align: center; }
.lp-foot p { margin: 4px 0; }
@media (max-width: 760px) {
  .lp-hero { padding: 28px 0; }
  .lp-two { grid-template-columns: 1fr; gap: 32px; }
  .lp-feature .lp-two > figure { order: 2; }
  .lp-three, .lp-grid { grid-template-columns: 1fr; gap: 18px; }
  .lp-feature { padding: 44px 0; }
  .lp-cta .btn { flex: 1 1 100%; }
}
