/* Layout and components, mobile first (the app is mainly used as a home-screen web app).
   All values come from tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100dvh; color: var(--text);
  background: radial-gradient(120% 60% at 50% -10%, var(--bg-tint), var(--bg) 60%) no-repeat, var(--bg);
  font-family: var(--font-text); font-size: var(--fs-md); line-height: var(--lh-text);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
body.has-tabs { padding-bottom: calc(var(--tabbar-h) + var(--tabbar-gap) * 2 + env(safe-area-inset-bottom)); }
h1, h2, h3, p, ol, ul, fieldset { margin: 0; padding: 0; }
ol, ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: var(--accent-text); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-user-select: none; user-select: none; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--s2); top: calc(-1 * var(--s7) * 2); padding: var(--s2) var(--s3); background: var(--text); color: var(--bg); border-radius: var(--r-sm); z-index: 30; }
.skip:focus { top: var(--s2); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.center { text-align: center; }
.pad { padding: var(--s4); }
.plain li { padding: var(--s1) 0; }

/* ---------- frame ---------- */
.page {
  width: 100%; max-width: var(--page-max); margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + var(--s2)) max(var(--gutter), env(safe-area-inset-right)) var(--s7) max(var(--gutter), env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: var(--s4);
}
.page > * { min-width: 0; }
.pagehead { padding-top: var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.pagehead--row { display: flex; flex-direction: row; align-items: flex-end; justify-content: space-between; gap: var(--s3); }
.pagehead .pagehead--row { padding: 0; align-items: center; }
.eyebrow { font-size: var(--fs-sm); color: var(--text-3); font-weight: var(--fw-medium); }
.h1 { font-size: var(--fs-2xl); line-height: var(--lh-tight); font-weight: var(--fw-black); letter-spacing: -.025em; }
.h2 { font-size: var(--fs-lg); line-height: var(--lh-tight); font-weight: var(--fw-bold); letter-spacing: -.01em; }
.h3 { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin: var(--s4) 0 var(--s2) var(--s1); }
.lead { color: var(--text-2); }
.hint { font-size: var(--fs-sm); color: var(--text-3); }
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--accent-text); text-decoration: none; min-height: var(--tap); margin-left: calc(-1 * var(--s2)); font-weight: var(--fw-medium); }
.back .icon { width: 20px; height: 20px; }

/* ---------- tab bar: floating glass pill ---------- */
.tabs {
  position: fixed; z-index: 10; left: var(--tabbar-gap); right: var(--tabbar-gap);
  bottom: calc(var(--tabbar-gap) + env(safe-area-inset-bottom));
  max-width: calc(var(--page-max) - var(--s4)); margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s1); padding: var(--s1);
  height: var(--tabbar-h); border-radius: var(--r-xl);
  background: var(--glass); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  box-shadow: var(--shadow-tab);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: calc(var(--r-xl) - var(--s1)); color: var(--text-3); text-decoration: none;
  font-size: var(--fs-xs); font-weight: var(--fw-medium); transition: background var(--t-med), color var(--t-med);
  -webkit-user-select: none; user-select: none;
}
.tab:active { transform: scale(.96); }
.tab[aria-current="page"] { color: var(--accent-text); background: var(--accent-wash); }
.tab[aria-current="page"] .icon { stroke-width: 2.3; }
@media (min-width: 900px) {
  body.has-tabs { padding-bottom: 0; padding-left: var(--rail); }
  .tabs { inset: var(--s4) auto var(--s4) var(--s4); width: calc(var(--rail) - var(--s6)); height: auto; max-width: none; margin: 0;
          grid-template-columns: 1fr; grid-auto-rows: var(--s7); align-content: start; padding: var(--s3); }
  .tab { flex-direction: row; justify-content: flex-start; gap: var(--s3); padding: 0 var(--s3); font-size: var(--fs-md); }
  .tab:hover { background: var(--surface-sunk); }
  .tab[aria-current="page"]:hover { background: var(--accent-wash); }
}

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--tap); padding: 0 var(--s5); border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font-weight: var(--fw-medium); text-decoration: none;
  transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn--primary { background: linear-gradient(180deg, var(--hero-from), var(--accent)); border-color: transparent; color: var(--on-accent); box-shadow: 0 4px 14px var(--accent-shadow); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--danger { color: var(--lvl-overdue-text); border-color: var(--lvl-overdue); background: transparent; }
.btn--ghost { border-color: transparent; background: var(--surface-sunk); }
.btn--sm { min-height: 34px; padding: 0 var(--s3); font-size: var(--fs-sm); }
.btn--block { width: 100%; }
.btn .icon { width: 18px; height: 18px; }
.link { background: none; border: 0; padding: var(--s2) 0; color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; min-height: var(--tap); font-weight: var(--fw-medium); }
.icon-btn { display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); border-radius: var(--r-pill); border: 0; background: transparent; color: var(--text-2); text-decoration: none; flex: none; }
.icon-btn:hover { background: var(--surface-sunk); }
.icon-btn:active { transform: scale(.92); }
.actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.actions > .btn, .actions > form { flex: 1; }
.actions > form .btn { width: 100%; }
.actions--sticky {
  position: sticky; z-index: 5; bottom: calc(var(--tabbar-h) + var(--tabbar-gap) * 2 + env(safe-area-inset-bottom));
  padding: var(--s2) 0; background: linear-gradient(to top, var(--bg) 70%, transparent);
}
@media (min-width: 900px) { .actions--sticky { bottom: 0; } }

.form { display: flex; flex-direction: column; gap: var(--s4); }
.field { display: flex; flex-direction: column; gap: var(--s1); }
.field > label, .field > legend, .stepper > label { font-weight: var(--fw-medium); font-size: var(--fs-sm); color: var(--text-2); margin-bottom: var(--s1); }
.field__hint { font-size: var(--fs-xs); color: var(--text-3); }
input:not([type=checkbox]):not([type=radio]), select {
  width: 100%; min-height: 48px; padding: 0 var(--s4); border-radius: var(--r-md);
  border: 1px solid var(--line-input); background: var(--surface); font-size: var(--fs-md);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input:focus-visible, select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash); }
.input--short { width: 6em !important; }
.inline { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.inline select, .inline input[type=date] { width: auto; }
.check { display: flex; align-items: center; gap: var(--s3); min-height: var(--tap); cursor: pointer; }
.check input, .chip input, .seg--radio input, .icon-pick input, .swatches input, .daychip input { accent-color: var(--accent); }
.check input { width: 22px; height: 22px; flex: none; }
.divider { display: flex; align-items: center; gap: var(--s3); color: var(--text-3); font-size: var(--fs-sm); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.alert { padding: var(--s3) var(--s4); border-radius: var(--r-md); }
.alert--error { background: var(--error-wash); color: var(--lvl-overdue-text); }
.flash { background: var(--accent-wash); color: var(--accent-text); padding: var(--s3) var(--s4); border-radius: var(--r-md); margin-top: var(--s2); font-weight: var(--fw-medium); animation: drop-in var(--t-slow) var(--ease-spring); }
@keyframes drop-in { from { opacity: 0; transform: translateY(-8px); } }
.banner { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-lg); text-decoration: none; color: var(--text); }
.banner > span { flex: 1; }
.banner--warn { background: var(--warn-wash); border: 1px solid var(--warn-line); }
.banner--warn > .icon { color: var(--lvl-low); }
.banner--info { background: var(--info-wash); }
.pill { display: inline-flex; align-items: center; gap: 3px; padding: 1px var(--s2); border-radius: var(--r-pill); background: var(--surface-sunk); font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-2); white-space: nowrap; }
.pill--wait { background: var(--info-wash); }
.pill--robot { background: var(--robot-wash); color: var(--robot); }
.pill--pts { background: var(--accent-soft); color: var(--accent-text); }

/* segmented control */
.seg { display: flex; gap: 2px; padding: 3px; background: var(--surface-sunk); border-radius: var(--r-pill); overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg__btn { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 var(--s3); border-radius: var(--r-pill); text-decoration: none; color: var(--text-2); font-size: var(--fs-sm); font-weight: var(--fw-medium); white-space: nowrap; cursor: pointer; transition: background var(--t-med); }
.seg__btn[aria-current="true"], .seg--radio .seg__btn:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg--radio input { position: absolute; opacity: 0; pointer-events: none; }
.seg--radio .seg__btn:has(input:focus-visible) { outline: 2px solid var(--focus); }

/* ---------- cards ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.card--me { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
details.card > summary { list-style: none; display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); min-height: 56px; cursor: pointer; font-weight: var(--fw-medium); }
details.card > summary::-webkit-details-marker { display: none; }
details[open].card > summary .icon:last-child { transform: rotate(180deg); }
details.card > summary .icon:last-child { transition: transform var(--t-med); color: var(--text-3); }
section.card.pad { display: flex; flex-direction: column; gap: var(--s3); }

/* ---------- hero (today) ---------- */
.hero {
  position: relative; overflow: hidden; color: var(--on-hero);
  background: linear-gradient(145deg, var(--hero-from), var(--hero-to));
  border-radius: var(--r-xl); padding: var(--s5); box-shadow: var(--shadow-lg);
  display: grid; grid-template-columns: 1fr auto; gap: var(--s3) var(--s4); align-items: center;
}
.hero::after { content: ""; position: absolute; width: 220px; height: 220px; right: -70px; top: -90px; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.hero__greet { font-size: var(--fs-xl); font-weight: var(--fw-black); letter-spacing: -.02em; line-height: var(--lh-tight); }
.hero__date { color: var(--on-hero-2); font-size: var(--fs-sm); font-weight: var(--fw-medium); margin-bottom: var(--s1); }
.hero__sub { color: var(--on-hero-2); font-size: var(--fs-sm); margin-top: var(--s2); }
.hero__chips { grid-column: 1 / -1; display: flex; gap: var(--s2); flex-wrap: wrap; position: relative; z-index: 1; }
.hero__chip { display: inline-flex; align-items: center; gap: var(--s1); padding: var(--s1) var(--s3); border-radius: var(--r-pill); background: rgba(255, 255, 255, .15); color: var(--on-hero); font-size: var(--fs-sm); font-weight: var(--fw-medium); text-decoration: none; }
.hero__chip .icon { width: 16px; height: 16px; color: var(--sun); }
.ring { position: relative; width: var(--ring); height: var(--ring); z-index: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .ring__track { stroke: var(--hero-track); }
.ring .ring__val { stroke: var(--sun); stroke-linecap: round; transition: stroke-dashoffset var(--t-slow) var(--ease-out); }
.ring__label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.05; }
.ring__label strong { font-size: var(--fs-xl); font-weight: var(--fw-black); }
.ring__label span { font-size: var(--fs-xs); color: var(--on-hero-2); }
.hero--done .ring .ring__val { stroke: var(--sun); }

/* ---------- bars ---------- */
.bar { display: block; height: var(--bar-h); background: var(--track); border-radius: var(--r-pill); overflow: hidden; }
.bar--thick { height: var(--bar-h-thick); }
.bar__fill { display: block; height: 100%; border-radius: inherit; background: var(--lvl-high); transition: width var(--t-slow) var(--ease-out); }
.lvl-mid .bar__fill, .bar.lvl-mid .bar__fill { background: var(--lvl-mid); }
.lvl-low .bar__fill, .bar.lvl-low .bar__fill { background: var(--lvl-low); }
.bar.lvl-overdue { background: var(--lvl-overdue-wash); }
.bar.lvl-progress .bar__fill { background: var(--accent); }
.bar.lvl-high .bar__fill { background: var(--lvl-high); }
.due { font-weight: var(--fw-medium); }
.due--overdue { color: var(--lvl-overdue-text); }
.due--low { color: var(--text-2); }

/* effort dots */
.effort { display: inline-flex; gap: 3px; flex: none; }
.effort i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.effort i.on { background: var(--accent); }

/* ---------- tasks ---------- */
.tasks { display: flex; flex-direction: column; }
.tasks.card { padding: var(--s1) 0; }
.task { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--line); animation: row-in var(--t-slow) var(--ease-out) both; }
@keyframes row-in { from { opacity: 0; transform: translateY(4px); } }
.tasks.card .task { padding: var(--s3) var(--s4); }
.task:first-child { border-top: 0; }
.task__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.task__title { display: flex; align-items: center; gap: var(--s2); }
.task__name { font-weight: var(--fw-medium); overflow-wrap: anywhere; }
.task__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--s2); font-size: var(--fs-sm); color: var(--text-3); }
.task--done .task__name { color: var(--text-3); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.task--done .bar { opacity: .45; }
.tick-form { display: contents; }
.tick {
  flex: none; width: var(--tick); height: var(--tick); border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--line-input); background: var(--surface); color: transparent;
  transition: background var(--t-med), border-color var(--t-med), transform var(--t-med) var(--ease-spring), color var(--t-med);
}
.tick .icon { width: 20px; height: 20px; stroke-width: 2.6; }
.tick:hover { border-color: var(--accent); color: var(--accent); }
.tick:active { transform: scale(.86); }
.tick.is-done { background: var(--accent); border-color: var(--accent); color: var(--on-accent); animation: pop var(--t-slow) var(--ease-spring); }
@keyframes pop { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.tick.is-pending { background: var(--info-wash); border-color: var(--line-strong); color: var(--text-2); animation: none; }
.tick.is-busy { opacity: .7; pointer-events: none; }
.done-note { display: flex; gap: var(--s3); align-items: center; background: var(--accent-soft); padding: var(--s3) var(--s4); border-radius: var(--r-md); }
.done-note > span { font-size: var(--fs-xl); line-height: 1; }
.others { display: flex; flex-direction: column; gap: var(--s2); }
.member-list .tasks { padding: 0 var(--s4) var(--s2); }
.member-list__name { flex: 1; }

/* ---------- robot ---------- */
.robot-card { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.robot-card__head { display: flex; align-items: center; gap: var(--s3); }
.robot-card__icon { width: var(--s7); height: var(--s7); border-radius: var(--r-md); background: var(--robot-wash); display: grid; place-items: center; font-size: var(--fs-xl); flex: none; }
.robot-card__title { flex: 1; min-width: 0; }
.robot-card__title p { font-size: var(--fs-sm); color: var(--text-3); }
.robot-job { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) 0; border-top: 1px solid var(--line); }
.robot-job:first-of-type { border-top: 0; }
.robot-job__name { flex: 1; min-width: 0; }
.robot-job .state { font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.robot-job .state--done { color: var(--lvl-high); }
.robot-job .state--skip { color: var(--lvl-overdue-text); }
.robot-job .state--later { color: var(--text-3); }
.robot-grid { display: flex; flex-direction: column; gap: var(--s3); }
.robot-room { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.robot-room__name { font-weight: var(--fw-bold); display: flex; align-items: center; gap: var(--s2); }
.robot-row { display: flex; flex-direction: column; gap: var(--s2); }
.robot-row__label { font-size: var(--fs-sm); color: var(--text-2); font-weight: var(--fw-medium); }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s1); }
.daychip { position: relative; }
.daychip input { position: absolute; opacity: 0; inset: 0; }
.daychip span { display: grid; place-items: center; height: 38px; border-radius: var(--r-sm); background: var(--surface-sunk); font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-2); cursor: pointer; transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast); }
.daychip input:checked + span { background: var(--robot); color: var(--on-accent); }
.daychip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.daychip span:active { transform: scale(.94); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.stat-card { padding: var(--s3) var(--s4); display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-xs); }
.stat-card__val { display: inline-flex; align-items: center; gap: var(--s1); font-size: var(--fs-xl); font-weight: var(--fw-black); color: var(--text); }
.stat-card__val .icon { color: var(--lvl-low); }
.house { display: flex; flex-direction: column; align-items: flex-end; }
.house .num { font-size: var(--fs-xl); font-weight: var(--fw-black); }

/* ---------- rooms: tiles ---------- */
.rooms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.rooms > li { min-width: 0; }
@media (min-width: 1200px) { .page:has(.rooms) { max-width: calc(var(--page-max) * 1.5); } .rooms { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.room-card {
  position: relative; display: flex; flex-direction: column; gap: var(--s2); height: 100%;
  padding: var(--s4); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow);
  text-decoration: none; color: var(--text); transition: transform var(--t-fast), box-shadow var(--t-med);
}
.room-card:active { transform: scale(.97); }
.room-card:hover { box-shadow: var(--shadow), 0 0 0 1px var(--line-strong); }
.room-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s2); }
.room-card__icon { font-size: 1.6rem; line-height: 1; width: 52px; height: 52px; display: grid; place-items: center; border-radius: var(--r-md); background: var(--lvl-high-wash); flex: none; }
.room-card.lvl-mid .room-card__icon { background: var(--lvl-mid-wash); }
.room-card.lvl-low .room-card__icon { background: var(--lvl-low-wash); }
.room-card.lvl-overdue .room-card__icon { background: var(--lvl-overdue-wash); }
.room-card.lvl-empty .room-card__icon { background: var(--surface-sunk); }
.room-card__badges { display: flex; align-items: center; gap: var(--s1); }
.room-card__name { font-weight: var(--fw-bold); overflow-wrap: anywhere; line-height: var(--lh-tight); margin-top: var(--s1); }
.room-card__pct { font-size: var(--fs-xl); font-weight: var(--fw-black); letter-spacing: -.02em; }
.room-card__pct small { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-3); }
.room-card__meta { font-size: var(--fs-xs); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.room-card .avatar { width: var(--avatar-sm); height: var(--avatar-sm); font-size: 11px; }
.icon-pick, .swatches { display: flex; flex-wrap: wrap; gap: var(--s1); }
.icon-pick label, .swatches label { position: relative; cursor: pointer; }
.icon-pick input, .swatches input { position: absolute; opacity: 0; }
.icon-pick span { display: grid; place-items: center; width: var(--tap); height: var(--tap); font-size: var(--fs-lg); border-radius: var(--r-sm); border: 2px solid transparent; background: var(--surface-sunk); }
.icon-pick input:checked + span, .swatches input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.icon-pick input:focus-visible + span, .swatches input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.room-head { display: flex; align-items: center; gap: var(--s3); }
.room-head__icon { font-size: 2rem; width: 64px; height: 64px; border-radius: var(--r-lg); display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow); flex: none; }
.room-head__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s2); }

/* ---------- setup ---------- */
.steps { display: flex; gap: var(--s2); font-size: var(--fs-sm); color: var(--text-3); }
.steps li { flex: 1; padding-top: var(--s2); border-top: 4px solid var(--line); border-radius: 2px; }
.steps .is-done { border-color: var(--accent); }
.steps .is-current { border-color: var(--accent); color: var(--text); font-weight: var(--fw-bold); }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s2); }
.chip { display: flex; align-items: center; gap: var(--s2); min-height: 52px; padding: 0 var(--s3); border-radius: var(--r-md); background: var(--surface); border: 2px solid var(--line); cursor: pointer; font-weight: var(--fw-medium); transition: border-color var(--t-fast), background var(--t-fast); }
.chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.chip:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.chip input { width: 18px; height: 18px; }
.chip--locked { opacity: .7; }
.chip__icon { font-size: var(--fs-lg); }
.setup-room { padding: var(--s4); }
.card__title { font-weight: var(--fw-bold); font-size: var(--fs-lg); padding: 0; float: left; width: 100%; margin-bottom: var(--s2); }
.setup-tasks { clear: both; }
.setup-task { padding: var(--s2) 0; border-top: 1px solid var(--line); }
.setup-task:first-child { border-top: 0; }
.setup-task__opts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); padding-left: calc(22px + var(--s3)); }
.setup-task:has(input[type=checkbox]:not(:checked)) .setup-task__opts { display: none; }
.setup-task.is-exists { color: var(--text-3); }

/* effort stepper */
.week { display: grid; gap: var(--s2); }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.stepper > label { margin: 0; font-size: var(--fs-md); color: var(--text); }
.stepper__ctl { display: flex; align-items: center; gap: var(--s1); }
.stepper__ctl input { width: 4em !important; text-align: center; font-weight: var(--fw-bold); }
.stepper__ctl .icon-btn { border: 1px solid var(--line-strong); background: var(--surface); }
.budget { padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--accent-soft); display: flex; flex-direction: column; gap: var(--s1); }
.budget--warn { background: var(--warn-wash); border: 1px solid var(--warn-line); }
.preview li { display: flex; gap: var(--s3); align-items: center; padding: var(--s2) 0; border-top: 1px solid var(--line); }
.preview li:first-child { border-top: 0; }
.preview__day { width: 6.5em; color: var(--text-2); }

/* ---------- household ---------- */
.avatar { display: inline-grid; place-items: center; width: var(--avatar); height: var(--avatar); border-radius: 50%; flex: none; color: var(--on-av); font-weight: var(--fw-bold); font-size: var(--fs-sm); background: var(--av-c1); }
.avatar--lg { width: var(--avatar-lg); height: var(--avatar-lg); font-size: var(--fs-lg); }
.avatar--c1 { background: var(--av-c1); } .avatar--c2 { background: var(--av-c2); } .avatar--c3 { background: var(--av-c3); }
.avatar--c4 { background: var(--av-c4); } .avatar--c5 { background: var(--av-c5); } .avatar--c6 { background: var(--av-c6); }
.members { padding: var(--s1) 0; }
.member { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-top: 1px solid var(--line); position: relative; }
.member:first-child { border-top: 0; }
.member__body { flex: 1; min-width: 0; }
.member__name { font-weight: var(--fw-bold); }
.member__body .muted { font-size: var(--fs-sm); }
.member__menu > summary { list-style: none; }
.member__menu > summary::-webkit-details-marker { display: none; }
.menu { position: absolute; right: var(--s4); top: calc(100% - var(--s2)); z-index: 6; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-lg), 0 0 0 1px var(--line); padding: var(--s3); display: flex; flex-direction: column; gap: var(--s2); min-width: 230px; }
.copy { display: flex; gap: var(--s2); margin: var(--s2) 0 var(--s1); flex-wrap: wrap; }
.copy input { flex: 1 1 200px; font-size: var(--fs-sm); }
.secret { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: var(--fs-lg); font-weight: var(--fw-bold); background: var(--surface-sunk); padding: var(--s2) var(--s3); border-radius: var(--r-sm); user-select: all; }
.owner-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) 0; border-top: 1px solid var(--line); }
.owner-row:first-of-type { border-top: 0; }
.owner-row label { flex: 1; font-weight: var(--fw-medium); }
.owner-row select { width: 46%; min-height: 40px; }

/* ---------- progress ---------- */
.board { display: flex; flex-direction: column; gap: var(--s3); margin-top: var(--s3); }
.board__row { display: grid; grid-template-columns: 1.5em var(--avatar) minmax(0, 7em) 1fr 3em; align-items: center; gap: var(--s2); }
.board__row.is-me .board__name { font-weight: var(--fw-bold); }
.board__rank { color: var(--text-3); text-align: center; font-weight: var(--fw-bold); }
.board__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board__bar { height: var(--bar-h-thick); background: var(--track); border-radius: var(--r-pill); overflow: hidden; }
.board__fill { display: block; height: 100%; border-radius: inherit; }
.board__pts { text-align: right; font-weight: var(--fw-black); }
.history { padding: var(--s1) 0; }
.history__row { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s4); border-top: 1px solid var(--line); }
.history__row:first-child { border-top: 0; }
.history__row.is-rejected { opacity: .55; }
.history__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.history__body .muted { font-size: var(--fs-sm); }
.history .avatar { width: 28px; height: 28px; font-size: var(--fs-xs); }
.approvals { padding: var(--s1) 0; }
.approval { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-top: 1px solid var(--line); flex-wrap: wrap; }
.approval:first-child { border-top: 0; }
.approval__body { flex: 1; min-width: 12em; }
.approval__body .muted { font-size: var(--fs-sm); }
.approval__actions { display: flex; gap: var(--s2); }

/* ---------- settings ---------- */
.menu-list { display: flex; flex-direction: column; padding: var(--s1) 0; }
.menu-list a { display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s4); min-height: 54px; color: var(--text); text-decoration: none; border-top: 1px solid var(--line); font-weight: var(--fw-medium); }
.menu-list a:first-child { border-top: 0; }
.menu-list a:active { background: var(--surface-2); }
.menu-list a > span { flex: 1; }
.menu-list a > .icon:first-child, .menu-list a > .menu-emoji { width: 32px; height: 32px; padding: 6px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font-size: var(--fs-md); }
.menu-list a > .icon:last-child { color: var(--text-3); }
.menu-list--flat { padding: 0; }
.menu-list--flat li { border-top: 1px solid var(--line); }
.menu-list--flat li:first-child { border-top: 0; }
.homes__row { display: flex; align-items: center; gap: var(--s2); min-height: 52px; width: 100%; }
.homes__row > :first-child { flex: 1; text-align: left; }
.homes__btn { background: none; border: 0; padding: 0; color: var(--text); }
details > summary.link { list-style: none; cursor: pointer; display: inline-flex; align-items: center; }
details > summary.link::-webkit-details-marker { display: none; }

/* ---------- empty states, auth ---------- */
.empty { text-align: center; padding: var(--s7) var(--s4); display: flex; flex-direction: column; align-items: center; gap: var(--s3); color: var(--text-2); }
.empty__art { font-size: 3.2rem; line-height: 1; width: 96px; height: 96px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); }
.auth .page { justify-content: center; min-height: 100dvh; max-width: 440px; }
.auth-card { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); padding: var(--s6) var(--s5); display: flex; flex-direction: column; gap: var(--s4); }
.brand { display: flex; align-items: center; gap: var(--s3); }
.brand h1 { font-size: var(--fs-xl); font-weight: var(--fw-black); letter-spacing: -.02em; }
.brand img { border-radius: var(--r-md); box-shadow: var(--shadow); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--tabbar-gap) * 2 + env(safe-area-inset-bottom) + var(--s2));
  transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: var(--s3);
  max-width: calc(100% - 2 * var(--gutter)); width: max-content;
  background: var(--text); color: var(--bg); padding: var(--s2) var(--s2) var(--s2) var(--s4); border-radius: var(--r-pill);
  box-shadow: var(--shadow-lg); font-weight: var(--fw-medium); animation: toast-in var(--t-med) var(--ease-spring);
}
.toast button { background: none; border: 0; color: var(--sun); font-weight: var(--fw-bold); min-height: 36px; padding: 0 var(--s3); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px) scale(.96); } }
@media (min-width: 900px) { .toast { bottom: var(--s5); left: calc(50% + var(--rail) / 2); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Bar widths in 5 % steps (inline styles are blocked by the CSP). */
.w-0 { width: 0%; }
.w-1 { width: 5%; }
.w-2 { width: 10%; }
.w-3 { width: 15%; }
.w-4 { width: 20%; }
.w-5 { width: 25%; }
.w-6 { width: 30%; }
.w-7 { width: 35%; }
.w-8 { width: 40%; }
.w-9 { width: 45%; }
.w-10 { width: 50%; }
.w-11 { width: 55%; }
.w-12 { width: 60%; }
.w-13 { width: 65%; }
.w-14 { width: 70%; }
.w-15 { width: 75%; }
.w-16 { width: 80%; }
.w-17 { width: 85%; }
.w-18 { width: 90%; }
.w-19 { width: 95%; }
.w-20 { width: 100%; }


/* ---------- telegram schedule timeline ---------- */
.timeline { display: flex; flex-direction: column; }
.timeline li { display: flex; gap: var(--s3); padding: var(--s2) 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline__time { flex: none; width: 4.2em; font-weight: var(--fw-black); color: var(--accent-text); }
.timeline__body { display: flex; flex-direction: column; min-width: 0; }
.timeline__body .muted { font-size: var(--fs-sm); }
.home-name { display: flex; gap: var(--s2); align-items: flex-end; }
.home-name .field { flex: 1; }

/* ---------- theme picker ---------- */
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.theme-pick { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: var(--s3); border-radius: var(--r-md); border: 2px solid var(--line); background: var(--surface); cursor: pointer; font-weight: var(--fw-medium); }
.theme-pick input { position: absolute; opacity: 0; }
.theme-pick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.theme-pick:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.theme-pick__swatch { width: 100%; height: 48px; border-radius: var(--r-sm); }
.theme-pick__swatch--gruen { background: linear-gradient(145deg, #0E7A6C, #0B4F47); }
.theme-pick__swatch--rosa { background: linear-gradient(145deg, #D9487F, #8E2352); }
