:root {
  --bg: #f4f6f2;
  --surface: #ffffff;
  --surface-2: #eef2ec;
  --ink: #17231d;
  --ink-2: #5d6b63;
  --line: #e1e7df;
  --brand: #1f5c45;
  --brand-2: #2f7d5f;
  --brand-ink: #ffffff;
  --pink: #fff1d6;
  --pink-ink: #8a5a00;
  --tint: #e2f0e8;
  --accent: #e39b2d;
  --accent-ink: #1b1306;
  --link: #1f6f52;
  --ok: #2f8a5c;
  --bad: #c2412f;
  --shadow: 0 1px 2px rgba(23, 35, 29, .05), 0 6px 20px rgba(23, 35, 29, .06);
  --radius: 18px;
  --tabbar: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212; --surface: #1c1c1e; --surface-2: #26262a; --ink: #ededed; --ink-2: #a1a1a6; --line: #2e2e32;
    --brand: #6fcf9f; --brand-2: #8fdcb5; --brand-ink: #0b1410; --pink: #3a2c10; --pink-ink: #ffd28a; --tint: #1c3328;
    --accent: #f2b24f; --accent-ink: #1b1306; --link: #8fdcb5; --ok: #6fcf97; --bad: #ff8a7a;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 6px 20px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121212; --surface: #1c1c1e; --surface-2: #26262a; --ink: #ededed; --ink-2: #a1a1a6; --line: #2e2e32;
  --brand: #6fcf9f; --brand-2: #8fdcb5; --brand-ink: #0b1410; --pink: #3a2c10; --pink-ink: #ffd28a; --tint: #1c3328;
  --accent: #f2b24f; --accent-ink: #1b1306; --link: #8fdcb5; --ok: #6fcf97; --bad: #ff8a7a; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.noscroll { overflow: hidden; }
a { color: var(--link); }
h1, h2, h3 { font-weight: 800; letter-spacing: -.01em; line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.08rem; }
h3 { font-size: 1rem; margin-top: 1rem; }
p { margin: .4rem 0; }
small { display: block; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.center { text-align: center; }
.pad { padding: 8px 0 16px; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; }
.row.top { align-items: flex-start; }
.row.between { justify-content: space-between; gap: 12px; }
.row.end { justify-content: flex-end; }
.row.wrap { flex-wrap: wrap; }
.gap { gap: 10px; }
.gap-sm { gap: 6px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack.center { align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.grid-name { display: grid; grid-template-columns: 72px 1fr; gap: 0 12px; }
@media (max-width: 520px) { .grid2, .grid3 { grid-template-columns: 1fr; } .grid3.tight { grid-template-columns: 70px 1fr; } .grid3.tight > :nth-child(3) { grid-column: 1 / -1; } }

/* shell */
.shell { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 12px); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.house-name { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: linear-gradient(135deg, #1f5c45, #2f7d5f); color: #fff; font: 800 28px/1 "Plus Jakarta Sans", system-ui, sans-serif; flex: none; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.logo::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #e39b2d; position: absolute; transform: translate(14px, -13px); }
.logo { position: relative; }
.logo.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 16px; }
.seg { display: inline-grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); flex: none; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font: inherit; font-size: .85rem; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg button.on.edit { background: var(--accent); color: var(--accent-ink); }
main { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.page { padding-top: 16px; }
.page.wide { max-width: 100%; }
.pagehead { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.pagehead-text { flex: 1; min-width: 0; }
.pagehead h1 { margin: 0; }
.pagehead .sub { margin: 2px 0 0; color: var(--ink-2); }
.pagehead-right { flex: none; }
.back { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 1.5rem; line-height: 1; flex: none; }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .75rem; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.tabbar a.on { color: var(--ink); }
.tabbar a.on .tab-icon { background: var(--tint); color: var(--brand); }
.tab-icon { display: grid; place-items: center; width: 56px; height: 30px; border-radius: 999px; }
.tab-icon svg { width: 22px; height: 22px; }
.badge { position: absolute; top: 6px; left: calc(50% + 10px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: .7rem; display: grid; place-items: center; }

/* cards + lists */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 14px; box-shadow: var(--shadow); }
.card.enjoy { background: linear-gradient(180deg, var(--pink), var(--surface) 75%); }
.card.alert-card { border-color: var(--accent); }
.banner { display: block; padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; background: var(--pink); color: var(--pink-ink); font-weight: 600; text-decoration: none; }
.banner.soft { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.notice { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: .9rem; }
.list-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; margin-bottom: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; text-align: left; font: inherit; cursor: pointer; }
.card .list-item { box-shadow: none; }
.li-main { flex: 1; min-width: 0; }
.li-main small { color: var(--ink-2); }
.chev { color: var(--ink-2); font-size: 1.3rem; }
ul.plain { list-style: none; padding: 0; margin: 6px 0; }
ul.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }
.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); vertical-align: middle; }
.pill.soft { background: var(--pink); color: var(--pink-ink); }
.code { font-family: ui-monospace, Menlo, monospace; letter-spacing: .08em; }
.ok { color: var(--ok); font-weight: 600; }
.pos { color: var(--ok); font-weight: 600; }
.neg { color: var(--bad); font-weight: 600; }
.danger-text { color: var(--bad) !important; }

/* jobs */
.job { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.job:last-child { border-bottom: 0; }
.tick { flex: none; width: 34px; height: 34px; border-radius: 10px; border: 2px solid var(--ink-2); background: transparent; color: #fff; font-weight: 800; font-size: 1.05rem; cursor: pointer; }
.tick[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); }
.tick:disabled { opacity: .35; cursor: default; }
.job-main { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.job-title { display: block; font-weight: 600; }
.job-sub { display: block; font-size: .85rem; color: var(--ink-2); }
.job-sub.note { color: var(--pink-ink); }
.job.is-done .job-title { text-decoration: line-through; color: var(--ink-2); }
.checklist { margin: 8px 0; padding-left: 1.2rem; }
.notes { white-space: pre-wrap; color: var(--ink-2); }
.meta { color: var(--ink-2); margin-top: 0; }
.who-line { display: flex; align-items: center; gap: 8px; margin: 8px 0; flex-wrap: wrap; }

.chip { --c: #6b5546; display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 9px; background: var(--c); color: #fff; font-weight: 700; font-size: .85rem; flex: none; }
.chip.sm { min-width: 22px; height: 22px; border-radius: 7px; font-size: .7rem; }
.chip.all { background: var(--tint); color: var(--brand); }
.chip.empty { background: transparent; border: 2px dashed var(--bad); color: var(--bad); }
.chip.done { opacity: .45; text-decoration: line-through; }

/* board */
.board-scroll { overflow-x: auto; margin: 0 -16px 10px; padding: 0 16px; -webkit-overflow-scrolling: touch; }
.board { border-collapse: separate; border-spacing: 0; min-width: 640px; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.board th, .board td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
.board tr:last-child th, .board tr:last-child td { border-bottom: 0; }
.board thead th { font-size: .8rem; color: var(--ink-2); background: var(--surface-2); }
.board thead th span { display: block; font-weight: 700; color: var(--ink); }
.board th.today, .board td.today { background: var(--tint); }
.board .job-col { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 130px; font-weight: 600; font-size: .9rem; }
.board thead .job-col { background: var(--surface-2); }
.board .job-col small { font-weight: 400; color: var(--ink-2); font-size: .75rem; }
.cellbtn { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; background: none; border: 0; padding: 2px; cursor: pointer; font: inherit; color: inherit; }
.cellbtn .part { font-size: .6rem; color: var(--ink-2); }
.span-cell { text-align: left !important; }
.span-cell .cellbtn { flex-direction: row; gap: 8px; }
.legend { display: inline-flex; align-items: center; gap: 4px; margin: 4px 10px 0 0; }
.strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.strip-day { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border-radius: 10px; background: var(--surface-2); font-size: .75rem; text-align: center; }
.strip-day.today { background: var(--tint); }
.strip-day small { font-size: .7rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.counts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.counts li { background: var(--surface-2); border-radius: 10px; }
.counts li > span:not(.chip) { flex: 1; }

/* meetings, posts, misc */
.meet-list { list-style: none; padding: 0; margin: 0; }
.meet-list li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.meet-list li:last-child { border-bottom: 0; }
.meet-day { flex: none; width: 92px; font-weight: 700; color: var(--brand); }
.meet-main { display: flex; flex-direction: column; }
.posts { list-style: none; padding: 0; margin: 12px 0 0; }
.posts li { padding: 10px 0; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.posts li p { margin: 0 0 2px; white-space: pre-wrap; }
.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.hub-item { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.hub-item.alert { border-color: var(--accent); }
.hub-item small { color: var(--ink-2); }
.hub-icon { font-size: 1.5rem; }
.swap { padding: 10px 0; border-bottom: 1px solid var(--line); }
.swap:last-child { border-bottom: 0; }
.nets { list-style: none; padding: 0; margin: 8px 0; }
.nets li { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.dir { list-style: none; padding: 0; margin: 0; }
.dir li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dir li:last-child { border-bottom: 0; }
.dir small, .contact small { color: var(--ink-2); }
.contact { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.member { padding: 10px 0; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: 0; }
.agreements { white-space: pre-wrap; max-height: 55vh; overflow: auto; padding: 4px 2px; }
.supplies li { padding: 8px 0; }
.prefs { display: flex; flex-direction: column; gap: 6px; }
.pref { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pref select { width: auto; max-width: 52%; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 10px; }
.tpl { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; }
.tpl span { font-size: 1.5rem; }
.tpl small { color: var(--accent); font-weight: 600; }
.order ol { list-style: none; padding: 0; margin: 6px 0 10px; }
.order li { display: flex; align-items: center; gap: 6px; padding: 6px 8px; margin-bottom: 4px; border-radius: 10px; background: var(--surface-2); }
.order-n { width: 22px; text-align: center; font-weight: 700; color: var(--ink-2); }
.daypick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.daypick label { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 600; font-size: .9rem; cursor: pointer; }
.daypick label.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.daypick input { position: absolute; opacity: 0; pointer-events: none; }
.slots { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.slot { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; }

/* forms */
.field { display: block; margin-bottom: 12px; }
.label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.hint { display: block; font-size: .8rem; color: var(--ink-2); margin-top: 4px; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
textarea { resize: vertical; line-height: 1.45; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
.emoji-in { text-align: center; font-size: 1.3rem; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.check { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .9rem; cursor: pointer; }
.check input { accent-color: var(--accent); }
.check.big { margin: 14px 0; padding: 10px 14px; border-radius: 12px; font-size: 1rem; }
.toggle { display: flex; align-items: center; gap: 12px; padding: 8px 0; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.track { width: 44px; height: 26px; border-radius: 13px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.toggle input:checked + .track { background: var(--ok); }
.toggle input:checked + .track .thumb { transform: translateX(18px); }
.toggle input:focus-visible + .track { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
.toggle-text small { color: var(--ink-2); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: .875rem; border-radius: 10px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 1.2rem; cursor: pointer; }
.icon-btn.sm { width: 30px; height: 30px; font-size: .9rem; }
.icon-btn:disabled { opacity: .35; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }

/* sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(20, 10, 5, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow: auto; background: var(--bg); border-radius: 20px 20px 0 0; padding: 0 16px calc(20px + env(safe-area-inset-bottom)); animation: up .18s ease-out; }
@media (min-width: 640px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 20px; } }
@keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } .track, .thumb { transition: none; } }
.sheet-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 0 10px; background: var(--bg); z-index: 1; }
.sheet-head h2 { margin: 0; }

/* auth */
.auth { max-width: 440px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 40px) 16px 40px; }
.auth.wide { max-width: 640px; }
.brand { text-align: center; margin-bottom: 20px; }
.brand h1 { margin: 12px 0 4px; font-size: 2rem; }
.brand p { color: var(--ink-2); }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; font-size: .9rem; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); margin-bottom: 16px; }
.tabs button { padding: 10px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.empty { text-align: center; padding: 40px 16px; color: var(--ink-2); }
.empty-icon { font-size: 2.4rem; }
.empty-title { font-weight: 700; color: var(--ink); }
.busy { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px 0; color: var(--ink-2); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 16px); transform: translateX(-50%); z-index: 60; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-weight: 600; box-shadow: var(--shadow); }
.toast.bad { background: var(--bad); color: #fff; }

/* today: hero + week rail */
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: 22px 20px 20px; margin-bottom: 14px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, #3a9a72 0%, #1f5c45 55%, #17473a 100%); box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; right: -70px; top: -80px; width: 170px; height: 170px; border-radius: 50%; background: rgba(227, 155, 45, .2); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero-date { margin: 0; font-size: .85rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.hero h1 { color: #fff; margin: 4px 0 6px; font-size: 1.7rem; }
.hero p { margin: 0; opacity: .92; }
.hero .hero-stat { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.16); font-weight: 700; font-size: .9rem; }
.rail { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 14px; }
.rail button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; min-height: 70px; }
.rail .rd { font-size: .7rem; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
.rail .rn { font-size: 1.15rem; font-weight: 800; }
.rail .dots { display: flex; gap: 3px; height: 8px; align-items: center; }
.rail .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.rail .dot.meet { background: transparent; border: 2px solid var(--brand-2); width: 7px; height: 7px; }
.rail button.today .rn { color: var(--brand); }
.rail button.sel { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.rail button.sel .rd, .rail button.sel .rn { color: var(--brand-ink); }
.rail button.sel .dot.meet { border-color: var(--brand-ink); }
.rail-key { display: flex; gap: 14px; font-size: .78rem; color: var(--ink-2); margin: -6px 0 14px; }
.rail-key span { display: inline-flex; align-items: center; gap: 5px; }
.rail-key .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; }
.rail-key .dot.meet { background: transparent; border: 2px solid var(--brand-2); }
.subhead { font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin: 14px 0 2px; }
.subhead:first-of-type { margin-top: 4px; }
.job.mine .job-title::after { content: "You"; margin-left: 8px; font-size: .68rem; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: var(--pink); color: var(--pink-ink); vertical-align: 2px; }
.logo.sm::after { display: none; }

/* names as pills: same font, colored so they catch the eye */
.name-pill { --c: #5d6b63; display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 4px 11px; border-radius: 999px; font-weight: 800; font-size: .88rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none;
  color: color-mix(in srgb, var(--c) 82%, #000); background: color-mix(in srgb, var(--c) 15%, var(--surface)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 35%, transparent); }
.name-pill.sm { padding: 2px 8px; font-size: .74rem; }
.name-pill.letter { min-width: 28px; justify-content: center; }
.name-pill.all { --c: #1f5c45; }
.name-pill.empty { color: var(--bad); background: transparent; box-shadow: inset 0 0 0 1.5px var(--bad); border: 0; }
.name-pill.done { opacity: .55; text-decoration: line-through; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .name-pill { color: color-mix(in srgb, var(--c) 45%, #fff); background: color-mix(in srgb, var(--c) 28%, var(--surface)); } }
:root[data-theme="dark"] .name-pill { color: color-mix(in srgb, var(--c) 45%, #fff); background: color-mix(in srgb, var(--c) 28%, var(--surface)); }
.board { min-width: 820px; }
.board td { padding: 8px 4px; }
.counts li { justify-content: space-between; }
.nets li .grow { min-width: 0; }
.dir li .grow .name-pill { margin-bottom: 4px; }
.banner.join { background: var(--accent); color: var(--accent-ink); }

/* today v3 */
.hero.compact { padding: 16px 18px; margin-bottom: 12px; }
.hero.compact h1 { font-size: 1.35rem; margin: 2px 0 0; }
.today-card { padding: 18px; }
.today-card .today-head { font-size: 1.3rem; margin: 0 0 4px; }
.today-card.calm { background: var(--tint); border-color: transparent; }
.today-card.calm .today-head { color: var(--brand); margin: 0; }
.today-card.calm .done-list { margin-top: 8px; }
.soft-card { background: var(--surface-2); box-shadow: none; padding: 12px 16px; }
.soft-card .subhead { margin-top: 0; }
.job.soft { padding: 6px 0; }
.job.soft .tick { width: 28px; height: 28px; border-width: 1.5px; border-radius: 8px; }
.job.soft .job-title { font-weight: 600; font-size: .95rem; }
.job.leaving { animation: leave .42s ease-in forwards; }
.job.leaving .tick { background: var(--ok); border-color: var(--ok); transform: scale(1.12); transition: transform .15s; }
@keyframes leave { 0% { opacity: 1; transform: none; } 45% { opacity: 1; transform: scale(1.01); } 100% { opacity: 0; transform: translateX(24px) scale(.96); max-height: 0; padding: 0; } }
.job-done-mini { display: flex; align-items: center; gap: 8px; padding: 3px 0; animation: shrinkin .35s ease-out; }
.mini-main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); cursor: pointer; text-align: left; }
.mini-check { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ok); color: #fff; font-size: .65rem; font-weight: 800; flex: none; }
.mini-title { font-size: .85rem; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink-2) 60%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-who { font-size: .75rem; font-weight: 700; color: var(--ink-2); }
.job-done-mini .linkish { color: var(--ink-2); font-size: .8rem; }
@keyframes shrinkin { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.done-list { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 6px; }
.today-tabs { grid-template-columns: repeat(3, 1fr); margin: 6px 0 12px; }
@media (prefers-reduced-motion: reduce) { .job.leaving, .job-done-mini { animation: none; } }

/* edit mode: everything that changes things is amber */
.edit-strip { position: sticky; top: calc(env(safe-area-inset-top) + 57px); z-index: 19; padding: 8px 16px; background: var(--accent); color: var(--accent-ink); font-size: .85rem; font-weight: 600; text-align: center; }
.btn.ed, .pill.ed { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 800; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn.ed.danger-ed { background: var(--bad); border-color: var(--bad); color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 25%, transparent); }
.ed-zone { border-radius: 14px; padding: 12px; margin-top: 8px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); box-shadow: inset 0 0 0 2px var(--accent); }
.card.ed-zone { padding: 16px; }
.shell.editing .hub-item, .shell.editing .list-item[href^="#/chore/"] { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }

/* iPhone: date/time inputs have a built-in minimum width that overflows cards */
input[type="date"], input[type="time"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; text-align: left; }
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; }
.grid2 > *, .grid3 > *, .grid-name > *, .field { min-width: 0; }
.card { overflow-wrap: anywhere; }
.ed-links a { color: var(--accent); font-weight: 700; }

/* house photo + themes */
:root { --hero-a: #3a9a72; --hero-b: #1f5c45; --hero-c: #17473a; }
.hero { background: radial-gradient(120% 140% at 100% 0%, var(--hero-a) 0%, var(--hero-b) 55%, var(--hero-c) 100%); }
.hero.has-photo { background-size: cover; background-position: center 35%; min-height: 170px; display: flex; flex-direction: column; justify-content: flex-end; }
.hero.has-photo::after { display: none; }
.hero.has-photo h1, .hero.has-photo .hero-date { text-shadow: 0 1px 8px rgba(0,0,0,.45); }
.house-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--brand); }
.house-banner { display: block; width: 100%; max-height: 260px; object-fit: cover; border-radius: var(--radius); margin: 4px 0 10px; box-shadow: var(--shadow); }
.photo-preview { display: block; width: 100%; max-height: 280px; object-fit: cover; border-radius: 14px; margin: 8px 0 12px; }
.photo-empty { display: grid; place-items: center; height: 140px; border-radius: 14px; margin: 8px 0 12px; border: 2px dashed var(--line); color: var(--ink-2); font-weight: 600; }
label.btn { cursor: pointer; }
label.btn.disabled { opacity: .6; pointer-events: none; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; }
.swatch .sw { width: 24px; height: 24px; border-radius: 50%; }
.swatch.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink) inset; }
:root[data-house-theme="ocean"] { --brand: #1d5a8a; --brand-2: #2f7fbf; --tint: #e1edf7; --link: #1d6aa0; --hero-a: #3d8fd1; --hero-b: #1d5a8a; --hero-c: #163f63; }
:root[data-house-theme="plum"] { --brand: #5b3a8c; --brand-2: #7d55b8; --tint: #efe8f8; --link: #6a44a3; --hero-a: #8a63c9; --hero-b: #5b3a8c; --hero-c: #40285f; }
:root[data-house-theme="sunset"] { --brand: #b5462b; --brand-2: #d4683f; --tint: #fbe9e2; --link: #a8401f; --hero-a: #e07a4f; --hero-b: #b5462b; --hero-c: #7f2f1d; }
:root[data-house-theme="slate"] { --brand: #33414f; --brand-2: #4d6073; --tint: #e7ebef; --link: #3c5266; --hero-a: #607489; --hero-b: #33414f; --hero-c: #232d37; }
@media (prefers-color-scheme: dark) {
  :root[data-house-theme="ocean"]:not([data-theme="light"]) { --brand: #8cc4f0; --brand-2: #a9d3f5; --tint: #18283a; --link: #a9d3f5; }
  :root[data-house-theme="plum"]:not([data-theme="light"]) { --brand: #c7b0ef; --brand-2: #d6c4f4; --tint: #261d36; --link: #d6c4f4; }
  :root[data-house-theme="sunset"]:not([data-theme="light"]) { --brand: #f4a98a; --brand-2: #f7bea7; --tint: #35201a; --link: #f7bea7; }
  :root[data-house-theme="slate"]:not([data-theme="light"]) { --brand: #b7c4d1; --brand-2: #cbd5df; --tint: #1e252c; --link: #cbd5df; }
}
.logo { background: linear-gradient(135deg, var(--hero-b), var(--hero-a)); }
.name-pill.all { --c: var(--hero-b); }

/* roles & permissions */
.role-group { padding: 10px 0; border-bottom: 1px solid var(--line); }
.role-group:last-of-type { border-bottom: 0; }
.role-group h3 { margin: 0 0 2px; }
.perm-list { list-style: none; padding: 0; margin: 8px 0 0; }
.perm-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.perm-list li:last-child { border-bottom: 0; }
.perm { flex: none; font-size: .78rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.p-all { background: var(--tint); color: var(--brand); }
.p-admin { background: color-mix(in srgb, var(--accent) 20%, var(--surface)); color: color-mix(in srgb, var(--accent) 70%, #000); }
.p-owner { background: color-mix(in srgb, var(--bad) 14%, var(--surface)); color: var(--bad); }

/* edit mode color: its own color, not used anywhere else */
:root { --edit: #d1267b; --edit-ink: #ffffff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --edit: #ff5fa8; --edit-ink: #1a0610; } }
.edit-strip { background: var(--edit); color: var(--edit-ink); }
.btn.ed, .pill.ed { background: var(--edit); border-color: var(--edit); color: var(--edit-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--edit) 28%, transparent); }
.ed-zone { background: color-mix(in srgb, var(--edit) 9%, var(--surface)); box-shadow: inset 0 0 0 2px var(--edit); }
.shell.editing .hub-item, .shell.editing .list-item[href^="#/chore/"] { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--edit) 55%, transparent); }
.seg button.on.edit { background: var(--edit); color: var(--edit-ink); }
.ed-links a { color: var(--edit); }
.linkish { color: var(--link); }
/* fairness details */
.counts li { display: block; padding: 0; }
.counts details summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; cursor: pointer; list-style: none; }
.counts details summary::-webkit-details-marker { display: none; }
.count-detail { list-style: none; margin: 0; padding: 0 10px 8px; font-size: .85rem; }
.count-detail li { display: flex; justify-content: space-between; padding: 3px 0; border-top: 1px dashed var(--line); }

/* queue (line) card */
.queue-card .q-next { font-size: 1.05rem; margin: 4px 0 6px; }
.queue-card.mine { box-shadow: inset 0 0 0 2px var(--accent), var(--shadow); }
.queue-card.mine .q-next { font-weight: 800; color: color-mix(in srgb, var(--accent) 70%, #000); }

/* ---------- personal backgrounds (Me → Look) ---------- */
:root[data-appearance="white"] { --bg: #ffffff; --surface: #ffffff; --surface-2: #f4f4f5; --ink: #0a0a0a; --ink-2: #52525b; --line: #e4e4e7; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05); }
:root[data-appearance="paper"] { --bg: #f6f0e4; --surface: #fffaf0; --surface-2: #efe6d6; --ink: #2b2418; --ink-2: #6b5f4d; --line: #e3d8c4; }
:root[data-appearance="gray"] { --bg: #e9ecef; --surface: #f8f9fa; --surface-2: #e2e6ea; --ink: #1d2329; --ink-2: #5b6570; --line: #d7dce1; }
:root[data-appearance="black"] { --bg: #000000; --surface: #0e0e0e; --surface-2: #181818; --ink: #f2f2f2; --ink-2: #a3a3a3; --line: #272727; --shadow: none; }
:root[data-appearance="forest"] { --bg: #0c1a14; --surface: #12241c; --surface-2: #183026; --ink: #e6f2ec; --ink-2: #a3bfb2; --line: #22392f; }
:root[data-appearance="white"] .card, :root[data-appearance="white"] .list-item { box-shadow: none; }
/* house colors when dark is chosen in the app (not just by the phone) */
:root[data-theme="dark"] { --edit: #ff5fa8; --edit-ink: #1a0610; }
:root[data-house-theme="ocean"][data-theme="dark"] { --brand: #8cc4f0; --brand-2: #a9d3f5; --tint: #18283a; --link: #a9d3f5; }
:root[data-house-theme="plum"][data-theme="dark"] { --brand: #c7b0ef; --brand-2: #d6c4f4; --tint: #261d36; --link: #d6c4f4; }
:root[data-house-theme="sunset"][data-theme="dark"] { --brand: #f4a98a; --brand-2: #f7bea7; --tint: #35201a; --link: #f7bea7; }
:root[data-house-theme="slate"][data-theme="dark"] { --brand: #b7c4d1; --brand-2: #cbd5df; --tint: #1e252c; --link: #cbd5df; }
:root[data-house-theme="evergreen"][data-theme="dark"], :root:not([data-house-theme])[data-theme="dark"] { --brand: #6fcf9f; --brand-2: #8fdcb5; --tint: #1c3328; --link: #8fdcb5; }
:root[data-theme="light"] { color-scheme: light; }
/* look picker */
.looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 6px; }
.look { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.look.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand) inset; }
.look-sw { flex: none; width: 34px; height: 34px; border-radius: 10px; border: 1px solid rgba(128,128,128,.35); }
.look-text { display: flex; flex-direction: column; min-width: 0; }
.look-text small { color: var(--ink-2); font-size: .74rem; line-height: 1.25; }
label.swatch { position: relative; }
label.swatch input[type="color"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.custom-sw { background: conic-gradient(#e33, #e93, #ee3, #3c3, #3cc, #36e, #a3e, #e33); }
.linkish.ed-link { color: var(--edit); font-weight: 700; }
.tick.ed { border-color: var(--edit); box-shadow: 0 0 0 3px color-mix(in srgb, var(--edit) 25%, transparent); }
.job-done-mini .linkish.ed-link { color: var(--edit); }

/* colored sections so long pages are easy to scan */
.card.toned { border-top: 4px solid var(--t); }
.card.toned h2 { color: color-mix(in srgb, var(--t) 78%, var(--ink)); }
:root[data-theme="dark"] .card.toned h2 { color: color-mix(in srgb, var(--t) 45%, #fff); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card.toned h2 { color: color-mix(in srgb, var(--t) 45%, #fff); } }
.card.toned { background: linear-gradient(180deg, color-mix(in srgb, var(--t) 6%, var(--surface)) 0, var(--surface) 90px); }
.banner.swaps-link { background: color-mix(in srgb, #c9790f 16%, var(--surface)); color: var(--ink); border: 1px solid color-mix(in srgb, #c9790f 35%, transparent); font-weight: 500; }
.banner.swaps-link span { color: var(--ink-2); }
.p-mem { background: color-mix(in srgb, #2f6fb3 14%, var(--surface)); color: color-mix(in srgb, #2f6fb3 80%, var(--ink)); }

/* new-house setup */
.setup-head { padding: 18px; border-radius: 22px; margin-bottom: 14px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, var(--hero-a), var(--hero-b) 55%, var(--hero-c)); }
.setup-head h1 { color: #fff; margin: 4px 0 12px; font-size: 1.45rem; }
.steps { display: flex; gap: 6px; }
.steps span { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.28); }
.steps span.on { background: #fff; }
.steps span.done { background: var(--accent); }
.person-row { display: grid; grid-template-columns: 1fr 76px 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.choices { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 14px; border: 1.5px solid var(--line); cursor: pointer; }
.choice.on { border-color: var(--brand); background: var(--tint); }
.choice input { margin-top: 4px; accent-color: var(--brand); }
.choice small { display: block; color: var(--ink-2); }
.chore-pick { border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; }
.chore-pick.on { border-color: var(--brand); }
.check-line { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check-line input { width: 20px; height: 20px; accent-color: var(--brand); }
.chore-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.chore-opts > :first-child { grid-column: 1 / -1; }
.bath-group { margin-top: 12px; }
.setup-nav { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0 20px; }
.setup-nav .btn { flex: 1; }
main:has(.page.wide) { max-width: 1180px; }
