/* Onely — design tokens + base styles
   monochrome paper + ink. editorial: serif headings, mono labels. */

:root {
  /* white/clean (default) */
  --bg: #F4F4F6;
  --paper: #FFFFFF;
  --ink: #15151A;
  --ink-2: #5C5C66;
  --ink-3: #B5B5BD;
  --line: #E8E8EC;
  --shade: #F0F0F3;
  --shade-2: #F7F7F9;
  --accent: #15151A;

  /* fonts — tokens, can be re-pointed for editorial mode */
  --font: "Geist", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: var(--font);
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* legacy aliases (styles below still reference --serif / --sans) */
  --serif: var(--font-display);
  --sans: var(--font);
  --mono: var(--font-mono);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;

  --col: 620px;
  --col-wide: 880px;

  --d-pad: 28px;
  --d-gap: 18px;
}

[data-density="compact"] { --d-pad: 22px; --d-gap: 14px; }
[data-density="airy"]    { --d-pad: 36px; --d-gap: 24px; }

/* warm paper (alt) */
[data-theme="paper"] {
  --bg: #F1ECE1;
  --paper: #FAF6EC;
  --ink: #1B1814;
  --ink-2: #5E5A53;
  --ink-3: #ACA69B;
  --line: #E0DACB;
  --shade: #EAE4D5;
  --shade-2: #F4EFE2;
  --accent: #1B1814;
}

/* light grey */
[data-theme="grey"] {
  --bg: #EDEDF0;
  --paper: #F7F7F9;
  --ink: #18181C;
  --ink-2: #5C5C66;
  --ink-3: #B0B0B8;
  --line: #E3E3E8;
  --shade: #EEEEF2;
  --shade-2: #F2F2F6;
  --accent: #18181C;
}

[data-theme="night"] {
  --bg: #0E0E12;
  --paper: #16161B;
  --ink: #EFEFF3;
  --ink-2: #8B8B94;
  --ink-3: #4A4A52;
  --line: #26262C;
  --shade: #1C1C22;
  --shade-2: #21212A;
  --accent: #EFEFF3;
}

[data-theme="void"] {
  --bg: #000;
  --paper: #000;
  --ink: #EFEFF3;
  --ink-2: #6A6A74;
  --ink-3: #3A3A42;
  --line: #1A1A1F;
  --shade: #0A0A0D;
  --shade-2: #0E0E12;
  --accent: #EFEFF3;
}

/* editorial — swap headings (and body) to Newsreader serif */
[data-font="editorial"] {
  --font: "Newsreader", "Source Serif 4", Georgia, serif;
  --font-display: var(--font);
}
[data-font="inter"] {
  --font: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-display: var(--font);
}
.brand-mark, .logo { font-weight: 500; }
[data-font="editorial"] .brand-mark, [data-font="editorial"] .logo { font-weight: 400; }

/* — White theme as explicit attribute (matches :root) — */
[data-theme="white"] {
  --bg: #F4F4F6;
  --paper: #FFFFFF;
  --ink: #15151A;
  --ink-2: #5C5C66;
  --ink-3: #B5B5BD;
  --line: #E8E8EC;
  --shade: #F0F0F3;
  --shade-2: #F7F7F9;
  --accent: #15151A;
}

/* Sea-glass / mist — pale, cool, ethereal */
[data-theme="mist"] {
  --bg: #E6EFE9;
  --paper: #F2F6F2;
  --ink: #16201C;
  --ink-2: #4F5A54;
  --ink-3: #A6AFA8;
  --line: #D7E0D9;
  --shade: #DFE7E1;
  --shade-2: #E9EFEA;
  --accent: #16201C;
}

/* Deeper sea — slightly more saturated companion to mist */
[data-theme="sage"] {
  --bg: #DDE8E0;
  --paper: #EBF2EC;
  --ink: #182521;
  --ink-2: #4D5852;
  --ink-3: #A2ACA5;
  --line: #CFDAD2;
  --shade: #D6E0D8;
  --shade-2: #E2E9E3;
  --accent: #182521;
}

/* On a Japanese gradient the pastel background washes out the light-grey
   muted text. Darken the muted ink tokens so labels/secondary text stay
   readable, and deepen the primary ink slightly for contrast. */
[data-bg="gradient"] {
  --ink:   #14130F;
  --ink-2: #46443C;
  --ink-3: #6E6B61;
  --line:  color-mix(in oklab, #14130F 14%, transparent);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { min-height: 100vh; }

button, input, textarea, select {
  font: inherit; color: inherit; background: none; border: 0; outline: none;
  font-family: var(--serif);
}
button { cursor: pointer; }
textarea, input { font-family: var(--serif); }

/* — Stage: the full web page — */
.stage {
  min-height: 100vh;
  background: var(--stage-bg, var(--paper));
  color: var(--ink);
  display: flex;
  flex-direction: column;
  transition: background .5s ease;
}
.app {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* — Top nav (web header) — logo left, tabs right — */
.webnav {
  position: sticky; top: 0; z-index: 4;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  padding: 20px 28px;
  background: transparent;
}
.webnav .brand {
  font-family: var(--mono);
  font-size: 13px; letter-spacing: .14em;
  color: var(--ink-3); cursor: pointer;
  background: transparent; padding: 0;
  white-space: nowrap;
  transition: color .15s ease;
}
.webnav .brand:hover { color: var(--ink-2); }
.webnav .brand em { font-style: italic; color: var(--ink-2); }
.webnav-settings {
  font-family: var(--mono);
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
  background: transparent;
  padding: 8px 10px; margin: -8px -10px;
  border-radius: 999px;
  transition: color .15s ease, background .15s ease;
}
.webnav-settings:hover { color: var(--ink-2); }
.webnav-settings.is-on { color: var(--ink); }
.webnav .meta {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3);
}
.webnav .meta b { font-weight: 500; color: var(--ink-2); }

@media (max-width: 720px) {
  .webnav { padding: 16px 18px; }
}

/* — View title switcher (big H1 doubles as nav) — */
.view-head {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 28px;
}

/* — Today: layout kept, title anchored so it doesn't jump while typing — */
.page-today {
  min-height: calc(100vh - 168px);
  display: flex; flex-direction: column;
  justify-content: flex-start;
  padding-top: 22vh;
}
.page-today .view-head { margin-bottom: 36px; }
.row-single { padding: 24px 10px; }
.row-single .row-title { font-size: 23px; }

/* — Committed task block: title + focus button — */
.row-single-block {
  padding: 22px 0;
  display: flex; flex-direction: column; align-items: flex-start;
}
.row-input-form {
  padding: 22px 0;
  display: flex; flex-direction: column; align-items: flex-start;
}
.row-draft-area {
  width: 100%;
  font-family: var(--font-display);
  font-size: 23px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
  background: transparent;
  border: 0; outline: none;
  resize: none; overflow: hidden;
  padding: 0; margin: 0;
  display: block;
}
.row-draft-area::placeholder { color: var(--ink-3); font-style: italic; }
.row-single-block .row-title { font-size: 23px; line-height: 1.3; }
.autosize-title {
  font-family: var(--font-display);
  font-size: 23px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.row-title-edit {
  color: var(--ink);
  background: transparent;
  border: 0; outline: none;
  cursor: text;
}
.row-title-edit::placeholder { color: var(--ink-3); font-style: italic; }
.row-enter-btn {
  margin-top: 22px;
  padding: 12px 24px;
  border-radius: 999px;
  border: .5px solid var(--ink-2);
  background: transparent;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: border-color .15s, color .15s;
}
.row-enter-btn:hover { border-color: var(--ink); color: var(--ink); }
.row-title-edit-inline {
  display: block; width: 100%;
  background: transparent; border: 0; outline: none;
  padding: 0; margin: 0; cursor: text;
  resize: none; overflow: hidden;
}
.row-add-block {
  margin-top: 22px;
  padding: 12px 24px;
  animation: fadein .25s ease;
}

/* — Settings: side-by-side rows, block centered vertically — */
.page-settings {
  min-height: calc(100vh - 168px);
  display: flex; flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  padding-top: 22vh;
}
.set-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 22px 0;
  border-top: .5px solid var(--line);
}
.set-row:first-child { border-top: 0; }
.set-row-top { align-items: flex-start; }
.set-label {
  font-family: var(--mono);
  font-size: 13px; letter-spacing: .14em;
  color: var(--ink-3);
  flex-shrink: 0;
  line-height: 1.5;
}
.set-control { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.set-hint {
  font-family: var(--mono);
  font-size: 13px; letter-spacing: .14em; color: var(--ink-3);
}
.set-done-list {
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 9px;
  text-align: right;
  line-height: 1.5;
}
.set-done-item {
  font-family: var(--mono);
  font-size: 13px; line-height: 1.5; letter-spacing: .14em;
  color: var(--ink-3);
}
.set-done-empty {
  font-family: var(--mono);
  font-size: 13px; letter-spacing: .14em; color: var(--ink-3); margin: 0;
}
.viewtitle { position: relative; }
.viewtitle-btn {
  display: inline-flex; align-items: baseline; gap: 10px;
  padding: 0; background: transparent;
  cursor: pointer;
}
.viewtitle-btn .h1 { transition: opacity .15s ease; }
.viewtitle-btn:hover .h1 { opacity: .7; }
.viewtitle-caret {
  font-family: var(--font);
  font-size: 26px; line-height: 1; color: var(--ink-3);
  transform: translateY(-4px);
  transition: transform .2s ease, color .2s ease;
}
.viewtitle-btn:hover .viewtitle-caret { color: var(--ink-2); }
.viewtitle-caret.is-open { transform: translateY(-2px) rotate(180deg); }

.viewtitle-scrim {
  position: fixed; inset: 0; z-index: 40;
}
.viewtitle-menu {
  position: absolute; top: calc(100% + 10px); left: -10px; z-index: 41;
  min-width: 190px;
  background: var(--paper);
  border: .5px solid var(--line);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow:
    0 0 0 .5px color-mix(in oklab, var(--ink) 5%, transparent),
    0 18px 40px -18px color-mix(in oklab, var(--ink) 38%, transparent);
  animation: menin .18s ease;
}
@keyframes menin { from { transform: translateY(-6px); } }
.viewtitle-item {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  font-family: var(--font-display);
  font-size: 22px; letter-spacing: -0.015em;
  color: var(--ink-2);
  padding: 10px 14px;
  border-radius: 9px;
  transition: color .12s ease, background .12s ease;
}
.viewtitle-item:hover { color: var(--ink); background: var(--shade-2); }
.viewtitle-item.is-on { color: var(--ink); }
.viewtitle-tick { color: var(--ink-3); font-size: 22px; line-height: 1; }

/* small muted prompt under a view title (e.g. empty Today) */
.view-prompt {
  font-family: var(--font);
  font-size: 17px; line-height: 1.5;
  color: var(--ink-2);
  margin: -12px 0 28px;
}

/* — One-at-a-time hint under the input — */
.one-hint {
  font-family: var(--font);
  font-size: 14.5px; line-height: 1.5;
  color: var(--ink-3);
  margin: 18px 0 0;
}

/* — Single active task gets a touch more presence — */
.row-single { padding: 24px 10px; }
.row-single .row-title { font-size: 23px; }

/* — This week — */
.week { margin-top: 4px; }
.week-day {
  display: flex; gap: 20px;
  padding: 16px 0;
  border-top: .5px solid var(--line);
}
.week-day:first-child { border-top: 0; }
.week-date {
  display: flex; flex-direction: column; align-items: center;
  width: 40px; flex-shrink: 0;
  padding-top: 2px;
}
.week-dow {
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3);
}
.week-num {
  font-family: var(--font-display);
  font-size: 19px; color: var(--ink-2); margin-top: 3px;
  letter-spacing: -0.01em;
}
.week-day.is-today .week-dow { color: var(--ink); }
.week-day.is-today .week-num {
  color: var(--paper); background: var(--ink);
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  margin-top: 1px;
}
.week-day.is-future { opacity: .4; }
.week-items {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 6px;
  padding-top: 2px;
}
.week-item {
  font-family: var(--font);
  font-size: 16px; line-height: 1.4; color: var(--ink);
  letter-spacing: -0.005em;
}
.week-empty { color: var(--ink-3); font-family: var(--mono); font-size: 14px; padding-top: 2px; }

/* — Page container — */
.page {
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding: 48px 28px 120px;
}
.page.wide { max-width: var(--col-wide); }
@media (max-width: 520px) {
  .page { padding: 36px 18px 96px; }
}

.screen { /* legacy alias for inner padding; now unused */ }
.screen-pad-top { padding-top: 0; }
.screen-pad-lg  { padding-top: 16px; }

/* — Page label (small muted line above page heading) — */
.page-label {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 28px;
}
.page-label b { font-weight: 500; color: var(--ink-2); }

/* — Hero (centered empty / single message screens) — */
.hero {
  min-height: 60vh;
  display: flex; flex-direction: column;
  justify-content: center;
  text-align: left;
}
.hero .hero-cta {
  margin-top: 40px;
  display: flex; gap: 14px; flex-wrap: wrap;
}

/* — Row simplification (tap-anywhere rows) — */
.row.row-tap { cursor: pointer; transition: background .15s ease; padding-left: 10px; padding-right: 10px; margin-left: -10px; margin-right: -10px; border-radius: 10px; }
.row.row-tap:hover { background: var(--shade-2); }
.row.row-tap .row-title { font-size: 21px; line-height: 1.32; }
.row-meta-line {
  margin-top: 6px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3);
}
.row-meta-line .dot-sep { margin: 0 8px; opacity: .55; }

/* — Progress whisper — */
.progress-line {
  margin-top: 40px; padding-top: 22px;
  border-top: .5px solid var(--line);
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3);
  text-align: center;
}

/* — Bottom capture link — */
.page-bottom {
  margin-top: 48px;
  display: flex; justify-content: center;
}

/* — Today: tiny progress dots (concrete, low-pressure dopamine) — */
.today-progress {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 34px;
}
.prog-dot {
  width: 9px; height: 9px; border-radius: 50%;
  border: 1.25px solid var(--ink-3);
  background: transparent;
  transition: background .4s cubic-bezier(.2,.7,.2,1), border-color .4s ease, transform .4s cubic-bezier(.2,.7,.2,1);
}
.prog-dot.is-on {
  background: var(--ink);
  border-color: var(--ink);
  transform: scale(1.05);
}
.prog-text {
  font-family: var(--mono);
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3);
}

/* — 44px tap target around the tick (motor / attention) — */
.tick-hit {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  margin: -11px 0 -11px -11px;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
  transition: background .15s ease;
}
.tick-hit:hover { background: var(--shade-2); }

/* — Next physical action under a task title (externalize working memory) — */
.row-next {
  margin-top: 7px;
  font-family: var(--font);
  font-size: 14.5px; line-height: 1.4;
  color: var(--ink-2);
  display: flex; align-items: baseline; gap: 7px;
}
.row-next-arrow { color: var(--ink-3); font-size: 13px; }

/* — Carry-over from yesterday (gentle, never forced) — */
.carry {
  margin-top: 40px;
  padding-top: 22px;
  border-top: .5px solid var(--line);
}
.carry-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
}
.carry-label {
  font-family: var(--mono);
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
}
.carry-clear {
  font-family: var(--mono);
  font-size: 10.5px; letter-spacing: .12em; text-transform: lowercase;
  color: var(--ink-3);
  padding: 4px 6px; margin: -4px -6px; border-radius: 6px;
  transition: color .15s ease, background .15s ease;
}
.carry-clear:hover { color: var(--ink-2); background: var(--shade-2); }
.carry-list { display: flex; flex-direction: column; gap: 8px; }
.carry-chip {
  display: inline-flex; align-items: baseline; gap: 9px;
  text-align: left;
  font-family: var(--font);
  font-size: 16px; line-height: 1.4; letter-spacing: -0.005em;
  color: var(--ink-2);
  padding: 9px 14px;
  border: .5px solid var(--line);
  border-radius: var(--radius);
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.carry-chip:hover { color: var(--ink); border-color: var(--ink-3); background: var(--shade-2); }
.carry-plus { color: var(--ink-3); font-family: var(--mono); font-size: 13px; }

/* — Inline input row (Today: type a pick in place) — */
.row-input {
  cursor: text;
}
.row-input-bare { padding-left: 0; padding-right: 0; }
.tick.tick-ghost {
  border: 1px dashed var(--ink-3);
  background: transparent;
  opacity: .55;
}
.row-input-body {
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
}
/* auto-sizing input: grows with text, capped at column width */
.autosize {
  display: inline-grid;
  max-width: 100%;
  font-family: var(--font);
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.005em;
}
.autosize::after,
.autosize > .row-input-field {
  grid-area: 1 / 1;
  width: auto;
  min-width: 1ch;
  font: inherit;
  letter-spacing: inherit;
  white-space: pre;
  padding: 0;
}
.autosize::after {
  content: attr(data-value);
  visibility: hidden;
}
.row-input-field {
  color: var(--ink);
  background: transparent;
  border: 0; outline: none;
}
.row-input-field::placeholder {
  color: var(--ink-3);
  font-style: italic;
}
.row-add {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font);
  font-size: 14px; letter-spacing: 0.01em;
  color: var(--ink-2);
  background: color-mix(in oklab, var(--ink) 8%, transparent);
  padding: 12px 24px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
  animation: addin .22s ease;
}
.row-add:hover { background: var(--ink); color: var(--bg); }
.row-add-key {
  display: inline-grid; place-items: center;
  font-family: var(--mono); font-size: 12px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink-2);
  line-height: 1;
  transition: background .15s ease, color .15s ease;
}
.row-add:hover .row-add-key { background: var(--ink-2); color: var(--paper); }
@keyframes addin { from { transform: scale(.9); } }

/* — Typography — */
.h1 { font-family: var(--font-display); font-weight: 400; font-size: 48px; line-height: 1.08; letter-spacing: -0.025em; margin: 0; color: var(--ink); }
.h2 { font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1.2; letter-spacing: -0.015em; margin: 0; color: var(--ink); }
.h3 { font-family: var(--font-display); font-weight: 400; font-size: 20px; line-height: 1.3; letter-spacing: -0.008em; margin: 0; color: var(--ink); }
.body { font-family: var(--font); font-size: 17px; line-height: 1.55; color: var(--ink); }
[data-font="editorial"] .h1 { font-size: 56px; line-height: 1.05; letter-spacing: -0.022em; }
[data-font="editorial"] .h2 { font-size: 32px; }
[data-font="editorial"] .h3 { font-size: 22px; }
@media (max-width: 520px) {
  .h1 { font-size: 36px; }
  .h2 { font-size: 24px; }
  [data-font="editorial"] .h1 { font-size: 40px; }
}
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-3);
}
em.serif-i {
  font-style: italic;
  font-weight: 400;
  color: var(--ink-2);
}
[data-font="editorial"] em.serif-i { color: inherit; }

/* — Buttons / links — */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 22px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  white-space: nowrap;
  transition: transform .18s ease, opacity .18s ease;
}
.btn:hover { opacity: .92; }
.btn:active { transform: scale(.985); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: .5px solid var(--line);
}
.btn-ghost:hover { background: var(--shade-2); }
.btn-text {
  background: transparent; color: var(--ink-2); padding: 8px 4px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  white-space: nowrap;
}
.btn-text:hover { color: var(--ink); }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 24px; }

/* — Cards / rows — */
.row {
  display: flex; align-items: center; gap: 18px;
  padding: 22px 0;
  border-top: .5px solid var(--line);
}
.row:first-child { border-top: 0; }
.row-num {
  font-family: var(--mono); font-size: 11px; color: var(--ink-3); width: 22px; flex-shrink: 0;
  letter-spacing: .05em;
}
.row-body { flex: 1; min-width: 0; }
.row-title { font-family: var(--serif); font-size: 22px; line-height: 1.3; color: var(--ink); letter-spacing: -0.005em; }
.row-title.done { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-3); text-decoration-thickness: .5px; }
.row-meta { display: flex; gap: 10px; align-items: center; margin-top: 6px; }

/* — Tiny checkbox circle — */
.tick {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--ink-3);
  background: transparent;
  flex-shrink: 0;
  position: relative;
  transition: background .25s ease, border-color .25s ease, transform .2s ease;
}
.tick:hover { border-color: var(--ink-2); }
.tick.is-on {
  background: var(--ink);
  border-color: var(--ink);
}
.tick.is-on::after {
  content: ""; position: absolute;
  left: 50%; top: 50%;
  width: 9px; height: 4.5px;
  border-left: 1.5px solid var(--paper);
  border-bottom: 1.5px solid var(--paper);
  transform: translate(-50%, -65%) rotate(-45deg);
}

/* — Pill / energy tag — */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-2);
  padding: 3px 0;
}
.pill .dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3);
}
.pill[data-e="low"]    .dot { background: var(--ink-3); }
.pill[data-e="medium"] .dot { background: var(--ink-2); }
.pill[data-e="deep"]   .dot { background: var(--ink); }

/* — Inbox lines — */
.lined {
  background-image: linear-gradient(var(--line) .5px, transparent .5px);
  background-size: 100% 34px;
  background-position: 0 33.5px;
  line-height: 34px;
}
.brain-input {
  width: 100%;
  min-height: 420px;
  resize: none;
  font-family: var(--serif);
  font-size: 20px;
  color: var(--ink);
  background: transparent;
  border: 0; outline: none;
  line-height: 36px;
  padding: 0;
}
.lined { background-size: 100% 36px !important; background-position: 0 35.5px !important; }
.brain-input::placeholder { color: var(--ink-3); font-style: italic; }

/* — Inputs — */
.input {
  width: 100%; padding: 12px 0;
  font-family: var(--serif); font-size: 18px;
  border-bottom: .5px solid var(--line);
  color: var(--ink);
  transition: border-color .2s ease;
}
.input:focus { border-color: var(--ink-2); }
.input::placeholder { color: var(--ink-3); font-style: italic; }

/* — Focus mode — */
.focus-stage {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: var(--stage-bg, var(--paper));
  padding: 40px 48px 36px;
  z-index: 50;
  animation: focusin .35s ease;
}
@media (max-width: 520px) {
  .focus-stage { padding: 36px 24px 28px; }
}
/* transform-only entry so paused animations don't hide content */
@keyframes focusin { from { transform: scale(.99); } }
.focus-top {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3);
}
.focus-top button { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--ink-2); text-transform: uppercase; }
.focus-task {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 0 4px;
}
.focus-task .label-only {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 24px;
}
.focus-task .text {
  font-family: var(--serif); font-weight: 400;
  font-size: 56px; line-height: 1.1; letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 760px;
}
@media (max-width: 520px) {
  .focus-task .text { font-size: 36px; }
}
.focus-step {
  margin-top: 26px;
  font-family: var(--serif); font-style: italic; font-size: 18px;
  color: var(--ink-2);
  max-width: 320px; line-height: 1.45;
}

/* — Calm timer ring (replaces dot when timer is on) — */
.focus-timer {
  position: relative;
  width: 180px; height: 180px;
  margin: 50px auto 0;
  display: grid;
  place-items: center;
  color: var(--ink);
}
.focus-ring {
  position: absolute; inset: 0;
  transition: stroke 1s ease;
}
.focus-time {
  position: relative; z-index: 1;
  font-family: var(--mono);
  font-weight: 300;
  font-size: 38px;
  letter-spacing: 0.02em;
  color: var(--ink);
  display: inline-flex; align-items: baseline; gap: 1px;
  font-variant-numeric: tabular-nums;
}
.focus-time-sep {
  opacity: .25;
  animation: blink 2.2s ease-in-out infinite;
  margin: 0 1px;
}
.focus-time-ss { color: var(--ink-2); }
@keyframes blink {
  0%, 100% { opacity: .15; }
  50%      { opacity: .55; }
}

/* — Breath ring (when no timer) — */
.breath {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--ink);
  margin: 50px auto 0;
  animation: breath 6.5s ease-in-out infinite;
}
@keyframes breath {
  0%, 100% { transform: scale(1);   opacity: .35; }
  50%      { transform: scale(2.4); opacity: 1;   }
}

/* — Timer bar — */
.timer-line {
  position: absolute; left: 0; bottom: 0; height: 1px;
  background: var(--ink);
  transition: width .9s linear;
}
.focus-foot {
  display: flex; justify-content: space-between; align-items: flex-end;
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3);
}
.focus-foot button { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--ink-2); text-transform: uppercase; padding: 8px 10px; margin: -8px -10px; border-radius: 6px; }
.focus-foot button:hover { color: var(--ink); }
.focus-foot button.primary { color: var(--ink); }

/* — Optional timer group (frames the timer as a gentle aid, not a demand) — */
.focus-timer-opt { display: flex; flex-direction: column; gap: 10px; }
.focus-opt-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3);
  text-transform: lowercase; letter-spacing: .04em; font-style: normal;
}
.focus-opt-btns { display: flex; align-items: center; gap: 8px; }
.focus-opt-btns button {
  font-family: var(--mono); font-size: 13px; letter-spacing: .02em;
  text-transform: none;
  color: var(--ink-2);
  border: .5px solid var(--line);
  padding: 8px 13px !important; margin: 0 !important;
  border-radius: 999px;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.focus-opt-btns button:hover { color: var(--ink); border-color: var(--ink-3); background: var(--shade-2); }
.focus-opt-unit {
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em;
  color: var(--ink-3); text-transform: lowercase; margin-left: 2px;
}

/* — Sheet / modal — */
.sheet-bg {
  position: fixed; inset: 0; z-index: 60;
  background: color-mix(in oklab, var(--ink) 30%, transparent);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fadein .25s ease;
}
.sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 61;
  width: 100%; max-width: 560px;
  transform: translateX(-50%);
  background: var(--paper);
  border-radius: 22px 22px 0 0;
  padding: 24px 32px 32px;
  max-height: 88vh;
  overflow-y: auto;
  animation: slideup .32s cubic-bezier(.2,.7,.2,1);
  box-shadow: 0 -10px 60px -20px color-mix(in oklab, var(--ink) 40%, transparent);
}
@media (min-width: 720px) {
  .sheet {
    bottom: auto; top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 18px;
    animation: sheetin .25s ease;
  }
  .sheet-grip { display: none; }
}
@keyframes sheetin { from { opacity: 0; transform: translate(-50%, -45%); } to { opacity: 1; transform: translate(-50%, -50%); } }
/* keep translateX(-50%) inside the keyframe so a stalled animation clock
   (paused/hidden context) doesn't drop the horizontal centering */
@keyframes slideup { from { transform: translateX(-50%) translateY(40%); opacity: .4; } }
.sheet-grip { width: 36px; height: 4px; background: var(--line); border-radius: 2px; margin: 0 auto 16px; }

/* — Step list (breakdown) — */
.sheet-steps { margin-top: 24px; }

/* — Next action callout: the single concrete thing to begin with — */
.next-action {
  margin-top: 16px; margin-bottom: 18px;
  padding: 16px 18px;
  background: var(--shade-2);
  border-radius: var(--radius);
}
.next-action-label {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.next-action-text {
  font-family: var(--font);
  font-size: 18px; line-height: 1.35; letter-spacing: -0.005em;
  color: var(--ink);
}
.next-action.is-clear { background: transparent; padding: 8px 0 0; }
.next-action.is-clear .next-action-text { color: var(--ink-2); font-size: 16px; }
.step-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-top: .5px solid var(--line);
}
.step-row:first-child { border-top: 0; }
.step-row .tick { width: 18px; height: 18px; }
.step-row .tick.is-on::after { width: 7px; height: 3.5px; }
.step-text {
  flex: 1; font-family: var(--font); font-size: 16px; line-height: 1.4; color: var(--ink);
}
.step-text.done { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.step-x {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); padding: 4px 6px; border-radius: 6px;
  transition: color .15s ease, background .15s ease;
}
.step-x:hover { color: var(--ink); background: var(--shade-2); }
.step-add {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0 4px;
  border-top: .5px solid var(--line);
  margin-top: 0;
}
.step-add-plus { font-family: var(--mono); font-size: 13px; color: var(--ink-3); }
.step-add input { flex: 1; font-family: var(--font); font-size: 16px; color: var(--ink); padding: 4px 0; }
.step-add input::placeholder { color: var(--ink-3); font-style: italic; }
.sheet-ai {
  margin-top: 14px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3);
  padding: 6px 0;
  transition: color .15s ease;
}
.sheet-ai:hover { color: var(--ink-2); }
.sheet-ai:disabled { opacity: .6; }

/* — Sheet foot: energy (quiet) + remove — */
.sheet-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 30px; padding-top: 20px;
  border-top: .5px solid var(--line);
}
.sheet-energy { display: inline-flex; gap: 4px; }
.energy-dot {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3);
  padding: 6px 10px; border-radius: 999px;
  transition: color .15s ease, background .15s ease;
}
.energy-dot:hover { color: var(--ink-2); }
.energy-dot.is-on { color: var(--ink); background: var(--shade); }
.energy-dot .pill { padding: 0; }

/* — Done log — */
.done-row {
  display: flex; align-items: baseline; gap: 14px;
  padding: 14px 0;
  border-top: .5px solid var(--line);
}
.done-row:first-child { border-top: 0; }
.done-time { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; color: var(--ink-3); width: 56px; flex-shrink: 0; }
.done-title { font-family: var(--serif); font-size: 17px; line-height: 1.4; color: var(--ink-2); }

/* — Onboarding — */
.onb {
  position: fixed; inset: 0; z-index: 70;
  background: var(--paper);
  display: flex; flex-direction: column;
  padding: 0;
}
.onb-inner {
  width: 100%; max-width: 560px;
  margin: 0 auto;
  flex: 1;
  display: flex; flex-direction: column;
  padding: 14vh 40px 56px;
}
.onb-mark {
  color: var(--ink);
  margin-bottom: 120px;
  animation: markin .55s cubic-bezier(.2,.7,.2,1);
}
@keyframes markin {
  from { transform: scale(.88); }
}
.onb-body {
  animation: bodyin .5s ease;
}
@keyframes bodyin {
  from { transform: translateY(8px); }
}
.onb-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 56px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0 0 24px;
}
.onb-sub {
  font-family: var(--font);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
  max-width: 460px;
}
[data-font="editorial"] .onb-title { font-weight: 400; font-size: 60px; letter-spacing: -0.022em; }
.onb-foot {
  margin-top: auto;
  display: flex; justify-content: center; align-items: center;
  padding-top: 60px;
}
.onb-cta {
  font-family: var(--font);
  font-weight: 500;
  font-size: 19px;
  color: var(--ink);
  background: transparent;
  padding: 14px 24px;
  border-radius: 999px;
  transition: opacity .18s ease, background .18s ease;
  letter-spacing: -0.005em;
}
.onb-cta:hover { background: var(--shade-2); }
.onb-skip {
  position: absolute; top: 24px; right: 28px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink-3);
  padding: 8px 12px;
  border-radius: 999px;
}
.onb-skip:hover { color: var(--ink-2); }
@media (max-width: 520px) {
  .onb-inner { padding: 10vh 26px 40px; }
  .onb-mark { margin-bottom: 80px; }
  .onb-title { font-size: 42px; }
  .onb-sub { font-size: 17px; }
}
.onb-foot { display: flex; align-items: center; justify-content: space-between; }
.onb-dots { display: flex; gap: 8px; }
.onb-dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--line); }
.onb-dots span.on { background: var(--ink); }

/* — Logo / mark — */
.logo {
  font-family: var(--serif); font-weight: 400; font-size: 24px; letter-spacing: -0.015em; color: var(--ink);
}
.logo em { font-style: italic; }

/* — Subtle utility — */
.divider { height: .5px; background: var(--line); margin: 14px 0; }
.spacer-sm { height: 14px; } .spacer { height: 26px; } .spacer-lg { height: 42px; }

/* — Done flash — */
.done-flash {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in oklab, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: flashin .35s ease;
  pointer-events: none;
}
@keyframes flashin { from { opacity: 0; } }
.done-flash .mark {
  width: 60px; height: 60px; border-radius: 50%;
  border: 1px solid var(--ink);
  display: grid; place-items: center;
  animation: ringgrow .9s ease-out;
}
.done-flash .mark::after {
  content: ""; width: 18px; height: 9px;
  border-left: 1.2px solid var(--ink); border-bottom: 1.2px solid var(--ink);
  transform: rotate(-45deg) translate(2px, -2px);
}
.done-flash .msg {
  position: absolute; bottom: 36%; font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--ink-2);
}
@keyframes ringgrow {
  0% { transform: scale(.4); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

/* — Energy chooser — */
.energy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.energy-card {
  text-align: left;
  padding: 14px 12px;
  border: .5px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  transition: border-color .2s, background .2s;
}
.energy-card.is-on { border-color: var(--ink); background: var(--shade-2); }
.energy-card .lbl { font-family: var(--mono); font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.energy-card .desc { font-family: var(--serif); font-size: 14px; line-height: 1.35; color: var(--ink-2); }
.energy-card.is-on .lbl { color: var(--ink-2); }
.energy-card.is-on .desc { color: var(--ink); }

/* — Inbox item — */
.inbox-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0;
  border-top: .5px solid var(--line);
}
.inbox-row:first-child { border-top: 0; }
.inbox-pick {
  width: 22px; height: 22px; border-radius: 50%;
  border: .5px solid var(--ink-3);
  flex-shrink: 0; position: relative; transition: all .2s ease;
}
.inbox-pick.is-on { border-color: var(--ink); background: var(--ink); }
.inbox-pick.is-on::after {
  content: ""; position: absolute;
  inset: 6px; border-radius: 50%; background: var(--paper);
}
.inbox-text { flex: 1; font-family: var(--serif); font-size: 17px; line-height: 1.4; color: var(--ink); }
.inbox-text.dim { color: var(--ink-2); }

/* — Settings (legacy .name/.val helpers; row layout defined earlier) — */
.set-row .name { font-family: var(--font); font-size: 17px; color: var(--ink); }
.set-row .val  { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.set-row:hover .val { color: var(--ink); }
.set-hint {
  font-family: var(--font); font-size: 13.5px;
  color: var(--ink-3); margin-top: 4px;
}

/* — Segmented control (two buttons inside a pill) — */
.seg {
  display: inline-flex; align-items: center;
  background: color-mix(in oklab, var(--ink) 7%, transparent);
  border-radius: 999px;
  padding: 3px;
  gap: 0;
}
.seg-btn {
  font-family: var(--font);
  font-size: 13px;
  color: var(--ink-3);
  padding: 7px 16px;
  border-radius: 999px;
  transition: color .2s ease, background .2s ease;
  letter-spacing: -0.005em;
}
.seg-btn:hover { color: var(--ink-2); }
.seg-btn.is-on {
  background: color-mix(in oklab, #fff 80%, transparent);
  color: var(--ink);
  box-shadow: 0 1px 2px color-mix(in oklab, var(--ink) 8%, transparent);
}

/* — Toggle switch — */
.toggle {
  width: 44px; height: 26px;
  background: color-mix(in oklab, var(--ink) 12%, transparent);
  border-radius: 999px;
  position: relative;
  padding: 0;
  transition: background .25s ease;
}
.toggle-knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 1px 3px color-mix(in oklab, var(--ink) 18%, transparent);
  transition: transform .25s cubic-bezier(.4,.2,.2,1);
}
.toggle.is-on { background: var(--ink); }
.toggle.is-on .toggle-knob { transform: translateX(18px); }

/* — Music player (hidden) — */
.music-player {
  position: fixed;
  width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
  bottom: 0; left: 0;
  overflow: hidden;
}

/* — Music chip in focus mode — */
.music-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono);
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
  padding: 5px 10px;
  border-radius: 999px;
  border: .5px solid var(--line);
  transition: color .2s ease, border-color .2s ease;
}
.music-chip:hover { color: var(--ink-2); border-color: var(--ink-3); }
.music-chip.is-on {
  color: var(--ink);
  border-color: var(--ink);
}

/* equalizer bar animation when music is on */
.mi-bar { transform-box: fill-box; transform-origin: center; }
.mi-bar.a1 { animation: bar1 1.1s ease-in-out infinite; }
.mi-bar.a2 { animation: bar2 0.9s ease-in-out infinite; }
.mi-bar.a3 { animation: bar3 1.3s ease-in-out infinite; }
.mi-bar.a4 { animation: bar4 1.0s ease-in-out infinite; }
@keyframes bar1 { 0%,100% { transform: scaleY(.5); } 50% { transform: scaleY(1.4); } }
@keyframes bar2 { 0%,100% { transform: scaleY(1.2); } 50% { transform: scaleY(.4); } }
@keyframes bar3 { 0%,100% { transform: scaleY(.6); } 50% { transform: scaleY(1.6); } }
@keyframes bar4 { 0%,100% { transform: scaleY(.8); } 50% { transform: scaleY(.3); } }

/* — Transitions —
   Entry animations only animate transform, never opacity. CSS animations paused in
   hidden tabs/iframes hold their `from` state at currentTime 0; if that includes
   opacity:0, content stays invisible until the tab is focused. transform-only
   entry animations are safe to be paused — the element remains fully visible. */
.fade-in { animation: fadein .35s ease; }
@keyframes fadein { from { transform: translateY(4px); } }

/* — Reduced motion: calm the screen for motion-sensitive users —
   Keeps everything visible and functional, just removes looping / large motion.
   The breathing dot becomes a soft static fade so it still reads as "alive". */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .breath {
    animation: none !important;
    opacity: .55;
    transform: scale(1.8);
  }
  .focus-time-sep { opacity: .35 !important; }
  .mi-bar { animation: none !important; }
}

/* — All-lowercase aesthetic, everywhere — */
* { text-transform: lowercase !important; }
