/* The look of the app. Fonts and tokens first, then the shell, then each component.
   Newer pieces (sign-in, settings, speech check) are in app.css. */

/* Fonts. The files are in /fonts and are served by the app itself, so nothing is
   loaded from another website. Switzer is for everything the app says, Kalam for
   everything "handwritten". To change a font: put the new .woff2 files in
   public/fonts, point these rules at them, and change the two --font names below.
   Give a changed file a new name, because phones keep font files for a year. */
@font-face { font-family: 'Switzer'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/switzer-400.woff2') format('woff2'); }
@font-face { font-family: 'Switzer'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/switzer-500.woff2') format('woff2'); }
@font-face { font-family: 'Switzer'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/switzer-600.woff2') format('woff2'); }
@font-face { font-family: 'Switzer'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/switzer-700.woff2') format('woff2'); }
@font-face { font-family: 'Kalam'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/kalam-400.woff2') format('woff2'); }
@font-face { font-family: 'Kalam'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/kalam-700.woff2') format('woff2'); }

:root {
  /* Type */
  --font-body: 'Switzer', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-hand: 'Kalam', 'Bradley Hand', cursive;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;

  /* Space, 4px grid */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Desk: the dark ground everything sits on */
  --desk-deep: oklch(0.16 0.005 85);
  --desk: oklch(0.215 0.006 85);
  --desk-raised: oklch(0.275 0.006 85);
  --desk-line: oklch(0.4 0.006 85);
  --black: oklch(0.115 0.003 85);
  --on-desk: oklch(0.955 0.004 95);
  --on-desk-soft: oklch(0.76 0.006 90);

  /* Paper: every reading surface */
  --paper: oklch(0.958 0.003 95);
  --paper-strip: oklch(0.905 0.004 95);
  --paper-line: oklch(0.855 0.004 95);
  --ink: oklch(0.2 0.012 265);
  --ink-soft: oklch(0.43 0.012 265);

  /* Pens and the one marker */
  --pen: oklch(0.49 0.2 262);
  --pen-on-desk: oklch(0.78 0.11 258);
  --marker: oklch(0.86 0.155 92);
  --marker-deep: oklch(0.79 0.155 88);
  --redpen: oklch(0.51 0.19 24);
  --redpen-on-desk: oklch(0.74 0.15 24);

  --color-bg: var(--desk-deep);
  --color-text: var(--on-desk);
  --color-primary: var(--pen-on-desk);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 22px;
  --radius-full: 999px;

  --shadow-card: 0 1px 1px oklch(0 0 0 / 0.28), 0 10px 20px -10px oklch(0 0 0 / 0.6);
  --shadow-lift: 0 2px 2px oklch(0 0 0 / 0.3), 0 22px 36px -14px oklch(0 0 0 / 0.7);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-interactive: 160ms var(--ease);
}

html,
body {
  height: 100%;
}
body {
  overflow: hidden;
  line-height: 1.45;
  font-feature-settings: 'ss01', 'cv11';
}
.ic {
  width: 18px;
  height: 18px;
  flex: none;
}
kbd {
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--desk-raised);
  color: var(--on-desk);
}
.noscript {
  position: fixed;
  inset: auto 0 0 0;
  padding: var(--space-4);
  text-align: center;
  background: var(--black);
}
.metaline {
  display: block;
  overflow: hidden;
}
.metaline__in {
  display: flex;
  flex-wrap: wrap;
  margin-left: -12px;
}
.metaline__in > span {
  position: relative;
  padding-left: 12px;
  white-space: nowrap;
}
.metaline__in > span::before {
  content: '\00b7';
  position: absolute;
  left: 0;
  width: 12px;
  text-align: center;
  color: var(--ink-soft);
}
.hand {
  font-family: var(--font-hand);
  font-size: 1.125rem;
  line-height: 1.2;
  color: var(--pen);
}

/* ---------- Stage: phone on a desk for wide screens ---------- */
.stage {
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(2rem, 5vw, 5rem);
  padding: var(--space-4) var(--space-8);
}
.side {
  max-width: 19rem;
}
.side--left {
  justify-self: end;
}
.side--right {
  justify-self: start;
  width: 100%;
}
.brand {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.promise {
  margin-top: var(--space-3);
  font-size: var(--text-lg);
  line-height: 1.3;
  font-weight: 500;
  color: var(--on-desk);
}
.loop {
  margin-top: var(--space-8);
  list-style: none;
  counter-reset: loop;
  display: grid;
  gap: var(--space-4);
}
.loop li {
  counter-increment: loop;
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  column-gap: var(--space-2);
}
.loop li::before {
  content: counter(loop);
  grid-row: span 2;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--pen-on-desk);
}
.loop strong {
  font-weight: 600;
}
.loop span {
  color: var(--on-desk-soft);
  font-size: var(--text-sm);
}
.side__title {
  font-size: var(--text-md);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.phone {
  width: 420px;
  height: min(880px, calc(100dvh - 32px));
  border-radius: 50px;
  background: #000;
  padding: 10px;
  box-shadow: 0 2px 0 oklch(0.3 0.005 85) inset, 0 40px 70px -30px oklch(0 0 0 / 0.8);
}
.app {
  position: relative;
  height: 100%;
  border-radius: 40px;
  overflow: hidden;
  background: var(--desk);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  isolation: isolate;
}

@media (max-width: 1079px) {
  .side {
    display: none;
  }
  .stage {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: var(--space-4);
  }
}
@media (max-width: 519px) {
  .stage {
    padding: 0;
  }
  .phone {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }
  .app {
    border-radius: 0;
  }
}

/* ---------- Notch: the black tab that names the screen ---------- */
.notch {
  justify-self: center;
  width: min(100% - 116px, 21rem);
  background: var(--black);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 18px 12px;
  text-align: center;
  position: relative;
  z-index: 5;
  box-shadow: 0 8px 16px -8px oklch(0 0 0 / 0.7);
}
.notch h1 {
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.notch__meta {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  align-items: center;
  margin: 3px auto 0;
  font-size: var(--text-xs);
  color: var(--on-desk-soft);
  font-variant-numeric: tabular-nums;
}
.notch__meta .late {
  color: var(--redpen-on-desk);
}
.pips {
  display: inline-flex;
  gap: 4px;
}
.pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--on-desk-soft);
}
.pip.is-on {
  background: var(--on-desk);
  border-color: var(--on-desk);
}

/* ---------- Screen ---------- */
.screen {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: var(--space-4) var(--space-4) 3.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--desk-line) transparent;
  outline: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 16px);
}
.section-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--on-desk-soft);
  margin: var(--space-6) var(--space-1) var(--space-2);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: var(--space-6) var(--space-1) var(--space-2);
}
.section-head .section-title {
  margin: 0;
}
.link {
  color: var(--pen-on-desk);
  font-size: var(--text-sm);
  font-weight: 500;
  min-height: 44px;
  min-width: 44px;
  margin: -14px 0;
  padding: 0 var(--space-1);
  text-align: right;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  border-radius: 12px;
  font-size: var(--text-base);
  font-weight: 600;
  white-space: nowrap;
}
.btn:active {
  transform: translateY(1px);
}
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn--primary {
  background: var(--paper);
  color: var(--ink);
}
@media (hover: hover) {
  .btn--primary:hover {
    background: oklch(1 0 0);
  }
}
.btn--quiet {
  background: var(--desk-raised);
  color: var(--on-desk);
}
@media (hover: hover) {
  .btn--quiet:hover {
    background: oklch(0.33 0.006 85);
  }
}
.btn--paper {
  background: var(--paper-strip);
  color: var(--ink);
  font-size: var(--text-sm);
  padding: 0 var(--space-3);
}
@media (hover: hover) {
  .btn--paper:hover {
    background: var(--paper-line);
  }
}
.icon-btn {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--ink-soft);
}
@media (hover: hover) {
  .icon-btn:hover {
    background: var(--paper-strip);
    color: var(--ink);
  }
}
.icon-btn:active {
  transform: scale(0.94);
}
.icon-btn--desk {
  color: var(--on-desk-soft);
}
@media (hover: hover) {
  .icon-btn--desk:hover {
    background: var(--desk-raised);
    color: var(--on-desk);
  }
}

/* ---------- Chips and pills ---------- */
.chips {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  margin: 0 calc(var(--space-4) * -1) var(--space-3);
  padding: 4px var(--space-4);
  scrollbar-width: none;
}
.chips::-webkit-scrollbar {
  display: none;
}
.chip,
.pill {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  min-width: 44px;
  justify-content: center;
  padding: 0 14px;
  border-radius: var(--radius-full);
  background: var(--desk-raised);
  color: var(--on-desk-soft);
  font-size: var(--text-sm);
  font-weight: 500;
}
.chip::after,
.pill::after {
  content: '';
  position: absolute;
  inset: -4px 0;
}
@media (hover: hover) {
  .chip:hover,
  .pill:hover {
    color: var(--on-desk);
  }
}
.chip[aria-pressed='true'] {
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
}
.chip small {
  font-size: var(--text-xs);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.pill {
  color: var(--on-desk);
}
.pill .ic {
  width: 15px;
  height: 15px;
  color: var(--on-desk-soft);
}
.pill .late {
  color: var(--redpen-on-desk);
}
.brief {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

/* ---------- Paper cards ---------- */
.card {
  --color-primary: var(--pen);
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transform: rotate(var(--tilt, 0deg));
}
.card__strip {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 7px 14px;
  background: var(--paper-strip);
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: 500;
  overflow: hidden;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.tag .ic {
  width: 14px;
  height: 14px;
}
.tag--end {
  margin-left: auto;
}
.card__body {
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: var(--space-3);
  align-items: center;
  padding: 12px 8px 2px 12px;
}
.card__num {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 46px;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 2.5rem;
  line-height: 1;
  padding-top: 6px;
  color: var(--pen);
}
.ink-circle {
  position: absolute;
  inset: -4px -5px -4px -5px;
  width: calc(100% + 10px);
  height: calc(100% + 8px);
  max-width: none;
  overflow: visible;
}
.ink-circle path,
.ink-arrow path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ink-circle path {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.fx-circle .ink-circle path {
  animation: draw 560ms var(--ease) 140ms both;
}
@keyframes draw {
  from {
    stroke-dashoffset: 1;
  }
}
.card__main {
  text-align: left;
  min-height: 48px;
  padding: 4px 0;
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
}
.card__title {
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.006em;
}
.strike {
  background: linear-gradient(var(--pen), var(--pen)) no-repeat 0 56% / 0 2px;
}
.is-done .strike {
  background-size: 100% 2px;
  color: var(--ink-soft);
}
.fx-strike .strike {
  animation: strike 460ms var(--ease) both;
}
@keyframes strike {
  from {
    background-size: 0 2px;
    color: var(--ink);
  }
}
.check {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.check__box {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  color: transparent;
  transition: background 160ms var(--ease), border-color 160ms var(--ease), transform 200ms var(--ease);
}
.check__box .ic {
  width: 16px;
  height: 16px;
  stroke-width: 3;
}
@media (hover: hover) {
  .check:hover .check__box {
    background: oklch(from var(--pen) l c h / 0.12);
  }
}
.check:active .check__box {
  transform: scale(0.88);
}
.check[aria-checked='true'] .check__box {
  background: var(--pen);
  border-color: var(--pen);
  color: var(--paper);
}
.card__plan {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 2px 14px 12px 18px;
  min-height: 38px;
}
.ink-arrow {
  width: 38px;
  height: 22px;
  flex: none;
  color: var(--pen);
  margin-bottom: 4px;
}
.hand--btn {
  min-height: 44px;
  margin: -10px 0;
  text-decoration: underline dashed;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.card.is-done {
  box-shadow: none;
  background: oklch(0.87 0.004 95);
}
.card.is-done .card__strip {
  background: oklch(0.83 0.004 95);
}
.card.is-done .card__num,
.card.is-done .card__plan .hand,
.card.is-done .ink-arrow {
  color: var(--ink-soft);
}

/* Today */
.slots {
  display: grid;
  gap: 14px;
}
.slot {
  max-width: none;
}
.slot-empty {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: var(--space-3);
  padding: 12px 12px 12px 14px;
  border: 1.5px dashed var(--desk-line);
  border-radius: var(--radius-lg);
}
.card__num--ghost {
  color: var(--desk-line);
  padding-top: 6px;
}
.slot-empty strong {
  display: block;
  font-weight: 600;
}
.slot-empty div span {
  color: var(--on-desk-soft);
  font-size: var(--text-sm);
}
.picklist {
  display: grid;
  gap: 6px;
  margin-top: var(--space-2);
}
.pick {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: var(--space-3);
  text-align: left;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--desk-raised);
  color: var(--on-desk);
  font-weight: 500;
  line-height: 1.3;
}
.pick small {
  grid-column: 1;
  color: var(--on-desk-soft);
  font-size: var(--text-xs);
  font-weight: 400;
}
.pick .ic,
.pick .tick {
  grid-column: 2;
  grid-row: 1 / span 2;
}
@media (hover: hover) {
  .pick:hover {
    background: oklch(0.33 0.006 85);
  }
}
.pick:active {
  transform: translateY(1px);
}
.pick[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.pick--paper {
  background: var(--paper-strip);
  color: var(--ink);
}
.pick--paper small {
  color: var(--ink-soft);
}
@media (hover: hover) {
  .pick--paper:hover {
    background: var(--paper-line);
  }
}
.tick {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  color: transparent;
}
.tick .ic {
  width: 14px;
  height: 14px;
  stroke-width: 3;
  grid-column: auto;
  grid-row: auto;
}
[aria-checked='true'] .tick {
  background: var(--pen);
  border-color: var(--pen);
  color: var(--paper);
}
.alldone {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--desk-raised);
  display: grid;
  gap: var(--space-1);
}
.alldone .hand {
  color: var(--pen-on-desk);
  font-size: 1.5rem;
  font-weight: 700;
}
.alldone p:last-child {
  color: var(--on-desk-soft);
  font-size: var(--text-sm);
}
.tools {
  display: grid;
  /* Two across; stacks on screens too narrow for both labels (320px). */
  grid-template-columns: repeat(auto-fit, minmax(152px, 1fr));
  gap: 10px;
  margin-top: var(--space-4);
}

/* Paper list panels */
.pad {
  --color-primary: var(--pen);
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.pad + .pad {
  margin-top: 10px;
}
.row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 56px;
  padding: 6px 8px 6px 14px;
  max-width: none;
}
.row + .row {
  border-top: 1px solid var(--paper-line);
}
.row__text {
  flex: 1;
  min-width: 0;
}
.row__title {
  display: block;
  font-weight: 600;
  line-height: 1.3;
}
.row small {
  display: block;
  color: var(--ink-soft);
  font-size: var(--text-xs);
  line-height: 1.35;
}
.row small .late,
.late-hand {
  color: var(--redpen);
}
.late-hand {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: var(--text-md);
  white-space: nowrap;
}
button.row__text {
  text-align: left;
  min-height: 44px;
  border-radius: var(--radius-sm);
}
.stamp {
  padding: 0 var(--space-2);
  white-space: nowrap;
}
.card__state {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
}
.avatar {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--text-sm);
  font-weight: 600;
}
.avatar--sm {
  width: 22px;
  height: 22px;
  font-size: 0.6875rem;
}

/* ---------- Board ---------- */
.rail {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-bottom: var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--desk-raised);
  padding: 2px;
}
.rail__step {
  min-height: 48px;
  display: grid;
  align-content: center;
  justify-items: center;
  border-radius: 12px;
  color: var(--on-desk-soft);
  font-size: var(--text-xs);
  line-height: 1.25;
}
.rail__step b {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--on-desk);
  font-variant-numeric: tabular-nums;
}
@media (hover: hover) {
  .rail__step:hover {
    color: var(--on-desk);
  }
}
.rail__step[aria-current='true'] {
  background: var(--paper);
  color: var(--ink-soft);
}
.rail__step[aria-current='true'] b {
  color: var(--ink);
}
.lanes {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: var(--space-4);
  margin: 0 calc(var(--space-4) * -1);
  padding: 0 var(--space-4) var(--space-2);
  scrollbar-width: none;
}
.lanes::-webkit-scrollbar {
  display: none;
}
.lane {
  flex: 0 0 86%;
  scroll-snap-align: start;
  background: var(--desk-raised);
  border-radius: 16px;
  padding: 12px 10px 10px;
}
.lane__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0 6px 10px;
}
.lane__head h2 {
  font-size: var(--text-base);
  font-weight: 600;
}
.lane__count {
  font-size: var(--text-xs);
  color: var(--on-desk-soft);
  font-variant-numeric: tabular-nums;
}
.lane__count.hand {
  color: var(--pen-on-desk);
  font-size: var(--text-md);
}
.lane__list {
  display: grid;
  gap: var(--space-2);
}
.lane__empty {
  color: var(--on-desk-soft);
  font-size: var(--text-sm);
  padding: 10px 6px 6px;
}
.card--mini {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border-radius: 12px;
  box-shadow: 0 1px 2px oklch(0 0 0 / 0.35);
}
.card--mini .card__main {
  display: block;
  min-height: 56px;
  padding: 10px 2px 10px 12px;
}
.card--mini .card__title {
  display: block;
  font-size: var(--text-base);
}
.card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  margin-top: 4px;
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--ink-soft);
}
.card__meta .late {
  color: var(--redpen);
  font-weight: 600;
}
.card--mini.is-done {
  background: oklch(0.87 0.004 95);
}

/* ---------- Notes ---------- */
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-lg);
  background: var(--desk-raised);
  color: var(--on-desk-soft);
}
.search:focus-within {
  box-shadow: 0 0 0 2px var(--pen-on-desk);
}
.search input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  /* 16px stops iOS Safari from zooming the page when a field takes focus */
  font-size: 1rem;
  background: none;
  border: 0;
  outline: 0;
  color: var(--on-desk);
  caret-color: var(--pen-on-desk);
}
.search input::placeholder {
  color: var(--on-desk-soft);
  opacity: 1;
}
.notes {
  display: grid;
  gap: 10px;
}
.notes li {
  max-width: none;
}
.note {
  position: relative;
  padding: 12px 14px;
}
.note h2 {
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.3;
}
.note__open {
  text-align: left;
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.note__open::after {
  content: '';
  position: absolute;
  inset: 0;
}
@media (hover: hover) {
  .note:has(.note__open:hover) {
    background: oklch(1 0 0);
  }
}
.note__excerpt {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.note__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 8px;
  font-size: var(--text-xs);
  color: var(--ink-soft);
}

/* ---------- Off plate: the fanned deck ---------- */
.deck {
  position: relative;
  height: 232px;
  margin: 6px 0 var(--space-3);
}
.card--deck {
  position: absolute;
  inset: 0 8px auto 8px;
  height: 212px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  box-shadow: var(--shadow-lift);
  transition: transform 340ms var(--ease), opacity 220ms var(--ease);
}
.card--deck[data-pos='0'] {
  z-index: 3;
}
.card--deck[data-pos='1'] {
  z-index: 2;
  transform: translate(24px, 12px) rotate(5deg) scale(0.95);
}
.card--deck[data-pos='2'] {
  z-index: 1;
  transform: translate(-24px, 12px) rotate(-5deg) scale(0.95);
}
.card--deck.is-leaving {
  transform: translate(115%, -8px) rotate(14deg);
  opacity: 0;
}
.card--deck.is-leaving.is-kept {
  transform: translate(-115%, -8px) rotate(-14deg);
}
.deck__body {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: var(--space-2);
  align-items: start;
  padding: 14px 10px 0 16px;
}
.deck__body h2 {
  font-size: var(--text-md);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.006em;
}
.sketch {
  width: 122px;
  height: 74px;
  flex: none;
}
.sk-line {
  fill: none;
  stroke: var(--pen);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sk-fill {
  fill: oklch(from var(--pen) l c h / 0.1);
}
.sk-red {
  fill: none;
  stroke: var(--redpen);
  stroke-width: 2.2;
  stroke-linecap: round;
}
.sk-init {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 24px;
  fill: var(--ink);
}
.sk-label {
  font-family: var(--font-hand);
  font-size: 14px;
  fill: var(--pen);
}
.deck__out {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 0 16px 14px;
}
.deck__warn {
  color: var(--redpen-on-desk);
  font-size: var(--text-sm);
  margin: 0 var(--space-1) var(--space-2);
  display: flex;
  gap: 6px;
  align-items: center;
}
.deck__warn .ic {
  width: 15px;
  height: 15px;
}
.deck__actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
}
.deck__count {
  margin: var(--space-2) auto 0;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--on-desk-soft);
}
.deck-empty {
  padding: var(--space-5) var(--space-4);
  border: 1.5px dashed var(--desk-line);
  border-radius: var(--radius-lg);
}
.deck-empty .hand {
  color: var(--pen-on-desk);
  font-size: 1.5rem;
  font-weight: 700;
}
.deck-empty p + p {
  color: var(--on-desk-soft);
  font-size: var(--text-sm);
  margin-top: var(--space-1);
}
.person__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 14px;
  background: var(--paper-strip);
}
.person__head strong {
  font-weight: 600;
  line-height: 1.2;
  display: block;
}
.person__head span.role {
  display: block;
  font-size: var(--text-xs);
  color: var(--ink-soft);
}
.load {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.load i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1.5px var(--ink-soft);
}
.load i.is-on {
  background: var(--ink);
  box-shadow: none;
}
.load.is-full i.is-on {
  background: var(--redpen);
}
.load.is-full {
  color: var(--redpen);
  font-weight: 600;
}
.row--free {
  color: var(--ink-soft);
  font-size: var(--text-sm);
}

/* ---------- Dock and the hold-to-talk button ---------- */
.dock {
  position: relative;
  z-index: 30;
  background: var(--black);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr 92px 1fr 1fr;
  align-items: end;
  padding: 6px 8px calc(env(safe-area-inset-bottom, 0px) + 8px);
}
.tab {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  min-height: 52px;
  border-radius: 12px;
  color: var(--on-desk-soft);
  font-size: 0.71875rem;
  font-weight: 500;
  transition: opacity 160ms var(--ease), color var(--transition-interactive);
}
.tab .ic {
  width: 22px;
  height: 22px;
}
@media (hover: hover) {
  .tab:hover {
    color: var(--on-desk);
  }
}
.tab:active {
  transform: scale(0.96);
}
.tab[aria-current='page'] {
  color: var(--on-desk);
  font-weight: 600;
}
.tab[aria-current='page']::before {
  content: '';
  position: absolute;
  top: 0;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: var(--on-desk);
}
.tab__badge {
  position: absolute;
  top: 4px;
  left: calc(50% + 8px);
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ptt-wrap {
  display: grid;
  justify-items: center;
  gap: 4px;
}
.ptt {
  position: relative;
  width: 72px;
  height: 72px;
  margin-top: -32px;
  border-radius: 50%;
  background: var(--marker);
  color: var(--black);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 6px var(--black);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 220ms var(--ease), background 160ms var(--ease);
}
.ptt .ic {
  width: 30px;
  height: 30px;
  stroke-width: 2.2;
  pointer-events: none;
}
@media (hover: hover) {
  .ptt:hover {
    background: oklch(0.9 0.15 94);
  }
}
.ptt:active {
  transform: scale(0.96);
  background: var(--marker-deep);
}
.ptt:focus-visible {
  outline-color: var(--marker);
  outline-offset: 9px;
  border-radius: 50%;
}
.ptt__label {
  font-size: 0.71875rem;
  font-weight: 500;
  color: var(--on-desk-soft);
  line-height: 1.2;
  padding-bottom: 5px;
}
.is-recording .tab {
  opacity: 0.2;
  pointer-events: none;
}
.is-recording .ptt__label {
  visibility: hidden;
}
.is-recording .ptt {
  transform: scale(1.14);
}
.is-recording .ptt::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--marker);
  animation: ring 1300ms ease-out infinite;
}
.is-sorting .ptt {
  transform: none;
  background: var(--marker-deep);
}
.is-sorting .ptt::after {
  display: none;
}
@keyframes ring {
  from {
    transform: scale(1);
    opacity: 0.9;
  }
  to {
    transform: scale(1.55);
    opacity: 0;
  }
}

/* ---------- Capture overlay ---------- */
.capture {
  position: absolute;
  inset: 0;
  z-index: 25;
  background: var(--desk-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: calc(env(safe-area-inset-top, 0px) + 30px) var(--space-6) calc(env(safe-area-inset-bottom, 0px) + 136px);
  text-align: center;
  animation: fade-in 180ms ease-out;
}
.capture[hidden] {
  display: none;
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
.capture__status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--on-desk-soft);
}
.capture__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--marker);
}
@keyframes blink {
  to {
    opacity: 0.25;
  }
}
.capture__time {
  font-variant-numeric: tabular-nums;
  color: var(--on-desk);
}
.capture__text {
  flex: 1;
  display: flex;
  align-items: center;
  max-width: 30ch;
  font-size: var(--text-lg);
  font-weight: 500;
  line-height: 1.4;
  text-wrap: balance;
}
.capture__release {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--on-desk);
}
.capture__hints {
  display: flex;
  gap: var(--space-5);
}
.hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--on-desk-soft);
}
.hint .ic {
  width: 15px;
  height: 15px;
}
.capture__locked,
.capture__sorting {
  display: none;
}
.is-locked .capture__locked {
  display: flex;
  gap: 10px;
}
.is-locked .capture__hints,
.is-locked .capture__release,
.is-sorting .capture__hints,
.is-sorting .capture__release,
.is-sorting .wave,
.is-sorting .capture__locked,
.is-sorting .capture__dot {
  display: none;
}
.is-sorting .capture__sorting {
  display: grid;
  gap: var(--space-2);
  width: min(100%, 16rem);
}
.skel {
  height: 12px;
  border-radius: 6px;
  background: var(--desk-raised);
  animation: blink 700ms ease-in-out infinite alternate;
}
.skel:nth-child(2) {
  width: 80%;
  animation-delay: -200ms;
}
.skel:nth-child(3) {
  width: 55%;
  animation-delay: -400ms;
}
.wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 40px;
}
.wave span {
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: var(--marker);
  /* Each bar's height is set from the microphone's loudness (see capture.js). */
  transform: scaleY(0.1);
  transition: transform 90ms linear;
}

/* ---------- Notice ---------- */
.notice {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 116px);
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 48px;
  padding: 2px 4px 2px var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--black);
  color: var(--on-desk);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms var(--ease), transform 240ms var(--ease);
}
.notice.is-on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.notice__undo {
  min-height: 44px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  color: var(--pen-on-desk);
  font-weight: 600;
}
@media (hover: hover) {
  .notice__undo:hover {
    background: var(--desk-raised);
  }
}

/* ---------- Sheets ---------- */
.sheet-layer {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: end;
}
.sheet-layer[hidden] {
  display: none;
}
.scrim {
  position: absolute;
  inset: 0;
  background: oklch(0.1 0 0 / 0.6);
  animation: fade-in 200ms ease-out;
}
.sheet {
  --color-primary: var(--pen);
  position: relative;
  max-height: 88%;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--paper);
  color: var(--ink);
  border-radius: 24px 24px 0 0;
  padding: 10px 18px calc(env(safe-area-inset-bottom, 0px) + 20px);
  scrollbar-width: thin;
  scrollbar-color: var(--paper-line) transparent;
  animation: sheet-in 300ms var(--ease);
}
@keyframes sheet-in {
  from {
    transform: translateY(40%);
    opacity: 0;
  }
}
.sheet__grip {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--paper-line);
  margin: 0 auto 14px;
}
.sheet__x {
  position: absolute;
  top: 12px;
  right: 10px;
}
.sheet h2 {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.22;
  padding-right: 44px;
  outline: none;
}
.sheet__sub {
  margin-top: var(--space-1);
  color: var(--ink-soft);
}
.sheet__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--ink-soft);
}
.sheet__plan {
  margin-top: var(--space-3);
  font-size: 1.25rem;
}
.sheet__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: var(--space-6) 0 var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-soft);
}
.sheet__label .count {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.sheet__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: var(--space-5);
}
.sheet__actions .btn {
  flex: 1 1 8rem;
}
.sheet .btn--primary {
  background: var(--ink);
  color: var(--paper);
}
@media (hover: hover) {
  .sheet .btn--primary:hover {
    background: oklch(0.28 0.02 265);
  }
}
.sheet .btn--quiet {
  background: var(--paper-strip);
  color: var(--ink);
}
@media (hover: hover) {
  .sheet .btn--quiet:hover {
    background: var(--paper-line);
  }
}
.btn--text {
  margin-top: var(--space-3);
  padding: 0 var(--space-2);
  color: var(--redpen);
  font-size: var(--text-sm);
}
@media (hover: hover) {
  .btn--text:hover {
    background: oklch(from var(--redpen) l c h / 0.1);
  }
}
.fine {
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--ink-soft);
}
.plain {
  list-style: none;
  display: grid;
  gap: 6px;
}
.plain li {
  max-width: none;
}
.seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: var(--paper-strip);
}
.seg__btn {
  position: relative;
  flex: 1;
  min-height: 38px;
  padding: 0 6px;
  border-radius: 9px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
}
.seg__btn::after {
  content: '';
  position: absolute;
  inset: -3px 0;
}
@media (hover: hover) {
  .seg__btn:hover {
    color: var(--ink);
  }
}
.seg__btn[aria-pressed='true'] {
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px oklch(0 0 0 / 0.2);
}
.who {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.chip--paper {
  background: var(--paper-strip);
  color: var(--ink-soft);
}
@media (hover: hover) {
  .chip--paper:hover {
    color: var(--ink);
  }
}
.chip--paper[aria-pressed='true'] {
  background: var(--ink);
  color: var(--paper);
}
.warn {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  margin-top: var(--space-3);
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--paper-strip);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.4;
}
.warn .ic {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--redpen);
}
.warn--block {
  display: block;
}
.warn--block p {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.warn--block .pick--paper {
  background: var(--paper);
}
.field {
  display: grid;
  gap: 6px;
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-soft);
}
.field textarea {
  width: 100%;
  min-height: 7.5rem;
  resize: vertical;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--paper-line);
  background: oklch(1 0 0);
  color: var(--ink);
  /* 16px stops iOS Safari from zooming the page when a field takes focus */
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.45;
  caret-color: var(--pen);
}
.field textarea:focus-visible {
  outline: none;
  border-color: var(--pen);
  box-shadow: 0 0 0 3px oklch(from var(--pen) l c h / 0.2);
}
.field textarea::placeholder {
  color: var(--ink-soft);
  opacity: 1;
}

/* Sorted result */
.heard {
  margin-top: var(--space-2);
  line-height: 1.5;
  color: var(--ink);
}
.heard__label {
  font-family: var(--font-hand);
  font-size: var(--text-md);
  color: var(--pen);
  margin-right: 4px;
}
.sorted {
  display: grid;
  gap: 10px;
  margin-top: var(--space-4);
}
.sorted__item {
  max-width: none;
  padding: 10px 10px 12px 12px;
  border-radius: var(--radius-lg);
  background: oklch(1 0 0);
  box-shadow: 0 1px 2px oklch(0 0 0 / 0.14);
}
.sorted__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: 10px;
  align-items: start;
  margin-bottom: var(--space-2);
}
.sorted__head > .ic {
  margin-top: 3px;
  color: var(--pen);
}
.sorted__dest {
  font-size: var(--text-xs);
  color: var(--ink-soft);
  margin-top: 2px;
}
.sorted__head .icon-btn {
  margin: -8px -6px -8px 0;
}

/* Close the day */
.doneline {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  color: var(--ink-soft);
}
.doneline .ic {
  width: 16px;
  height: 16px;
  color: var(--pen);
  stroke-width: 3;
}
.doneline span {
  text-decoration: line-through;
  text-decoration-color: var(--pen);
  text-decoration-thickness: 2px;
}
.carry {
  display: grid;
  gap: 6px;
  padding: 10px 0;
  font-weight: 600;
  line-height: 1.3;
}
.carry + .carry {
  border-top: 1px solid var(--paper-line);
}
.closed__hand {
  margin-top: var(--space-3);
  font-size: 1.5rem;
  font-weight: 700;
}
.closed__list {
  margin: var(--space-3) 0 0 1.4rem;
  display: grid;
  gap: 6px;
  font-weight: 600;
}
.closed__list li::marker {
  font-family: var(--font-hand);
  color: var(--pen);
  font-size: 1.125rem;
}
.note-body {
  margin-top: var(--space-3);
  line-height: 1.55;
}

/* ---------- Focus ---------- */
.focus {
  position: absolute;
  inset: 0;
  z-index: 45;
  background: var(--desk);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  padding: var(--space-6);
  animation: fade-in 220ms ease-out;
}
.focus[hidden] {
  display: none;
}
.focus__close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  right: 14px;
}
.focus__hand {
  color: var(--pen-on-desk);
  font-size: 1.5rem;
}
.focus__card {
  width: 100%;
}
.focus__body {
  padding: var(--space-5) var(--space-4);
  display: grid;
  gap: var(--space-2);
}
.focus__body h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.18;
}
.focus__time {
  font-size: 3.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.focus__actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  width: 100%;
}
