/* Home: the full-size Halo, the title row and the work cards. Tokens only. See DESIGN-NOTES.md. */

.halo.full {
  --halo-full: 82px;
  --p: 0;
  height: auto;
  align-items: stretch;
}
.halo.full .halo-rule { height: calc(48px - 24px * var(--p)); margin-top: calc(8px + 2px * var(--p)); opacity: calc(1 - 0.4 * var(--p)); }
.halo.full .halo-clients {
  flex: none;
  align-items: flex-start;
  height: calc(var(--halo-full) - 34px * var(--p));
  overflow-y: hidden;
}
/* One person or client: 48->36 px ring; parallel scroll-linked width/spacing (--e) & threshold label reveal/hide */
.who {
  --q: clamp(0, calc(var(--p) * 1.15 - var(--i, 0) * 0.025), 1);
  --e: calc(var(--q) * var(--q) * (3 - 2 * var(--q)));
  position: relative; flex: none; width: calc(68px - 20px * var(--e, 0)); height: calc(var(--halo-full) - 34px * var(--p)); padding: 6px 0 0;
  display: flex; flex-direction: column; align-items: center; gap: calc(3px * (1 - var(--e, 0)));
  background: none; border: 0; font-size: 11.5px; font-weight: 700; line-height: 1.25;
}
.who .ring {
  width: calc(48px - 12px * var(--e)); height: calc(48px - 12px * var(--e)); flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--hba-surface-page); border: var(--hba-border-thick) solid var(--hba-line-control);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  font-weight: var(--hba-font-weight-bold); font-size: calc(var(--hba-type-size-body) - 2px * var(--e));
}
/* Threshold-triggered staggered reveal/hide for each circle heading (Follow-Through & Overlapping Action) */
.who .label {
  max-width: 68px; height: 16px; opacity: 1;
  transform: translateY(0) scale(1);
  transform-origin: top center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition:
    opacity 260ms cubic-bezier(0.22, 1, 0.36, 1) calc(min(var(--i, 0), 8) * 18ms),
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1) calc(min(var(--i, 0), 8) * 18ms),
    height 260ms cubic-bezier(0.22, 1, 0.36, 1) calc(min(var(--i, 0), 8) * 18ms);
}
.sc-halo.labels-hidden .who .label {
  height: 0;
  opacity: 0;
  transform: translateY(-6px) scale(0.86);
  transition:
    opacity 160ms cubic-bezier(0.4, 0, 1, 1) calc(min(var(--i, 0), 8) * 14ms),
    transform 180ms cubic-bezier(0.4, 0, 1, 1) calc(min(var(--i, 0), 8) * 14ms),
    height 220ms cubic-bezier(0.22, 1, 0.36, 1) calc(min(var(--i, 0), 8) * 14ms);
}
.who.me .ring { background: var(--hba-brand-surface); color: var(--hba-brand-on-surface); border-color: var(--hba-brand-surface); }
.who.due .ring { border: 3px solid var(--hba-status-warning); }
.who.new .ring { border-style: dashed; border-color: var(--hba-status-info); color: var(--hba-status-info); }
.who.on .ring { background: var(--hba-surface-selected); border-color: var(--hba-action-primary); box-shadow: 0 0 0 calc(3px - 1px * var(--e)) var(--hba-action-primary); }
.who.due.on .ring { border-color: var(--hba-status-warning); }
.who.on .label { font-weight: var(--hba-font-weight-bold); }
.who.hiding .ring { background: var(--hba-text-primary); border-color: var(--hba-text-primary); color: var(--hba-surface-page); }
/* Due: a "!" mark as well as the thicker ring, and it stays when the ring is chosen */
.who .due-mark {
  position: absolute; top: calc(40px - 14px * var(--e)); inset-inline-start: calc(6px - 4px * var(--e)); transform: scale(calc(1 - 0.12 * var(--e))); width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--hba-status-warning); color: var(--hba-surface-page); box-shadow: 0 0 0 2px var(--hba-surface-page);
}
.who .due-mark svg { width: 14px; height: 14px; stroke-width: 3; }
.halo-hint { align-self: center; padding: 0 var(--hba-space-2); font-size: var(--hba-type-size-small); color: var(--hba-text-muted); opacity: calc(1 - 2 * var(--p)); }
.halo.bare .halo-rule { display: none; }
/* The frost behind the Halo arrives as the list slides under it; at rest there is nothing beneath to frost */
.home .halo.full::before { opacity: calc(0.35 + 0.65 * var(--p)); }

/* Small timed moves, only at the two ends and on touch. None of them runs when the phone asks for less motion. */
@media (prefers-reduced-motion: no-preference) {
  .who .ring { transition: box-shadow var(--hba-duration-fast), background-color var(--hba-duration-fast), transform var(--hba-duration-fast); }
  .who:active .ring { transform: scale(0.94); }
  /* Back at full size: the rings ease out by a hair, one after another */
  .halo.full.breathe .who .ring { animation: halo-breathe 260ms ease-out both; animation-delay: calc(var(--i, 0) * 20ms); }
}
@keyframes halo-breathe { from { transform: scale(0.95); } to { transform: scale(1); } }

/* ---------- Title row: what this list is and how many, and whose it is. One height in every state ---------- */
.home-top { min-height: 52px; padding: var(--hba-space-1) var(--shell-gutter); display: flex; align-items: center; gap: var(--hba-space-2); }
.home-top h1 { flex: 1; min-width: 0; margin: 0; font-size: var(--hba-type-size-h3); line-height: var(--hba-type-leading-heading); font-weight: var(--hba-font-weight-bold); }

/* ---------- Segmented switch: two choices, one is on ---------- */
.seg { flex: none; display: flex; border-radius: 23px; background: var(--hba-surface-alt); border: var(--hba-border-thin) solid var(--hba-line-decorative); }
.seg button { min-width: 52px; height: var(--hba-size-touch); padding: 0 var(--hba-space-3); border: 0; border-radius: 22px; background: none; font-size: var(--hba-type-size-small); color: var(--hba-text-muted); }
.seg button[aria-pressed="true"] { background: var(--hba-action-primary); color: var(--hba-action-on-primary); font-weight: var(--hba-font-weight-bold); }

/* ---------- Group heading: bold, plain, no note beside it. Only "Due now" carries an icon, a clock ---------- */
.group { display: flex; align-items: center; gap: var(--hba-space-2); margin: var(--hba-space-3) 0 0; padding-bottom: var(--hba-space-1); font-size: var(--hba-type-size-small); font-weight: var(--hba-font-weight-bold); }
.group h2 { margin: 0; font: inherit; }
.group.due { color: var(--hba-status-warning); }
/* The count beside a stage name: plain and quiet, never a badge */
.group .n { margin-inline-start: var(--hba-space-1); font-weight: var(--hba-font-weight-regular, 400); color: var(--hba-text-muted); }
.group.due .n { color: inherit; }
/* A stage held by other people: its heading is a button that opens the stage in place */
.group.fold-h { padding-bottom: 0; }
.group.fold-h h2 { flex: 1; }
.stage-btn {
  display: flex; align-items: center; justify-content: space-between; gap: var(--hba-space-2);
  width: 100%; min-height: 44px; padding: 0; background: none; border: 0; font: inherit; color: inherit; text-align: start; cursor: pointer;
}
.stage-btn .icon { color: var(--hba-text-muted); transition: transform var(--motion-fast, 120ms) var(--ease-move, ease); }
.stage-btn[aria-expanded="true"] .icon { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .stage-btn .icon { transition: none; } }

/* ---------- Work card: two lines. Tap opens it; nothing else ----------
   Line 1: client and project at full width, 16 px bold. If it is too long the client shortens; the project is never cut.
   Line 2, 14 px: the deadline first if there is one (clock, words and colour together), then the step or what
   was asked, with the price at the right. Near-black for everything a person acts on.
   Three text levels on Home: 20 bold (title), 16 bold (line 1), 14 (headings, line 2, quiet lines). */
.card {
  width: 100%; min-height: 52px; padding: var(--hba-space-2) 0; background: none; border: 0; text-align: start;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--hba-space-2); align-items: center;
  border-top: var(--hba-border-thin) solid var(--hba-line-decorative);
}
.card:active { background: var(--hba-surface-alt); }
.card .body { display: grid; min-width: 0; }
.card .l1 { display: flex; min-width: 0; font-weight: var(--hba-font-weight-bold); line-height: 1.3; white-space: nowrap; }
.card .cl { flex: 0 1 auto; min-width: 2ch; overflow: hidden; text-overflow: ellipsis; }
.card .pj { flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.card .l2 { display: flex; align-items: center; gap: var(--hba-space-2); min-width: 0; font-size: var(--hba-type-size-small); line-height: 1.45; }
.card .say { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .when { flex: none; white-space: nowrap; }
.card .when.soon { display: inline-flex; align-items: center; gap: var(--hba-space-1); color: var(--hba-status-warning); font-weight: var(--hba-font-weight-bold); }
.card .price { flex: none; font-weight: var(--hba-font-weight-bold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.card .by { flex: none; align-self: center; display: inline-grid; place-items: center; min-width: 24px; height: 20px; margin-inline-start: auto; font-size: var(--hba-type-size-small); padding: 0 var(--hba-space-1); border-radius: 10px; background: var(--hba-surface-alt); border: var(--hba-border-thin) solid var(--hba-line-decorative); font-weight: var(--hba-font-weight-bold); }
/* Whose it is sits after the name on line 1; the client shortens to make room, the project is never cut.
   A step that does not fit is never cut: it wraps, and with a deadline beside it takes a line of its own. */
.card.long .say, .card.due .l2 + .l2 .say { white-space: normal; overflow: visible; }
.card.long.dl .l2 { flex-wrap: wrap; row-gap: 0; }
.card.long.dl .price { margin-inline-start: auto; }
.card.long.dl .say { order: 2; flex: 0 0 100%; }
.card .chev { color: var(--hba-text-muted); display: grid; place-items: center; }
/* The one heavy card: something due. A bar down its side, as well as the clock and the words */
.card.due { padding-inline-start: var(--hba-space-3); border-inline-start: 4px solid var(--hba-status-warning); background: var(--hba-status-warning-soft); border-radius: 0 var(--hba-radius-control) var(--hba-radius-control) 0; border-top-color: transparent; margin-top: var(--hba-space-1); }
.card.due .chev { padding-inline-end: var(--hba-space-2); }

/* ---------- Quiet line: worth knowing, nothing to do ---------- */
.quiet {
  width: 100%; min-height: var(--hba-size-touch); padding: var(--hba-space-2) 0; background: none; border: 0; text-align: start;
  display: flex; align-items: center; gap: var(--hba-space-2); font-size: var(--hba-type-size-small); color: var(--hba-text-muted);
  border-top: var(--hba-border-thin) solid var(--hba-line-decorative);
}
.quiet span { flex: 1; }
.fold { color: var(--hba-action-link); font-weight: var(--hba-font-weight-bold); }
.end { padding: var(--hba-space-3) 0 var(--hba-space-4); font-size: var(--hba-type-size-small); color: var(--hba-text-muted); border-top: var(--hba-border-thin) solid var(--hba-line-decorative); }

/* Home has no fact line in the footer, so the footer is shorter and one more card shows,
   while preserving the progressive bottom frosted scrim so scrolled cards never peek behind '+'. */
.home { --foot-h: 93px; }
.empty .fact { color: var(--hba-text-primary); }

/* ---------- Filter bar: the list is showing one client ---------- */
.filterbar { display: flex; align-items: center; gap: var(--hba-space-2); min-height: var(--hba-size-touch); margin-bottom: var(--hba-space-1); font-size: var(--hba-type-size-small); }
.filterbar span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filterbar .add { display: inline-flex; align-items: center; gap: var(--hba-space-1); min-width: 0; padding: 0 var(--hba-space-3); }

/* Notice, empty state and first-load rows are shared: see feedback.css */

/* Names hidden: the Halo keeps only Me */
.halo.private .halo-rule { display: none; }

/* Test pages only: which build this is */
.build { padding: var(--hba-space-2) 0 var(--hba-space-4); font-size: var(--hba-type-size-small); color: var(--hba-text-muted); text-align: center; }

/* Test pages only, with ?speed=1: how fast the list is moving and how far the Halo has folded */
.speed-readout { position: fixed; z-index: 30; top: 96px; right: 8px; padding: var(--hba-space-1) var(--hba-space-2); border-radius: var(--hba-radius-control); background: var(--hba-text-primary); color: var(--hba-surface-page); font-size: var(--hba-type-size-small); font-variant-numeric: tabular-nums; pointer-events: none; }

/* ---------- The + panel ----------
   Owner, 2026-11-13: + grows into a panel while the bar and Search leave the screen. Spec: MOTION.md M5, M6.
   The panel is drawn at its full size over + and clipped to +'s circle (clip-path); opening un-clips it, so it
   grows upward and across from where + is. Its cross sits exactly where + was, so the same thumb closes it.
   Solid, never glass: something blurred that grows would be re-blurred on every frame. */
.plus-panel {
  position: absolute; z-index: 3; left: var(--hba-space-3); right: var(--hba-space-3);
  bottom: calc(var(--hba-space-3) + 8px + env(safe-area-inset-bottom, 0px));
  padding: var(--hba-space-2) var(--hba-space-4) 0; border-radius: 28px;
  background: var(--hba-surface-raised); color: var(--hba-text-primary);
  clip-path: inset(calc(100% - 56px) calc(100% - 56px) 0 0 round 28px); opacity: 0; pointer-events: none;
  transition: clip-path calc(var(--motion-slow) * 0.7) var(--ease-exit), opacity var(--motion-press) linear calc(var(--motion-slow) * 0.7);
}
.pp-row {
  display: block; width: 100%; min-height: 56px; padding: 0; background: none; border: 0; text-align: start;
  border-bottom: var(--hba-border-thin) solid var(--hba-line-decorative); font-weight: var(--hba-font-weight-bold);
  opacity: 0; transition: opacity var(--motion-press) linear;
}
.pp-row:active { background: var(--hba-surface-alt); }
.pp-foot { display: flex; align-items: center; gap: var(--hba-space-3); height: 56px; margin-inline-start: calc(-1 * var(--hba-space-4)); font-size: var(--hba-type-size-small); color: var(--hba-text-muted); }
.pp-foot span { opacity: 0; transition: opacity var(--motion-press) linear; }
.pp-x { width: 56px; height: 56px; flex: none; border-radius: 50%; border: 0; padding: 0; background: none; display: grid; place-items: center; }
.pp-x svg { transition: transform var(--motion-base) var(--ease-move); }
/* The list and the Halo dim behind it */
.plus-dim { position: absolute; inset: 0; z-index: 2; background: var(--hba-overlay-scrim); opacity: 0; pointer-events: none; transition: opacity calc(var(--motion-slow) * 0.7) var(--ease-exit); }
/* The bar and Search drop off the bottom, and rise back when the panel closes */
.home .omnibar, .home .omni-side { transition: transform var(--motion-base) var(--ease-enter), opacity var(--motion-base) var(--ease-enter); }

.plus-open .plus-panel { clip-path: inset(0 round 28px); opacity: 1; pointer-events: auto; box-shadow: var(--hba-elevation-dialog);
  transition: clip-path var(--motion-slow) var(--ease-enter), opacity var(--motion-press) linear; }
.plus-open .pp-row, .plus-open .pp-foot span { opacity: 1; transition: opacity var(--motion-base) var(--ease-enter) calc(var(--motion-slow) * 0.4); }
.plus-open .pp-x svg { transform: rotate(45deg); }
.plus-open .plus-dim { opacity: 1; pointer-events: auto; transition: opacity var(--motion-slow) var(--ease-enter); }
.plus-open .omnibar, .plus-open .omni-side { transform: translateY(120px); opacity: 0; pointer-events: none;
  transition: transform calc(var(--motion-slow) * 0.7) var(--ease-exit), opacity calc(var(--motion-slow) * 0.7) var(--ease-exit); }
.plus-open #plus { opacity: 0; }
.plus-open .foot { z-index: 3; }

@media (prefers-reduced-motion: reduce) {
  .plus-panel, .plus-open .plus-panel { clip-path: none; transition: opacity var(--motion-fade-reduced) linear; }
  .plus-open .omnibar, .plus-open .omni-side, .home .omnibar, .home .omni-side { transform: none; transition: opacity var(--motion-fade-reduced) linear; }
  .pp-x svg { transition: none; }
}

/* Wider screens: the + panel keeps to the bottom row's width, so it still grows out of + */
@media (min-width: 600px) {
  .plus-panel { max-width: 456px; margin-inline: auto; }
  .home-top { padding-inline: var(--hba-space-5); }
}
