/* Sova on the web — the marketing site's field, grain, ivory and gilt,
   carried into a working surface. Hairlines and type do the structure;
   nothing here is a card. */

:root {
  --field: #1F2E26;
  --field-deep: #121B15;
  --field-raised: #18251E;
  --ivory: #F6F2E8;
  --ivory-dim: rgba(246, 242, 232, 0.72);
  --ivory-faint: rgba(246, 242, 232, 0.5);
  --ivory-ghost: rgba(246, 242, 232, 0.08);
  --gilt: #C6A460;
  --gilt-soft: rgba(198, 164, 96, 0.16);
  --gilt-hairline: rgba(198, 164, 96, 0.35);
  --edge: rgba(246, 242, 232, 0.09);
  --late: #E7A488;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --rail: 17.5rem;
  --read: 42rem;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Roboto, "Helvetica Neue", "PingFang SC", "Noto Sans", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ivory);
  background:
    radial-gradient(90rem 50rem at 70% -20%, rgba(198, 164, 96, 0.07), transparent 60%),
    radial-gradient(70rem 50rem at 0% 110%, rgba(18, 27, 21, 0.9), transparent 70%),
    linear-gradient(180deg, #22332A 0%, var(--field) 38%, #1A271F 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern", "ss01";
  overflow-x: clip;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: url("/assets/grain.jpg") repeat;
  background-size: 192px;
  opacity: 0.07;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 100;
}

::selection { background: rgba(198, 164, 96, 0.35); color: var(--ivory); }

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

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--gilt); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.2em; }

:focus-visible {
  outline: 2px solid var(--gilt);
  outline-offset: 3px;
  border-radius: 8px;
}

/* Route changes move focus to the page heading for screen readers; it is not a control. */
h1[tabindex="-1"]:focus, main[tabindex="-1"]:focus { outline: none; }

[hidden] { display: none !important; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 200;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: var(--gilt);
  color: var(--field-deep);
  font-weight: 650;
  transform: translateY(-200%);
  transition: transform 0.25s var(--ease);
}
.skip:focus { transform: none; text-decoration: none; }

.noscript { padding: 3rem 1.5rem; text-align: center; color: var(--ivory-dim); }

/* ---------- type ---------- */

.kicker {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gilt);
}

.relief {
  text-shadow:
    0 -1px 1px rgba(6, 10, 8, 0.55),
    0 1px 0 rgba(255, 255, 255, 0.06);
}

.display {
  margin: 0;
  font-size: clamp(1.9rem, 4.6vw, 2.6rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.012em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.lede {
  margin: 0;
  color: var(--ivory-dim);
  font-size: 1.04rem;
  text-wrap: pretty;
}

.quiet { color: var(--ivory-faint); }

/* ---------- boot ---------- */

.boot {
  min-height: 100dvh;
  display: grid;
  place-items: center;
}
.boot-mark {
  opacity: 0;
  animation: boot-in 0.9s var(--ease) 0.25s forwards;
}
.boot-mark img { display: block; opacity: 0.85; }
@keyframes boot-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* ---------- the owl ---------- */

.owl {
  position: relative;
  width: var(--owl, 96px);
  aspect-ratio: 1;
  flex: none;
}
.owl img { position: absolute; inset: 0; width: 100%; height: 100%; }
.owl .lid {
  position: absolute;
  width: 17.7%;
  height: 17.7%;
  border-radius: 50%;
  background: #E5E3DA;
  transition: transform 0.5s var(--ease-out);
}
.owl .lid-l { left: 22.62%; top: 41.11%; }
.owl .lid-r { left: 59.55%; top: 41.11%; }
.owl.awake .lid { transform: scale(0); }
.owl.blink .lid { animation: blink 0.42s var(--ease) 1; }
@keyframes blink {
  0%, 100% { transform: scale(0); }
  45%, 55% { transform: scale(1); }
}

/* ---------- auth / join / name — one quiet column ---------- */

.gate {
  min-height: 100dvh;
  display: grid;
  align-content: center;
  justify-items: stretch;
  width: min(100%, 27rem);
  margin: 0 auto;
  padding: max(3rem, env(safe-area-inset-top)) 1.5rem calc(3rem + var(--safe-b));
  gap: 0;
}
.gate .owl { --owl: 88px; margin: 0 0 1.75rem -0.6rem; }
.gate .kicker { margin-bottom: 0.7rem; }
.gate .display { font-size: clamp(1.85rem, 6vw, 2.35rem); }
.gate .lede { margin-top: 0.85rem; }
.gate form { width: 100%; margin-top: 2.25rem; }
.gate .foot {
  margin-top: 2.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  font-size: 0.86rem;
  color: var(--ivory-faint);
}
.gate .foot a { color: var(--ivory-dim); }

.stagger > * {
  opacity: 0;
  transform: translateY(10px);
  animation: rise 0.7s var(--ease-out) forwards;
}
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.12s; }
.stagger > *:nth-child(4) { animation-delay: 0.18s; }
.stagger > *:nth-child(5) { animation-delay: 0.24s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }
@keyframes rise { to { opacity: 1; transform: none; } }

.field { position: relative; display: block; }
.field-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  color: var(--ivory-faint);
}
.line-input {
  width: 100%;
  padding: 0.55rem 0 0.6rem;
  border: 0;
  border-bottom: 1px solid var(--edge);
  border-radius: 0;
  background: transparent;
  font-size: 1.3rem;
  outline: none;
  caret-color: var(--gilt);
}
.line-input::placeholder { color: rgba(246, 242, 232, 0.28); }
.field::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--gilt);
  transform: scaleX(0);
  transition: transform 0.45s var(--ease-out);
}
.field:focus-within::after { transform: scaleX(1); }

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.4rem;
  margin-top: 1.6rem;
}
.row-actions:not(:has(> :not([hidden], :empty))) { display: none; }

/* Email code + Sign in with Apple. Apple's button stays white with a black
   mark and label on dark backgrounds, per Apple's guidelines. */
.choices { width: 100%; }
.choices.apple-first { margin-top: 2.25rem; }
.choices.apple-first .code-flow form { margin-top: 0; }
.choices .or {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 1.4rem 0;
  font-size: 0.8rem;
  color: var(--ivory-faint);
}
.choices .or::before, .choices .or::after { content: ""; flex: 1; height: 1px; background: var(--edge); }
.choices:not(.apple-first) .or { margin-top: 0.4rem; }
.choices .apple-choice .form-error { margin-top: 0.6rem; }
/* Once a code is on its way, the other door steps aside. */
.choices:has(.code-step) > :not(.code-flow) { display: none; }
.apple-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.9rem;
  padding: 0 1.2rem;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  transition: transform 0.2s var(--spring), opacity 0.2s var(--ease);
}
.apple-btn svg { width: 1.1rem; height: 1.1rem; margin-top: -0.12rem; flex: none; }
.apple-btn:active { transform: scale(0.98); }
.apple-btn[disabled] { opacity: 0.6; cursor: default; }
.apple-btn:focus-visible { outline: 2px solid var(--gilt); outline-offset: 3px; }
.confirm .apple-btn { width: auto; margin-top: 0.4rem; }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0 1.5rem;
  border-radius: 999px;
  background: var(--gilt);
  color: var(--field-deep);
  font-weight: 650;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 30px -12px rgba(198, 164, 96, 0.55);
  transition: transform 0.25s var(--spring), filter 0.2s var(--ease), opacity 0.2s var(--ease);
}
.pill:hover { filter: brightness(1.06); text-decoration: none; }
.pill:active { transform: scale(0.97); }
.pill[disabled], .pill[aria-disabled="true"] {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}
.pill.ghost {
  background: transparent;
  color: var(--gilt);
  box-shadow: inset 0 0 0 1px var(--gilt-hairline);
}
.pill.danger { background: var(--late); box-shadow: none; }
.pill .spin {
  width: 1rem; height: 1rem;
  border-radius: 50%;
  border: 2px solid rgba(18, 27, 21, 0.25);
  border-top-color: var(--field-deep);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.text-btn {
  min-height: 2.75rem;
  color: var(--ivory-dim);
  font-size: 0.92rem;
  transition: color 0.2s var(--ease);
}
.text-btn:hover { color: var(--ivory); }
.text-btn[disabled] { color: var(--ivory-faint); cursor: default; }
.text-btn.gilt { color: var(--gilt); }
.text-btn.gilt[disabled] { color: var(--ivory-faint); }
.text-btn.late { color: var(--late); }

.form-error {
  min-height: 1.4rem;
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--late);
}
.form-error:empty { visibility: hidden; }

/* six-cell code — one real input over drawn cells */
.code {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.6rem;
  max-width: 22rem;
}
.code input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  border: 0;
  font-size: 16px;
  caret-color: transparent;
  color: transparent;
  background: transparent;
  letter-spacing: 3em;
  z-index: 1;
}
.code .cell {
  position: relative;
  display: grid;
  place-items: center;
  height: 3.6rem;
  border-bottom: 1px solid var(--edge);
  font-family: ui-rounded, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.9rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.3s var(--ease);
}
.code .cell.filled { border-bottom-color: var(--gilt-hairline); }
.code .cell.filled span { animation: digit 0.32s var(--spring); }
.code:focus-within .cell.active { border-bottom-color: var(--gilt); }
.code:focus-within .cell.active::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 1.7rem;
  border-radius: 1px;
  background: var(--gilt);
  animation: caret 1.1s steps(1) infinite;
}
.code.shake { animation: shake 0.42s var(--ease); }
@keyframes digit { from { opacity: 0; transform: translateY(6px) scale(0.9); } }
@keyframes caret { 50% { opacity: 0; } }
@keyframes shake {
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}
.sent-to { margin: 0 0 1.4rem; color: var(--ivory-dim); }
.sent-to strong { color: var(--ivory); font-weight: 600; overflow-wrap: anywhere; }

/* ---------- shell: rail + main ---------- */

.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100dvh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 1.35rem 0.9rem calc(1rem + var(--safe-b));
  border-right: 1px solid var(--edge);
  background: linear-gradient(180deg, rgba(18, 27, 21, 0.55), rgba(18, 27, 21, 0.3));
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0 0.6rem 1.4rem;
}
.brand .owl { --owl: 34px; margin-left: -0.35rem; }
.brand-name {
  font-weight: 600;
  font-size: 1.08rem;
  letter-spacing: 0.02em;
}

.nav { flex: 1; overflow-y: auto; margin: 0 -0.9rem; padding: 0 0.9rem; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-head {
  margin: 1.4rem 0.6rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ivory-faint);
}
.nav-list { list-style: none; margin: 0; padding: 0; }

.nav-link {
  position: relative;
  display: grid;
  grid-template-columns: 0.9rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  min-height: 2.6rem;
  padding: 0 0.6rem;
  border-radius: 10px;
  color: var(--ivory-dim);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.nav-link:hover { color: var(--ivory); background: rgba(246, 242, 232, 0.035); text-decoration: none; }
.nav-link[aria-current="page"] { color: var(--ivory); }
.nav-link .bar {
  justify-self: center;
  width: 3px;
  height: 0.8rem;
  border-radius: 2px;
  background: var(--c, var(--gilt));
  opacity: 0.85;
  transition: height 0.35s var(--spring), opacity 0.2s var(--ease), width 0.3s var(--ease);
}
.nav-link[aria-current="page"] .bar { height: 1.35rem; opacity: 1; }
.nav-link .sun {
  justify-self: center;
  width: 0.62rem; height: 0.62rem;
  border-radius: 50%;
  background: var(--gilt);
  box-shadow: 0 0 0 3px rgba(198, 164, 96, 0.18);
}
.nav-link .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link .count {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--ivory-faint);
}
.nav-link .lock { width: 0.8rem; height: 0.8rem; color: var(--ivory-faint); }

.rail-foot {
  display: grid;
  gap: 0.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--edge);
}
.me {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.9rem;
  padding: 0 0.6rem;
  border-radius: 10px;
  color: var(--ivory-dim);
  text-align: start;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.me:hover { background: rgba(246, 242, 232, 0.035); color: var(--ivory); text-decoration: none; }
.me[aria-current="page"] { color: var(--ivory); }
.me .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-foot .text-btn { justify-self: start; padding: 0 0.6rem; font-size: 0.84rem; }

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--av, 1.75rem);
  height: var(--av, 1.75rem);
  border-radius: 50%;
  background: color-mix(in srgb, var(--c, var(--gilt)) 22%, var(--field-deep));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, var(--gilt)) 45%, transparent);
  color: color-mix(in srgb, var(--c, var(--gilt)) 70%, var(--ivory));
  font-size: calc(var(--av, 1.75rem) * 0.42);
  font-weight: 650;
  line-height: 1;
  text-transform: uppercase;
}

.main {
  min-width: 0;
  padding: 0 clamp(1.25rem, 5vw, 4rem) calc(7rem + var(--safe-b));
}

.page {
  max-width: var(--read);
  margin: 0 auto;
}

.page-head {
  position: relative;
  padding: clamp(2.2rem, 7vh, 4.5rem) 0 1.6rem;
}
.page-head .kicker { margin-bottom: 0.6rem; }
.page-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 0.9rem;
  color: var(--ivory-faint);
  font-size: 0.9rem;
}
.faces { display: flex; }
.faces .avatar { --av: 1.6rem; margin-inline-start: -0.4rem; box-shadow: 0 0 0 2px var(--field), inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent); }
.faces .avatar:first-child { margin-inline-start: 0; }
.notice {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  margin: 0 0 1.8rem;
  color: var(--ivory-dim);
  font-size: 0.92rem;
}
.notice::before {
  content: "";
  flex: none;
  width: 0.4rem; height: 0.4rem;
  border-radius: 50%;
  background: var(--gilt);
  transform: translateY(-0.1rem);
}

.mobile-bar { display: none; }

/* ---------- composer ---------- */

.composer {
  position: relative;
  margin: 0 0 1.4rem;
  padding: 0.2rem 0 0;
}
.composer-line {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) auto;
  align-items: center;
  border-bottom: 1px solid var(--edge);
  transition: border-color 0.3s var(--ease);
}
.composer:focus-within .composer-line { border-bottom-color: var(--gilt-hairline); }
.composer .plus {
  justify-self: start;
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  margin-inline-start: 0.1rem;
  border-radius: 50%;
  border: 1.5px dashed rgba(246, 242, 232, 0.35);
  color: var(--ivory-faint);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.4s var(--spring);
}
.composer:focus-within .plus { border-color: var(--gilt); border-style: solid; color: var(--gilt); transform: rotate(90deg); }
.composer .plus svg { width: 0.7rem; height: 0.7rem; }
.composer input[type="text"] {
  min-height: 3.1rem;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 1.06rem;
  caret-color: var(--gilt);
}
.composer input::placeholder { color: rgba(246, 242, 232, 0.36); }
.composer .enter {
  min-height: 2.2rem;
  padding: 0 0.9rem;
  border-radius: 999px;
  color: var(--field-deep);
  background: var(--gilt);
  font-size: 0.85rem;
  font-weight: 650;
  opacity: 0;
  transform: scale(0.85);
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.3s var(--spring);
}
.composer.has-text .enter { opacity: 1; transform: none; pointer-events: auto; }

.whens {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.4rem;
  padding: 0.55rem 0 0 2.75rem;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.35s var(--ease-out), opacity 0.25s var(--ease);
}
.composer:focus-within .whens,
.composer.has-text .whens,
.composer.chosen .whens { max-height: 6rem; opacity: 1; }

.when {
  position: relative;
  min-height: 2.1rem;
  padding: 0 0.8rem;
  border-radius: 999px;
  color: var(--ivory-faint);
  font-size: 0.86rem;
  transition: color 0.2s var(--ease), background-color 0.25s var(--ease);
}
.when:hover { color: var(--ivory); }
.when[aria-pressed="true"], .when.on { color: var(--gilt); background: var(--gilt-soft); }
label.when { display: inline-flex; align-items: center; cursor: pointer; }
label.when:focus-within { outline: 2px solid var(--gilt); outline-offset: 2px; }
.when-date {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}
.when-date::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.composer-list {
  margin-inline-start: auto;
  font-size: 0.84rem;
  color: var(--ivory-faint);
}
.composer-list select {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.3rem 1.1rem 0.3rem 0.2rem;
  color: var(--ivory-dim);
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ivory-faint) 50%), linear-gradient(135deg, var(--ivory-faint) 50%, transparent 50%);
  background-position: calc(100% - 7px) 55%, calc(100% - 3px) 55%;
  background-size: 4px 4px;
  background-repeat: no-repeat;
}
.composer-list select option { background: var(--field-deep); color: var(--ivory); }

/* ---------- sections + rows ---------- */

.section { margin: 0 0 1.6rem; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 0 0 0.25rem;
  padding: 0 0 0.45rem 2.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ivory-faint);
}
.section-head.today { color: var(--gilt); }
.section-head.overdue { color: var(--late); }
.section-head .n { letter-spacing: 0.04em; font-variant-numeric: tabular-nums; opacity: 0.7; }

.rows { list-style: none; margin: 0; padding: 0; }

.row {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.42s var(--ease-out), opacity 0.3s var(--ease);
}
.row > .row-in { overflow: hidden; min-height: 0; }
.row.leaving { grid-template-rows: 0fr; opacity: 0; }
.row.entering { animation: row-enter 0.5s var(--ease-out); }
@keyframes row-enter {
  from { opacity: 0; transform: translateY(-8px); }
}
.row.remote .row-body { animation: remote-glow 2.2s var(--ease) 1; }
@keyframes remote-glow {
  0% { background-color: rgba(198, 164, 96, 0.14); }
  100% { background-color: transparent; }
}

.row-body {
  position: relative;
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) auto;
  align-items: start;
  min-height: 3.2rem;
  border-radius: 12px;
  transition: background-color 0.2s var(--ease);
}
.row-body::after {
  content: "";
  position: absolute;
  left: 2.75rem; right: 0; bottom: 0;
  height: 1px;
  background: var(--edge);
}
.row:last-child .row-body::after { display: none; }
.row-body:hover { background: rgba(246, 242, 232, 0.028); }
.row.selected .row-body { background: rgba(246, 242, 232, 0.045); }
.row.selected .row-body::before {
  content: "";
  position: absolute;
  left: -0.7rem; top: 0.9rem; bottom: 0.9rem;
  width: 2px;
  border-radius: 1px;
  background: var(--gilt);
}

.tick {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 3.2rem;
}
.tick svg { width: 1.4rem; height: 1.4rem; overflow: visible; }
.tick .ring {
  fill: transparent;
  stroke: rgba(246, 242, 232, 0.38);
  stroke-width: 1.5;
  transition: fill 0.35s var(--ease-out), stroke 0.25s var(--ease), transform 0.35s var(--spring);
  transform-origin: 12px 12px;
}
.tick:hover .ring { stroke: var(--gilt); }
.tick .check {
  fill: none;
  stroke: var(--field-deep);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 16;
  stroke-dashoffset: 16;
  transition: stroke-dashoffset 0.32s var(--ease-out) 0.08s;
}
.row.done .tick .ring { fill: var(--gilt); stroke: var(--gilt); }
.row.done .tick .check { stroke-dashoffset: 0; }
.row.just-done .tick .ring { animation: pop 0.45s var(--spring); }
@keyframes pop { 40% { transform: scale(1.18); } }
.tick[aria-disabled="true"] { cursor: default; }
.tick[aria-disabled="true"] .ring { stroke-dasharray: 2.5 3; }
.tick[aria-disabled="true"]:hover .ring { stroke: rgba(246, 242, 232, 0.38); }

.row-main {
  min-width: 0;
  padding: 0.78rem 0.5rem 0.78rem 0;
  text-align: start;
  cursor: pointer;
}
.row-title {
  position: relative;
  display: inline;
  font-size: 1.02rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  background-image: linear-gradient(var(--ivory-faint), var(--ivory-faint));
  background-repeat: no-repeat;
  background-position: 0 58%;
  background-size: 0% 1px;
  transition: color 0.35s var(--ease), background-size 0.4s var(--ease-out);
}
.row.done .row-title { color: var(--ivory-faint); background-size: 100% 1px; }
.row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.7rem;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--ivory-faint);
}
.row-meta .dot {
  display: inline-block;
  width: 0.45rem; height: 0.45rem;
  margin-inline-end: 0.35rem;
  border-radius: 50%;
  background: var(--c);
  vertical-align: 0.05rem;
}
.row-meta .late { color: var(--late); }
.row-meta .pending { color: var(--gilt); }
.row-side {
  padding: 0.85rem 0.25rem 0 0.5rem;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: var(--ivory-faint);
  white-space: nowrap;
}
.row-side.late { color: var(--late); }

.done-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  margin-inline-start: 2.75rem;
  color: var(--ivory-faint);
  font-size: 0.86rem;
  transition: color 0.2s var(--ease);
}
.done-toggle:hover { color: var(--ivory); }
.done-toggle svg { width: 0.7rem; height: 0.7rem; transition: transform 0.3s var(--ease-out); }
.done-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }

/* ---------- empty + locked states ---------- */

.empty {
  padding: clamp(2.5rem, 9vh, 5rem) 0 2rem 2.75rem;
}
.empty .display { font-size: clamp(1.5rem, 3.5vw, 1.9rem); font-weight: 500; color: var(--ivory-dim); }
.empty p { margin: 0.6rem 0 0; max-width: 28rem; color: var(--ivory-faint); }
.empty .owl { --owl: 64px; margin: 0 0 1.2rem -0.45rem; opacity: 0.9; }
.empty .pill { margin-top: 1.4rem; }

/* ---------- mobile index ---------- */

.index-today {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 4.5rem;
  padding: 0 0.2rem;
  border-top: 1px solid var(--edge);
  border-bottom: 1px solid var(--edge);
  color: var(--ivory);
}
.index-today:hover { text-decoration: none; }
.index-today > span:first-child { min-width: 0; }
.index-today .big { font-size: 1.25rem; font-weight: 600; }
.index-today .sub { display: block; margin-top: 0.1rem; font-size: 0.86rem; color: var(--ivory-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.index-today .n { font-size: 1.6rem; font-weight: 300; color: var(--gilt); font-variant-numeric: tabular-nums; }

/* ---------- detail drawer ---------- */

dialog.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(28rem, 100vw);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--edge);
  background: linear-gradient(180deg, rgb(34, 51, 42), rgb(24, 37, 30));
  color: var(--ivory);
  box-shadow: -30px 0 80px -20px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  transform: translateX(100%);
  transition: transform 0.42s var(--ease-out), overlay 0.42s allow-discrete, display 0.42s allow-discrete;
}
dialog.drawer[open] { transform: none; }
@starting-style { dialog.drawer[open] { transform: translateX(100%); } }
dialog.drawer::backdrop {
  background: rgba(8, 12, 10, 0);
  transition: background-color 0.42s var(--ease), overlay 0.42s allow-discrete, display 0.42s allow-discrete;
}
dialog.drawer[open]::backdrop { background: rgba(8, 12, 10, 0.45); }
@starting-style { dialog.drawer[open]::backdrop { background: rgba(8, 12, 10, 0); } }

.drawer-in {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem 0 1.5rem;
}
.drawer-top .grab { display: none; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  color: var(--ivory-dim);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.icon-btn:hover { background: rgba(246, 242, 232, 0.06); color: var(--ivory); }
.icon-btn svg { width: 1.05rem; height: 1.05rem; }
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.4rem 1.5rem calc(2rem + var(--safe-b));
  overscroll-behavior: contain;
}
.drawer-title-row {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  align-items: start;
  margin: 0.4rem 0 1.4rem -0.55rem;
}
.drawer-title-row .tick { width: 2.4rem; height: 2.9rem; }
.title-edit {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.35rem 0;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.3;
  field-sizing: content;
  overflow-wrap: anywhere;
  caret-color: var(--gilt);
}
.title-edit[readonly] { cursor: default; }

.facts { margin: 0; padding: 0; }
.fact {
  display: grid;
  grid-template-columns: 6.2rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.95rem 0;
  border-top: 1px solid var(--edge);
}
.fact dt { font-size: 0.82rem; color: var(--ivory-faint); padding-top: 0.12rem; }
.fact dd { margin: 0; min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.fact dd .dot { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--c); margin-inline-end: 0.5rem; }
.fact .whens { max-height: none; opacity: 1; padding: 0; margin: -0.35rem 0 0 -0.8rem; }
.drawer-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 1.6rem; padding-top: 1rem; border-top: 1px solid var(--edge); }
.drawer-note { margin: 1.2rem 0 0; font-size: 0.86rem; color: var(--ivory-faint); }

.confirm {
  margin-top: 1.2rem;
  padding: 1rem 0 0;
  border-top: 1px solid var(--edge);
  animation: rise 0.4s var(--ease-out) both;
  opacity: 0;
  transform: translateY(6px);
}
.confirm p { margin: 0 0 0.9rem; color: var(--ivory-dim); }
.confirm .row-actions { margin-top: 0; }

/* ---------- account ---------- */

.settings { margin: 0; padding: 0; list-style: none; }
.settings > li { padding: 1.3rem 0; border-top: 1px solid var(--edge); }
.settings h2 { margin: 0 0 0.35rem; font-size: 0.8rem; font-weight: 500; color: var(--ivory-faint); }
.settings .line-input { font-size: 1.15rem; }
.settings .email { font-size: 1.05rem; overflow-wrap: anywhere; }
.settings .danger-zone p { margin: 0.5rem 0 0; color: var(--ivory-faint); font-size: 0.92rem; max-width: 34rem; }

/* ---------- banners + toasts ---------- */

.offline {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.55rem 1rem;
  background: rgba(18, 27, 21, 0.88);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--edge);
  color: var(--ivory-dim);
  font-size: 0.84rem;
  animation: drop 0.4s var(--ease-out);
}
.offline::before {
  content: "";
  width: 0.4rem; height: 0.4rem;
  border-radius: 50%;
  background: var(--gilt);
  animation: breathe 2.4s var(--ease) infinite;
}
.offline:has(button) { padding-block: 0.1rem; }
.offline .text-btn { font-size: inherit; padding: 0 0.3rem; }
@keyframes drop { from { transform: translateY(-100%); } }
@keyframes breathe { 50% { opacity: 0.3; } }

.toast-region {
  position: fixed;
  left: 50%;
  bottom: calc(1.4rem + var(--safe-b));
  z-index: 150;
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  width: max-content;
  max-width: calc(100vw - 2rem);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  min-height: 3rem;
  padding: 0 0.6rem 0 1.25rem;
  border-radius: 999px;
  background: rgba(14, 21, 17, 0.92);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 0 0 1px var(--edge), 0 18px 40px -12px rgba(0, 0, 0, 0.6);
  color: var(--ivory);
  font-size: 0.92rem;
  pointer-events: auto;
  animation: toast-in 0.45s var(--spring);
}
.toast.plain { padding-inline-end: 1.25rem; }
.toast.out { animation: toast-out 0.3s var(--ease) forwards; }
.toast button {
  min-height: 2.3rem;
  padding: 0 0.9rem;
  border-radius: 999px;
  color: var(--gilt);
  font-weight: 650;
}
.toast button:hover { background: var(--gilt-soft); }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(0.98); } }

.column { min-width: 0; }
.shell.read-only .shortcuts { display: none; }
.shortcuts {
  max-width: var(--read);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 4rem) calc(4.5rem + var(--safe-b));
  box-sizing: content-box;
  font-size: 0.74rem;
  color: rgba(246, 242, 232, 0.32);
  letter-spacing: 0.02em;
}

/* ---------- view transitions ---------- */

@view-transition { navigation: none; }
::view-transition-old(root) { animation: vt-out 0.18s var(--ease) both; }
::view-transition-new(root) { animation: vt-in 0.36s var(--ease-out) both; }
::view-transition-group(list-title) { animation-duration: 0.42s; animation-timing-function: var(--ease-out); }
@keyframes vt-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
.rail { view-transition-name: rail; }
::view-transition-old(rail), ::view-transition-new(rail) { animation: none; }

/* ---------- narrow screens: index ⇄ page ---------- */

@media (max-width: 860px) {
  .shell { display: block; }
  .rail {
    position: static;
    height: auto;
    min-height: 100dvh;
    padding: max(1rem, env(safe-area-inset-top)) 1.25rem calc(1.5rem + var(--safe-b));
    border-right: 0;
    background: none;
    view-transition-name: none;
  }
  .shell.on-page .rail { display: none; }
  .shell.on-index .main { display: none; }
  .brand { padding: 0.4rem 0 0; }
  .nav { margin: 0; padding: 0; overflow: visible; }
  .nav-link { min-height: 3.35rem; padding: 0 0.2rem; font-size: 1.08rem; border-radius: 0; border-bottom: 1px solid var(--edge); }
  .nav-link:hover { background: none; }
  .nav-link .count { font-size: 0.9rem; }
  .nav-head { margin: 2rem 0.2rem 0.4rem; }
  .index-hello { padding: 2rem 0.2rem 1.6rem; }
  .index-hello .kicker { margin-bottom: 0.55rem; }
  .rail-foot { margin-top: 2rem; border-top: 0; }
  .me { padding: 0 0.2rem; border-radius: 0; min-height: 3.35rem; border-bottom: 1px solid var(--edge); }
  .rail-foot .text-btn { padding: 0 0.2rem; }
  .nav-today { display: none; }

  .main { padding: 0 1.25rem calc(6rem + var(--safe-b)); }
  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 -1.25rem;
    padding: max(0.4rem, env(safe-area-inset-top)) 0.4rem 0.4rem;
    background: linear-gradient(180deg, rgba(31, 46, 38, 0.96) 60%, rgba(31, 46, 38, 0));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  .mobile-bar .back {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    min-height: 2.75rem;
    padding: 0 0.7rem 0 0.35rem;
    color: var(--gilt);
    font-size: 1rem;
  }
  .mobile-bar .back svg { width: 1.2rem; height: 1.2rem; }
  .page-head { padding-top: 0.6rem; }
  .shortcuts { display: none; }

  dialog.drawer {
    inset: auto 0 0 0;
    width: 100vw;
    height: auto;
    max-height: 92dvh;
    border-left: 0;
    border-top: 1px solid var(--edge);
    border-radius: 22px 22px 0 0;
    transform: translateY(100%);
    box-shadow: 0 -20px 60px -10px rgba(0, 0, 0, 0.6);
  }
  @starting-style { dialog.drawer[open] { transform: translateY(100%); } }
  .drawer-in { height: auto; max-height: 92dvh; }
  .drawer-top { position: relative; padding-top: 1.1rem; }
  .drawer-top .grab {
    display: block;
    position: absolute;
    top: 0.5rem; left: 50%;
    width: 2.4rem; height: 0.3rem;
    border-radius: 999px;
    background: rgba(246, 242, 232, 0.2);
    transform: translateX(-50%);
  }
  .fact { grid-template-columns: 5.2rem minmax(0, 1fr); }
}

@media (min-width: 861px) {
  .index-hello, .index-today { display: none; }
}

@media (min-width: 861px) and (hover: hover) {
  .main { padding-bottom: 2.5rem; }
}

@media (hover: none) {
  .row-body:hover, .nav-link:hover, .me:hover { background: none; }
  .shortcuts { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .owl .lid { display: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

@media (forced-colors: active) {
  .tick .ring { stroke: CanvasText; }
  .row.done .tick .ring { fill: Highlight; stroke: Highlight; }
  .pill { border: 1px solid ButtonText; }
}
