:root {
  color-scheme: light;
  --ink: #1e2a2a;
  --muted: #67716f;
  --faint: #8d9693;
  --paper: #f7f4ee;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #fffdf9;
  --line: #deddd7;
  --line-soft: #ebe9e3;
  --forest: #2f6259;
  --forest-dark: #214940;
  --forest-soft: #dfece7;
  --coral: #e56f51;
  --coral-soft: #f8ded5;
  --gold: #d5a84f;
  --shadow: 0 24px 70px rgba(38, 50, 47, 0.1);
  --shadow-soft: 0 10px 35px rgba(38, 50, 47, 0.07);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    var(--paper);
  background-size: 34px 34px;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.8), transparent 44%);
  z-index: -2;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(47, 98, 89, 0.22);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(8px);
  pointer-events: none;
  opacity: 0.32;
  z-index: -1;
}

.ambient-one {
  top: -250px;
  right: -80px;
  background: #e8c8bb;
}

.ambient-two {
  bottom: -300px;
  left: -150px;
  background: #bcd8cd;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  height: 76px;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid rgba(82, 91, 88, 0.12);
  background: rgba(247, 244, 238, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--ink);
  font-weight: 750;
  font-size: 20px;
  letter-spacing: -0.5px;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: inline-block;
  width: 31px;
  height: 25px;
}

.brand-mark span {
  position: absolute;
  top: 3px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--forest);
  border-radius: 50% 50% 50% 8px;
  transform: rotate(45deg);
}

.brand-mark span:first-child {
  left: 0;
}

.brand-mark span:last-child {
  right: 0;
  border-color: var(--coral);
  transform: scaleX(-1) rotate(45deg);
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(46, 63, 59, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.nav-button {
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: 160ms ease;
}

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

.nav-button.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 3px 12px rgba(37, 51, 47, 0.08);
}

.settings-button {
  justify-self: end;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(44, 57, 54, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.66);
  cursor: pointer;
  transition: 160ms ease;
}

.icon-button:hover:not(:disabled) {
  border-color: rgba(44, 57, 54, 0.25);
  background: #fff;
  transform: translateY(-1px);
}

.icon-button:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.icon-button svg,
.button svg,
.edit-icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#app-main {
  min-height: calc(100vh - 76px);
}

.page-shell {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 58px 0 90px;
}

.week-hero {
  margin-bottom: 34px;
}

.week-title-row,
.board-toolbar,
.prize-heading,
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.week-switcher {
  display: flex;
  align-items: center;
  gap: 20px;
}

.week-switcher > div {
  min-width: 310px;
  text-align: center;
}

.week-arrow {
  width: 43px;
  height: 43px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--forest);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

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

h1,
h2 {
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.035em;
}

h1 {
  margin-bottom: 5px;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.08;
}

h3 {
  letter-spacing: -0.02em;
}

.date-range {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.hero-actions,
.board-actions,
.data-tool-buttons,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.58;
  cursor: wait;
  transform: none;
}

.button-primary {
  color: #fff;
  background: var(--forest);
  box-shadow: 0 8px 20px rgba(47, 98, 89, 0.18);
}

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

.button-dark {
  color: #fff;
  background: var(--ink);
}

.button-dark svg {
  width: 15px;
}

.button-ghost {
  border-color: rgba(40, 55, 51, 0.14);
  background: rgba(255, 255, 255, 0.65);
}

.button-ghost:hover {
  background: #fff;
}

.button-danger {
  color: #a34637;
  border-color: rgba(163, 70, 55, 0.15);
  background: #fff4f0;
}

.button-small {
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 12px;
}

.scoreboard {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 40px;
}

.score-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px 26px;
  min-width: 0;
  padding: 25px 28px;
  overflow: hidden;
  border: 1px solid rgba(44, 57, 54, 0.1);
  border-radius: 24px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: 180ms ease;
}

.score-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--person-color);
  opacity: 0;
  transition: 180ms ease;
}

.score-card:hover,
.score-card.is-active {
  border-color: color-mix(in srgb, var(--person-color) 35%, transparent);
  background: color-mix(in srgb, var(--person-soft) 34%, white);
  transform: translateY(-2px);
}

.score-card.is-active::before {
  opacity: 1;
}

.score-person {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.avatar,
.mini-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--person-color);
  background: var(--person-soft);
  font-weight: 800;
}

.avatar {
  width: 50px;
  height: 50px;
  font-size: 14px;
}

.mini-avatar {
  width: 31px;
  height: 31px;
  font-style: normal;
  font-size: 10px;
}

.score-person small,
.score-person strong {
  display: block;
}

.score-person small {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.score-person strong {
  overflow: hidden;
  font-size: 20px;
  text-overflow: ellipsis;
}

.score-number {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.score-number strong {
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 42px;
  line-height: 0.9;
}

.score-number span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.score-progress {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.score-progress > span,
.target-meter > span {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(43, 56, 53, 0.09);
}

.score-progress i,
.target-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--person-color, var(--active-color));
}

.score-progress small {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.leader-chip {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 8px;
  border-radius: 99px;
  color: var(--person-color);
  background: var(--person-soft);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.versus-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 5px solid var(--paper);
  border-radius: 50%;
  color: var(--muted);
  background: #fff;
  font-family: Georgia, serif;
  font-size: 15px;
  transform: translate(-50%, -50%);
}

.week-pulse {
  display: grid;
  grid-template-columns: auto minmax(150px, 0.8fr) minmax(280px, 1.5fr) auto;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
  padding: 17px 22px;
  border: 1px solid rgba(47, 98, 89, 0.13);
  border-radius: 17px;
  background: rgba(223, 236, 231, 0.46);
}

.pulse-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: var(--forest);
  background: #fff;
}

.trophy-icon {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pulse-copy span,
.pulse-copy strong {
  display: block;
}

.pulse-copy span {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.pulse-copy strong {
  font-size: 14px;
}

.prize-preview {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding-left: 22px;
  border-left: 1px solid rgba(47, 98, 89, 0.16);
  font-size: 12px;
}

.prize-preview-row {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.prize-preview span {
  color: var(--muted);
  font-weight: 650;
}

.prize-preview i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--person-color);
}

.prize-preview strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-button {
  padding: 7px;
  border: 0;
  color: var(--forest);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.goals-board {
  padding: 34px;
  border: 1px solid rgba(44, 57, 54, 0.11);
  border-radius: 28px;
  background: rgba(255, 253, 249, 0.9);
  box-shadow: var(--shadow);
  scroll-margin-top: 96px;
}

.board-toolbar {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line-soft);
}

.board-toolbar h2 {
  max-width: 540px;
}

.allocation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 14px 17px;
  border: 1px solid #ead9b4;
  border-radius: 14px;
  color: #80591f;
  background: #fbf2dd;
}

.allocation-banner > div {
  display: grid;
  gap: 2px;
}

.allocation-banner span,
.allocation-banner p {
  font-size: 10px;
  font-weight: 750;
}

.allocation-banner span {
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.allocation-banner strong {
  font-size: 14px;
}

.allocation-banner p {
  margin: 0;
}

.allocation-banner.is-ready {
  border-color: rgba(47, 98, 89, 0.18);
  color: var(--forest);
  background: var(--forest-soft);
}

.allocation-banner.is-over {
  border-color: rgba(184, 73, 55, 0.22);
  color: #a23f31;
  background: #fbe7e2;
}

.allocation-actions {
  justify-items: end;
}

.allocation-actions .text-button {
  padding: 2px 0;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.read-only-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.person-tabs {
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  background: #f4f2ed;
}

.person-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.person-tab.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 4px 14px rgba(42, 52, 49, 0.08);
}

.person-tab .mini-avatar {
  color: var(--avatar-color);
  background: var(--avatar-soft);
}

.goal-group {
  padding-top: 27px;
}

.goal-group + .goal-group {
  margin-top: 8px;
  border-top: 1px dashed var(--line);
}

.group-heading,
.goal-row {
  display: grid;
  grid-template-columns: minmax(280px, 1.28fr) minmax(440px, 1.62fr) 76px;
  gap: 22px;
}

.group-heading {
  align-items: end;
  padding: 0 14px 12px;
}

.group-heading h3 {
  margin: 0 0 2px;
  font-size: 16px;
}

.group-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.days-heading,
.day-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.days-heading span {
  color: var(--faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-align: center;
  text-transform: uppercase;
}

.goal-count-heading {
  color: var(--faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-align: center;
  text-transform: uppercase;
}

.goal-list {
  display: grid;
  gap: 7px;
}

.goal-row {
  align-items: center;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: #f7f6f2;
  transition: 160ms ease;
}

.goal-row:hover {
  border-color: var(--line);
  background: #fff;
}

.goal-row.is-complete {
  background: color-mix(in srgb, var(--active-soft) 35%, white);
}

.goal-row.is-dragging {
  opacity: 0.42;
}

.goal-row.drag-before {
  box-shadow: inset 0 3px var(--active-color);
}

.goal-row.drag-after {
  box-shadow: inset 0 -3px var(--active-color);
}

.goal-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.drag-handle {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 22px;
  height: 31px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: var(--faint);
  background: transparent;
  cursor: grab;
  touch-action: none;
}

.drag-handle:hover,
.drag-handle:focus-visible {
  color: var(--active-color);
  background: var(--active-soft);
  outline: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.goal-edit {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.goal-edit.is-read-only,
.goal-edit:disabled {
  opacity: 1;
  cursor: default;
}

.goal-status {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 9px;
  color: var(--active-color);
  background: var(--active-soft);
  font-size: 13px;
  font-weight: 850;
}

.goal-copy {
  min-width: 0;
}

.goal-copy strong,
.goal-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-copy strong {
  margin-bottom: 2px;
  font-size: 12px;
}

.goal-copy small {
  color: var(--muted);
  font-size: 9px;
}

.edit-icon {
  flex: 0 0 auto;
  width: 14px;
  opacity: 0;
  transition: 140ms ease;
}

.goal-edit:hover .edit-icon {
  opacity: 0.65;
}

.earned-chip {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 8px;
  color: var(--active-color);
  background: var(--active-soft);
  font-size: 10px;
  font-weight: 800;
}

.earned-chip small {
  font-size: 8px;
}

.day-cell {
  display: grid;
  place-items: center;
}

.day-cell > span {
  display: none;
}

.day-check {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #d6d8d3;
  border-radius: 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transition: 140ms ease;
}

.day-check svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.65);
  transition: 140ms ease;
}

.day-check:hover:not(:disabled) {
  border-color: var(--active-color);
  transform: scale(1.06);
}

.day-check.is-checked {
  border-color: var(--active-color);
  background: var(--active-color);
  box-shadow: 0 5px 12px color-mix(in srgb, var(--active-color) 22%, transparent);
}

.day-check.is-checked svg {
  opacity: 1;
  transform: scale(1);
}

.day-check:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.goal-count-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.goal-count-check {
  display: grid;
  place-items: center;
  width: 38px;
  height: 32px;
  padding: 0;
  border: 1px solid #d6d8d3;
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  font-size: 9px;
  font-weight: 850;
  cursor: pointer;
  transition: 140ms ease;
}

.goal-count-check span,
.goal-count-check svg {
  grid-area: 1 / 1;
}

.goal-count-check svg {
  width: 16px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

.goal-count-check:hover:not(:disabled) {
  border-color: var(--active-color);
  color: var(--active-color);
  transform: translateY(-1px);
}

.goal-count-check.is-checked {
  border-color: var(--active-color);
  color: #fff;
  background: var(--active-color);
  box-shadow: 0 5px 12px color-mix(in srgb, var(--active-color) 22%, transparent);
}

.goal-count-check.is-checked span {
  opacity: 0;
}

.goal-count-check.is-checked svg {
  opacity: 1;
}

.goal-count-check:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.target-meter {
  display: grid;
  grid-template-columns: 1fr 22px;
  align-items: center;
  gap: 8px;
}

.target-meter > span {
  height: 4px;
}

.target-meter small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-align: right;
}

.empty-state {
  display: grid;
  justify-items: center;
  padding: 75px 20px 55px;
  text-align: center;
}

.empty-state h3 {
  margin: 14px 0 7px;
  font-size: 21px;
}

.empty-state p {
  max-width: 420px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.empty-orbit {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px dashed var(--active-color);
  border-radius: 50%;
  color: var(--active-color);
  background: var(--active-soft);
}

.prize-page {
  padding-top: 65px;
}

.prize-heading {
  align-items: center;
}

.prize-heading h1 {
  margin-bottom: 10px;
}

.prize-heading > div > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.prize-stats {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  gap: 13px;
  margin: 42px 0 54px;
}

.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 170px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(44, 57, 54, 0.1);
  border-radius: 21px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-soft);
}

.stat-card > span:not(.mini-avatar, .sparkle) {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.stat-card > strong {
  margin-bottom: 4px;
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 30px;
  line-height: 1;
}

.stat-card > small {
  color: var(--faint);
  font-size: 10px;
}

.stat-card .mini-avatar,
.stat-card .sparkle {
  position: absolute;
  top: 20px;
  left: 20px;
  color: var(--person-color, var(--gold));
  background: var(--person-soft, #f6ebd1);
}

.sparkle {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
}

.stat-featured {
  color: #fff;
  background: var(--forest);
}

.stat-featured::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -70px;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  box-shadow: 0 0 0 25px rgba(255, 255, 255, 0.035), 0 0 0 52px rgba(255, 255, 255, 0.025);
}

.stat-featured .trophy-icon {
  position: absolute;
  top: 19px;
  left: 20px;
  color: #e7c77d;
}

.stat-featured > span,
.stat-featured > small {
  color: rgba(255, 255, 255, 0.66) !important;
}

.history-section {
  padding: 34px;
  border: 1px solid rgba(44, 57, 54, 0.1);
  border-radius: 27px;
  background: rgba(255, 253, 249, 0.88);
  box-shadow: var(--shadow);
}

.section-heading {
  margin-bottom: 24px;
  padding-bottom: 23px;
  border-bottom: 1px solid var(--line-soft);
}

.section-heading h2 {
  font-size: 34px;
}

.section-heading > p {
  max-width: 300px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-row {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 12px 13px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: #f7f6f2;
}

.history-row.is-current {
  border-color: rgba(47, 98, 89, 0.18);
  background: rgba(223, 236, 231, 0.38);
}

.history-week {
  display: flex;
  align-items: center;
  gap: 11px;
}

.history-week > span {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 12px;
  color: var(--forest);
  background: #fff;
  font-size: 11px;
  font-weight: 850;
}

.history-week strong,
.history-week small {
  display: block;
}

.history-week strong {
  margin-bottom: 2px;
  font-size: 12px;
}

.history-week small {
  color: var(--muted);
  font-size: 9px;
}

.prize-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.prize-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 56px;
  padding: 8px 12px;
  border: 1px solid rgba(44, 57, 54, 0.09);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.62);
}

.prize-option.is-winner {
  border-color: color-mix(in srgb, var(--person-color) 25%, transparent);
  background: color-mix(in srgb, var(--person-soft) 60%, white);
}

.prize-option > div {
  min-width: 0;
}

.prize-option small,
.prize-option strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prize-status {
  display: inline-flex;
  align-items: center;
  width: max-content;
  margin-top: 4px;
  padding: 3px 6px;
  border-radius: 99px;
  color: #94641d;
  background: #fbefd2;
  font-size: 7px;
  font-weight: 850;
  letter-spacing: 0.35px;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.prize-status.is-accepted {
  color: var(--forest);
  background: var(--forest-soft);
}

.prize-preview .prize-status {
  margin-top: 0;
}

.prize-option small {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 8px;
}

.prize-option strong {
  padding-right: 34px;
  font-size: 11px;
}

.winner-label {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 3px 5px;
  border-radius: 99px;
  color: var(--person-color);
  background: #fff;
  font-size: 7px;
  font-weight: 850;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.edit-prize-button {
  width: 34px;
  height: 34px;
}

.edit-prize-button svg {
  width: 15px;
}

.modal {
  width: min(580px, calc(100% - 28px));
  max-height: calc(100vh - 34px);
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(44, 57, 54, 0.12);
  border-radius: 25px;
  color: var(--ink);
  background: var(--surface-solid);
  box-shadow: 0 40px 100px rgba(22, 34, 31, 0.24);
}

.modal::backdrop {
  background: rgba(23, 31, 29, 0.42);
  backdrop-filter: blur(6px);
}

.modal form {
  padding: 28px;
}

.modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.modal-heading h2 {
  font-size: 32px;
}

.modal-heading .icon-button {
  width: 35px;
  height: 35px;
}

.modal-copy,
.form-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.modal-copy {
  margin: -13px 0 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.field {
  display: grid;
  gap: 7px;
}

.field-wide {
  margin-bottom: 15px;
}

.field > span {
  color: #4f5b58;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.field > small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.field input,
.field select {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid #d9dad4;
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
}

.read-only-field {
  display: flex;
  align-items: center;
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid #e2e2dc;
  border-radius: 12px;
  color: var(--muted);
  background: #f5f4ef;
  font-size: 13px;
  font-weight: 700;
  text-transform: none !important;
}

.field input:focus,
.field select:focus {
  border-color: var(--forest);
  outline: 3px solid rgba(47, 98, 89, 0.1);
}

.form-note {
  margin: 15px 0 0;
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--forest-soft);
}

.form-note.is-error {
  color: #a23f31;
  background: #fbe7e2;
}

.modal-actions {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

.action-spacer {
  flex: 1;
}

.is-hidden {
  display: none !important;
}

.prize-fields {
  display: grid;
  gap: 14px;
}

.prize-field {
  padding: 16px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--person-soft) 44%, white);
}

.prize-field > span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--person-color);
}

.prize-field-heading b {
  margin-right: auto;
}

.prize-field-heading .prize-status {
  margin-top: 0;
}

.prize-field > small,
.partner-prize-field > small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.partner-prize-field {
  display: grid;
  gap: 11px;
}

.partner-prize-copy {
  font-family: var(--display);
  font-size: 19px;
}

.partner-prize-field .button {
  justify-self: start;
}

.prize-field .mini-avatar {
  width: 25px;
  height: 25px;
}

.profile-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 13px;
  background: #f4f2ed;
}

.profile-preview small,
.profile-preview strong {
  display: block;
}

.profile-preview small {
  color: var(--muted);
  font-size: 9px;
}

.data-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 23px;
  padding: 16px;
  border-radius: 14px;
  background: #f4f2ed;
}

.data-tools strong {
  font-size: 12px;
}

.data-tools p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 80;
  max-width: calc(100% - 30px);
  padding: 12px 17px;
  border-radius: 12px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 14px 35px rgba(24, 34, 31, 0.25);
  font-size: 12px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sync-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid rgba(47, 98, 89, 0.13);
  border-radius: 999px;
  color: var(--forest);
  background: rgba(223, 236, 231, 0.55);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.sync-chip > i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #43a278;
  box-shadow: 0 0 0 3px rgba(67, 162, 120, 0.12);
}

.sync-chip[data-status="syncing"] > i {
  background: var(--gold);
  animation: sync-pulse 900ms ease-in-out infinite alternate;
}

.sync-chip[data-status="error"] {
  color: #a34637;
  border-color: rgba(163, 70, 55, 0.16);
  background: #fff3ef;
}

.sync-chip[data-status="error"] > i {
  background: #c85d47;
}

@keyframes sync-pulse {
  to { opacity: 0.35; }
}

.gateway-shell {
  display: grid;
  place-items: center;
  width: min(1180px, calc(100% - 48px));
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  padding: 60px 0 90px;
}

.gateway-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(390px, 0.85fr);
  align-items: center;
  gap: clamp(55px, 8vw, 110px);
  width: 100%;
}

.gateway-intro h1 {
  max-width: 680px;
  margin-bottom: 22px;
  font-size: clamp(52px, 6.5vw, 82px);
  line-height: 0.96;
}

.gateway-intro > p:not(.eyebrow) {
  max-width: 530px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.trust-list {
  display: grid;
  gap: 10px;
  margin-top: 31px;
}

.trust-list span {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #4f5b58;
  font-size: 12px;
  font-weight: 650;
}

.trust-list i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--forest);
  background: var(--forest-soft);
  font-style: normal;
  font-size: 10px;
}

.gateway-card {
  position: relative;
  width: 100%;
  padding: 34px;
  border: 1px solid rgba(44, 57, 54, 0.11);
  border-radius: 27px;
  background: rgba(255, 253, 249, 0.92);
  box-shadow: var(--shadow);
}

.gateway-card h2 {
  margin-bottom: 14px;
  font-size: 37px;
}

.gateway-copy {
  margin-bottom: 25px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.gateway-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 28px;
  border-radius: 14px;
  color: var(--forest);
  background: var(--forest-soft);
  font-size: 20px;
  font-weight: 800;
}

.gateway-icon.success {
  color: #267253;
  background: #dcefe6;
}

.gateway-icon.warning {
  color: #9a6a20;
  background: #f6ead0;
}

.button-wide {
  width: 100%;
}

.privacy-caption {
  margin: 14px 0 0;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
}

.loading-card,
.setup-card {
  max-width: 510px;
  text-align: center;
}

.loading-card .eyebrow,
.loading-card .loading-mark,
.setup-card .gateway-icon {
  margin-right: auto;
  margin-left: auto;
}

.loading-card h1 {
  margin-bottom: 11px;
  font-size: 42px;
}

.loading-card > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.loading-mark {
  position: relative;
  display: block;
  width: 58px;
  height: 42px;
  margin-bottom: 26px;
}

.loading-mark i {
  position: absolute;
  top: 7px;
  width: 30px;
  height: 30px;
  border: 3px solid var(--forest);
  border-radius: 50%;
  animation: sync-pulse 650ms ease-in-out infinite alternate;
}

.loading-mark i:first-child { left: 3px; }
.loading-mark i:last-child { right: 3px; border-color: var(--coral); animation-delay: 300ms; }

.setup-card code {
  display: block;
  margin: 20px 0;
  padding: 13px;
  overflow-wrap: anywhere;
  border-radius: 10px;
  color: var(--forest-dark);
  background: #f1f1ec;
  font-size: 10px;
}

.setup-card .text-button {
  margin-top: 11px;
}

.onboarding-shell {
  display: block;
}

.onboarding-heading {
  max-width: 650px;
  margin: 0 auto 38px;
  text-align: center;
}

.onboarding-heading h1 {
  margin-bottom: 12px;
}

.onboarding-heading > p:last-child {
  color: var(--muted);
  font-size: 14px;
}

.onboarding-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.onboarding-grid.has-invite .onboarding-card:last-child {
  border-color: rgba(47, 98, 89, 0.3);
  box-shadow: 0 24px 70px rgba(47, 98, 89, 0.14);
}

.onboarding-card {
  padding-top: 28px;
}

.onboarding-card h2 {
  max-width: 420px;
}

.onboarding-card .form-grid {
  margin-bottom: 15px;
}

.step-number {
  position: absolute;
  top: 24px;
  right: 27px;
  color: #d8d8d1;
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 27px;
}

.sign-out-link {
  display: block;
  margin: 24px auto 0;
}

.cloud-settings {
  margin-top: 20px;
}

.cloud-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(47, 98, 89, 0.12);
  border-radius: 14px;
  background: rgba(223, 236, 231, 0.46);
}

.cloud-status-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  background: var(--forest);
  font-size: 11px;
}

.cloud-status-row strong,
.cloud-status-row p {
  display: block;
}

.cloud-status-row strong {
  margin-bottom: 2px;
  font-size: 12px;
}

.cloud-status-row p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.copy-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.copy-field input {
  min-width: 0;
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border-radius: 12px;
  color: var(--forest-dark);
  background: var(--forest-soft);
  font-size: 10px;
  line-height: 1.45;
}

.privacy-note svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 980px) {
  .page-shell {
    width: min(100% - 32px, 800px);
  }

  .week-title-row,
  .board-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .week-title-row {
    align-items: center;
  }

  .scoreboard {
    grid-template-columns: 1fr;
  }

  .versus-badge {
    display: none;
  }

  .week-pulse {
    grid-template-columns: auto 1fr auto;
  }

  .prize-preview {
    grid-column: 2 / -1;
    grid-row: 2;
    padding: 13px 0 0;
    border-top: 1px solid rgba(47, 98, 89, 0.13);
    border-left: 0;
  }

  .board-actions {
    justify-content: space-between;
  }

  .group-heading {
    display: block;
  }

  .days-heading {
    display: none;
  }

  .goal-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 15px;
  }

  .day-cell {
    gap: 4px;
  }

  .day-cell > span {
    display: block;
    color: var(--faint);
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .day-check {
    width: 100%;
    min-width: 35px;
  }

  .goal-count-grid {
    justify-content: stretch;
    gap: 4px;
  }

  .goal-count-check {
    flex: 1;
    min-width: 0;
    height: 36px;
  }

  .target-meter {
    grid-template-columns: 1fr 27px;
  }

  .prize-stats {
    grid-template-columns: 1fr 1fr;
  }

  .history-row {
    grid-template-columns: 120px 1fr auto;
  }

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

  .gateway-layout {
    grid-template-columns: 1fr;
    gap: 42px;
    max-width: 670px;
    margin: 0 auto;
  }

  .gateway-intro {
    text-align: center;
  }

  .gateway-intro > p:not(.eyebrow) {
    margin-right: auto;
    margin-left: auto;
  }

  .trust-list {
    justify-content: center;
  }
}

@media (max-width: 700px) {
  .topbar {
    grid-template-columns: 1fr auto;
    height: 68px;
    padding: 0 16px;
  }

  .brand {
    font-size: 18px;
  }

  .brand-mark {
    transform: scale(0.9);
    transform-origin: left center;
  }

  .primary-nav {
    position: fixed;
    right: 16px;
    bottom: 14px;
    left: 16px;
    z-index: 30;
    justify-content: stretch;
    padding: 5px;
    border-color: rgba(44, 57, 54, 0.16);
    background: rgba(255, 253, 249, 0.92);
    box-shadow: 0 14px 40px rgba(31, 42, 39, 0.18);
    backdrop-filter: blur(16px);
  }

  .nav-button {
    flex: 1;
  }

  .settings-button {
    grid-column: 2;
  }

  .page-shell {
    width: calc(100% - 24px);
    padding: 37px 0 100px;
  }

  .week-switcher {
    width: 100%;
    gap: 8px;
  }

  .week-switcher > div {
    flex: 1;
    min-width: 0;
  }

  .week-arrow {
    width: 38px;
    height: 38px;
  }

  h1 {
    font-size: 39px;
  }

  h2 {
    font-size: 29px;
  }

  .hero-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .hero-actions .button:not(.sync-chip) {
    flex: 1;
  }

  .sync-chip {
    width: 100%;
    justify-content: center;
    order: -1;
  }

  .scoreboard {
    margin-top: 27px;
  }

  .score-card {
    padding: 21px;
    border-radius: 20px;
  }

  .score-number strong {
    font-size: 36px;
  }

  .score-progress {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .week-pulse {
    grid-template-columns: auto 1fr;
    padding: 16px;
  }

  .week-pulse .text-button {
    grid-column: 2;
    justify-self: start;
    padding-left: 0;
  }

  .prize-preview {
    grid-column: 1 / -1;
  }

  .goals-board,
  .history-section {
    padding: 21px 14px;
    border-radius: 21px;
  }

  .board-toolbar {
    padding: 0 6px 22px;
  }

  .allocation-banner {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .allocation-actions {
    justify-items: start;
  }

  .board-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .person-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .person-tab {
    justify-content: center;
  }

  .goal-group {
    padding-top: 23px;
  }

  .group-heading {
    padding-right: 7px;
    padding-left: 7px;
  }

  .day-grid {
    gap: 4px;
  }

  .day-check {
    min-width: 0;
    height: 36px;
    border-radius: 9px;
  }

  .goal-copy strong {
    max-width: 205px;
  }

  .earned-chip {
    display: none;
  }

  .prize-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .prize-stats {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin: 30px 0;
  }

  .stat-card {
    min-height: 145px;
    padding: 16px;
  }

  .stat-featured {
    grid-column: 1 / -1;
  }

  .stat-card .mini-avatar,
  .stat-card .sparkle {
    top: 15px;
    left: 15px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading > p {
    text-align: left;
  }

  .history-row {
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 13px;
  }

  .history-week {
    grid-column: 1;
  }

  .prize-options {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .edit-prize-button {
    grid-column: 2;
    grid-row: 1;
  }

  .modal form {
    padding: 22px 18px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    flex-wrap: wrap;
  }

  .modal-actions .button:not(.button-danger) {
    flex: 1;
  }

  .modal-actions .button-danger {
    width: 100%;
  }

  .data-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .gateway-shell {
    width: calc(100% - 24px);
    min-height: calc(100vh - 68px);
    padding: 38px 0 90px;
  }

  .gateway-intro h1 {
    font-size: 45px;
  }

  .gateway-intro > p:not(.eyebrow) {
    font-size: 14px;
  }

  .gateway-card {
    padding: 25px 19px;
    border-radius: 21px;
  }

  .gateway-card h2 {
    font-size: 31px;
  }

  .onboarding-grid {
    grid-template-columns: 1fr;
  }

  .onboarding-grid.has-invite .onboarding-card:last-child {
    grid-row: 1;
  }

  .copy-field {
    grid-template-columns: 1fr;
  }
}

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