/* ============================================================
   Attention Switch — Jovey theme
   Design contract from jovey.co: calm, warm, low-saturation.
   Prata (serif display) · Anuphan (body) · Quicksand (labels).
   No red-as-negative. Pill buttons. Phone-portrait first.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --ink: #212226;
  --bg: #F8F9FA;
  --btn: #121317;
  --blue: #2E74A8;          /* jovey blue, chroma-tuned for data marks */
  --muted: #6a6a71;
  --line: #e1e6ec;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(18, 19, 23, 0.04), 0 12px 32px -18px rgba(18, 19, 23, 0.14);
  --dock-bg: rgba(255, 255, 255, 0.82);
  --toast-bg: #121317;
  --toast-text: #F8F9FA;
  --break-ink: #9aa1ab;

  /* Project slots use the same Jovey field/pillar colors as the swarm. */
  --cat-0: #FF9F43;
  --cat-1: #3B6E8F;
  --cat-2: #FECA57;
  --cat-3: #B0519E;
  --cat-4: #1FA39A;
  --cat-5: #FF5E7E;
  --cat-6: #48DBFB;
  --cat-7: #B15BFF;
  --cat-8: #E67673;

  --font-display: "Prata", "Times New Roman", serif;
  --font-body: "Anuphan", "Helvetica Neue", system-ui, sans-serif;
  --font-label: "Quicksand", "Avenir Next", system-ui, sans-serif;
}

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

html { color-scheme: light; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  touch-action: manipulation;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
}

button {
  -webkit-user-select: none;
  user-select: none;
}

h1, h2, h3 { margin: 0; line-height: 1.18; font-weight: 400; }
p { margin: 0; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
input { font: inherit; color: inherit; }

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

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

.icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ---------- Ambient wash (immersive session tint) ---------- */
#wash {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 60% at 50% -8%, color-mix(in srgb, var(--pc, transparent) 16%, transparent), transparent 62%),
    var(--bg);
  opacity: 0;
  transition: opacity 600ms ease-out;
  pointer-events: none;
  overflow: hidden;
}
body.in-session #wash { opacity: 1; }

/* jovey-orb grain */
#wash::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="140" height="140"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2"/></filter><rect width="140" height="140" filter="url(%23n)" opacity="0.55"/></svg>');
  opacity: 0.05;
}

/* ---------- Shell (phone-portrait column) ---------- */
.shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 20px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

main { flex: 1; padding-bottom: 40px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 22px;
  padding-top: max(16px, env(safe-area-inset-top));
  transition: opacity 400ms ease-out, transform 400ms ease-out;
}
body.in-session .topbar {
  opacity: 0.55;
  transform: scale(0.92);
  transform-origin: left center;
  padding-bottom: 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
}
.brand-mark { display: block; width: 48px; height: 48px; flex: none; }
.brand-name {
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
}
.brand-tag {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-align: right;
}
body.in-session .brand-tag { display: none; }

.footer {
  padding: 18px 0 22px;
  padding-bottom: max(22px, env(safe-area-inset-bottom));
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}
.foot-home { margin-top: 6px; }
.foot-home a {
  color: var(--muted);
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-decoration: none;
}
.foot-home a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
body.in-session .footer { display: none; }

/* ---------- Pills (jovey buttons) ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: background 180ms ease-out, border-color 180ms ease-out, color 180ms ease-out,
              transform 140ms ease-out, box-shadow 180ms ease-out;
}
.pill:active { transform: scale(0.965); }

.pill-dark {
  background: var(--btn);
  color: #ffffff;
}
.pill-dark:hover { background: #26272d; box-shadow: var(--shadow); }

.pill-ghost {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
}
.pill-ghost:hover { border-color: #cdd6df; box-shadow: var(--shadow); }

.pill-quiet {
  background: transparent;
  color: var(--muted);
  min-height: 44px;
  padding: 0 14px;
}
.pill-quiet:hover { color: var(--ink); background: rgba(18, 19, 23, 0.05); }

.pill-block { width: 100%; }
.pill[disabled] { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.pill .icon { width: 18px; height: 18px; }

/* ---------- Section labels (jovey eyebrows) ---------- */
.sec-label {
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.section { margin-bottom: 30px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-head .count {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ---------- Home ---------- */
.hero-copy { margin: 4px 0 26px; }
.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 8vw, 2.4rem);
  letter-spacing: 0.005em;
}
.hero-copy p { color: var(--muted); margin-top: 10px; font-size: 0.98rem; }

/* Jovey-style particle swarm, summoned above the project list */
.swarm-stage {
  position: relative;
  width: 100%;
  height: min(76vw, 320px);
  min-height: 250px;
  margin: -8px 0 12px;
  pointer-events: none;
  overflow: hidden;
}
.home-arrow-swarm {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.today-strip {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 20px;
  margin-bottom: 28px;
  font-size: 0.88rem;
  color: var(--muted);
}
.today-strip b {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.today-strip .sep { color: var(--line); }

.proj-list { display: flex; flex-direction: column; gap: 8px; }
.proj-item { min-width: 0; }
.project-swipe-shell {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: #B46651;
}
.proj-item.tasks-open .project-swipe-shell {
  border-radius: 18px 18px 0 0;
}

.proj-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 16px;
  min-height: 60px;
  width: 100%;
  touch-action: pan-y;
  will-change: transform;
  transform: translateX(0);
  transition: transform 220ms cubic-bezier(0.22, 0.75, 0.24, 1);
  cursor: pointer;
}
.proj-item.tasks-open .proj-row { border-radius: 18px 18px 0 0; }
.proj-row.swiping { transition: none; }
.swipe-delete {
  position: absolute;
  z-index: 0;
  inset: 0 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  width: 92px;
  background: #B46651;
  color: #ffffff;
  font-family: var(--font-label);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transform: translateX(12px);
  transition: opacity 160ms ease-out, transform 200ms ease-out, background 160ms ease-out;
}
.project-swipe-shell.open .swipe-delete,
.project-swipe-shell.revealing .swipe-delete {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}
.swipe-delete:hover { background: #9E5645; }
.swipe-delete:active { background: #87493B; }
.swipe-delete .icon { width: 18px; height: 18px; }
.swipe-hint {
  margin: 8px 4px 0;
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 0.7rem;
  font-weight: 600;
  text-align: right;
}
.proj-row .p-name,
.archived-row .p-name {
  flex: 1 1 0;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.proj-row .p-meta {
  flex: 0 1 auto;
  max-width: 148px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.project-color-trigger,
.row-action {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  flex: none;
  transition: background 160ms ease-out, color 160ms ease-out, box-shadow 160ms ease-out;
}
.project-color-trigger {
  margin: -6px 0 -6px -8px;
}
.project-color-trigger .dot {
  width: 14px;
  height: 14px;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--pc) 10%, transparent);
  transition: transform 160ms ease-out, box-shadow 160ms ease-out;
}
.project-color-trigger:hover,
.project-color-trigger.active { background: color-mix(in srgb, var(--pc) 9%, transparent); }
.project-color-trigger:hover .dot,
.project-color-trigger.active .dot {
  transform: scale(1.12);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--pc) 18%, transparent);
}
.row-action {
  color: var(--muted);
}
.row-action:hover { background: rgba(18, 19, 23, 0.06); color: var(--ink); }
.row-action.task-toggle.active {
  color: var(--pc);
  background: color-mix(in srgb, var(--pc) 10%, transparent);
}
.row-action.task-toggle .icon { transition: transform 180ms ease-out; }
.row-action.task-toggle.active .icon { transform: scale(1.12); }
.row-action.danger:hover {
  color: #B46651;
  background: rgba(180, 102, 81, 0.09);
}
.row-action .icon { width: 17px; height: 17px; }

.project-color-editor {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 12px;
  margin-top: 5px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--card) 84%, var(--bg));
  animation: editorIn 160ms ease-out;
}
.project-color-editor > span {
  flex: none;
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.project-swatches {
  display: grid;
  grid-template-columns: repeat(9, minmax(20px, 1fr));
  gap: 5px;
  width: 100%;
}
.project-swatch {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-width: 30px;
  min-width: 20px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(18, 19, 23, 0.06);
  transition: transform 140ms ease-out, box-shadow 140ms ease-out;
}
.project-swatch:hover { transform: scale(1.1); }
.project-swatch.selected {
  box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--swatch);
  transform: scale(0.82);
}
@keyframes editorIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.project-task-panel {
  padding: 12px;
  margin-top: -1px;
  border: 1px solid color-mix(in srgb, var(--pc) 20%, var(--line));
  border-radius: 0 0 18px 18px;
  background: color-mix(in srgb, var(--pc) 3.5%, var(--card));
  animation: editorIn 160ms ease-out;
}
.project-task-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 3px 9px;
  font-family: var(--font-label);
}
.project-task-head > span:first-child {
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.project-task-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.project-task-head-actions > span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
}
.project-task-head-actions button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pc) 9%, var(--card));
  color: color-mix(in srgb, var(--pc) 78%, var(--ink));
  font-size: 0.7rem;
  font-weight: 700;
}
.project-task-head-actions button:hover { background: color-mix(in srgb, var(--pc) 15%, var(--card)); }
.task-add-form {
  display: flex;
  gap: 7px;
  margin-bottom: 7px;
  animation: taskComposerIn 180ms cubic-bezier(0.22, 0.75, 0.24, 1);
}
@keyframes taskComposerIn {
  from { opacity: 0; transform: translateY(-5px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.task-add-form input {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
}
.task-add-form input:focus {
  border-color: color-mix(in srgb, var(--pc) 52%, var(--line));
}
.task-add-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 76px;
  min-height: 42px;
  padding: 0 13px;
  border-radius: 13px;
  background: var(--btn);
  color: #ffffff;
  font-family: var(--font-label);
  font-size: 0.76rem;
  font-weight: 700;
}
.task-add-form button:hover { background: #26272d; }
.task-add-form button .icon { width: 15px; height: 15px; }
.project-task-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.project-task label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 42px;
  padding: 10px 7px;
  border-radius: 11px;
  cursor: pointer;
  transition: background 140ms ease-out;
}
.project-task label:hover { background: color-mix(in srgb, var(--pc) 6%, transparent); }
.project-task input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.task-checkbox {
  position: relative;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1.5px solid color-mix(in srgb, var(--pc) 55%, #a5adb7);
  border-radius: 7px;
  background: var(--card);
  flex: none;
  transition: background 150ms ease-out, border-color 150ms ease-out, transform 150ms ease-out;
}
.project-task input:focus-visible + .task-checkbox {
  outline: 2.5px solid var(--blue);
  outline-offset: 2px;
}
.project-task input:checked + .task-checkbox {
  border-color: var(--pc);
  background: var(--pc);
  transform: scale(0.94);
}
.project-task input:checked + .task-checkbox::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.task-text {
  min-width: 0;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.project-task.done .task-text {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--muted) 65%, transparent);
}
.task-empty {
  padding: 9px 7px 3px;
  color: var(--muted);
  font-size: 0.8rem;
}

.archived-projects { margin-top: 14px; }
.archived-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 0 10px 0 14px;
  border-radius: 14px;
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 700;
  transition: color 160ms ease-out, background 160ms ease-out;
}
.archived-toggle:hover { color: var(--ink); background: rgba(18, 19, 23, 0.035); }
.archived-toggle > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.archived-toggle .icon { width: 16px; height: 16px; }
.archived-toggle > .icon:last-child {
  margin-left: 8px;
  transition: transform 180ms ease-out;
}
.archived-projects.open .archived-toggle > .icon:last-child { transform: rotate(90deg); }
.archived-count {
  min-width: 24px;
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
  text-align: center;
}
.archived-list { display: flex; flex-direction: column; gap: 7px; margin-top: 6px; }
.archived-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 54px;
  padding: 7px 8px 7px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--card) 72%, var(--bg));
}
.archived-row .p-name { opacity: 0.78; }
.archived-row .p-meta {
  flex: 0 1 auto;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

@media (max-width: 430px) {
  .proj-row .p-meta,
  .archived-row .p-meta { display: none; }
}
@media (max-width: 390px) {
  .project-color-editor { align-items: flex-start; flex-direction: column; gap: 9px; }
  .task-add-form button { min-width: 48px; }
  .task-add-form button span { display: none; }
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pc);
  flex: none;
}

.add-form { display: flex; gap: 8px; margin-top: 12px; }
.add-form input {
  flex: 1;
  min-width: 0;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
}
.add-form input::placeholder { color: var(--muted); }
.add-form input:focus-visible { outline-offset: 0; border-radius: 999px; }
.add-form .pill { padding: 0 20px; }
.form-note { margin-top: 10px; font-size: 0.82rem; color: var(--muted); }

.empty-card {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

.start-wrap { margin: 26px 0 34px; }
.cta-start { font-size: 1.02rem; min-height: 58px; }
.cta-hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 10px;
}

/* A persistent doorway to ideas captured without leaving the timer. */
.notes-wall-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  margin: -12px 0 30px;
  padding: 11px 14px;
  border: 1px solid color-mix(in srgb, var(--cat-2) 32%, var(--line));
  border-radius: 20px;
  background: color-mix(in srgb, var(--cat-2) 7%, var(--card));
  text-align: left;
  transition: transform 140ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out;
}
.notes-wall-link:hover { border-color: color-mix(in srgb, var(--cat-2) 62%, var(--line)); box-shadow: var(--shadow); }
.notes-wall-link:active { transform: scale(0.985); }
.notes-wall-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px 13px 13px 5px;
  background: color-mix(in srgb, var(--cat-2) 34%, white);
  color: #765c12;
  transform: rotate(-2deg);
}
.notes-wall-icon .icon { width: 20px; height: 20px; }
.notes-wall-link > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.notes-wall-link b { font-family: var(--font-label); font-size: 0.92rem; }
.notes-wall-link small { overflow: hidden; color: var(--muted); font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.notes-wall-link strong {
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  font-family: var(--font-label);
  font-size: 0.76rem;
  text-align: center;
}
.notes-wall-link > .icon { width: 16px; color: var(--muted); }

.sess-list { display: flex; flex-direction: column; gap: 8px; }
.sess-row {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 16px;
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out, transform 140ms ease-out;
}
.sess-row:hover { border-color: #cdd6df; box-shadow: var(--shadow); }
.sess-row:active { transform: scale(0.99); }
.sess-row .s-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.88rem;
}
.sess-row .s-date { font-weight: 600; }
.sess-row .s-meta {
  margin-left: auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.link-more {
  min-height: 44px;
  padding: 0 6px;
  color: var(--muted);
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 160ms ease-out;
}
.link-more:hover { color: var(--ink); }

/* ---------- Timeline strip ---------- */
.strip {
  display: flex;
  gap: 2px;
  height: 38px;
  border-radius: 10px;
}
.strip.mini { height: 9px; border-radius: 5px; }
.strip i {
  flex: var(--f) 1 0px;
  min-width: 3px;
  border-radius: 4px;
  background: var(--pc);
}
.strip.mini i { border-radius: 2.5px; min-width: 2px; }
.strip i.brk {
  background: repeating-linear-gradient(
    45deg,
    transparent 0 3px,
    var(--break-ink) 3px 4.5px
  );
  opacity: 0.5;
}

/* ---------- Session (live, immersive) ---------- */
.live-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.live-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.82rem;
  color: var(--muted);
}
.live-chip b {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.live-chip .icon { width: 14px; height: 14px; align-self: center; }
.live-chip b.pop { animation: pop 280ms ease-out; }
@keyframes pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.live-chip b { display: inline-block; }

/* ----- The dial ----- */
.dial-wrap {
  position: relative;
  display: grid;
  place-items: center;
  padding: 26px 0 12px;
}
.dial {
  position: relative;
  width: min(84vw, 340px);
  aspect-ratio: 1;
}
/* the attention ring — confetti dashes drawn on canvas */
.ring-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.dial-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  padding: 0 30px;
}
.focus-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  row-gap: 0;
  gap: 8px;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.95rem;
  max-width: 100%;
}
.focus-label .state-word { white-space: nowrap; }
.focus-label > span:not(.state-word):not(.pulse-dot) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.focus-label .state-word { color: var(--muted); font-weight: 600; }
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pc, var(--blue));
  flex: none;
  animation: pulse 1.9s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pc, var(--blue)) 42%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.big-clock {
  font-family: var(--font-display);
  font-size: clamp(3.3rem, 18vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: 0.01em;
  color: var(--ink);
  white-space: nowrap;
}
.big-clock .d { display: inline-block; width: 0.62em; text-align: center; }
.big-clock .c { display: inline-block; width: 0.3em; text-align: center; transform: translateY(-0.04em); }
.big-clock.idle, .big-clock.paused { color: var(--muted); }
.big-clock .chg { animation: digitIn 260ms ease-out; }
@keyframes digitIn {
  from { opacity: 0.1; transform: translateY(0.14em); }
  to   { opacity: 1; transform: translateY(0); }
}

.under-clock {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.under-clock b { color: var(--ink); font-weight: 600; }

/* the switch count lives inside the clock — the only other number on screen */
.switch-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.82rem;
}
.switch-line .icon { width: 15px; height: 15px; }
.switch-line b {
  display: inline-block;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
#switch-n.pop { animation: pop 280ms ease-out; }

/* ----- Project tiles ----- */
.grid-label { margin-bottom: 12px; }
.proj-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.proj-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 10px 16px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  transition: border-color 180ms ease-out, background 180ms ease-out,
              box-shadow 180ms ease-out, transform 140ms ease-out;
}
/* soft ripple wash on press */
.proj-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 55%,
    color-mix(in srgb, var(--pc) 20%, transparent), transparent 68%);
  opacity: 0;
  transform: scale(0.55);
  transition: opacity 340ms ease-out, transform 340ms ease-out;
  pointer-events: none;
}
.proj-card:active::after {
  opacity: 1;
  transform: scale(1.15);
  transition: none;
}
.proj-card:hover { border-color: color-mix(in srgb, var(--pc) 45%, var(--line)); box-shadow: var(--shadow); }
.proj-card:active { transform: scale(0.96); }
.proj-card .c-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.proj-card .c-head .dot { width: 10px; height: 10px; }
.proj-card .c-name {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.proj-card .kbd { margin-left: auto; }
.proj-card .c-time {
  color: var(--muted);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-label);
  font-weight: 600;
}
.proj-card.active {
  border-color: var(--pc);
  background: color-mix(in srgb, var(--pc) 8%, var(--card));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc) 20%, transparent);
}
.proj-card.active .c-time { color: var(--ink); }

/* Add-a-project tile (dashed, works mid-session) */
.add-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  border: 1.5px dashed var(--line);
  border-radius: 20px;
  color: var(--muted);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.9rem;
  background: transparent;
  transition: border-color 180ms ease-out, color 180ms ease-out, background 180ms ease-out;
}
.add-card:hover { border-color: #c6cfd9; color: var(--ink); background: rgba(255, 255, 255, 0.6); }
.add-card .icon { width: 17px; height: 17px; }

.add-card-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 56px;
  padding: 12px;
  border: 1.5px dashed #c6cfd9;
  border-radius: 20px;
  background: var(--card);
}
.add-card-form input {
  min-height: 34px;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0 2px;
  background: transparent;
  font-size: 0.92rem;
}
.add-card-form input:focus-visible { outline: none; border-bottom-color: var(--blue); }
.add-card-form .row { display: flex; gap: 6px; }
.add-card-form .pill { min-height: 34px; padding: 0 14px; font-size: 0.8rem; flex: 1; }

.kbd {
  display: none;
  flex: none;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}
@media (hover: hover) and (pointer: fine) {
  .kbd { display: block; }
}

/* ----- Floating dock ----- */
.controls-bar {
  position: sticky;
  bottom: 14px;
  z-index: 10;
  display: flex;
  gap: 8px;
  padding: 8px;
  margin-bottom: max(0px, env(safe-area-inset-bottom));
  background: var(--dock-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.controls-bar .pill { flex: 1; min-height: 48px; }
.lbl-short { display: none; }
@media (max-width: 430px) {
  .controls-bar .lbl-long { display: none; }
  .controls-bar .lbl-short { display: inline; }
}

.key-hints {
  display: none;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 12px;
}
@media (hover: hover) and (pointer: fine) {
  .key-hints { display: block; }
}
.key-hints .kbd { display: inline-block; margin: 0 2px; }

/* ----- In-session capture: deliberately separate from attention switching ----- */
.session-capture {
  margin: -2px 0 14px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--cat-2) 25%, var(--line));
  border-radius: 19px;
  background: color-mix(in srgb, var(--cat-2) 5%, rgba(255, 255, 255, 0.82));
  box-shadow: 0 8px 28px -24px rgba(18, 19, 23, 0.32);
}
.session-capture-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.session-capture-head > div:first-child { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.session-capture-head .sec-label { font-size: 0.66rem; }
.session-capture-head small { color: var(--muted); font-size: 0.67rem; line-height: 1.3; }
.session-capture-tabs { display: flex; gap: 5px; }
.session-capture-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 0.72rem;
  font-weight: 700;
  transition: color 160ms ease-out, border-color 160ms ease-out, background 160ms ease-out, transform 140ms ease-out;
}
.session-capture-tabs button:active { transform: scale(0.96); }
.session-capture-tabs button.active {
  border-color: color-mix(in srgb, var(--cat-2) 65%, var(--line));
  background: color-mix(in srgb, var(--cat-2) 16%, white);
  color: var(--ink);
}
.session-capture-tabs .icon { width: 15px; height: 15px; }
.session-capture-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--cat-2) 22%, var(--line));
}
.session-capture-form > label {
  align-self: center;
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 0.7rem;
  font-weight: 700;
}
.session-capture-form input,
.session-capture-form select,
.session-capture-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
}
.session-capture-form input,
.session-capture-form select { min-height: 42px; padding: 0 12px; }
.session-capture-form select { appearance: auto; }
.session-capture-form textarea {
  grid-column: 1 / -1;
  min-height: 92px;
  padding: 11px 12px;
  line-height: 1.45;
  resize: vertical;
}
.session-capture-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}
.session-capture-actions .pill { min-height: 39px; padding: 0 16px; font-size: 0.78rem; }
.session-note-context {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.72rem;
}
.session-note-context .dot { width: 8px; height: 8px; }
.session-note-context b { color: var(--ink); font-weight: 600; }
.session-capture-feed {
  max-height: 300px;
  margin-top: 12px;
  padding-top: 11px;
  overflow-y: auto;
  border-top: 1px solid color-mix(in srgb, var(--cat-2) 22%, var(--line));
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
}
.session-capture-group + .session-capture-group { margin-top: 11px; }
.session-capture-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
  padding: 0 6px;
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.session-capture-group-head span {
  min-width: 23px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}
.session-capture-items { margin-top: 3px; }
.session-capture-task label {
  min-height: 47px;
  padding: 7px 6px;
  background: color-mix(in srgb, var(--pc) 4%, rgba(255, 255, 255, 0.68));
}
.session-task-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}
.session-task-copy small,
.session-capture-note small {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.62rem;
}
.session-task-copy small .dot,
.session-capture-note small .dot { width: 6px; height: 6px; }
.session-capture-notes { display: flex; flex-direction: column; gap: 4px; }
.session-capture-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
  min-height: 49px;
  padding: 8px 6px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--pc) 6%, rgba(255, 255, 255, 0.68));
}
.session-capture-note-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px 8px 8px 3px;
  background: color-mix(in srgb, var(--pc) 22%, white);
  color: color-mix(in srgb, var(--pc) 76%, var(--ink));
}
.session-capture-note-icon .icon { width: 14px; height: 14px; }
.session-capture-note p {
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.session-capture-note > button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 1.05rem;
}
.session-capture-note > button:hover { background: rgba(255, 255, 255, 0.72); color: var(--ink); }

@media (max-width: 380px) {
  .session-capture-head { align-items: flex-start; flex-direction: column; }
  .session-capture-tabs { width: 100%; }
  .session-capture-tabs button { flex: 1; justify-content: center; }
}

/* ---------- Post-session reflection ---------- */
.reflection-head { margin: 8px 0 22px; }
.reflection-head .sec-label { display: block; margin-bottom: 10px; }
.reflection-head h1 {
  max-width: 390px;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 8vw, 2.5rem);
}
.reflection-head p { margin-top: 9px; color: var(--muted); font-size: 0.92rem; }
.reflection-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.reflection-progress > span {
  position: relative;
  overflow: hidden;
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: var(--line);
}
.reflection-progress > span::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #FF9F43, #B0519E, #1FA39A);
  transform: scaleX(var(--f));
  transform-origin: left;
  transition: transform 220ms ease-out;
}
.reflection-progress small {
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 0.72rem;
  font-weight: 700;
}
.reflection-card {
  position: relative;
  padding: 22px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.reflection-time {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
}
.reflection-path {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}
.reflection-path > span:not(.path-arrow) {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 50px;
  padding: 8px 10px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--pc) 7%, var(--bg));
}
.reflection-path b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.path-arrow { color: var(--muted); font-size: 1.35rem; text-align: center; }
.reflection-question {
  margin: 22px 0 10px;
  font-family: var(--font-label);
  font-weight: 700;
  text-align: center;
}
.reason-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.reason-choices button {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 700;
  transition: border-color 150ms ease-out, background 150ms ease-out, transform 120ms ease-out;
}
.reason-choices button:hover,
.reason-choices button.active { border-color: #b8c4cf; background: var(--card); }
.reason-choices button:active { transform: scale(0.97); }
.reason-choices .reason-other { grid-column: 1 / -1; }
.saved-reasons { margin-top: 14px; }
.saved-reasons-label {
  display: block;
  margin: 0 2px 7px;
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.saved-reason-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.saved-reason-cards button {
  min-width: 0;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, var(--blue) 24%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--blue) 7%, var(--card));
  font-family: var(--font-label);
  font-size: 0.73rem;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-align: left;
}
.saved-reason-cards button:hover { border-color: var(--blue); }
.reason-custom-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  animation: taskComposerIn 180ms ease-out;
}
.reason-custom-form input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}
.reason-custom-form button {
  min-height: 46px;
  padding: 0 15px;
  border-radius: 14px;
  background: var(--btn);
  color: #fff;
  font-family: var(--font-label);
  font-size: 0.76rem;
  font-weight: 700;
}
.reflection-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
.reflection-actions .pill { font-size: 0.78rem; }

/* ---------- Summary ---------- */
.sum-head { margin: 4px 0 22px; }
.sum-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 7vw, 2.1rem);
}
.sum-head p { color: var(--muted); margin-top: 8px; font-size: 0.9rem; }

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 28px;
}
.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px 18px 14px;
}
.tile b {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.55rem;
  line-height: 1.15;
  letter-spacing: 0.005em;
}
.tile small {
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.tile .sub { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.tile.feature b { color: var(--blue); }

.sum-section { margin-bottom: 30px; }
.sum-section .sec-label { display: block; margin-bottom: 12px; }
.strip-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.share-bar {
  display: flex;
  gap: 2px;
  height: 13px;
  border-radius: 7px;
  margin-bottom: 14px;
}
.share-bar i {
  flex: var(--f) 1 0px;
  min-width: 3px;
  border-radius: 4px;
  background: var(--pc);
}

.break-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.break-table th {
  text-align: left;
  font-family: var(--font-label);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
}
.break-table th.num, .break-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.break-table td { padding: 11px 0; border-bottom: 1px solid var(--line); }
.break-table tr:last-child td { border-bottom: none; }
.break-table .cell-name { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.break-table td.num.pct { color: var(--muted); width: 64px; }

.sum-actions { display: flex; gap: 10px; margin-top: 6px; }
.sum-actions .pill-dark { flex: 1; }
.sum-actions .pill-icon { width: 54px; padding: 0; color: var(--muted); }

/* ---------- Hook: new-day card, streaks, rewards ---------- */
.day-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 20px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}
.day-echo { color: var(--muted); font-size: 0.92rem; }
.day-streak {
  margin-top: 4px;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--blue);
}
.day-actions { display: flex; gap: 8px; margin-top: 14px; }
.day-actions .pill { flex: 1; min-height: 52px; }
.day-actions .pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.streak-note {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.reward-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 20px;
}
.flow-chip, .moment-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 8px 14px;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.8rem;
}
.moment-chip {
  background: color-mix(in srgb, var(--blue) 9%, var(--card));
  border: 1px solid color-mix(in srgb, var(--blue) 25%, var(--line));
  color: #2b5a80;
}
.moment-chip .icon { width: 14px; height: 14px; }
.flow-chip.flow-deep   { background: color-mix(in srgb, #1FA39A 11%, var(--card)); border: 1px solid color-mix(in srgb, #1FA39A 30%, var(--line)); color: #177F77; }
.flow-chip.flow-steady { background: color-mix(in srgb, var(--blue) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--blue) 28%, var(--line)); color: #2b5a80; }
.flow-chip.flow-lively { background: color-mix(in srgb, #D9822B 11%, var(--card)); border: 1px solid color-mix(in srgb, #D9822B 30%, var(--line)); color: #B4661A; }
.flow-chip.flow-busy   { background: var(--surface-2, #eef1f5); border: 1px solid var(--line); color: var(--muted); }

/* ---------- Switch paths, heatmaps, and project hubs ---------- */
.switch-reason-list,
.path-summary-list,
.move-log,
.hub-session-list { display: flex; flex-direction: column; gap: 8px; }
.switch-reason-row,
.path-summary-row {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
}
.mini-path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 700;
}
.mini-path > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.mini-path .dot { width: 9px; height: 9px; }
.mini-path b { color: var(--muted); }
.switch-why {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 0.78rem;
}
.switch-why small {
  display: block;
  margin-bottom: 1px;
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.switch-why > span { display: block; }
.switch-why.missing { color: var(--muted); font-style: italic; }
.path-summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
}
.path-summary-row strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 400;
}
.path-summary-row small { grid-column: 1 / -1; color: var(--muted); font-size: 0.72rem; }
.subsection-label {
  margin: 18px 2px 9px;
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.move-log > button {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  text-align: left;
  transition: border-color 150ms ease-out, transform 120ms ease-out, box-shadow 150ms ease-out;
}
.move-log > button:hover { border-color: #c8d1da; box-shadow: var(--shadow); }
.move-log > button:active { transform: scale(0.985); }
.move-log-time { color: var(--muted); font-size: 0.68rem; }

.attention-map-card {
  overflow: hidden;
  padding: 10px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 48%, rgba(59, 110, 143, 0.045), transparent 55%),
    var(--card);
  box-shadow: 0 16px 44px -36px rgba(18, 19, 23, 0.45);
}
.attention-map-canvas {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  touch-action: manipulation;
}
.attention-path-analysis {
  margin: 0 2px 12px;
  padding: 14px;
  border: 1px solid rgba(59, 110, 143, 0.18);
  border-radius: 17px;
  background: color-mix(in srgb, var(--blue) 4.5%, var(--card));
  animation: analysis-in 180ms ease-out both;
}
@keyframes analysis-in {
  from { opacity: 0; transform: translateY(5px); }
}
.attention-analysis-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start;
  gap: 9px;
}
.attention-analysis-head > div { min-width: 0; }
.attention-analysis-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.67rem;
}
.attention-analysis-head > strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.25;
}
.attention-analysis-head > button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
}
.attention-analysis-head > button:hover { background: rgba(33, 34, 38, 0.06); color: var(--ink); }
.attention-path-analysis h3 {
  margin: 14px 0 8px;
  font-family: var(--font-label);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.attention-reason-breakdown { display: flex; flex-direction: column; gap: 8px; }
.attention-reason-row > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  font-size: 0.73rem;
}
.attention-reason-row > div b { font-family: var(--font-label); font-size: 0.68rem; }
.attention-reason-row > i {
  display: block;
  overflow: hidden;
  height: 5px;
  border-radius: 999px;
  background: rgba(59, 110, 143, 0.1);
}
.attention-reason-row > i span {
  display: block;
  width: var(--share);
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}
.attention-reason-row.missing { color: var(--muted); font-style: italic; }
.attention-reason-row.missing > i span { background: #b9c0c8; }
.attention-analysis-empty { color: var(--muted); font-size: 0.74rem; }
.attention-map-key {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 3px 3px 0;
}
.attention-map-key button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 34px;
  padding: 5px 7px;
  border-radius: 11px;
  color: var(--ink);
  text-align: left;
  transition: background 150ms ease-out, transform 120ms ease-out;
}
.attention-map-key button:hover { background: color-mix(in srgb, var(--pc) 9%, var(--bg)); }
.attention-map-key button:active { transform: scale(0.98); }
.attention-map-key i {
  display: inline-grid;
  place-items: center;
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: var(--pc);
  color: var(--number-ink, #fff);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72);
  font-family: var(--font-label);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 700;
}
.attention-map-key span {
  overflow: hidden;
  font-family: var(--font-label);
  font-size: 0.72rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attention-map-note {
  margin: 10px 4px 1px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
  text-align: center;
}

.time-day-card {
  padding: 15px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}
.time-day-bars {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  align-items: end;
  gap: 2px;
  height: 112px;
  padding: 3px 1px 0;
}
.time-day-bars > i {
  display: flex;
  align-items: flex-end;
  height: 100%;
}
.time-day-bars > i > span {
  width: 100%;
  height: var(--h);
  min-height: 2px;
  border-radius: 3px 3px 1px 1px;
  background: color-mix(in srgb, var(--blue) 74%, #48dbfb);
  opacity: 0.72;
}
.time-day-bars > i.peak > span {
  background: var(--blue);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 15%, transparent);
  opacity: 1;
}
.time-day-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 0.58rem;
  font-weight: 600;
}
.time-day-card > p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.74rem;
  text-align: center;
}
.time-day-card > p b { color: var(--ink); font-weight: 600; }

.heatmap-wrap { position: relative; }
.heatmap-weekdays {
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 25px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 14px;
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 0.55rem;
}
.heatmap-scroll {
  overflow-x: auto;
  margin-left: 18px;
  padding: 1px 1px 7px;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.heatmap-grid {
  display: inline-flex;
  gap: 3px;
  min-width: max-content;
}
.heat-week { display: grid; grid-template-rows: repeat(7, 10px); gap: 3px; }
.heat-cell {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: #e7ebef;
  box-shadow: inset 0 0 0 1px rgba(18, 19, 23, 0.025);
}
.heat-cell.blank { background: transparent; box-shadow: none; }
.heat-cell.level-0,
.heatmap-legend .level-0 { background: #e7ebef; }
.heat-cell.level-1,
.heatmap-legend .level-1 { background: #c4e5df; }
.heat-cell.level-2,
.heatmap-legend .level-2 { background: #7cc8bd; }
.heat-cell.level-3,
.heatmap-legend .level-3 { background: #32a99d; }
.heat-cell.level-4,
.heatmap-legend .level-4 { background: #187f78; }
.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin: 3px 2px 0;
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 0.6rem;
}
.heatmap-legend i { width: 10px; height: 10px; border-radius: 3px; }

.hub-nav { margin: -4px 0 12px; }
.hub-nav .pill { min-height: 38px; padding-left: 6px; }
.project-hub-head {
  padding: 4px 2px 18px;
  margin-bottom: 12px;
}
.project-hub-head > div { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.project-hub-head h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 9vw, 2.7rem);
  overflow-wrap: anywhere;
}
.project-hub-head p { margin-top: 9px; color: var(--muted); font-size: 0.92rem; }
.archived-chip {
  margin-left: auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 0.64rem;
  font-weight: 700;
}
.hub-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 28px;
}
.hub-stats > div {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--card);
}
.hub-stats b { display: block; font-family: var(--font-display); font-size: 1.25rem; font-weight: 400; }
.hub-stats span { color: var(--muted); font-family: var(--font-label); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.hub-section {
  padding: 14px;
  margin-bottom: 30px;
  border: 1px solid color-mix(in srgb, var(--pc) 20%, var(--line));
  border-radius: 19px;
  background: color-mix(in srgb, var(--pc) 3.5%, var(--card));
}
.hub-task-list { margin-top: 4px; }
.hub-session-list > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  text-align: left;
}
.hub-session-list > button:hover { border-color: #c8d1da; box-shadow: var(--shadow); }
.hub-session-list span { display: flex; flex-direction: column; }
.hub-session-list b { font-weight: 600; }
.hub-session-list small { color: var(--muted); font-size: 0.68rem; }
.hub-session-list strong { font-family: var(--font-label); font-size: 0.8rem; }
.empty-card.compact { padding: 16px 18px; font-size: 0.84rem; }

/* ---------- Notes wall ---------- */
.notes-head { margin: 4px 0 24px; }
.notes-head .sec-label { display: block; margin-bottom: 9px; }
.notes-head h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 11vw, 3.15rem);
}
.notes-head p { max-width: 390px; margin-top: 9px; color: var(--muted); font-size: 0.9rem; }
.notes-wall {
  columns: 2;
  column-gap: 12px;
  padding: 3px 2px 18px;
}
.post-it {
  position: relative;
  display: inline-block;
  width: 100%;
  min-height: 142px;
  break-inside: avoid;
  margin: 0 0 13px;
  padding: 18px 15px 13px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--pc) 26%, var(--line));
  border-radius: 7px 15px 10px 13px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.38), transparent 44%),
    color-mix(in srgb, var(--pc) 18%, #fffdf6);
  box-shadow: 0 14px 26px -22px color-mix(in srgb, var(--pc) 45%, rgba(18, 19, 23, 0.32));
  transform: rotate(-0.7deg);
}
.post-it:nth-child(3n + 2) { transform: rotate(0.8deg); border-radius: 13px 7px 14px 9px; }
.post-it:nth-child(3n) { transform: rotate(-0.2deg); border-radius: 9px 14px 6px 14px; }
.post-it::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 17px;
  height: 17px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--pc) 14%, white) 49%, color-mix(in srgb, var(--pc) 30%, white) 51%);
  box-shadow: -1px -1px 1px rgba(18, 19, 23, 0.04);
}
.post-it-delete {
  position: absolute;
  top: 6px;
  right: 7px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: color-mix(in srgb, var(--ink) 52%, transparent);
  font-size: 1.15rem;
  line-height: 1;
}
.post-it-delete:hover { background: rgba(255, 255, 255, 0.48); color: var(--ink); }
.post-it-project {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 26px);
  color: color-mix(in srgb, var(--ink) 70%, var(--pc));
  font-family: var(--font-label);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.post-it-project .dot { width: 7px; height: 7px; }
.post-it > p {
  margin: 13px 0 18px;
  color: color-mix(in srgb, var(--ink) 92%, var(--pc));
  font-size: 0.92rem;
  line-height: 1.48;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.post-it footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 7px;
  color: color-mix(in srgb, var(--muted) 80%, var(--pc));
  font-family: var(--font-label);
  font-size: 0.55rem;
  line-height: 1.3;
}
.post-it footer button {
  position: relative;
  z-index: 1;
  color: color-mix(in srgb, var(--ink) 72%, var(--pc));
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.notes-empty { margin-top: 10px; }
.session-note-list { columns: 2; column-gap: 12px; }
.session-note-list .post-it { min-height: 118px; }

@media (max-width: 350px) {
  .notes-wall,
  .session-note-list { columns: 1; }
}

/* ---------- Trends ---------- */
.trends-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 999px;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--blue);
  transition: background 160ms ease-out;
}
.trends-link:hover { background: rgba(46, 116, 168, 0.08); }
.spark {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}
.spark i {
  width: 4px;
  border-radius: 2px;
  background: var(--blue);
  opacity: 0.75;
}
.spark i.nil { opacity: 0.22; height: 3px !important; }

.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.chart-max {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.bars {
  display: flex;
  align-items: stretch;
  gap: 5px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 12px 10px;
}
.bar-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}
.bar-stack {
  height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
}
.bar-stack i {
  border-radius: 3px;
  background: var(--pc);
  min-height: 3px;
}
.bar-stack i.mono { background: var(--blue); opacity: 0.8; }
.bar-stack .nil {
  height: 3px;
  border-radius: 2px;
  background: var(--line);
}
.bar-day {
  text-align: center;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.66rem;
  color: var(--muted);
  text-transform: uppercase;
}
.bar-value {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-label);
  font-size: 0.54rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
}
.bar-col.today .bar-day { color: var(--ink); }

.delta {
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.74rem;
}
.delta.good { color: var(--blue); }
.delta.quiet { color: var(--muted); }

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  bottom: max(28px, env(safe-area-inset-bottom));
  transform: translate(-50%, 16px);
  max-width: min(90vw, 420px);
  background: var(--toast-bg);
  color: var(--toast-text);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 11px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease-out, transform 220ms ease-out;
  z-index: 50;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive Mac and resizable-window layouts ---------- */
@media (min-width: 640px) {
  .shell {
    max-width: 760px;
    padding-left: max(30px, env(safe-area-inset-left));
    padding-right: max(30px, env(safe-area-inset-right));
  }
  .topbar { padding-top: 22px; padding-bottom: 28px; }
  .brand-mark { width: 54px; height: 54px; }
  .brand-name { font-size: 1.12rem; }
  .hero-copy h1 { font-size: clamp(2.55rem, 6.5vw, 3.45rem); }
  .hero-copy p { max-width: 560px; font-size: 1.02rem; }
  .swarm-stage { height: min(58vw, 410px); min-height: 340px; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hub-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .notes-wall { columns: 3; column-gap: 16px; }
  .session-note-list { columns: 3; column-gap: 14px; }
}

@media (min-width: 900px) {
  .shell {
    width: 100%;
    max-width: 1180px;
    padding-left: max(38px, env(safe-area-inset-left));
    padding-right: max(38px, env(safe-area-inset-right));
  }
  main { padding-bottom: 64px; }
  .topbar { padding: 24px 0 34px; }
  .brand-mark { width: 58px; height: 58px; }
  .brand-name { font-size: 1.18rem; }
  .brand-tag { font-size: 0.74rem; }
  .footer { padding-bottom: 30px; }

  /* Home becomes a desktop workspace: attention visual left, projects right. */
  body.view-home main {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(410px, 0.95fr);
    grid-template-areas:
      "hero    projects"
      "today   projects"
      "day     projects"
      "swarm   projects"
      "start   projects"
      "notes   projects"
      "history history";
    column-gap: clamp(34px, 5vw, 68px);
    align-items: start;
  }
  body.view-home main > .hero-copy { grid-area: hero; margin-top: 22px; }
  body.view-home main > .today-strip { grid-area: today; width: fit-content; margin-bottom: 20px; }
  body.view-home main > .day-card { grid-area: day; }
  body.view-home main > .swarm-stage {
    grid-area: swarm;
    height: clamp(390px, 42vw, 500px);
    min-height: 390px;
    margin: -12px 0 8px;
  }
  body.view-home main > .section[aria-label="Your projects"] {
    grid-area: projects;
    position: sticky;
    top: 22px;
    max-height: calc(100vh - 44px);
    margin: 0;
    padding: 22px 18px 24px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: color-mix(in srgb, var(--card) 88%, var(--bg));
    box-shadow: 0 24px 56px -46px rgba(18, 19, 23, 0.5);
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
  }
  body.view-home main > .start-wrap { grid-area: start; margin: 8px 0 28px; }
  body.view-home main > .notes-wall-link { grid-area: notes; margin: -12px 0 34px; }
  body.view-home main > .section[aria-label="Past sessions"] {
    grid-area: history;
    margin-top: 30px;
  }
  body.view-home .hero-copy h1 {
    max-width: 610px;
    font-size: clamp(3.15rem, 5.4vw, 4.65rem);
  }
  body.view-home .hero-copy p { max-width: 530px; font-size: 1.08rem; }
  body.view-home .sess-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* The live timer uses two stable panes instead of a long phone column. */
  body.in-session .shell { max-width: 1180px; }
  body.in-session .topbar {
    opacity: 0.72;
    transform: none;
    padding-bottom: 16px;
  }
  body.view-session main {
    display: grid;
    grid-template-columns: minmax(320px, 0.92fr) minmax(380px, 1.08fr);
    grid-template-areas:
      "dial label"
      "dial grid"
      "dial capture"
      "dial dock"
      "dial hints";
    grid-template-rows: auto auto auto auto auto;
    column-gap: clamp(38px, 6vw, 76px);
    align-items: start;
  }
  body.view-session .dial-wrap {
    grid-area: dial;
    position: sticky;
    top: 92px;
    align-self: start;
    min-height: 520px;
    padding: 18px 0;
  }
  body.view-session .dial { width: min(39vw, 470px); }
  body.view-session .big-clock { font-size: clamp(4.2rem, 7vw, 5.6rem); }
  body.view-session .focus-label { font-size: 1.05rem; }
  body.view-session .grid-label { grid-area: label; margin: 22px 0 12px; }
  body.view-session .proj-grid {
    grid-area: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 18px;
  }
  body.view-session .proj-card,
  body.view-session .add-card { min-height: 64px; }
  body.view-session .session-capture { grid-area: capture; margin-bottom: 16px; padding: 15px; }
  body.view-session .session-capture-feed { max-height: 290px; }
  body.view-session .controls-bar { grid-area: dock; position: static; margin: 0; }
  body.view-session .key-hints { grid-area: hints; display: block; }

  /* Reading and analysis views gain width without becoming hard to scan. */
  body.view-reflection main { width: 100%; max-width: 680px; margin: 0 auto; }
  body.view-summary main,
  body.view-trends main,
  body.view-project main { width: 100%; max-width: 1020px; margin: 0 auto; }
  body.view-summary .sum-head,
  body.view-trends .sum-head { max-width: 720px; }
  body.view-summary .tiles,
  body.view-trends .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.view-summary .tile,
  body.view-trends .tile { min-height: 118px; padding: 20px 22px; }
  body.view-summary .tile b,
  body.view-trends .tile b { font-size: 1.9rem; }
  body.view-summary .sum-section,
  body.view-trends .sum-section,
  body.view-project .sum-section,
  body.view-project .hub-section {
    padding: 22px 24px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: color-mix(in srgb, var(--card) 92%, var(--bg));
  }
  body.view-trends .bars { padding: 20px 18px 14px; }
  body.view-trends .bar-stack { height: 150px; }
  body.view-project .project-hub-head h1 { font-size: clamp(3rem, 5vw, 4.25rem); }
  body.view-project .hub-stats > div { min-height: 96px; padding: 18px 20px; }
  body.view-project .hub-stats b { font-size: 1.55rem; }
  body.view-notes main { width: 100%; }
  body.view-notes .notes-head { max-width: 720px; margin-top: 18px; }
  body.view-notes .notes-head h1 { font-size: clamp(3.3rem, 6vw, 4.8rem); }
  body.view-notes .notes-wall { columns: 4; column-gap: 18px; }
  body.view-notes .post-it { margin-bottom: 18px; }
  .attention-map-card { max-width: 780px; margin-left: auto; margin-right: auto; }
  .heat-week { grid-template-rows: repeat(7, 12px); }
  .heat-cell { width: 12px; height: 12px; }
}

/* ---------- Landscape phone: dial left, switcher right ---------- */
@media (orientation: landscape) and (max-height: 540px) {
  body.in-session .shell { max-width: 920px; }
  body.in-session main {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    grid-template-areas:
      "dial  label"
      "dial  grid"
      "dial  capture"
      "dial  dock";
    grid-template-rows: auto 1fr auto auto;
    column-gap: 28px;
    align-items: start;
    padding-bottom: 16px;
  }
  body.in-session .dial-wrap { grid-area: dial; align-self: center; padding: 0; }
  body.in-session .grid-label { grid-area: label; margin: 10px 0 8px; }
  body.in-session .proj-grid { grid-area: grid; align-content: start; margin-bottom: 10px; }
  body.in-session .session-capture { grid-area: capture; margin-bottom: 8px; padding: 8px 10px; }
  body.in-session .session-capture-head small { display: none; }
  body.in-session .session-capture-form { margin-top: 7px; padding-top: 7px; }
  body.in-session .session-capture-form textarea { min-height: 54px; }
  body.in-session .session-capture-feed { max-height: 118px; margin-top: 7px; padding-top: 6px; }
  body.in-session .controls-bar { grid-area: dock; position: static; }
  body.in-session .dial { width: min(72vh, 300px); }
  body.in-session .key-hints { display: none; }
  body.in-session .proj-card,
  body.in-session .add-card,
  body.in-session .add-card-form { min-height: 52px; padding: 8px 14px; }
  body.in-session .controls-bar .pill { min-height: 44px; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
