/* Sprout on the web. The look is the iPhone app's (ios/Sprout/Views/Components.swift). */

:root {
  color-scheme: light dark;
  --bg: #faf6ef;
  --card: #ffffff;
  --ink: #1e2a23;
  --sub: #66726b;
  --line: #e9e2d6;
  /* The person using the phone. */
  --green: #2e7d5b;
  --on-green: #ffffff;
  --green-tint: #e2f0e8;
  /* Their partner. */
  --coral: #cf5f47;
  --coral-tint: #fbe6e0;
  /* The pot and duo days. */
  --gold: #a87a16;
  --gold-tint: #f6eacb;
  --bar: rgb(255 255 255 / 0.78);
  --shade: rgb(0 0 0 / 0.35);
  /* The part of the screen the keyboard leaves free; set from app.js. */
  --vv-top: 0px;
  --vv-height: 100dvh;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121714;
    --card: #1c2420;
    --ink: #f1eee6;
    --sub: #9da9a1;
    --line: #2c3630;
    --green: #5dbf94;
    --on-green: #0f1f18;
    --green-tint: #1d3529;
    --coral: #e8876f;
    --coral-tint: #3b231d;
    --gold: #e0b44c;
    --gold-tint: #382e14;
    --bar: rgb(28 36 32 / 0.78);
    --shade: rgb(0 0 0 / 0.55);
  }
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.3 ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

html.covered,
html.covered body {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  cursor: default;
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

svg {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

svg.filled {
  fill: currentColor;
  stroke-width: 1.5;
}

svg.small {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

h1,
h2,
p {
  margin: 0;
}

/* ── Screens ─────────────────────────────────────────────── */

.app {
  max-width: 560px;
  margin: 0 auto;
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 16px) calc(env(safe-area-inset-right) + 16px) calc(env(safe-area-inset-bottom) + 112px)
    calc(env(safe-area-inset-left) + 16px);
}

.screen.pair {
  padding-top: calc(env(safe-area-inset-top) + 56px);
  padding-bottom: calc(env(safe-area-inset-bottom) + 32px);
}

.display {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.heading {
  font-size: 17px;
  font-weight: 600;
}

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

.subhead {
  font-size: 15px;
}

.footnote {
  font-size: 13px;
}

.digits {
  font-variant-numeric: tabular-nums;
}

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

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

.title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--green-tint);
  color: var(--green);
  font-weight: 600;
}

.back {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: -4px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
}

.loading {
  width: 28px;
  height: 28px;
  margin: 80px auto 0;
  border: 3px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading.inline {
  width: 18px;
  height: 18px;
  margin: 0;
  border-width: 2px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Cards and rows ──────────────────────────────────────── */

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}

.card.tint {
  border-color: transparent;
}

.card.green {
  background: var(--green-tint);
}

.card.goldy {
  background: var(--gold-tint);
}

button.card {
  transition: transform 0.15s ease-out;
}

button.card:active {
  transform: scale(0.985);
}

.card-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.rows {
  display: flex;
  flex-direction: column;
}

.rows > * + * {
  border-top: 1px solid var(--line);
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 7px 0;
}

.row .words {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.row.done .name {
  color: var(--sub);
  text-decoration: line-through;
}

.row .side {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  color: var(--sub);
}

.one-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tick {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border: 1.75px solid color-mix(in srgb, var(--sub) 45%, transparent);
  border-radius: 50%;
  color: var(--on-green);
  transition:
    background-color 0.2s,
    border-color 0.2s,
    transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.tick svg {
  width: 14px;
  height: 14px;
  stroke-width: 3.25;
  opacity: 0;
  transition: opacity 0.15s;
}

.done > .tick {
  border-color: var(--green);
  background: var(--green);
}

.done > .tick svg {
  opacity: 1;
}

button.row:active .tick {
  transform: scale(0.86);
}

/* Their keystones, to read: smaller rows, in their colour. */
.their-keystones {
  display: flex;
  flex-direction: column;
  margin: -4px 0 4px 74px;
}

.row.read {
  min-height: 34px;
  padding: 3px 0;
  gap: 10px;
  font-size: 15px;
}

.row.read .tick {
  width: 20px;
  height: 20px;
}

.row.read .tick svg {
  width: 11px;
  height: 11px;
}

.row.read.done > .tick {
  border-color: var(--coral);
  background: var(--coral);
}

.tag {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--line);
  color: var(--sub);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.tag.mine {
  background: var(--green-tint);
  color: var(--green);
}

.tag.theirs {
  background: var(--coral-tint);
  color: var(--coral);
}

.tag.shared {
  background: var(--gold-tint);
  color: var(--gold);
}

.tag.main {
  background: var(--ink);
  color: var(--bg);
}

.bar {
  flex: none;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--green);
  transition: width 0.3s ease-out;
}

.bar.theirs > i {
  background: var(--coral);
}

.bar.pot > i {
  background: var(--gold);
}

.person {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}

.person .bar {
  flex: 1;
  width: auto;
}

.person .who {
  width: 64px;
}

.person .count {
  width: 30px;
  color: var(--sub);
  text-align: right;
}

.week {
  display: flex;
  gap: 6px;
}

.week > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--sub);
  font-size: 11px;
}

.week > div::before {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  content: "";
}

.week > .duo::before {
  background: var(--gold);
}

.week > .now {
  color: var(--ink);
  font-weight: 700;
}

.duo-made {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--gold-tint);
  color: var(--gold);
  font-size: 15px;
  font-weight: 600;
  animation: pop 0.45s cubic-bezier(0.3, 1.5, 0.5, 1);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
}

.label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
}

.label svg {
  width: 20px;
  height: 20px;
  margin-top: -1px;
}

.coach-line {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.coach-line p {
  flex: 1;
}

.coach-line .leaf {
  margin-top: 1px;
  color: var(--green);
}

.coach-line .go {
  margin-top: 4px;
  color: var(--sub);
}

.pot-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.pot-count b {
  color: var(--gold);
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
}

/* ── Buttons ─────────────────────────────────────────────── */

.primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  padding: 8px 16px;
  border-radius: 14px;
  background: var(--green);
  color: var(--on-green);
  font-weight: 600;
  text-align: center;
  transition:
    transform 0.15s ease-out,
    opacity 0.15s;
}

.primary:active {
  transform: scale(0.98);
}

.primary:disabled {
  opacity: 0.4;
  transform: none;
}

.primary .loading {
  border-color: color-mix(in srgb, var(--on-green) 35%, transparent);
  border-top-color: var(--on-green);
}

.quiet {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  min-height: 44px;
  color: var(--green);
  font-size: 15px;
  font-weight: 600;
}

.quiet:active {
  opacity: 0.6;
}

.quiet svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.5;
}

.icon-button {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  color: var(--sub);
}

/* ── Life map ────────────────────────────────────────────── */

.dot {
  flex: none;
  width: 12px;
  height: 12px;
  border: 1.75px solid color-mix(in srgb, var(--sub) 45%, transparent);
  border-radius: 50%;
}

.dot.green {
  border-color: var(--green);
  background: var(--green);
}

.dot.yellow {
  border-color: var(--gold);
  background: var(--gold);
}

.dot.red {
  border-color: var(--coral);
  background: var(--coral);
}

.dot.hidden {
  border-color: transparent;
  background: color-mix(in srgb, var(--sub) 45%, transparent);
}

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

.dots .dot {
  width: 16px;
  height: 16px;
}

.map-row {
  align-items: flex-start;
}

.map-row .words {
  gap: 4px;
  padding: 6px 0;
}

.map-row .name {
  font-weight: 600;
}

.answer {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.answer .dot {
  position: relative;
  top: 1px;
  width: 10px;
  height: 10px;
}

.to-rate {
  color: var(--green);
  font-weight: 500;
}

.segments button .dot {
  display: inline-block;
  margin-right: 6px;
  vertical-align: -1px;
}

/* ── Goal card ───────────────────────────────────────────── */

.spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

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

.part {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.part > b {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--green-tint);
  color: var(--green);
  font-weight: 600;
}

.part > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.part h2 {
  display: flex;
  align-items: center;
  min-height: 30px;
}

.fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-wrap: anywhere;
}

.rule {
  height: 1px;
  background: var(--line);
}

.plain-rows > .row {
  border: 0;
}

/* ── Pairing ─────────────────────────────────────────────── */

.badge {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--green-tint);
  color: var(--green);
}

.badge svg {
  width: 32px;
  height: 32px;
}

.intro {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.step b {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green-tint);
  color: var(--green);
  font-size: 15px;
  font-weight: 600;
}

.code {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: 0;
  background: var(--card);
  font: 600 22px/1.2 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.code::placeholder {
  color: color-mix(in srgb, var(--sub) 50%, transparent);
}

.code:focus {
  border-color: var(--green);
}

.code.wrong {
  border-color: var(--coral);
}

/* ── Tabs ────────────────────────────────────────────────── */

.tabs {
  position: fixed;
  right: 0;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 0;
  z-index: 5;
  display: flex;
  width: min(calc(100% - 32px), 420px);
  margin: 0 auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bar);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
}

.tabs button {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  transition:
    background-color 0.2s,
    color 0.2s;
}

.tabs button[aria-current] {
  background: var(--green-tint);
  color: var(--green);
}

.tabs svg {
  width: 24px;
  height: 24px;
}

/* ── Sheets ──────────────────────────────────────────────── */

.layer:empty {
  display: none;
}

.shade {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--shade);
  animation: fade 0.2s ease-out;
}

.over .shade {
  z-index: 20;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.sheet-wrap {
  position: fixed;
  top: var(--vv-top);
  right: 0;
  left: 0;
  z-index: 11;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: var(--vv-height);
  pointer-events: none;
}

.over .sheet-wrap {
  z-index: 21;
}

.sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: calc(100% - env(safe-area-inset-top) - 28px);
  border-radius: 22px 22px 0 0;
  background: var(--bg);
  box-shadow: 0 -8px 40px rgb(0 0 0 / 0.18);
  pointer-events: auto;
  animation: rise 0.32s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.sheet.tall {
  height: calc(100% - env(safe-area-inset-top) - 28px);
}

@keyframes rise {
  from {
    transform: translateY(100%);
  }
}

.sheet-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  flex: none;
  min-height: 52px;
  padding: 4px 16px 0;
}

.sheet-head h2 {
  font-size: 17px;
  font-weight: 600;
}

.sheet-head button {
  justify-self: start;
  min-height: 44px;
  color: var(--green);
}

.sheet-head button:last-child {
  justify-self: end;
  font-weight: 600;
}

.sheet-head button:disabled {
  opacity: 0.4;
}

.sheet-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 16px calc(env(safe-area-inset-bottom) + 24px);
  -webkit-overflow-scrolling: touch;
}

.section {
  margin: 12px 4px 0;
  color: var(--sub);
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.note {
  margin: 0 4px 4px;
  color: var(--sub);
  font-size: 13px;
}

.group {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.group > * + * {
  border-top: 1px solid var(--line);
}

.group > * {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 6px 14px;
}

.group .value {
  color: var(--sub);
  text-align: right;
  overflow-wrap: anywhere;
}

.group button {
  color: var(--green);
}

.group button.danger {
  color: var(--coral);
}

.group input:not([type="checkbox"]),
.group textarea,
.group select {
  min-width: 0;
  padding: 6px 0;
  border: 0;
  outline: 0;
  background: none;
}

.group > input:not([type="checkbox"]),
.group > textarea {
  padding: 12px 14px;
}

.group textarea {
  min-height: 96px;
  resize: none;
}

.group select,
.group input[type="date"] {
  max-width: 62%;
  color: var(--green);
  text-align: right;
  text-align-last: right;
  appearance: none;
  -webkit-appearance: none;
}

.group input[type="number"],
.group input.amount {
  width: 96px;
  text-align: right;
}

::placeholder {
  color: color-mix(in srgb, var(--sub) 65%, transparent);
}

input[type="checkbox"].switch {
  position: relative;
  flex: none;
  width: 51px;
  height: 31px;
  margin: 0;
  border-radius: 999px;
  background: var(--line);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

input[type="checkbox"].switch::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.2);
  content: "";
  transition: transform 0.2s;
}

input[type="checkbox"].switch:checked {
  background: var(--green);
}

input[type="checkbox"].switch:checked::after {
  transform: translateX(20px);
}

.days {
  display: flex;
  gap: 6px;
}

.days button {
  display: grid;
  place-items: center;
  flex: 1;
  aspect-ratio: 1;
  max-height: 44px;
  border-radius: 999px;
  background: var(--line);
  color: var(--sub);
  font-size: 15px;
  font-weight: 600;
  transition:
    background-color 0.15s,
    color 0.15s;
}

.days button[aria-pressed="true"] {
  background: var(--green);
  color: var(--on-green);
}

.segments {
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 11px;
  background: var(--line);
}

.segments button {
  flex: 1;
  min-height: 36px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
}

.segments button[aria-pressed="true"] {
  background: var(--card);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
}

/* Ten numbers in two rows, each big enough for a thumb. */
.scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.scale button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  font-size: 17px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.scale button[aria-pressed="true"] {
  border-color: var(--green);
  background: var(--green);
  color: var(--on-green);
}

/* Where each of you stands on a card you share. */
.agreement {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.agreement .label {
  align-items: center;
  color: var(--sub);
}

.agreement .label.yes {
  color: var(--ink);
}

.agreement .label.yes svg {
  color: var(--green);
}

.stepper {
  display: flex;
  flex: none;
  border-radius: 9px;
  background: var(--line);
}

.stepper button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 34px;
  color: var(--ink);
}

.stepper button + button {
  border-left: 1px solid color-mix(in srgb, var(--sub) 30%, transparent);
}

.stepper button:disabled {
  opacity: 0.3;
}

.add-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.add-row svg {
  width: 26px;
  color: var(--green);
}

.add-row input {
  flex: 1;
  min-width: 0;
  padding: 8px 0;
  border: 0;
  outline: 0;
  background: none;
}

/* ── Coach ───────────────────────────────────────────────── */

.talk {
  gap: 10px;
  padding-bottom: 16px;
}

.bubble {
  align-self: flex-start;
  max-width: min(300px, 86%);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.bubble.me {
  align-self: flex-end;
  border-color: transparent;
  background: var(--green);
  color: var(--on-green);
}

.opening {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0;
}

.thinking {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.composer {
  display: flex;
  align-items: flex-end;
  flex: none;
  gap: 8px;
  padding: 8px 12px calc(env(safe-area-inset-bottom) + 8px);
  border-top: 1px solid var(--line);
  background: var(--bar);
}

.composer textarea {
  flex: 1;
  min-width: 0;
  max-height: 132px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  outline: 0;
  background: var(--card);
  resize: none;
}

.send {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
}

.send i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green);
  color: var(--on-green);
}

.send:disabled i {
  opacity: 0.4;
}

/* ── Asking, and notices ─────────────────────────────────── */

.ask {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 560px;
  padding: 0 12px calc(env(safe-area-inset-bottom) + 12px);
  pointer-events: auto;
  animation: rise 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.ask > div,
.ask > button {
  border-radius: 16px;
  background: var(--card);
}

.ask .why {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--sub);
  font-size: 13px;
  text-align: center;
}

.ask .why b {
  font-weight: 600;
}

.ask button {
  width: 100%;
  min-height: 56px;
  padding: 8px 16px;
  font-size: 18px;
  text-align: center;
}

.ask > div > button {
  color: var(--green);
}

.ask > div > button + button {
  border-top: 1px solid var(--line);
}

.ask .danger {
  color: var(--coral);
}

.ask > button {
  color: var(--green);
  font-weight: 600;
}

.notice {
  position: fixed;
  top: calc(var(--vv-top) + env(safe-area-inset-top) + 8px);
  right: 0;
  left: 0;
  z-index: 30;
  width: min(calc(100% - 32px), 528px);
  margin: 0 auto;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--coral) 50%, transparent);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 4px 20px rgb(0 0 0 / 0.14);
  font-size: 15px;
  text-align: left;
  animation: drop 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes drop {
  from {
    opacity: 0;
    transform: translateY(-24px);
  }
}

/* ── A wide screen ───────────────────────────────────────── */

/* On a phone the columns, the panes and the sidebar's extra rows take no part in the layout. */
.cols,
.col,
.panes,
.pane {
  display: contents;
}

.tabs .brand,
.tabs .gap,
.tabs .side {
  display: none;
}

@media (hover: hover) {
  .tabs button:hover:not([aria-current]):not([aria-pressed="true"]) {
    background: color-mix(in srgb, var(--line) 70%, transparent);
  }

  button.card:hover {
    border-color: color-mix(in srgb, var(--green) 50%, var(--line));
  }

  button.row:hover:not(:disabled):not(.done) .tick {
    border-color: var(--green);
  }

  .primary:hover:not(:disabled) {
    filter: brightness(1.07);
  }

  .quiet:hover,
  .sheet-head button:hover:not(:disabled) {
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .back:hover,
  .icon-button:hover {
    background: var(--line);
  }
}

/* From 1024 px: a sidebar, the page beside it, and the coach in a panel on the right. The same width is in app.js. */
@media (min-width: 1024px) {
  :root {
    --side: 232px;
    --dock: 380px;
  }

  /* A dialog stops the page scrolling without moving it: the window keeps its scrollbar's room, and the Goals list stays put. */
  html {
    scrollbar-gutter: stable;
  }

  html.covered body {
    overflow: visible;
  }

  .app {
    max-width: none;
    margin: 0;
    padding-left: var(--side);
  }

  .app.talking {
    padding-right: var(--dock);
  }

  .app[data-key="pair"] {
    padding-left: 0;
  }

  /* Each screen lays itself out by the room it has, which the coach's panel changes. */
  .screen {
    container: screen / inline-size;
    gap: 20px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 40px clamp(24px, 3vw, 40px) 64px;
  }

  /* In one column, nothing is wider than it would be worth reading. */
  .screen > * {
    max-width: 640px;
  }

  .cols,
  .col,
  .panes,
  .pane {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
  }

  .screen.pair {
    justify-content: center;
    max-width: 472px;
    padding: 40px 16px;
  }

  .display {
    font-size: 32px;
  }

  /* Settings are under the name in the sidebar. */
  .header .avatar {
    display: none;
  }

  .tabs {
    top: 0;
    right: auto;
    bottom: 0;
    flex-direction: column;
    gap: 2px;
    width: var(--side);
    margin: 0;
    padding: 24px 12px 16px;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: var(--bg);
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .tabs .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px 24px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
  }

  .tabs .brand svg {
    width: 26px;
    height: 26px;
    color: var(--green);
  }

  .tabs button,
  .tabs .side {
    display: flex;
    flex: none;
    flex-direction: row;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 15px;
  }

  .tabs svg {
    width: 22px;
    height: 22px;
  }

  .tabs .gap {
    display: block;
    flex: 1;
  }

  .tabs .side[aria-pressed="true"] {
    background: var(--green-tint);
    color: var(--green);
  }

  .tabs .avatar {
    width: 22px;
    height: 22px;
    font-size: 12px;
  }

  /* The coach beside the page: no shade, and the page stays in use. */
  .dock .shade {
    display: none;
  }

  .dock .sheet-wrap {
    top: 0;
    left: auto;
    z-index: 6;
    align-items: stretch;
    width: var(--dock);
    height: 100dvh;
  }

  .dock .sheet {
    height: 100%;
    max-width: none;
    max-height: none;
    border-left: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    animation: slide 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
  }

  /* Sheets are dialogs in the middle of the window. */
  .layer:not(.dock) .sheet-wrap {
    align-items: center;
    padding: 32px;
  }

  .layer:not(.dock) .sheet {
    max-width: 480px;
    max-height: min(100%, 760px);
    border-radius: 22px;
    box-shadow: 0 24px 80px rgb(0 0 0 / 0.28);
    animation: pop 0.2s ease-out;
  }

  .sheet-body {
    padding-bottom: 20px;
  }

  .ask {
    max-width: 380px;
    padding: 0;
    animation: pop 0.2s ease-out;
  }

  /* Where a screen has 700 px to itself: two columns, and Goals as a list with one goal beside it. */
  @container screen (min-width: 700px) {
    .cols {
      display: grid;
      grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
      align-items: start;
      gap: 24px;
      max-width: none;
    }

    .panes {
      display: grid;
      grid-template-columns: clamp(280px, 34%, 380px) minmax(0, 1fr);
      align-items: start;
      gap: clamp(24px, 3vw, 32px);
      max-width: none;
    }

    /* The list stays where it is and scrolls by itself, while the page scrolls the goal. */
    .pane.list {
      position: sticky;
      top: 40px;
      max-height: calc(100dvh - 80px);
      margin: -4px;
      padding: 4px;
      overflow-y: auto;
      overscroll-behavior: contain;
    }

    .pane.detail {
      max-width: 640px;
    }

    .pane.list [aria-current] {
      border-color: var(--green);
      box-shadow: 0 0 0 1px var(--green);
    }

    .split .back {
      display: none;
    }
  }

  /* Where it is narrower, Goals is the list or the one chosen, as on a phone. */
  @container screen (max-width: 699.98px) {
    .split:not(.picked) .pane.detail,
    .split.picked .pane.list {
      display: none;
    }
  }
}

@keyframes slide {
  from {
    transform: translateX(100%);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
}

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