@font-face {
  font-family: "Plus Jakarta Sans"; font-weight: 200 800; font-display: swap;
  src: url("/fonts/plus-jakarta-sans.woff2") format("woff2");
}
@font-face {
  font-family: "Plus Jakarta Sans"; font-weight: 200 800; font-display: swap;
  src: url("/fonts/plus-jakarta-sans-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF;
}

:root {
  --radius: 20px;
  --radius-small: 12px;
  --tabbar: 68px;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  /* Keeps a focused card from hiding behind the tab bar. */
  scroll-padding-bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; line-height: 1.35; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.sprite, .visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.icon {
  width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.icon .solid, #i-flame .solid { fill: currentColor; stroke: none; }
#i-more path { stroke-width: 3.2; }

/* Frame. The tabs are at the bottom on a phone, and in the header on a computer. */
.shell {
  max-width: 560px; margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(var(--tabbar) + 32px + env(safe-area-inset-bottom));
}
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.brand { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; font-size: 20px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.brand img { width: 36px; height: 36px; border-radius: 11px; }
.today { color: var(--soft); font-weight: 600; white-space: nowrap; }
.account { display: grid; place-items: center; min-width: 44px; min-height: 44px; border-radius: 14px; }
.beside { display: none; }
.view-title { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }

.tabs {
  position: fixed; inset: auto 0 0; z-index: 5;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--soft); font-size: 12px; font-weight: 700; text-decoration: none;
}
.tab:focus-visible { outline-offset: -3px; border-radius: 14px; }
.tab[aria-current="page"] { color: var(--ink); }
.tab .icon { width: 44px; height: 28px; padding: 2px 0; border-radius: 10px; }
.tab[aria-current="page"] .icon { background: var(--sun); color: var(--on-color); }

/* Small boxes that mark a task or page */
.label {
  display: inline-flex; align-items: center; gap: 5px; min-width: 0; padding: 2px 8px; border-radius: 7px;
  background: var(--inset); color: var(--ink); font-size: 13px; font-weight: 700; overflow-wrap: anywhere;
}
.label .icon { width: 14px; height: 14px; stroke-width: 2.6; }
.label.private { background: var(--track); }
.due { color: var(--soft); font-weight: 600; white-space: nowrap; }
.due.overdue { padding: 1px 8px; border-radius: 7px; background: var(--danger-tint); color: var(--danger); font-weight: 700; }

/* Buttons and choices */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border-radius: 16px; font-weight: 700; text-align: center;
  background: var(--button); color: var(--on-button); text-decoration: none;
}
.button.quiet { background: var(--inset); color: var(--ink); }
.button.danger { background: var(--danger-tint); color: var(--danger); }
.button.small { min-height: 44px; padding: 8px 14px; }
.button.small .icon { width: 20px; height: 20px; }
.choices {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px;
  padding: 4px; border-radius: 16px; background: var(--inset);
}
.choice { position: relative; display: block; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice span, .choices > button {
  display: block; min-height: 44px; padding: 11px 4px; border-radius: 12px;
  color: var(--soft); font-size: 15px; font-weight: 700; text-align: center; overflow-wrap: anywhere;
}
.choice input:checked + span, .choices > button[aria-pressed="true"] {
  background: var(--raised); color: var(--ink); box-shadow: 0 1px 3px rgb(20 14 36 / 18%);
}
.icon-button {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: var(--radius-small); color: var(--soft);
}
.icon-button .icon { width: 20px; height: 20px; }
.choice input:focus-visible + span { outline: 3px solid var(--focus); }

/* Score */
.score-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.score-side { display: flex; align-items: center; gap: 10px; min-width: 0; }
.score-side:last-child { flex-direction: row-reverse; text-align: right; }
.score-side > span:last-child { min-width: 0; }
.score-name, .score-xp, .leader { display: block; }
a.score { color: inherit; text-decoration: none; }
.avatar {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 14px;
  background: var(--player); color: var(--on-color); font-size: 18px; font-weight: 800; line-height: 1;
}
.score-name { color: var(--soft); font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.score-xp { color: var(--player-deep); font-size: 24px; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.score-xp small { margin-left: -.1em; font-size: 12px; }
.versus { color: var(--soft); font-size: 13px; font-weight: 700; }
.score-bar { display: flex; gap: 4px; height: 12px; margin-top: 14px; }
.score-bar i { flex: var(--share) 1 0; min-width: 12px; border-radius: 6px; background: var(--player); transition: flex-grow .4s ease; }
.leader { margin-top: 12px; text-align: center; font-weight: 700; }
.view-tasks .score { display: block; margin-bottom: 16px; }
.view-score .score { margin-top: 12px; padding: 20px 16px; }
.view-score .score-side { flex-direction: column; text-align: center; }
.view-score .score-side > span:last-child { max-width: 100%; }
.view-score .avatar { width: 52px; height: 52px; border-radius: 18px; font-size: 22px; }
.view-score .score-xp { font-size: 32px; }
.week-dates { color: var(--soft); font-weight: 600; }
.heading-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.past { margin-top: 28px; }
.past-list { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.private-xp { margin-top: 10px; }
.past-week, .private-xp { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.badge {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 14px;
  background: var(--player-tint, var(--inset)); color: var(--player-deep, var(--soft));
}
.past-week > div, .private-xp > div { flex: 1; min-width: 0; }
.past-week strong, .private-xp strong { display: block; overflow-wrap: anywhere; }
.past-week small, .private-xp small { color: var(--soft); font-size: 14px; }
.past-week output, .private-xp output { font-weight: 800; white-space: nowrap; }

/* Tasks */
.task-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.task-tools .button { min-height: 52px; }
.group { margin-top: 20px; }
.group h3 { margin-bottom: 8px; color: var(--soft); font-size: 15px; font-weight: 700; }
.cards { display: grid; gap: 10px; }
.card { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 0; overflow: hidden; }
.card-main { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 14px 0 14px 14px; text-align: left; }
button.card-main:active { background: var(--player-tint); }
button.card-main:focus-visible, .card-more:focus-visible { outline-offset: -3px; border-radius: var(--radius); }
.mark {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px;
  border: 2.5px solid var(--player); border-radius: 14px; color: var(--player-deep);
}
/* The outline keeps its edges clear if a theme is close to the person's color. */
.card.done { background: var(--player-tint); border-color: var(--player-line); }
.card.done .mark { background: var(--player); color: var(--on-color); }
.labels { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 5px; }
.card .label:not(.private) { background: var(--player-tint); color: var(--player-deep); }
.card.done .label:not(.private) { background: var(--card); }
.card-text { flex: 1; min-width: 0; }
.card-title { display: block; font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 3px; color: var(--soft); font-size: 14px; font-weight: 600; }
.tags > span { display: inline-flex; align-items: center; gap: 4px; }
.tags .icon { width: 17px; height: 17px; }
.tags .xp { color: var(--player-deep); font-weight: 800; }
.tags .flame .icon { color: var(--flame); }
.progress { display: flex; align-items: center; gap: 10px; margin-top: 8px; color: var(--player-deep); font-size: 14px; font-weight: 800; white-space: nowrap; }
.pips { display: flex; flex: 0 1 160px; gap: 3px; min-width: 0; }
.pips i { flex: 1; min-width: 0; height: 8px; border-radius: 4px; background: var(--player-tint); }
.pips i.on, .card.done .pips i { background: var(--player); }
.pips.long { gap: 1px; }
.pips.long i { border-radius: 2px; }
.card-more { display: grid; place-items: center; width: 52px; color: var(--soft); }
.card-done { grid-column: 1 / -1; padding: 0 14px 14px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--player-deep); font-size: 14px; font-weight: 700; }
.card.done .card-foot .button { background: var(--card); }
.photo { display: block; width: 100%; border-radius: 14px; overflow: hidden; background: var(--inset); }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photos { display: grid; gap: 8px; margin-bottom: 10px; }
.photos.many { grid-template-columns: 1fr 1fr; }
.photos .photo { height: 160px; }
.photos.many .photo { height: 120px; }
.starters-button { width: 100%; margin-top: 20px; }
.email-card { gap: 14px; margin-bottom: 16px; }
.hint { color: var(--soft); }
.empty { margin-top: 16px; padding: 28px 20px; text-align: center; }
.empty strong { display: block; font-size: 18px; }
.empty p { margin-top: 4px; color: var(--soft); }

/* Feed */
.feed-list { display: grid; gap: 10px; margin-top: 12px; }
.feed-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.feed-item strong { display: block; overflow-wrap: anywhere; }
.feed-item small { color: var(--soft); font-size: 14px; }
.feed-item .xp { color: var(--player-deep); font-weight: 800; white-space: nowrap; }
.feed-item .photo { grid-column: 1 / -1; height: 260px; margin-top: 10px; }

/* Forms and sheets */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > span:first-child, .field > legend { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0; font-weight: 700; }
.field > span > small { font-weight: 500; }
.field > legend { margin-bottom: 6px; }
.field small { color: var(--soft); font-size: 14px; }
.input {
  width: 100%; min-width: 0; min-height: 50px; padding: 12px 14px; border: 1.5px solid var(--field-line); border-radius: 14px;
  background: var(--card); font-size: 17px;
}
.input::placeholder { color: var(--soft); opacity: 1; }
textarea.input { resize: vertical; line-height: 1.5; }
.select { position: relative; display: block; }
.select select { appearance: none; padding-right: 44px; text-overflow: ellipsis; cursor: pointer; }
.select::after {
  content: ""; position: absolute; top: calc(50% - 7px); right: 18px; width: 9px; height: 9px; pointer-events: none;
  border: solid var(--soft); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.pair { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px; }
.times-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 12px; align-items: center; font-weight: 700; }
.times-row .input { font-weight: 400; }
.times-row small { display: block; color: var(--soft); font-size: 14px; font-weight: 500; }
/* Follows the two numbers it comes from. */
.earns-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 10px 14px; border-radius: 14px; background: var(--track); font-weight: 700; }
.earns { font-size: 18px; font-weight: 800; }
.minutes-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; }
.minutes-row .choices { padding: 3px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; font-weight: 700; cursor: pointer; }
.switch small { display: block; color: var(--soft); font-size: 14px; font-weight: 500; }
.switch input {
  appearance: none; flex: none; position: relative; width: 52px; height: 32px; margin: 0;
  border-radius: 10px; background: var(--off); cursor: pointer; transition: background .15s;
}
.switch input::after {
  content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px;
  border-radius: 7px; background: #fff; transition: transform .15s;
}
.switch input:checked { background: var(--on); }
.switch input:checked::after { transform: translateX(20px); }
.error { color: var(--danger); font-weight: 600; }
.error:empty { display: none; }
.actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; }
[hidden] { display: none !important; }

/* Choices that save when tapped */
/* Lines up the choices with their heading, with room for an outline around them. */
.picks { display: grid; gap: 4px; margin: 0 -7px; }
.picks.colors { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.picks.themes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field > h3 { margin-bottom: 2px; font-size: 16px; font-weight: 700; }
.pick {
  display: grid; gap: 6px; padding: 5px 5px 7px; border: 2px solid transparent; border-radius: 16px;
  font-size: 14px; font-weight: 700; text-align: center; overflow-wrap: anywhere;
}
.pick[aria-pressed="true"] { border-color: var(--accent); background: var(--card); }
.pick:disabled { color: var(--soft); opacity: 1; }
.swatch {
  display: grid; place-items: center; height: 52px; border-radius: 11px;
  background: var(--player); color: var(--on-color); font-size: 20px; font-weight: 800;
}
.pick:disabled .swatch { background: var(--player-tint); color: var(--player-deep); }
.sample { display: grid; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); color: var(--ink); }
.sample-top { display: flex; align-items: center; justify-content: space-between; height: 20px; }
.sample-top .icon { width: 20px; height: 20px; stroke-width: 3; }
.sample-tab { width: 28px; height: 14px; border-radius: 5px; background: var(--sun); }
.sample-card { display: grid; gap: 7px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.sample-line { width: 70%; height: 6px; border-radius: 3px; background: var(--accent); }
.sample-button { height: 14px; border-radius: 5px; background: var(--button); }

.account-email {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 6px 12px 16px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
}
.account-email > div { min-width: 0; }
.account-email strong, .account-email span { display: block; overflow-wrap: anywhere; }
.account-email span { color: var(--soft); }

.starter-list { display: grid; gap: 8px; }
.starter {
  --player: var(--pick);
  --player-deep: var(--on);
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); cursor: pointer;
}
.starter input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.starter strong, .starter small { display: block; }
.starter small { color: var(--soft); font-size: 14px; }
.starter .mark .icon { visibility: hidden; }
.starter input:checked + .mark { background: var(--player); color: var(--on-color); }
.starter input:checked + .mark .icon, .starter input:disabled + .mark .icon { visibility: visible; }
.starter:has(input:checked) { border-color: var(--player); background: var(--inset); }
.starter:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.starter:has(input:disabled) { --player: var(--off); border-color: var(--line); background: var(--inset); color: var(--soft); cursor: default; }
/* Keeps the buttons in view while the list scrolls. */
.sheet-foot {
  position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); z-index: 1; display: grid; gap: 10px;
  margin: 0 -16px calc(-20px - env(safe-area-inset-bottom)); padding: 12px 16px calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--paper);
}

.welcome { max-width: 440px; margin: 0 auto; padding: calc(40px + env(safe-area-inset-top)) 20px calc(40px + env(safe-area-inset-bottom)); }
.welcome header { margin-bottom: 24px; text-align: center; }
.welcome header img { width: 84px; height: 84px; border-radius: 24px; }
.welcome h1 { margin-top: 12px; font-size: 30px; letter-spacing: -.03em; }
.welcome header p { margin-top: 4px; color: var(--soft); }
.welcome header .button { margin-top: 12px; }
.welcome .person { display: grid; gap: 14px; border-color: transparent; background: var(--player-tint); }
.welcome .person h2 { color: var(--player-deep); font-size: 17px; }

dialog { color: inherit; }
dialog::backdrop { background: var(--shade); }
.sheet {
  width: 100%; max-width: 560px; max-height: calc(100dvh - 24px - env(safe-area-inset-top)); margin: auto auto 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain;
  border: 0; border-radius: 28px 28px 0 0; background: var(--paper);
}
.sheet > h2 { margin-bottom: 16px; font-size: 22px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.sheet > p { margin-bottom: 16px; color: var(--soft); }
.preview { display: block; max-width: 100%; max-height: 50dvh; margin: 0 auto; border-radius: var(--radius); }
.lightbox { max-width: 100vw; max-height: 100dvh; margin: auto; padding: 16px; border: 0; background: none; }
.lightbox button { display: block; border-radius: var(--radius); }
.lightbox img { display: block; max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); border-radius: var(--radius); }

#toast {
  position: fixed; z-index: 10; left: 50%; bottom: calc(var(--tabbar) + 14px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 16px; width: max-content; max-width: calc(100vw - 32px);
  padding: 6px 18px; min-height: 52px; border-radius: 18px; background: var(--toast); color: #fff; font-weight: 700;
  opacity: 0; visibility: hidden; transform: translate(-50%, 12px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
#toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
#toast button { min-height: 44px; color: var(--sun); font-weight: 800; }

/* Four labels do not fit in one row on the smallest phones. */
@media (max-width: 359px) {
  .field > .choices:has(> :nth-child(4)) { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
}

/* Two dates do not fit side by side on a phone. */
@media (max-width: 479px) {
  .pair:has([type=date]) { grid-auto-flow: row; grid-auto-columns: auto; gap: 18px; }
}

@media (min-width: 900px) {
  :root { scroll-padding-bottom: 0; }
  .shell { max-width: 1304px; padding: 24px 32px 48px; }
  .top { gap: 20px; margin-bottom: 28px; }
  .brand { flex: 0 0 auto; }
  .tabs { position: static; display: flex; flex: 1; gap: 4px; height: auto; padding: 0 0 0 12px; border: 0; background: none; }
  .tab { flex-direction: row; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: var(--radius-small); font-size: 15px; }
  .tab .icon { width: 20px; height: 20px; padding: 0; }
  .tab[aria-current="page"] { background: var(--sun); color: var(--on-color); }
  .shell[data-view="tasks"] .view {
    display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; gap: 32px;
  }
  .view-tasks .score { display: none; }
  .beside { display: grid; gap: 28px; }
  .shell[data-view="score"] .view-score {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 32px;
  }
  .shell[data-view="score"] .past { margin-top: 0; }
  .shell[data-view="feed"] .view { max-width: 720px; margin: 0 auto; }
  .sheet-foot { bottom: -24px; margin: 0 -24px -24px; padding: 12px 24px 24px; }
  .sheet { margin: auto; padding: 24px; border-radius: 28px; max-width: 480px; }
  #toast { bottom: 24px; }
}

@media (hover: hover) {
  .tab:not([aria-current]):hover, .icon-button:hover, .card-more:hover { color: var(--ink); }
  a.score:hover, .button:not(:disabled):hover { filter: brightness(.97); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
