:root {
  --bg: #f6f5f1; --card: #fff; --ink: #1d2428; --muted: #5d676d;
  --accent: #1f6f5c; --accent-ink: #fff; --line: #dcd9d0; --danger: #a4372b;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14181a; --card: #1e2427; --ink: #eceeed; --muted: #a2acb0;
          --accent: #4fb89d; --accent-ink: #0c1512; --line: #333c40; --danger: #f08b7d; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; }
main { max-width: 30rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
header.site { display: flex; align-items: center; justify-content: space-between;
  max-width: 30rem; margin: 0 auto; padding: 1rem 1rem 0; }
header.site .brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
header.site nav a { margin-left: 1rem; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem; }
form p { margin: 0 0 0.9rem; }
label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url],
input:not([type]) {
  width: 100%; min-height: 48px; padding: 0.6rem 0.75rem; font: inherit; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
input[type=checkbox] { width: 1.2rem; height: 1.2rem; vertical-align: middle; }
button, .button { display: inline-block; width: 100%; min-height: 52px; margin: 0.35rem 0;
  padding: 0.8rem 1rem; font: inherit; font-weight: 650; text-align: center; text-decoration: none;
  color: var(--accent-ink); background: var(--accent); border: 0; border-radius: 12px; cursor: pointer; }
button.secondary, .button.secondary { color: var(--accent); background: transparent; border: 1px solid var(--line); }
ul.messages, .errorlist { list-style: none; margin: 0 0 1rem; padding: 0.75rem 1rem;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.errorlist { color: var(--danger); border-color: var(--danger); }
.helptext { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 0.4rem 0.25rem; border-bottom: 1px solid var(--line); }

/* --- app shell ----------------------------------------------------------- */
body { padding-top: env(safe-area-inset-top); }
body.has-tabs main { padding-bottom: calc(6.5rem + env(safe-area-inset-bottom)); }
.small { font-size: 0.85rem; }
.empty { text-align: center; padding: 2rem 1.25rem; }
.badge { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.85rem;
  font-weight: 600; color: var(--accent); border: 1px solid var(--accent); }
th { color: var(--muted); font-weight: 500; width: 40%; }
ul.menu { list-style: none; margin: 0 0 1rem; padding: 0; }
ul.menu li + li { border-top: 1px solid var(--line); }
ul.menu a { display: block; min-height: 52px; padding: 0.9rem 1.25rem; text-decoration: none; color: var(--ink); }

nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--line); }
nav.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 0.15rem; min-height: 52px; font-size: 0.72rem; font-weight: 600;
  color: var(--muted); text-decoration: none; -webkit-tap-highlight-color: transparent; }
nav.tabs a[aria-current="page"] { color: var(--accent); }
nav.tabs svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }

/* --- capture --------------------------------------------------------------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); border: 0; white-space: nowrap; }
label.button { display: flex; align-items: center; justify-content: center; cursor: pointer;
  -webkit-user-select: none; user-select: none; }
nav.tabs label.capture { display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end; gap: 0.15rem; min-height: 52px; margin: 0; font-size: 0.72rem;
  font-weight: 600; color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; }
nav.tabs label.capture svg { width: 60px; height: 60px; padding: 14px; margin-top: -22px;
  border-radius: 50%; color: var(--accent-ink); background: var(--accent); stroke-width: 1.9;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.22); }
.choices { display: grid; gap: 0.25rem; margin-bottom: 0.5rem; }
textarea { width: 100%; padding: 0.6rem 0.75rem; font: inherit; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; resize: vertical; }
form.card label { margin-top: 0; }
form.card input, form.card textarea { margin-bottom: 0.6rem; }

.sheet { position: fixed; left: 0.6rem; right: 0.6rem; z-index: 20;
  bottom: calc(5.6rem + env(safe-area-inset-bottom)); max-width: 28.8rem; margin: 0 auto;
  padding: 0.9rem; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.25); }
.sheet.is-error { border-color: var(--danger); }
body.is-offline .sheet { bottom: calc(1rem + env(safe-area-inset-bottom)); }
.sheet-detail { margin: 0.1rem 0 0; font-size: 0.9rem; color: var(--muted); }
/* "2 items waiting to upload": sits just above the tab bar on every page. */
.pending { position: fixed; z-index: 15; left: 50%; transform: translateX(-50%);
  bottom: calc(5.4rem + env(safe-area-inset-bottom)); width: auto; min-height: 36px; margin: 0;
  padding: 0.3rem 0.9rem; border-radius: 999px; font-size: 0.85rem; font-weight: 650;
  white-space: nowrap; color: var(--ink); background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.18); }
.pending.is-error { color: var(--danger); border-color: var(--danger); }
body.is-offline .pending { bottom: calc(1rem + env(safe-area-inset-bottom)); }
.sheet-row { display: flex; align-items: center; gap: 0.75rem; }
.sheet-status { margin: 0; font-weight: 650; font-size: 1.05rem; }
.sheet.is-error .sheet-status { color: var(--danger); }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; margin-top: 0.6rem; }
.sheet-actions .button, .sheet-actions button { min-height: 48px; margin: 0; padding: 0.5rem; font-size: 0.95rem; }
.sheet input[type=text] { margin-top: 0.6rem; }
.thumbs { display: flex; gap: 0.3rem; }
.thumbs:empty { display: none; }
.thumb { width: 46px; height: 46px; border-radius: 8px; overflow: hidden; flex: none;
  display: grid; place-items: center; font-size: 0.7rem; font-weight: 700; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:nth-child(n+5) { display: none; }

/* --- inbox ----------------------------------------------------------------- */
nav.tabs a { position: relative; }
.tab-badge { position: absolute; top: 0; left: calc(50% + 6px); min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 999px; font-size: 0.7rem; line-height: 18px; text-align: center;
  color: var(--accent-ink); background: var(--accent); }
ul.inbox { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.inbox-row { position: relative; border-radius: 14px; overflow: hidden; transition: opacity 0.18s; }
/* The red "Discard" backing only exists while a row is being swiped. */
.inbox-row.is-swiping, .inbox-row.is-leaving { background: var(--danger); }
.inbox-row:not(.is-swiping):not(.is-leaving) .swipe-hint { display: none; }
.inbox-row.is-leaving { opacity: 0; }
.swipe-hint { position: absolute; inset: 0 1.1rem 0 auto; display: flex; align-items: center;
  font-weight: 650; color: #fff; opacity: 0.75; }
.inbox-row.will-discard .swipe-hint { opacity: 1; }
a.inbox-item { position: relative; display: flex; align-items: center; gap: 0.85rem;
  padding: 0.7rem; color: var(--ink); text-decoration: none; touch-action: pan-y;
  -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
.inbox-thumb { position: relative; flex: none; width: 68px; height: 68px; border-radius: 10px;
  overflow: hidden; display: grid; place-items: center; font-size: 0.8rem; font-weight: 700;
  color: var(--muted); background: var(--bg); border: 1px solid var(--line); }
.inbox-thumb img { width: 100%; height: 100%; object-fit: cover; }
.inbox-thumb .count { position: absolute; right: 3px; bottom: 3px; min-width: 20px; padding: 0 5px;
  border-radius: 999px; font-size: 0.72rem; line-height: 20px; text-align: center; color: #fff;
  background: rgb(0 0 0 / 0.65); }
.inbox-text { display: grid; gap: 0.15rem; min-width: 0; }
.inbox-text strong { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; font-weight: 600; }
.inbox-more { margin-top: 1.25rem; text-align: center; }
.inbox-tip { text-align: center; }
.spinner { display: inline-block; width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; z-index: 18; left: 0.6rem; right: 0.6rem; max-width: 28.8rem; margin: 0 auto;
  bottom: calc(5.6rem + env(safe-area-inset-bottom)); display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; padding: 0.5rem 0.6rem 0.5rem 1rem; font-weight: 600;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.25); }
.toast button { width: auto; min-height: 44px; margin: 0; padding: 0.4rem 1.1rem; }
.back { margin: 0 0 0.75rem; }
.back a { display: inline-block; padding: 0.4rem 0.6rem 0.4rem 0; font-weight: 600; text-decoration: none; }
figure.page { margin: 0 0 1.25rem; }
figure.page img { display: block; width: 100%; height: auto; margin-bottom: 0.5rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); }
figure.page figcaption { display: flex; justify-content: space-between; gap: 1rem; }
figure.page figcaption a { margin-left: auto; }
#inbox-detail .card { margin-bottom: 1rem; }
.wrap { overflow-wrap: anywhere; }
.prose { white-space: normal; overflow-wrap: anywhere; }
button.danger { color: var(--danger); }

/* --- shortcut setup ---------------------------------------------------------- */
.copybox { display: block; margin: 0.4rem 0; padding: 0.7rem 0.8rem; font: 0.85rem/1.4 ui-monospace, Menlo, monospace;
  overflow-wrap: anywhere; -webkit-user-select: all; user-select: all; background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; }
ol.steps { padding-left: 1.3rem; }
ol.steps li { margin-bottom: 0.7rem; }
ol.steps table { margin: 0.4rem 0; font-size: 0.92rem; }
.card + .card, .card + h2 { margin-top: 1rem; }
form.inline { display: inline; }
form.inline button { width: auto; min-height: 40px; margin: 0; padding: 0.3rem 0.9rem; font-size: 0.9rem; }

/* --- filing ------------------------------------------------------------------ */
select, input[type=date] { width: 100%; min-height: 48px; padding: 0.6rem 0.75rem; font: inherit;
  color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
form.filing h2 { margin-top: 0; }
form.filing label { margin-top: 0.8rem; }
form.filing details { margin: 0.9rem 0 0.4rem; }
form.filing summary { font-weight: 600; color: var(--accent); cursor: pointer; }
form.filing button { margin-top: 1rem; }
.heading-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.small-button { width: auto; min-height: 40px; margin: 0; padding: 0.3rem 1rem; font-size: 0.95rem; }
.swipe-hint.file { inset: 0 auto 0 1.1rem; }
.inbox-row.is-filing { background: var(--accent); }
.inbox-row.is-filing .swipe-hint:not(.file), .inbox-row.is-swiping:not(.is-filing) .swipe-hint.file { display: none; }
.inbox-row .pick { display: none; position: absolute; z-index: 2; left: 0.6rem; top: 50%;
  width: 1.6rem; height: 1.6rem; margin-top: -0.8rem; accent-color: var(--accent); }
.selecting .inbox-row .pick { display: block; }
.selecting a.inbox-item { padding-left: 3rem; }
.bulk { position: fixed; z-index: 19; left: 0.6rem; right: 0.6rem; max-width: 28.8rem; margin: 0 auto;
  bottom: calc(5.6rem + env(safe-area-inset-bottom)); padding: 0.7rem; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgb(0 0 0 / 0.25); }
.bulk-actions { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 0.5rem; margin-top: 0.5rem; }
.bulk-actions button, .bulk-actions select { min-height: 46px; margin: 0; padding: 0.4rem 0.6rem; font-size: 0.95rem; }

/* --- documents --------------------------------------------------------------- */
input[type=search] { width: 100%; min-height: 48px; padding: 0.6rem 0.9rem; font: inherit; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; -webkit-appearance: none; }
.filters { margin-bottom: 1rem; }
.filter-row { display: flex; gap: 0.5rem; margin-top: 0.5rem; overflow-x: auto; }
.filter-row select { width: auto; flex: 1 0 auto; min-height: 42px; padding: 0.3rem 0.6rem; font-size: 0.92rem; }
.snippet { color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
mark { color: inherit; background: color-mix(in srgb, var(--accent) 28%, transparent); border-radius: 3px; padding: 0 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.15rem; }
.tag { padding: 0.05rem 0.5rem; border-radius: 999px; font-size: 0.75rem; color: var(--muted); border: 1px solid var(--line); }
h2.flush { margin-top: 0; }
ul.plain { list-style: none; margin: 0.8rem 0 0; padding: 0; }
ul.plain li { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.6rem 0; border-top: 1px solid var(--line); }
#document-detail > .card, #document-detail > form.card { margin-bottom: 1rem; }
a.cardlink { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem;
  color: var(--ink); text-decoration: none; font-weight: 600; }
a.cardlink span { color: var(--muted); font-weight: 400; }

/* --- property profile ---------------------------------------------------------- */
.heading-row h1 { margin-bottom: 0.6rem; }
table.facts tr:last-child td, table.facts tr:last-child th { border-bottom: 0; }
table.facts th { vertical-align: top; }
.fact-hint, .notes { margin: 0.8rem 0 0; }
ul.keydocs { list-style: none; margin: 0; padding: 0 1.25rem; }
ul.keydocs li + li { border-top: 1px solid var(--line); }
ul.keydocs a, ul.keydocs .missing { display: flex; align-items: center; gap: 0.75rem; min-height: 56px;
  padding: 0.6rem 0; color: var(--ink); text-decoration: none; }
.keydoc-label { flex: 0 0 5.2rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.keydoc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.warn { color: var(--danger); font-weight: 600; }
section.property + section.property { margin-top: 2rem; }
ul.factlist { list-style: none; margin: 0 0 1rem; padding: 0; }
/* On a phone each fact is two full-width fields with its remove button beside them. */
ul.factlist li { display: grid; grid-template-columns: 1fr auto; gap: 0.35rem 0.5rem; align-items: center;
  padding: 0.6rem 0; border-top: 1px solid var(--line); }
ul.factlist li:first-child { border-top: 0; }
ul.factlist input[name=label] { font-weight: 600; }
ul.factlist input { grid-column: 1; }
ul.factlist button { grid-column: 2; grid-row: 1 / span 2; }
@media (min-width: 40rem) {
  ul.factlist li { grid-template-columns: 1fr 1.6fr auto; border-top: 0; padding: 0.3rem 0; }
  ul.factlist input { grid-column: auto; }
  ul.factlist button { grid-column: auto; grid-row: auto; }
}
ul.factlist input, form.factadd input { min-height: 44px; margin: 0; }
form.factadd { display: grid; grid-template-columns: 1fr 1.4fr; gap: 0.4rem; padding-top: 0.8rem;
  border-top: 1px solid var(--line); }
form.factadd label, form.factadd button { grid-column: 1 / -1; margin-bottom: 0; }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 40px; margin: 0.4rem 0 0; }
.pair { display: grid; grid-template-columns: 1fr 1.6fr; gap: 0.6rem; }
#property-edit > .card { margin-bottom: 1rem; }
label.check { display: flex; align-items: center; gap: 0.6rem; font-weight: 500; min-height: 44px; }
form.card label.check input { margin: 0; }

/* --- one file at a time ---------------------------------------------------------- */
.file-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; margin-top: 0.5rem; }
figure.page + figure.page { margin-top: 1.5rem; }

/* What the AI read, above the filing form. */
.ai-note { margin: 0 0 0.4rem; padding: 0.6rem 0.75rem; border-radius: 0.6rem; background: color-mix(in srgb, var(--accent) 12%, transparent); font-size: 0.95rem; }
.contact-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.6rem; }
.contact-row { padding: 0.75rem 1rem; }
.contact-main { display: block; text-decoration: none; color: var(--ink); min-height: 44px; overflow-wrap: anywhere; }
.contact-main span { display: block; }
.contact-quick { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.contact-quick .button { flex: 1 1 5rem; text-align: center; }
ul.reach { list-style: none; margin: 0 0 1rem; padding: 0.25rem 1.25rem; }
ul.reach li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.6rem 0; }
ul.reach li + li { border-top: 1px solid var(--line); }
.reach-text { flex: 1 1 10rem; min-width: 0; }
fieldset.rows, fieldset.chips { border: 0; margin: 0.9rem 0 0; padding: 0; min-width: 0; }
fieldset.rows legend, fieldset.chips legend { padding: 0; font-weight: 600; margin-bottom: 0.3rem; }
.method-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.method-row select { flex: 0 0 6.5rem; width: 6.5rem; margin: 0; }
.method-row input { flex: 1 1 auto; min-width: 0; margin: 0; }
.method-row .row-remove { flex: 0 0 44px; width: 44px; min-height: 44px; padding: 0; }
fieldset.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
fieldset.chips legend { flex-basis: 100%; }
fieldset.chips label { margin: 0; font-weight: 400; }
fieldset.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
fieldset.chips span { display: inline-flex; align-items: center; min-height: 40px; padding: 0.3rem 0.85rem; border: 1px solid var(--line); border-radius: 999px; }
fieldset.chips legend span { display: inline; min-height: 0; padding: 0; border: 0; }
fieldset.chips input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
fieldset.chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
li.paper-row { display: flex; align-items: center; gap: 0.5rem; padding-right: 0.75rem; }
li.paper-row a { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
#keep-with { margin-bottom: 1rem; }
.task-add { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.task-add input { flex: 1 1 auto; min-width: 0; margin: 0; }
.task-add button { width: auto; margin: 0; padding-inline: 1.1rem; }
nav.segments { display: flex; gap: 0.4rem; overflow-x: auto; margin: 0.75rem 0 1rem; padding-bottom: 0.2rem; }
nav.segments a { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.35rem; min-height: 40px; padding: 0.3rem 0.9rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); white-space: nowrap; }
nav.segments a[aria-current] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
nav.segments .count { font-size: 0.85rem; opacity: 0.8; }
.task-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.5rem; }
.task-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.9rem; }
.task-main { flex: 1 1 auto; min-width: 0; text-decoration: none; color: var(--ink); overflow-wrap: anywhere; }
.task-main span { display: block; }
button.tick { flex: 0 0 auto; width: 44px; min-height: 44px; margin: 0; padding: 0; border-radius: 50%; background: transparent; border: 2px solid var(--line); position: relative; }
button.tick::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; border: 2px solid var(--muted); }
button.tick.ticked::after { background: var(--accent); border-color: var(--accent); }
ul.steplist { list-style: none; margin: 0 0 0.75rem; padding: 0; }
ul.steplist li { display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0; }
ul.steplist label { flex: 1 1 auto; display: flex; align-items: center; gap: 0.6rem; min-height: 44px; margin: 0; font-weight: 400; overflow-wrap: anywhere; min-width: 0; }
ul.steplist input[type=checkbox] { flex: 0 0 auto; width: 1.4rem; height: 1.4rem; margin: 0; }
ul.steplist input:checked + span { text-decoration: line-through; color: var(--muted); }
ul.roomlist { list-style: none; margin: 0 0 0.75rem; padding: 0; }
ul.roomlist li { display: flex; gap: 0.5rem; align-items: center; padding: 0.25rem 0; }
ul.roomlist input { flex: 1 1 auto; min-width: 0; min-height: 44px; margin: 0; }
#link-contact, #link-document, #task-toggle { margin-bottom: 1rem; }
.repeat-row { align-items: center; }
.repeat-row input { flex: 0 0 5rem; width: 5rem; }
.repeat-row select { flex: 1 1 auto; width: auto; }
#calendar-new .button, #calendar-new button { margin-top: 0.6rem; }
.idea-room { margin-bottom: 1.25rem; }
.idea-room .heading-row h2 { margin: 0 0 0.5rem; }
ul.idea-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.6rem; }
.idea-card { padding: 0.6rem; display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.idea-main { display: flex; flex-direction: column; gap: 0.15rem; text-decoration: none; color: var(--ink); overflow-wrap: anywhere; flex: 1 1 auto; }
.idea-main strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.idea-thumb { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: 10px; background: var(--bg); overflow: hidden; font-size: 2rem; margin-bottom: 0.3rem; }
.idea-thumb img { width: 100%; height: 100%; object-fit: cover; }
.votes { display: flex; gap: 0.4rem; }
button.vote { flex: 1 1 0; width: auto; min-height: 44px; margin: 0; padding: 0.2rem 0.5rem; background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.vote.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); font-weight: 600; }
.vote-row { margin: 0 0 1rem; }
#make-idea { margin-top: 0.75rem; }
#idea-approve { margin-bottom: 0.75rem; }
.idea-task, #task-idea { margin: 0 0 0.75rem; }
.comments { margin: 1rem 0; }
ul.comment-list { list-style: none; margin: 0 0 0.75rem; padding: 0; }
ul.comment-list li { padding: 0.5rem 0; border-top: 1px solid var(--line); }
ul.comment-list li:first-child { border-top: 0; }
.comment-meta { margin: 0 0 0.15rem; }
.comment-body { margin: 0; overflow-wrap: anywhere; }
.mention { color: var(--accent); }
button.linklike { width: auto; min-height: 0; margin: 0 0 0 0.5rem; padding: 0.4rem 0.2rem; background: none; border: 0; color: var(--muted); font-size: inherit; text-decoration: underline; }
#comment-form textarea { margin: 0 0 0.5rem; }
.comment-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
ul.switches { list-style: none; margin: 0; padding: 0; }
ul.switches label { display: flex; align-items: center; gap: 0.75rem; min-height: 48px; margin: 0; font-weight: 400; }
ul.switches input { flex: 0 0 auto; width: 1.4rem; height: 1.4rem; margin: 0; }
.device-name { flex: 1 1 auto; padding: 0.9rem 1.25rem; }
#push-test { margin-top: 0.6rem; }
ul.lately { list-style: none; margin: 0 0 1rem; padding: 0.25rem 1.25rem; }
ul.lately li { padding: 0.55rem 0; overflow-wrap: anywhere; }
ul.lately li + li { border-top: 1px solid var(--line); }
ul.lately a { color: var(--ink); text-decoration: none; }
ul.lately li > span { display: block; }
.meter { height: 0.6rem; border-radius: 0.3rem; background: var(--line); overflow: hidden; }
.meter span { display: block; width: 0; height: 100%; background: var(--accent); }
.table-scroll { overflow-x: auto; }
table.plain { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.plain th, table.plain td { text-align: right; padding: 0.35rem 0.4rem; border-top: 1px solid var(--line); white-space: nowrap; }
table.plain th:first-child, table.plain td:first-child { text-align: left; }
table.plain thead th { border-top: 0; font-weight: 600; }
.contacts ul { list-style: none; margin: 0; padding: 0; }
.contacts li { padding: 0.5rem 0; border-top: 1px solid var(--line, rgba(127,127,127,0.25)); overflow-wrap: anywhere; }
.contacts li:first-child { border-top: 0; }
.contact-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.15rem; }
.contact-links a { padding: 0.35rem 0; }
.link-card img { display: block; width: 100%; max-height: 14rem; object-fit: contain; border-radius: 0.5rem; margin-bottom: 0.6rem; background: var(--bg); }
.link-card p { margin: 0 0 0.5rem; }
.money-add input[name=amount] { flex: 0 0 6.5rem; width: 6.5rem; }
.ledger-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }
.ledger-filter select, .ledger-filter input { flex: 1 1 8rem; width: auto; min-width: 0; margin: 0; }
.ledger-month .heading-row h2 { margin: 0 0 0.5rem; }
.expense-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.9rem; }
.expense-amount { flex: 0 0 auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.expense-amount.refund { color: var(--muted); }
.needs { color: var(--accent); font-weight: 600; }
#ledger-totals td:first-child { white-space: normal; }
.button-row { display: flex; gap: 0.6rem; }
.button-row button { flex: 1 1 0; }
.account-form label { display: block; }
.money-links { margin: 0 0 0.75rem; }
.room-cost { margin-bottom: 0.6rem; }
.room-cost .heading-row h2 { margin: 0; }
.room-cost input.room-budget { flex: 0 0 7.5rem; width: 7.5rem; margin: 0; text-align: right; }
.room-figures { margin: 0.5rem 0 0; }
.over { color: var(--danger); }
label.quiet-room { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0.5rem 0 0; font-weight: 400; }
label.quiet-room input { flex: 0 0 7.5rem; width: 7.5rem; margin: 0; text-align: right; }
.cost-ask { margin-bottom: 0.75rem; }
.cost-ask .task-add { margin: 0.5rem 0 0; }
.cost-ask .task-add button { white-space: nowrap; }
.bill-add input[type=date] { flex: 0 0 9.5rem; width: 9.5rem; }
.bill-section h2 { margin: 1rem 0 0.5rem; }
h2.over { color: var(--danger); }
.expense-row .small-button { flex: 0 0 auto; }
ul.plain-list { list-style: none; margin: 0; padding: 0; }
ul.plain-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.45rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
ul.plain-list li:first-child { border-top: 0; }
.notice { border-left: 4px solid var(--accent); }
.asset-row details { margin-top: 0.5rem; }
.asset-row summary { color: var(--accent); font-weight: 600; cursor: pointer; }
.asset-form label { display: block; margin-top: 0.6rem; }
#register-year { max-width: 9rem; }
ul.checks { margin: 0.4rem 0 0; padding-left: 1.1rem; }
ul.checks li { margin: 0.35rem 0; }
.year-property h2 { margin: 0.4rem 0 0.2rem; }
.year-property + .year-property { margin-top: 1.25rem; border-top: 1px solid var(--line); padding-top: 0.75rem; }
table.year-table td:first-child { white-space: normal; }
#package-build { margin-bottom: 0.5rem; }
#income-add { margin-top: 0.75rem; }
#income-add input[type=date] { flex: 1 1 8rem; min-width: 0; }
.property-row { padding: 0; }
.property-row a { display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1rem; text-decoration: none; color: var(--ink); }
.property-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; overflow-wrap: anywhere; }
.property-text strong { font-size: 1.1rem; }
#property-add { margin-top: 0.5rem; }
ul.photo-strip, ul.photo-grid { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.35rem; }
ul.photo-strip { grid-template-columns: repeat(6, 1fr); }
ul.photo-grid { grid-template-columns: repeat(3, 1fr); }
ul.photo-strip a, ul.photo-grid a { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--line); }
ul.photo-strip img, ul.photo-grid img { width: 100%; height: 100%; object-fit: cover; }
.photo-tag { position: absolute; left: 0; right: 0; bottom: 0; padding: 0.15rem 0.35rem; font-size: 0.72rem; color: #fff; background: linear-gradient(transparent, rgb(0 0 0 / 65%)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-month h2 { margin: 1rem 0 0.4rem; }
.photo-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 0.75rem; }
#photo-add label.button { margin-top: 0; }
@media (min-width: 40rem) { ul.photo-grid { grid-template-columns: repeat(5, 1fr); } }
.figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 0.5rem; }
.figures div { display: flex; flex-direction: column; min-width: 0; }
.figures strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#property-bills a { flex: 1 1 auto; min-width: 0; }

/* Small helpers that replace what used to be inline styles. */
nav.tabs svg.bold { stroke-width: 3; }
td.right { text-align: right; }
details.other-way { margin-top: 1.5rem; }
details.other-way form { margin-top: 1rem; }
