:root {
  color-scheme: light;
  --paper: #f7f5f0;
  --project-band: #efe9dc;
  --ink: #141414;
  --secondary: #8a8578;
  --muted: #5c574c;
  --line: #e3ded2;
  --dot-off: #d5cdb9;
  --forced: #e85d26;
  --control-line: var(--secondary);
  --wash: color-mix(in srgb, var(--ink) 5%, var(--paper));
  --mono: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --gutter: clamp(16px, 4.6vw, 32px);
  --content: 44rem;
  --mark-column: 30px;
  --mark-gap: 8px;
  --topbar-row: 46px;
  --topbar-height: calc(var(--topbar-row) + env(safe-area-inset-top, 0px));
  --heading-travel: 90px;
  font-family: system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #0b0b0c;
    --project-band: #17191d;
    --ink: #f2f2f2;
    --secondary: #7d8590;
    --muted: #aab2bb;
    --line: rgb(255 255 255 / 14%);
    --dot-off: #2a2d31;
    --forced: #ff6b1a;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, textarea, select { max-width: 100%; font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
h1, h2, h3, p, ul, dl, dt, dd { margin: 0; }
h1, h2, h3 { line-height: 1.2; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.app-shell, .auth-shell { min-height: 100vh; min-height: 100dvh; }
.app-shell { container-type: inline-size; touch-action: pan-y pinch-zoom; }

.app-header-inner, .main-content {
  width: min(var(--content), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

.app-header {
  position: sticky;
  z-index: 5;
  top: 0;
  height: var(--topbar-height);
  padding-block-start: env(safe-area-inset-top, 0px);
  background: var(--paper);
}

.app-header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-row);
}

.page-actions, .button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.page-actions { flex-wrap: nowrap; gap: 4px; }
.app-header-inner > .button, .page-actions { position: relative; z-index: 1; }

.main-content { padding-block: var(--heading-travel) calc(88px + env(safe-area-inset-bottom)); }
.main-content:has(.page-view:not(.page-view--outgoing) .board-tabs) {
  padding-block-end: calc(88px + env(safe-area-inset-bottom) + var(--board-scroll-space, 0px));
}
:root:has(.page-view:not(.page-view--outgoing) .board-tabs) { overflow-anchor: none; }
.page-body { position: relative; }
.app-shell:has(.page-body--sliding) { overflow-x: clip; }
.page-body--sliding { isolation: isolate; }
.page-view { display: flow-root; }
.page-view--outgoing { position: absolute; inset: 0 0 auto; pointer-events: none; overflow-anchor: none; }
.page-heading {
  position: absolute;
  inset: 100% 0 auto;
  padding-block: 6px 2px;
  pointer-events: none;
}
.page-heading::after {
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: var(--ink);
  transform: scaleX(var(--heading-rule-scale, 1));
  content: '';
}
.point-heading { position: relative; }
.page-heading .point-heading { transform-origin: top left; }
.dot-field { display: block; width: 100%; height: 112px; }

.heading-line, .section-heading h2, .count, .task-status, .today-summary, .bottom-nav .button,
.task-meta, .shopping-quantity {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .075em;
}

.heading-line, .section-heading h2, .count, .task-status, .today-summary, .bottom-nav .button,
.meta-label { text-transform: uppercase; }

.heading-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding-block: 5px;
  color: var(--muted);
}

.heading-line span:first-child { color: var(--ink); }
.heading-kicker { justify-content: flex-end; }
.page-date { padding-block: 5px 10px; }
.today-summary { padding-block: 14px 4px; }

.view-section { margin-block: 18px 24px; }
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-block-end: 8px;
}

.section-heading h2 { min-width: 0; overflow-wrap: anywhere; }
.count, .task-status { color: var(--muted); white-space: nowrap; }

.button, .check-button, .board-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 650;
  text-align: center;
  overflow-wrap: anywhere;
}

.button:hover:not(:disabled), .check-button:hover:not(:disabled),
.task-card:hover, .board-switch:hover { background: var(--wash); }
.button--primary { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.button--primary:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 85%, var(--paper)); }
.button--danger { color: var(--muted); }
.button--icon {
  flex: none;
  width: 40px;
  min-width: 40px;
  padding: 0;
  border-color: transparent;
  color: var(--ink);
}
.avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--wash);
  font-family: var(--mono);
  font-size: 12px;
}

.marked-line {
  display: grid;
  grid-template-columns: var(--mark-column) minmax(0, 1fr);
  column-gap: var(--mark-gap);
  align-items: center;
}

.dot-cluster {
  --marker-size: 26px;
  --point-color: var(--ink);
  display: block;
  position: relative;
  flex: none;
  justify-self: center;
  width: var(--marker-size);
  height: var(--marker-size);
  color: var(--point-color);
  pointer-events: none;
}

.dot-cluster i {
  position: absolute;
  inset: var(--y) auto auto var(--x);
  width: var(--diameter);
  aspect-ratio: 1;
  border-radius: 50%;
  background: currentColor;
  opacity: var(--alpha, 1);
  transform: translate(-50%, -50%) scale(var(--growth, 1));
}
.dot-cluster i:nth-child(1) { --x: 45%; --y: 17%; --diameter: 15%; --alpha: .45; }
.dot-cluster i:nth-child(2) { --x: 72%; --y: 28%; --diameter: 20%; --alpha: .53; }
.dot-cluster i:nth-child(3) { --x: 22%; --y: 37%; --diameter: 23%; --alpha: .48; }
.dot-cluster i:nth-child(4) { --x: 51%; --y: 49%; --diameter: 31%; --alpha: .53; }
.dot-cluster i:nth-child(5) { --x: 79%; --y: 62%; --diameter: 19%; --alpha: .4; }
.dot-cluster i:nth-child(6) { --x: 29%; --y: 71%; --diameter: 20%; --alpha: .5; }
.dot-cluster i:nth-child(7) { --x: 56%; --y: 80%; --diameter: 14%; --alpha: .4; }

.marker-dots { --marker-size: 20px; }
.marker-dots i { opacity: 1; }
.is-forced .check-dots { --point-color: var(--forced); --growth: 1.14; }
:is(.is-checked .check-dots, .check-dots.is-checked, [aria-pressed="true"] .check-dots) i {
  inset: calc(50% + (var(--y) - 50%) * .8) auto auto calc(50% + (var(--x) - 50%) * .8);
  opacity: 1;
  scale: 1.23;
}

.task-list { padding: 0; list-style: none; }
.task-list > li { border-top: 1px solid var(--line); }
.task-list > li:last-child { border-bottom: 1px solid var(--line); }

.task-card {
  width: 100%;
  min-height: 44px;
  padding: 10px 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: start;
}

.row-copy, .collection-copy { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.task-title, .collection-copy h3 { font-size: 16px; font-weight: 750; line-height: 1.35; }
.task-reason { color: var(--muted); font-size: 12px; }
.task-meta { color: var(--muted); line-height: 1.45; letter-spacing: .035em; font-weight: 500; }
.task-status { margin-inline-start: 3px; }
.task-card.is-checked .task-title,
.collection-row--bought .collection-copy h3 { color: var(--muted); text-decoration: line-through; }
.collection-notes { color: var(--muted); font-size: 13px; white-space: pre-wrap; }

.defer-section { margin-block: 12px 18px; }
.deferred-task {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  align-content: center;
  align-items: baseline;
  gap: 8px;
  min-height: 40px;
  padding: 4px 0;
}
.deferred-task > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deferred-title { font-size: 13px; font-weight: 650; max-width: min(43vw, 14rem); }
.small-thing-section .section-heading { align-items: center; }
.small-thing-copy {
  padding: 10px 0 10px calc(var(--mark-column) + var(--mark-gap));
  border-block: 1px solid var(--line);
}
.small-thing-copy h3 { font-size: 14px; font-weight: 700; }
.small-item-list > li { padding-block: 9px; }

.collection-row { min-height: 54px; padding-block: 6px; }
.collection-row:has(.collection-side) { grid-template-columns: var(--mark-column) minmax(0, 1fr) auto; }
.collection-row > .error-message { grid-column: 2 / -1; }
.collection-side { display: flex; align-items: center; justify-content: end; gap: 5px; }
.shopping-quantity { color: var(--muted); text-align: end; }
.check-button {
  justify-self: center;
  width: 44px;
  max-width: none;
  height: 44px;
  padding: 0;
  border: 0;
}
.collection-copy .button-row { margin-block-start: 4px; }
.collection-copy .button { min-height: 40px; }
.board-tabs, .people-groups {
  --band-gutter: max(var(--gutter), (100cqw - var(--content)) / 2);
}
.board-tabs {
  --board-heading-height: 48px;
  isolation: isolate;
  margin-block: 16px 24px;
}
.people-groups { margin-block: 16px 24px; }
.board-section { border-top: 1px solid var(--line); }
.board-section:last-child { border-bottom: 1px solid var(--line); }
.board-switch, .project-row, .people-row {
  display: grid;
  align-items: center;
  gap: 8px;
  border: 0;
  text-align: start;
  overflow-wrap: anywhere;
}

.board-switch {
  position: sticky;
  z-index: 2;
  inset-block-start: var(--topbar-height);
  grid-template-columns: minmax(0, 1fr) auto auto 16px;
  width: calc(100% + 2 * var(--band-gutter));
  max-width: none;
  height: var(--board-heading-height);
  margin-inline: calc(-1 * var(--band-gutter));
  padding: 4px var(--band-gutter);
  background: var(--paper);
  color: var(--muted);
}
.board-switch:focus-visible { outline-offset: -2px; }
.board-name { font-size: 21px; font-weight: 750; text-transform: uppercase; }
.board-section[open] > .board-switch { color: var(--ink); }
.board-actions, .group-actions { display: flex; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
.fold-arrow {
  justify-self: center;
  width: 7px;
  height: 7px;
  border-inline-end: 1px solid currentColor;
  border-block-end: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
details[open] > summary .fold-arrow { transform: translateY(2px) rotate(225deg); }

.board-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  padding-block: 0 8px;
}
.board-filters select { padding-inline: 5px; font-size: 12px; }
.board-filters .form-field { color: var(--muted); font-size: 11px; }

.project-row, .people-row {
  grid-template-columns: var(--mark-column) minmax(0, 1fr) auto 16px;
  min-height: 44px;
  margin-inline: calc(-1 * var(--band-gutter));
  padding: 2px var(--band-gutter);
  background: var(--project-band);
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}
.project-row {
  position: sticky;
  z-index: 1;
  inset-block-start: calc(var(--topbar-height) + var(--board-heading-height));
}
.project-row:has(.group-actions) { grid-template-columns: var(--mark-column) minmax(0, 1fr) auto auto 16px; }
.project-row:focus-visible, .people-row:focus-visible { outline-offset: -2px; }
.people-group + .people-group > .people-row { border-block-start: 1px solid var(--line); }
.project-tools { justify-content: flex-end; }
.project-group .group-content > .empty-state { margin-block: 8px; }
:is(.project-group, .people-group) .task-list > li:last-child { border-bottom: 0; }
.board-content > .empty-state { margin-block: 4px 14px; }

.empty-state, .status-line, .error-message {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.empty-state { padding-block: 10px; border-top: 1px solid var(--line); }
.status-line, .error-message { margin-block: 10px; }
.error-message { border-inline-start: 2px solid var(--ink); padding-inline-start: 8px; color: var(--ink); }

.bottom-nav {
  position: fixed;
  z-index: 1;
  inset: auto 0 0;
  display: flex;
  justify-content: center;
  padding: 4px max(6px, calc((100% - var(--content)) / 2)) calc(4px + env(safe-area-inset-bottom));
  border-top: 2px solid var(--ink);
  background: var(--paper);
}
.bottom-nav .button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 46px;
  padding-inline: 2px;
  border: 0;
  color: var(--muted);
  font-weight: 500;
}
.bottom-nav [aria-current="page"] { color: var(--ink); font-weight: 800; }

@media (max-width: 22rem) {
  .bottom-nav .button { font-size: 10px; letter-spacing: .055em; }
}

.auth-shell { display: grid; place-items: center; padding: var(--gutter); }
.auth-card { display: grid; gap: 14px; width: min(100%, 26rem); }
.auth-card .point-heading { border-bottom: 2px solid var(--ink); }

.form-stack, .form-grid { display: grid; gap: 12px; }
.form-stack fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.form-field {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  font-size: 13px;
  font-weight: 650;
}

input:not([type="checkbox"]), textarea, select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 7px 8px;
  border: 1px solid var(--control-line);
  border-radius: 0;
  background: var(--paper);
  color: inherit;
  font-size: 16px;
  font-weight: 400;
}

textarea { min-height: 5.5rem; resize: vertical; }
.field-hint { color: var(--muted); font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
.checkbox-field { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.checkbox-field input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }

.modal {
  width: min(37rem, calc(100% - 2 * var(--gutter)));
  max-height: calc(100dvh - 2 * var(--gutter));
  padding: 0;
  overflow-y: auto;
  border: 1px solid var(--control-line);
  color: var(--ink);
  background: var(--paper);
}
.modal::backdrop { background: rgb(0 0 0 / 49%); }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 2px solid var(--ink);
  overflow-wrap: anywhere;
}
.modal-header h2 { font-size: 20px; }
.modal-header > .button { flex: none; white-space: nowrap; }
.modal-body { padding: 16px; overflow-wrap: anywhere; }
.modal-body > .button-row:not(:first-child) { margin-block-start: 12px; }
.detail-list { display: grid; gap: 7px; }
.detail-list > div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 8px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { white-space: pre-wrap; }

.account-household {
  margin-block: 20px 0;
  padding-block: 14px;
  border-block: 1px solid var(--line);
}
.membership-section { display: grid; gap: 12px; }
.membership-section > .status-line, .membership-section > .error-message { margin-block: 0; }
.modal[data-panel="account"] .modal-header {
  position: sticky;
  z-index: 1;
  inset-block-start: 0;
  background: var(--paper);
}
.membership-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.membership-heading h3 {
  font: 700 12px/1.3 var(--mono);
  text-transform: uppercase;
  letter-spacing: .055em;
}
.membership-list {
  display: grid;
  padding: 0;
  list-style: none;
  border-block-start: 1px solid var(--line);
}
.membership-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  padding-block: 4px;
  border-block-end: 1px solid var(--line);
}
.membership-person { min-width: 0; }
.membership-person > .membership-meta { display: block; }
.membership-title { font-size: 17px; font-weight: 750; }
.membership-invite .membership-person { flex: 1; }
.membership-invite .form-field { margin-block-start: 8px; }
.membership-meta {
  color: var(--muted);
  font: 400 12px/1.45 var(--mono);
}
.membership-actions { display: flex; align-items: center; flex: none; }
.membership-confirm {
  display: grid;
  gap: 12px;
  padding-block: 12px;
  border-block: 1px solid var(--line);
}

@media (min-width: 36rem) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
