:root {
  --bg: #f4efe6;
  --surface: #fffdf9;
  --ink: #1e2627;
  --muted: #69716f;
  --line: #e2dacd;
  --accent: #2e6a64;
  --accent-ink: #ffffff;
  --accent-soft: #dcebe7;
  --danger: #a3462c;
  --shadow: 0 1px 2px rgb(30 38 39 / 6%), 0 6px 24px rgb(30 38 39 / 6%);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121716;
    --surface: #1b2120;
    --ink: #ece7de;
    --muted: #9aa29f;
    --line: #2b3431;
    --accent: #7cc0b5;
    --accent-ink: #0d1a18;
    --accent-soft: #23332f;
    --danger: #e08a6f;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
#app {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 16px) calc(env(safe-area-inset-right) + 16px)
    calc(env(safe-area-inset-bottom) + 24px) calc(env(safe-area-inset-left) + 16px);
}
.view { display: flex; flex-direction: column; gap: 16px; }
.center-screen { min-height: 70vh; align-items: center; justify-content: center; }
#v-remind, #v-outcome { min-height: 75vh; min-height: 75dvh; justify-content: center; }

h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 650; }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.lede { color: var(--muted); font-size: 18px; max-width: 26em; }
.eyebrow { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.centered { text-align: center; align-items: center; }

.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 24px 0 8px; }
.hero.small { padding-top: 40px; }
.appicon { width: 88px; height: 88px; border-radius: 22%; box-shadow: var(--shadow); }
.hero.small .appicon { width: 72px; height: 72px; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow);
}
.note { font-size: 15px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.num {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.steps li > span:last-child { padding-top: 3px; }
.inline-icon { width: 22px; height: 22px; vertical-align: -5px; color: var(--accent); }
.big-icon { width: 52px; height: 52px; color: var(--accent); }

.field { display: flex; flex-direction: column; gap: 8px; font-weight: 600; font-size: 15px; }
.field.big { font-size: 19px; }
.field.inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; font-weight: 500; font-size: 17px; }
input, select {
  font: inherit; font-weight: 400; font-size: 18px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 14px; width: 100%; min-height: 50px;
}
.field.big input { font-size: 21px; padding: 15px 16px; }
.field.inline select { width: auto; min-width: 11em; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.pw { display: flex; gap: 8px; }
.pw input { flex: 1; }

.btn {
  font: inherit; font-weight: 600; font-size: 17px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--ink);
  padding: 13px 20px; min-height: 50px; cursor: pointer;
  touch-action: manipulation;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--accent); }
.btn.link { background: none; border: none; color: var(--muted); font-weight: 500; min-height: 44px; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--line); }
.btn.small { font-size: 15px; padding: 8px 12px; min-height: 40px; }
.btn.wide { width: 100%; }
.btn.big { font-size: 19px; min-height: 58px; }
.btn:disabled { opacity: .5; }

.row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.row.left { justify-content: flex-start; }
.row .btn { flex: 1; min-width: 8em; }
.row.left .btn { flex: 0 1 auto; }
.stack { display: flex; flex-direction: column; gap: 10px; width: 100%; }

.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  font: inherit; font-size: 17px; font-weight: 600;
  padding: 11px 18px; min-height: 48px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer;
}
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.bar nav { display: flex; gap: 4px; }
.bar .title { font-weight: 650; font-size: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; }
.brand img { width: 30px; height: 30px; border-radius: 22%; }

.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--accent-soft); border-radius: 14px; padding: 10px 10px 10px 16px; font-size: 16px;
}

.err { color: var(--danger); font-size: 15px; }
.small-print { font-size: 15px; }

/* the running block */
.run {
  min-height: calc(100dvh - 80px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 18px;
}
.intention { font-size: clamp(26px, 5.5vw, 40px); font-weight: 650; max-width: 18em; overflow-wrap: anywhere; }
.clock {
  font-size: clamp(84px, 22vw, 176px); font-weight: 300; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.clock.dim { opacity: .4; }
.progress { width: min(420px, 80%); height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width 1s linear; }
.line { font-size: 19px; font-style: italic; color: var(--muted); max-width: 26em; overflow-wrap: anywhere; }
.intention-sm { font-size: 19px; font-weight: 600; overflow-wrap: anywhere; }

.sheet {
  position: fixed; inset: 0; z-index: 10;
  background: rgb(18 23 22 / 45%);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px 16px calc(env(safe-area-inset-bottom) + 24px);
}
.sheet .card { width: min(560px, 100%); padding: 28px 22px; animation: rise .22s ease-out; }
.sheet h2 { overflow-wrap: anywhere; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@media (min-width: 700px) { .sheet { align-items: center; } }

/* history */
.hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hist li {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px;
}
.hist .what { font-weight: 600; overflow-wrap: anywhere; }
.hist .when, .hist .meta { color: var(--muted); font-size: 14px; }
.hist .badge { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.badge { font-size: 14px; font-weight: 650; padding: 5px 11px; border-radius: 999px; background: var(--line); color: var(--ink); white-space: nowrap; }
.badge.done { background: var(--accent); color: var(--accent-ink); }
.badge.partly { background: var(--accent-soft); color: var(--accent); }
.badge.none { background: transparent; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-size: 16px;
  z-index: 20; max-width: calc(100% - 32px); text-align: center;
}

/* tools while a block runs */
.tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.tools .btn.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
.step { font-size: 17px; color: var(--muted); max-width: 26em; overflow-wrap: anywhere; }
.step b { color: var(--ink); font-weight: 600; }
.small-chips { gap: 8px; }
.small-chips .chip { font-size: 15px; padding: 7px 13px; min-height: 40px; font-weight: 500; }
.left-link { align-self: flex-start; padding-left: 0; margin: -6px 0; color: var(--accent); }
.banner-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* parked thoughts */
.parked { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; text-align: left; width: 100%; }
.parked li { background: var(--bg); border-radius: 10px; padding: 9px 12px; font-size: 16px; overflow-wrap: anywhere; }
.parked-box { width: 100%; display: flex; flex-direction: column; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 14px; }
.hist .parked { grid-column: 1 / -1; margin-top: 6px; }
.hist .parked li { font-size: 14px; padding: 6px 10px; }
.keep { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }

/* breathing */
.breath { width: min(260px, 60vw); aspect-ratio: 1; display: grid; place-items: center; margin: 12px 0; }
.breath > div {
  width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0 55%, transparent 56%), var(--accent-soft);
  border: 3px solid var(--accent);
  transform: scale(.55);
  animation: breathe 16s ease-in-out infinite;
}
@keyframes breathe { 0% { transform: scale(.55); } 25%, 50% { transform: scale(1); } 75%, 100% { transform: scale(.55); } }
@media (prefers-reduced-motion: reduce) { .breath > div { animation: none; transform: scale(.8); } }
.breath-word { font-size: 28px; font-weight: 600; min-height: 1.3em; }

/* stats + settings */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.stats b { display: block; font-size: 22px; font-weight: 650; }
.stats span { color: var(--muted); font-size: 14px; }
.switch { width: 26px; height: 26px; min-height: 0; accent-color: var(--accent); flex: none; }
.daily { display: flex; flex-direction: column; gap: 12px; }
input[type="time"] { width: auto; min-width: 8em; }

/* disk timer: the colored slice is the time left */
.disk {
  --left: 1;
  width: min(300px, 64vw); aspect-ratio: 1; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--left) * 1turn), var(--line) 0);
  box-shadow: inset 0 0 0 10px var(--bg);
}
.disk.dim { opacity: .4; }
.disk-left { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* daily goal */
.goal { display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; }
.goal p { font-weight: 600; }
.goal .progress { height: 8px; border-radius: 4px; }
.goal.met .progress > div { background: var(--accent); }

/* why you drifted */
.chips.why { justify-content: center; }

/* Later list */
.later { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.later li {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 10px 10px 16px;
  display: flex; align-items: center; gap: 8px;
}
.later li span { flex: 1; overflow-wrap: anywhere; }

/* heatmap */
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.heat .dn { font-size: 12px; color: var(--muted); text-align: center; }
.heat .d { aspect-ratio: 1; border-radius: 6px; background: var(--line); max-height: 44px; }
.heat .d.l1 { background: color-mix(in srgb, var(--accent) 25%, var(--surface)); }
.heat .d.l2 { background: color-mix(in srgb, var(--accent) 50%, var(--surface)); }
.heat .d.l3 { background: color-mix(in srgb, var(--accent) 75%, var(--surface)); }
.heat .d.l4 { background: var(--accent); }
.heat .d.today { outline: 2px solid var(--ink); outline-offset: 1px; }
.heat .d.future { background: transparent; }

/* account tabs */
.tabs { justify-content: center; }

/* friends */
.friends { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.friends li { display: flex; align-items: center; gap: 10px; }
.friends .who { flex: 1; min-width: 0; }
.friends .who b { display: block; }
.friends .who span { color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.friends .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); flex: none; }
.friends .dot.focusing { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.friends .dot.paused, .friends .dot.break { background: #d9a441; }
.together { font-size: 16px; }
.code-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.code { font: 700 22px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .12em; }

/* Cat mode: a cat peeks up from the bottom edge */
.cat {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: 0; z-index: 30;
  width: min(250px, 52vw); transform: translateY(115%); transition: transform .55s cubic-bezier(.2, 1.35, .4, 1);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.cat.up { transform: translateY(14%); }
.cat svg { display: block; width: 100%; overflow: visible; }
.cat .fur { fill: #e9a15b; stroke: #1e2627; stroke-width: 5; stroke-linejoin: round; }
.cat .ear { fill: #f3c6b4; }
.cat .stripe { fill: none; stroke: #b86e2c; stroke-width: 5; stroke-linecap: round; }
.cat .eye { fill: #1e2627; }
.cat .shine { fill: #fff; }
.cat .nose { fill: #e07a6a; }
.cat .mouth { fill: #6b2b2b; }
.cat .whisker { stroke: #1e2627; stroke-width: 3; stroke-linecap: round; }
.cat .bubble {
  position: absolute; bottom: 86%; right: 34%; width: max-content; max-width: min(300px, 70vw);
  background: var(--surface); color: var(--ink); border: 2.5px solid #1e2627; border-radius: 18px;
  padding: 10px 14px; font-weight: 700; font-size: 17px; line-height: 1.3; box-shadow: var(--shadow);
}
.cat .bubble::after {
  content: ""; position: absolute; right: 22px; bottom: -11px; width: 18px; height: 18px;
  background: var(--surface); border-right: 2.5px solid #1e2627; border-bottom: 2.5px solid #1e2627; transform: rotate(45deg);
}
@media (prefers-reduced-motion: reduce) { .cat { transition: none; } }

/* usage dashboard */
.bars { width: 100%; height: 120px; display: block; }
.bars rect { fill: var(--accent); }
.bars rect.low { fill: var(--accent-soft); }
.bars text { fill: var(--muted); font-size: 11px; }
.t { width: 100%; border-collapse: collapse; font-size: 15px; }
.t td, .t th { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.t td.n, .t th.n { text-align: right; font-variant-numeric: tabular-nums; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
