@font-face {
  font-family: "Rubik";
  src: url("/assets/rubik-variable-latin-f5dd2030.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --paper: #f5f8f8;
  --surface: #ffffff;
  --ink: #243943;
  --muted: #586c74;
  --line: #d8e3e6;
  --line-soft: #edf2f3;
  --track: #e2ebee;
  --line-strong: #b5c6cd;

  --primary: #23566b;
  --primary-dark: #1a4354;
  --primary-soft: #e2edf0;
  --primary-line: #bfd5de;

  --token: #f4c65e;
  --token-edge: #dea93d;
  --token-hover: #eabb4d;
  --pop: #d88165;

  --correct: #1a7a50;
  --correct-soft: #e3f4ea;
  --growing: #6b4e00;
  --growing-soft: #fdf1cc;
  --missed: #a8372d;
  --missed-soft: #fce9e6;
  --danger: #c8463a;
  --danger-dark: #a8372d;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --font-ui: "Rubik", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  font-family: var(--font-ui);
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

strong,
b {
  font-weight: 600;
}

fieldset {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

legend {
  margin-bottom: 8px;
  padding: 0;
  font-weight: 500;
}

button,
.button {
  touch-action: manipulation;
}

:where(a,
button,
input,
textarea,
select,
summary,
[tabindex]):focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

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

.shell {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

.main-content {
  padding-block: 32px 72px;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.header-inner {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.wordmark {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 500;
}

.site-nav a,
.link-button {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}

.site-nav form,
.heading-actions form,
.danger-zone form {
  margin: 0;
}

.account-menu {
  position: relative;
}

.account-menu > summary {
  list-style: none;
}

.account-menu > summary::-webkit-details-marker {
  display: none;
}

.account-menu-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid transparent;
  border-radius: 50%;
  color: white;
  background: var(--primary);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
}

.account-menu-button:hover,
.account-menu[open] .account-menu-button {
  border-color: var(--primary);
}

.account-menu-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  right: 0;
  display: flex;
  width: max-content;
  min-width: 220px;
  max-width: min(300px, calc(100vw - 32px));
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(36, 57, 67, 0.12);
}

.account-menu-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line-soft);
  padding: 8px 10px 12px;
}

.account-menu-identity strong {
  color: var(--ink);
}

.account-menu-identity span {
  font-size: 0.85rem;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.account-menu-panel a,
.account-menu-panel .link-button {
  display: block;
  width: 100%;
  border-radius: var(--radius-sm);
  padding: 10px;
  color: var(--ink);
  text-align: left;
}

.account-menu-panel a:hover,
.account-menu-panel .link-button:hover {
  color: var(--ink);
  background: var(--paper);
}

.site-nav a:hover,
.link-button:hover,
.text-link:hover {
  color: var(--primary);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.subhead {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.muted {
  color: var(--muted);
}

.page-heading {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

.heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
}

.page-heading.heading-row {
  flex-direction: row;
}

.heading-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  list-style: none;
}

.breadcrumbs li + li::before {
  margin-right: 8px;
  content: "/";
}

.breadcrumbs a {
  color: inherit;
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--primary);
}

.breadcrumbs [aria-current="page"] {
  color: var(--ink);
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0 20px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.button.primary {
  color: white;
  background: var(--primary);
}

.button.primary:hover {
  background: var(--primary-dark);
}

.button.secondary {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface);
}

.button.secondary:hover {
  border-color: var(--primary-line);
  background: var(--primary-soft);
}

.button.quiet {
  color: var(--muted);
  background: transparent;
}

.button.quiet:hover {
  color: var(--ink);
}

.button.danger {
  color: white;
  background: var(--danger);
}

.button.danger:hover {
  background: var(--danger-dark);
}

.text-link {
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: none;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.empty-state {
  max-width: 720px;
  margin: 48px auto;
  border: 2px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 56px 36px;
  text-align: center;
  background: var(--surface);
}

.empty-state.compact {
  margin-block: 8px 64px;
}

.empty-state p {
  max-width: 480px;
  margin: 0 auto 24px;
  color: var(--muted);
  line-height: 1.6;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-bottom: 16px;
}

.section-heading h2,
.section-heading p {
  margin-bottom: 0;
}

.narrow-page {
  max-width: 640px;
  margin-inline: auto;
}

.stacked-form {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  background: var(--surface);
}

.page-heading + .stacked-form {
  margin-top: 0;
}

.field + .field {
  margin-top: 24px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.field input,
.field textarea,
.auth-card input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  color: var(--ink);
  outline: none;
  background: var(--surface);
  transition: border 150ms ease, box-shadow 150ms ease;
}

.field textarea {
  min-height: 240px;
  resize: vertical;
  line-height: 1.7;
}

.field input:focus,
.field textarea:focus,
.auth-card input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.field-hint {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.5;
}

.form-actions {
  margin-top: 28px;
}

.form-errors {
  margin-bottom: 24px;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  color: var(--missed);
  background: var(--missed-soft);
}

.form-errors p {
  margin-bottom: 6px;
  font-weight: 600;
}

.form-errors ul {
  margin-block: 0;
  padding-left: 20px;
}

.form-section {
  min-width: 0;
  margin: 28px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 20px 0 0;
}

.form-section legend {
  float: left;
  width: 100%;
  margin-bottom: 16px;
  padding: 0;
  font-size: 1rem;
  font-weight: 600;
}

.form-section legend + * {
  clear: both;
}

.form-section + .field {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.danger-zone {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.danger-zone p {
  color: var(--muted);
}

.panel {
  padding: 28px;
}

.panel + .panel {
  margin-top: 24px;
}

.choice-group {
  margin-bottom: 0;
}

.choice-group {
  min-width: 0;
  border: 0;
  padding: 0;
}

.choice-group legend {
  margin-bottom: 10px;
  font-weight: 500;
}

.choice-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.choice-option {
  position: relative;
  cursor: pointer;
}

.choice-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-option > span {
  display: flex;
  min-height: 88px;
  flex-direction: column;
  justify-content: center;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--surface);
  transition: border-color 150ms ease, background 150ms ease;
}

.choice-option strong {
  font-weight: 600;
}

.choice-option small {
  margin-top: 5px;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.4;
}

.choice-option:has(input:checked) > span {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.choice-option:has(input:focus-visible) > span {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.flash-wrap {
  position: relative;
  z-index: 30;
}

.flash {
  margin-top: 18px;
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-weight: 500;
}

.flash.notice {
  color: var(--correct);
  background: var(--correct-soft);
}

.flash.alert {
  color: var(--missed);
  background: var(--missed-soft);
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 36px 20px;
}

.auth-card {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px;
  background: var(--surface);
}

.main-content > .auth-card {
  margin-inline: auto;
}

.member-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  flex-wrap: wrap;
  padding: 14px 0;
}

.member-row + .member-row {
  border-top: 1px solid var(--line-soft);
}

.member-info {
  display: flex;
  min-width: 0;
  flex: 1 1 220px;
  flex-direction: column;
  gap: 2px;
}

.member-info strong {
  overflow-wrap: anywhere;
}

.member-info > span {
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.member-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.member-actions form {
  margin: 0;
}

.role-tag {
  border-radius: 8px;
  padding: 3px 8px;
  color: var(--muted);
  background: var(--paper);
  font-size: 0.8rem;
  font-weight: 600;
}

.role-tag.admin {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.button.compact {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.9rem;
}

.invite-form {
  margin-top: 16px;
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.auth-card h1 {
  margin-bottom: 8px;
  font-size: 2rem;
  text-align: center;
}

.auth-intro {
  margin-bottom: 28px;
  color: var(--muted);
  text-align: center;
}

.auth-card .field {
  margin-top: 18px;
}

.auth-card .button {
  width: 100%;
  margin-top: 24px;
}

.auth-options {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-options input {
  width: auto;
}

.auth-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  color: var(--primary-dark);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Day checklist */

.day-page {
  display: flex;
  max-width: 640px;
  flex-direction: column;
  gap: 16px;
  margin-inline: auto;
}

.date-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stepper-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
}

span.stepper-button {
  color: var(--line);
  background: transparent;
}

.stepper-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.date-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.date-label strong {
  font-size: 1.1rem;
  font-weight: 600;
}

.date-label span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.child-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-radius: 14px;
  padding: 4px;
  background: var(--track);
}

.child-tab {
  display: inline-flex;
  min-height: 40px;
  flex: 1 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  padding: 0 16px;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}

.child-tab[aria-current="page"] {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(36, 57, 67, 0.12);
  font-weight: 600;
}

.heat-dot {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--heat);
}


.day-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: var(--surface);
}

.day-summary h1 {
  font-size: 1.5rem;
}

.day-summary-text p {
  margin: 2px 0 0;
  color: var(--muted);
  font-weight: 400;
}

.progress-track {
  height: 10px;
  grid-column: 1 / -1;
  overflow: hidden;
  border-radius: 999px;
  background: var(--track);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--correct);
  transition: width 300ms ease;
}

.task-list {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0;
  background: var(--surface);
  list-style: none;
}

.task-row {
  display: flex;
  min-height: 66px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 14px;
}

.task-row + .task-row {
  border-top: 1px solid var(--line-soft);
}

.task-row form {
  margin: 0;
}

.task-text {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.task-text strong {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.task-text span {
  color: var(--muted);
  font-size: 0.85rem;
}

/* A done task turns into a coin with a check, like the logo. */
.check-button {
  display: grid;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  place-items: center;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  padding: 0;
  color: transparent;
  background: var(--surface);
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
}

span.check-button {
  cursor: default;
}

.check-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.2;
  transition: stroke-dashoffset 250ms ease 120ms;
}

.check-button.done {
  border-color: var(--token);
  color: var(--primary);
  background: var(--token);
}

.check-button.done svg {
  stroke-dashoffset: 0;
}

.check-button.missed {
  border-color: var(--missed-soft);
  color: var(--missed);
  background: var(--missed-soft);
}

.check-button.missed svg {
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  stroke-width: 2.8;
}

.task-row.missed .task-text span {
  color: var(--missed);
}

.row-menu-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
}

.row-menu-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.day-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.pill-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill-option input {
  position: absolute;
  opacity: 0;
}

.pill-option input:focus-visible + span {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.pill-option {
  position: relative;
  cursor: pointer;
}

.pill-option span {
  display: inline-flex;
  min-height: 44px;
  min-width: 52px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  background: var(--surface);
  font-weight: 500;
}

.pill-option input:checked + span {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-soft);
}

/* Scoreboard: a full-screen display for a wall tablet or TV. */

body.focus-mode .main-content {
  width: auto;
  padding: clamp(16px, 3vw, 40px);
}

.scoreboard {
  display: flex;
  height: calc(100dvh - 2 * clamp(16px, 3vw, 40px));
  flex-direction: column;
  gap: clamp(16px, 2vw, 28px);
  font-size: clamp(1rem, 0.8rem + 0.6vw, 1.5rem);
}

/* On body so it also covers the page padding and elements that set their own cursor. */
body:has(.cursor-hidden),
body:has(.cursor-hidden) * {
  cursor: none;
}

.scoreboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.scoreboard-header h1 {
  font-size: 1.6em;
}

.scoreboard-grid {
  display: grid;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
  gap: clamp(16px, 2vw, 28px);
}

.scoreboard-card {
  display: flex;
  flex-direction: column;
  gap: 0.65em;
  border: 1px solid var(--line);
  border-top: 8px solid var(--heat);
  border-radius: var(--radius-lg);
  padding: 1.3em;
  background: var(--surface);
}

.scoreboard-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.scoreboard-card h2 {
  font-size: 1.6em;
  overflow-wrap: anywhere;
}

.scoreboard-balance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1.6em;
  font-weight: 700;
}

.scoreboard-score {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  color: var(--muted);
}

.scoreboard-card .progress-track {
  height: 14px;
}

.scoreboard-score strong {
  flex-basis: 100%;
  overflow-wrap: anywhere;
}

.scoreboard-badge {
  margin: 0;
  font-weight: 600;
}

.scoreboard-badge {
  align-self: flex-start;
  border-radius: 999px;
  padding: 4px 14px;
  color: var(--correct);
  background: var(--correct-soft);
}

.scoreboard-tasks {
  margin: 0;
  border-top: 1px solid var(--line-soft);
  padding: 0;
  list-style: none;
}

.scoreboard-tasks .task-row {
  min-height: 0;
  gap: 0.55em;
  padding: 0.45em 0;
}

.scoreboard-tasks .check-button {
  width: 1.85em;
  height: 1.85em;
}

.scoreboard-tasks .check-button svg {
  width: 0.95em;
  height: 0.95em;
}

/* Bottom tabs */

.has-tab-bar .main-content {
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

.tab-bar {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  border-top: 1px solid var(--line);
  padding: 6px max(8px, calc((100% - 640px) / 2)) calc(6px + env(safe-area-inset-bottom));
  background: var(--surface);
}

.tab-bar-link {
  display: flex;
  min-height: 56px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
}

.tab-bar-link svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.tab-bar-link[aria-current="page"] {
  color: var(--primary);
  font-weight: 600;
}

/* Tokens */

.coin {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
}

.day-summary-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.balance {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 1.1rem;
  font-weight: 700;
}

.bonus-button {
  border-color: var(--token-edge);
  color: var(--ink);
  background: var(--token);
}

.bonus-button:hover {
  background: var(--token-hover);
}

.bonus-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.balance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: 20px;
  padding: 18px 20px;
  color: white;
  background: var(--ink);
}

.balance-card span {
  display: block;
  color: var(--primary-line);
  font-size: 0.85rem;
  font-weight: 400;
}

.balance-card strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}

.balance-worth {
  text-align: right;
}

.balance-worth strong {
  justify-content: flex-end;
  font-size: 1.5rem;
}

.reward-progress {
  display: block;
  height: 6px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--track);
}

.reward-progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--token);
}

.task-row .text-link {
  padding: 8px 4px;
}

.ledger-amount {
  width: 44px;
  flex-shrink: 0;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: right;
}

.ledger-amount.plus {
  color: var(--correct);
}

.ledger-amount.minus {
  color: var(--missed);
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pills a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 500;
  text-decoration: none;
}

.filter-pills a[aria-current="page"] {
  border-color: var(--ink);
  color: white;
  background: var(--ink);
}

.activity-day h2 {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* History */

.heatmap-panel {
  padding: 18px;
}

/* Right-to-left scrolling starts the graph at today; the grid itself stays left-to-right. */
.heatmap-scroll {
  overflow-x: auto;
  direction: rtl;
}

/* The padding leaves room for today's outline, which the scroll box would otherwise clip. */
.heatmap {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  direction: ltr;
}

.heatmap-weekdays,
.heatmap-week {
  display: grid;
  grid-template-rows: 14px repeat(7, 12px);
  gap: 3px;
}

.heatmap-weekdays {
  padding-right: 4px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 500;
  line-height: 12px;
}

.heatmap-month {
  width: 12px;
  overflow: visible;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 500;
  white-space: nowrap;
}

.heat-cell {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--heat, transparent);
}

.heat-0 { --heat: var(--line); }
.heat-1 { --heat: #c6e9d3; }
.heat-2 { --heat: #6fbf93; }
.heat-3 { --heat: #2c8f5f; }
.heat-4 { --heat: #14613f; }
.heat-blank { outline: 1px dashed var(--line); outline-offset: -1px; }
.heat-future { visibility: hidden; }

.heat-today {
  box-shadow: 0 0 0 2px var(--ink);
}

.heatmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.heatmap-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: var(--surface);
}

.stat strong {
  font-size: 1.5rem;
  font-weight: 700;
}

.stat span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
}

/* Tappable lists */

.link-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-list > li + li {
  border-top: 1px solid var(--line-soft);
}

.link-row {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  color: var(--ink);
  text-decoration: none;
}

a.link-row:hover .link-row-text strong {
  color: var(--primary-dark);
}

.link-row-text {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.link-row-text strong {
  overflow-wrap: anywhere;
}

.link-row-text span {
  color: var(--muted);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--line-strong);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.avatar {
  display: grid;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  place-items: center;
  border-radius: 50%;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-weight: 600;
}

.avatar.invited {
  border: 1.5px dashed var(--primary-line);
  color: var(--muted);
  background: transparent;
}

.role-tag.invited {
  color: var(--growing);
  background: var(--growing-soft);
}

.settings-list {
  margin: 0;
}

.settings-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}

.settings-list div + div {
  border-top: 1px solid var(--line-soft);
}

.settings-list dt {
  color: var(--muted);
}

.settings-list dd {
  margin: 0;
  font-weight: 500;
  text-align: right;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.preset-chip {
  min-height: 36px;
  border: 1px dashed var(--primary-line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--primary-dark);
  background: transparent;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
}

.preset-chip:hover {
  background: var(--primary-soft);
}

.person-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.person-heading .avatar {
  width: 56px;
  height: 56px;
  font-size: 1.3rem;
}

.person-heading p {
  margin: 4px 0 0;
  color: var(--muted);
}

/* Reordering */

.reorder-list .row-menu-button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.reorder-list .row-menu-button:disabled {
  cursor: default;
  opacity: 0.35;
}

/* Celebration when the last task of a day is checked off */

.celebration {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  animation: celebration-fade 1.2s ease forwards;
}

.celebration-message {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 20px;
  padding: 16px 24px;
  color: white;
  background: var(--primary);
  box-shadow: 0 18px 50px rgba(36, 57, 67, 0.25);
  font-size: 1.4rem;
  font-weight: 700;
  animation: celebration-pop 650ms cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}

.celebration-message svg {
  width: 40px;
  height: 40px;
}

.confetti {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 18px;
  border-radius: 3px;
  background: var(--token);
  animation: confetti-burst 900ms ease-out forwards;
}

.confetti:nth-of-type(3n) {
  background: var(--primary);
}

.confetti:nth-of-type(3n + 1) {
  background: var(--pop);
}

.confetti-1 { --x: -190px; --y: -140px; --r: 80deg; }
.confetti-2 { --x: -120px; --y: -210px; --r: -95deg; }
.confetti-3 { --x: -35px; --y: -190px; --r: 150deg; }
.confetti-4 { --x: 80px; --y: -210px; --r: -130deg; }
.confetti-5 { --x: 180px; --y: -130px; --r: 190deg; }
.confetti-6 { --x: 200px; --y: -20px; --r: -60deg; }
.confetti-7 { --x: 185px; --y: 90px; --r: -160deg; }
.confetti-8 { --x: 110px; --y: 170px; --r: 120deg; }
.confetti-9 { --x: 25px; --y: 190px; --r: 210deg; }
.confetti-10 { --x: -80px; --y: 175px; --r: -110deg; }
.confetti-11 { --x: -170px; --y: 110px; --r: -220deg; }
.confetti-12 { --x: -200px; --y: -10px; --r: 70deg; }

@keyframes celebration-pop {
  0% { opacity: 0; transform: scale(0.5) rotate(-6deg); }
  60% { opacity: 1; transform: scale(1.08) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes celebration-fade {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

@keyframes confetti-burst {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.2); }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)); }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 32px, 1120px);
  }

  .site-nav {
    gap: 18px;
  }

  .main-content {
    padding-block: 24px 56px;
  }

  .scoreboard {
    height: auto;
  }

  .choice-options {
    grid-template-columns: 1fr;
  }

  .stacked-form,
  .panel,
  .auth-card {
    padding: 24px;
  }
}

@media (max-width: 359px) {
  .site-header .wordmark {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
