/*
  Vigil on your phone. Apple's system colors; color only for status or actions, always next to a word:
  blue = working / actions, orange = needs you, green = done, red = problem. The brand mark is plain white.
  Follows the iPhone's light or dark appearance.
*/
:root {
  --bg: #111113;
  --card: #1c1c1e;
  --card2: #2c2c2e;
  --hair: rgba(255, 255, 255, 0.1);
  --t1: #f5f5f7;
  --t2: #c7c7cc;
  --t3: #a1a1a6;
  --blue: #0a84ff;
  --orange: #ff9f0a;
  --green: #30d158;
  --red: #ff453a;
  --mark: #f5f5f7;
  --gray: #8e8e93;
  color-scheme: light dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f2f2f7;
    --card: #ffffff;
    --card2: #f2f2f7;
    --hair: rgba(60, 60, 67, 0.18);
    --t1: #1c1c1e;
    --t2: #3a3a3c;
    --t3: #545458;
    --blue: #007aff;
    --orange: #c45c00;
    --green: #248a3d;
    --red: #d70015;
    --mark: #1c1c1e;
    --gray: #6c6c70;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { background: var(--bg); }
html, body {
  margin: 0;
  color: var(--t1);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  /* The page only ever scrolls up and down; decorations can't push it sideways. */
  overflow-x: hidden;
  overflow-x: clip;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 18px) 18px calc(env(safe-area-inset-bottom) + 28px);
}

h1 { font-size: 30px; line-height: 1.12; letter-spacing: -0.02em; margin: 0; font-weight: 700; }
h2 { font-size: 15px; color: var(--t2); margin: 28px 2px 10px; font-weight: 600; }
p { margin: 0; }
.sub { color: var(--t2); font-size: 15px; }
.tiny { color: var(--t3); font-size: 12.5px; }
.center { text-align: center; }

/* Header */
/* Like an iOS navigation bar: stays put, and the page scrolls under frosted glass. */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  margin: calc(-1 * (env(safe-area-inset-top) + 18px)) -18px 14px;
  padding: calc(env(safe-area-inset-top) + 12px) 18px 10px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid transparent;
  transition: border-color 0.2s;
}
.top.scrolled { border-bottom-color: var(--hair); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 17px; }
.brand svg { width: 26px; height: 26px; }

/* The status card: one word, one sentence */
.status { display: flex; gap: 14px; align-items: center; padding: 18px; background: var(--card); border-radius: 22px; }
.eye-tile { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; flex: none; }
.eye-tile svg { width: 36px; height: 36px; }
.status .title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.status .line { color: var(--t2); font-size: 14.5px; margin-top: 3px; }
.facts { color: var(--t3); font-size: 12.5px; margin: 10px 4px 0; }
.stale { margin-top: 10px; padding: 10px 14px; border-radius: 14px; background: var(--card); color: var(--orange); font-size: 13.5px; }

/* Sessions */
.list { background: var(--card); border-radius: 20px; overflow: hidden; }
.row { display: grid; grid-template-columns: 16px 1fr auto; gap: 0 10px; padding: 13px 16px; align-items: start; }
.row.tap { grid-template-columns: 16px 1fr auto 8px; }
.row.tap::after { content: ""; grid-column: 4; grid-row: 1; align-self: center; width: 7px; height: 7px; border-right: 2px solid var(--t3); border-bottom: 2px solid var(--t3); transform: rotate(-45deg); opacity: 0.7; }
.task { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row + .row { border-top: 1px solid var(--hair); }
.dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; }
.dot.live { animation: breathe 2.2s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.3; } }
.name { font-weight: 600; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.what { color: var(--t2); font-size: 14px; margin-top: 1px; }
.meta { color: var(--t3); font-size: 12.5px; margin-top: 2px; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.row .action { grid-column: 2 / -1; margin-top: 10px; }

/* What happened */
.recap-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 2px 2px 10px; }
.card { background: var(--card); border-radius: 20px; padding: 16px; margin-top: 10px; }
.card .head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.card .headline { color: var(--t2); font-size: 14.5px; margin-top: 6px; }
.facts-line { color: var(--t3); font-size: 13px; margin-top: 8px; }
.asked { color: var(--orange); font-size: 13px; margin-top: 4px; }
.state-word { font-size: 13px; font-weight: 600; white-space: nowrap; }

/* Buttons: capsules */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 999px; padding: 12px 20px; font: inherit; font-weight: 600; font-size: 15px;
  background: var(--card2); color: var(--t1); text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--blue); color: #fff; }
.btn.small { padding: 7px 14px; font-size: 13.5px; }
.btn.block { display: flex; width: 100%; padding: 15px 20px; font-size: 16px; }
.btn:active { opacity: 0.7; }
.link { background: none; border: 0; color: var(--blue); font: inherit; font-size: 14px; padding: 6px 0; cursor: pointer; }
.link.quiet { color: var(--t3); }

/* Onboarding */
.hero { padding-top: 18px; }
.hero svg.big { width: 72px; height: 72px; }
.steps { margin: 26px 0 0; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; margin-bottom: 20px; }
.num { color: var(--t2); font-weight: 600; font-size: 16px; padding-top: 1px; }
.steps b { display: block; font-size: 16.5px; }
.steps span { color: var(--t2); font-size: 14.5px; }
.share-glyph { display: inline-block; vertical-align: -3px; width: 18px; height: 18px; }
.bullets { margin: 18px 0 0; padding: 0; list-style: none; }
.bullets li { display: flex; gap: 10px; align-items: baseline; margin-bottom: 10px; color: var(--t2); font-size: 15px; }
.bullets li::before { content: "\2013"; color: var(--t3); flex: none; }

.footer { margin-top: 34px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px); transform: translateX(-50%); background: var(--card2); color: var(--t1); padding: 11px 18px; border-radius: 999px; font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.25); }

/* "Make notifications impossible to miss" */
.tips + .tips { margin-top: 10px; }
.tips { margin-top: 30px; background: var(--card); border-radius: 18px; padding: 14px 16px; }
.tips summary { cursor: pointer; font-weight: 600; color: var(--t1); list-style: none; }
.tips summary::-webkit-details-marker { display: none; }
.tips summary::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 10px; border-right: 2px solid var(--t3); border-bottom: 2px solid var(--t3); transform: rotate(-45deg); vertical-align: 2px; }
.tips[open] summary::after { transform: rotate(45deg); vertical-align: 4px; }
.steps.small { margin: 0; }
.steps.small li { margin-bottom: 14px; grid-template-columns: 34px 1fr; }
.steps.small .num { width: 26px; height: 26px; font-size: 13px; }
.steps.small b { display: inline; font-size: 15px; }
.steps.small span { display: block; font-size: 13.5px; }

.task { color: var(--t3); font-size: 13px; margin-top: 2px; }

/* Activity: one lane per session, like Screen Time. Blue = working, orange = waiting on you. */
.chart { padding: 14px 16px 12px; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--t2); margin-bottom: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lanes { position: relative; }
.lane { display: grid; grid-template-columns: 112px 1fr; align-items: center; height: 24px; }
.lane-name { font-size: 12.5px; color: var(--t2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 10px; }
.track { position: relative; height: 8px; border-radius: 4px; background: var(--hair); }
.bar { position: absolute; top: 0; bottom: 0; min-width: 4px; border-radius: 4px; }
.bar.live { animation: breathe 2.2s ease-in-out infinite; }
.gridlines { position: absolute; left: 112px; right: 0; top: 0; bottom: 0; pointer-events: none; }
.gridlines i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--hair); }
.axis { position: relative; margin-left: 112px; height: 16px; margin-top: 6px; font-size: 11.5px; color: var(--t3); }
.axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.axis span.first { transform: none; }
.axis span.last { transform: translateX(-100%); }

/* Header buttons */
.top-right { display: flex; align-items: center; gap: 10px; }
.refresh { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--card); color: var(--blue); display: grid; place-items: center; cursor: pointer; padding: 0; }
.refresh svg { width: 18px; height: 18px; }
.refresh:active { opacity: 0.6; }
.refresh.spinning svg { animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.back { display: flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--blue); font: inherit; font-size: 17px; padding: 6px 0; cursor: pointer; }
.chev { width: 10px; height: 10px; border-left: 2.5px solid var(--blue); border-bottom: 2.5px solid var(--blue); transform: rotate(45deg); margin-left: 3px; }

/* Tappable rows and cards */
.tap { cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background 0.15s; }
.tap:active { background: var(--card2); }

/* One session */
.detail-title { font-size: 30px; margin-top: 4px; overflow-wrap: anywhere; }
.detail-status { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; font-size: 15px; }
.detail-status .state-word { font-size: 15px; }
.detail-since { color: var(--t2); font-variant-numeric: tabular-nums; }
.big-line { font-size: 17px; font-weight: 600; line-height: 1.35; }
.quote { font-size: 15.5px; line-height: 1.45; border-left: 3px solid var(--hair); padding-left: 12px; white-space: pre-wrap; }
.said { color: var(--t2); font-size: 15px; line-height: 1.45; }
.card.flush { padding: 4px 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 16px 1fr auto; gap: 0 10px; padding: 10px 16px; align-items: start; }
.timeline li + li { border-top: 1px solid var(--hair); }
.timeline .dot { margin-top: 6px; width: 8px; height: 8px; }
.step-text { font-size: 14.5px; }
.step-text.strong { font-weight: 600; }
.step-time { color: var(--t3); font-size: 12.5px; white-space: nowrap; padding-top: 2px; }
.files, .commits { list-style: none; margin: 10px 0 0; padding: 0; }
.files li { font: 13.5px ui-monospace, "SF Mono", Menlo, monospace; padding: 5px 0; color: var(--t1); overflow-wrap: anywhere; }
.files li + li, .commits li + li { border-top: 1px solid var(--hair); }
.commits li { font-size: 14.5px; padding: 7px 0; }
.sub-head { font-size: 13px; font-weight: 600; color: var(--t2); margin-top: 14px; }
.detail-meta { margin: 22px 2px 0; }

/* ===== The sky: Vigil's color comes from the time of day, like the Weather app ===== */
html { --sky-top: #070b1c; --sky-mid: #0f1a3a; --sky-bottom: #1a2a55; }
html[data-sky="dawn"] { --sky-top: #1b2d5e; --sky-mid: #b35e6b; --sky-bottom: #f4a06a; }
html[data-sky="day"] { --sky-top: #0e4fa8; --sky-mid: #2f86d8; --sky-bottom: #79c3ee; }
html[data-sky="dusk"] { --sky-top: #1c2350; --sky-mid: #b04e62; --sky-bottom: #f08a4b; }
body { position: relative; isolation: isolate; }
/* The sky behind the top of the page, and the night it wakes up from. */
.sky, .night { position: absolute; left: 0; right: 0; top: 0; height: 460px; z-index: -1; pointer-events: none; }
.sky { background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 38%, color-mix(in srgb, var(--sky-bottom) 55%, var(--bg)) 62%, var(--bg) 100%); }
.night { background: linear-gradient(180deg, #070b1c 0%, #0f1a3a 38%, color-mix(in srgb, #1a2a55 55%, var(--bg)) 62%, var(--bg) 100%); transition: opacity 2.2s ease-in-out 0.25s; }
.stars {
  position: absolute; left: 0; right: 0; top: 0; height: 300px; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 27% 8%, #fff 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 41% 26%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 55% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 68% 30%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 79% 6%, #fff 50%, transparent 51%),
    radial-gradient(1.8px 1.8px at 88% 22%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 6% 40%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 33% 44%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 61% 48%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 93% 42%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 19% 58%, #fff 50%, transparent 51%);
  opacity: 0.75; transition: opacity 1.8s ease-out 0.6s;
}
.sun {
  /* Full width, never wider than the screen: a fixed-size 520px circle made the whole page slide sideways on phones. */
  position: absolute; left: 0; right: 0; top: 150px; height: 520px; z-index: -1; pointer-events: none;
  background: radial-gradient(circle 368px at 50% 50%, color-mix(in srgb, var(--sky-bottom) 70%, #fff) 0%, color-mix(in srgb, var(--sky-bottom) 35%, transparent) 38%, transparent 68%);
  opacity: 0; transform: translateY(160px); transition: opacity 1.6s ease-out 0.5s, transform 2.6s cubic-bezier(0.16, 1, 0.3, 1) 0.4s;
}
html[data-sky="night"] .sun { display: none; }
html.awake .night { opacity: 0; }
html.still *, html.still *::before, html.still *::after { transition: none !important; animation: none !important; }
html.awake .sun { opacity: 0.55; transform: translateY(0); }
html.awake:not([data-sky="night"]) .stars { opacity: 0; }

/* Over the sky, the header is white; once you scroll it becomes the frosted bar. */
.top { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; color: #fff; transition: background 0.2s, color 0.2s; }
.top .tiny { color: rgba(255, 255, 255, 0.78); }
.top .refresh { background: rgba(255, 255, 255, 0.18); color: #fff; }
.top .back, .top .back .chev { color: #fff; border-color: #fff; }
.top.scrolled { color: var(--t1); background: color-mix(in srgb, var(--bg) 78%, transparent); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.top.scrolled .tiny { color: var(--t3); }
.top.scrolled .refresh { background: var(--card); color: var(--blue); }
.top.scrolled .back { color: var(--blue); }
.top.scrolled .back .chev { border-color: var(--blue); }
.brand svg path { stroke: currentColor; }
.brand svg circle[mask]:not([fill="none"]) { fill: currentColor; }
:root { --white: #fff; }

/* The status card wears the state's color: blue working, amber needs you, green done, red hot. */
.status, .session-hero {
  --g1: #3a3a44; --g2: #26262e;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  color: #fff;
  box-shadow: 0 12px 30px -14px color-mix(in srgb, var(--g2) 80%, transparent);
}
.tone-working, .tone-manual { --g1: #0a84ff; --g2: #22c3e6; }
.tone-needs, .tone-warning { --g1: #ffb340; --g2: #ff7a2f; }
.tone-done { --g1: #34d399; --g2: #14b8a6; }
.tone-danger { --g1: #ff5a4f; --g2: #ff8a3d; }
.status .line, .session-hero .line { color: rgba(255, 255, 255, 0.86); }
.status .eye-tile { background: rgba(255, 255, 255, 0.2) !important; }
.status-facts { color: rgba(255, 255, 255, 0.78); font-size: 12.5px; margin-top: 8px; }
.status .eye-tile svg { transform-origin: 50% 50%; }
html.awake .status .eye-tile svg { animation: open-eye 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s both; }
@keyframes open-eye { from { transform: scaleY(0.08); } to { transform: scaleY(1); } }
.status.idle .eye-tile svg { animation: none; }

/* Things arrive one after another as Vigil wakes up. */
/* Always visible by default; the entrance only plays on top of that. */
html.awake:not(.settled) .reveal { animation: rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: calc(0.15s + var(--i, 0) * 0.06s); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
html.settled .status .eye-tile svg { animation: none; }

/* Gradient bars, like light running along them. */
.bar.working, .legend i.working { background: linear-gradient(90deg, #0a84ff, #2dd4e8) !important; }
.bar.waiting, .legend i.waiting { background: linear-gradient(90deg, #ff9f0a, #ff6a3d) !important; }

/* The session screen: a colored hero with the name and how long. */
.session-hero { border-radius: 22px; padding: 18px; margin-top: 4px; }
.session-hero .detail-title { margin: 0; color: #fff; }
.session-hero .detail-status { color: rgba(255, 255, 255, 0.9); }
.session-hero .detail-status .state-word { color: #fff !important; }
.session-hero .detail-since { color: rgba(255, 255, 255, 0.85); }
.session-hero .btn { margin-top: 14px; }
.session-hero .btn.primary, .session-hero .btn { background: rgba(255, 255, 255, 0.95); color: #111; }

@media (prefers-reduced-motion: reduce) {
  .night, .stars, .sun { transition: none; }
  html.awake:not(.settled) .reveal { animation: none; }
  html.awake .status .eye-tile svg { animation: none; }
}

/* ===== More life ===== */

/* Project avatars: the project's own color, a ring for the state. */
.avatar { position: relative; width: calc(var(--size) + 8px); height: calc(var(--size) + 8px); display: grid; place-items: center; flex: none; }
.avatar .face { width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; letter-spacing: 0.02em; background: linear-gradient(135deg, var(--a), var(--b)); box-shadow: 0 4px 12px -6px var(--b); }
.avatar.ended .face, .avatar.quiet .face, .avatar.ready .face { opacity: 0.55; }
.avatar.working::after, .avatar.needs::after { content: ""; position: absolute; inset: 0; border-radius: 50%; }
.avatar.working::after {
  background: conic-gradient(from 0deg, transparent 0 55%, rgba(45, 212, 232, 0.2) 62%, #2dd4e8 85%, #0a84ff 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  animation: spin 1.6s linear infinite;
}
.avatar.needs::after { border: 2.5px solid #ff9f0a; animation: breathe 2.2s ease-in-out infinite; }
.row { grid-template-columns: 42px 1fr auto; align-items: start; }
.row.tap { grid-template-columns: 42px 1fr auto 8px; }
.row > .avatar { align-self: start; margin-top: -3px; margin-left: -4px; }
.row .action { grid-column: 2 / -1; }
.name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.name-row .avatar { margin: -6px 0 -6px -6px; }
.hero-head { display: flex; align-items: center; gap: 10px; }
.hero-head .avatar { margin-left: -4px; }
.session-hero .avatar .face { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6); }

/* Activity ring + summary */
.chart-head { display: flex; align-items: center; margin-bottom: 12px; }
.ring-sum { display: flex; align-items: center; gap: 10px; }
.ring { width: 44px; height: 44px; }
.ring-big { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
html.awake:not(.settled) .ring-arc { animation: ring-in 1s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both; }
@keyframes ring-in { from { stroke-dashoffset: var(--c); } to { stroke-dashoffset: var(--v); } }
.hue-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; background: linear-gradient(135deg, var(--a), var(--b)); }

/* The sky keeps moving once it's light: aurora at night, clouds by day. */
.drift { position: absolute; left: 0; right: 0; top: 0; height: 380px; z-index: -1; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity 2.4s ease-out 0.9s; }
html.awake .drift { opacity: 1; }
.drift i { position: absolute; border-radius: 50%; filter: blur(28px); animation: drift 22s ease-in-out infinite alternate; }
.drift i:nth-child(1) { left: -20%; top: 4%; width: 75%; height: 120px; background: var(--d1); }
.drift i:nth-child(2) { left: 45%; top: 16%; width: 65%; height: 100px; background: var(--d2); animation-duration: 28s; animation-delay: -6s; }
.drift i:nth-child(3) { left: 5%; top: 40%; width: 90%; height: 130px; background: var(--d3); animation-duration: 34s; animation-delay: -12s; }
@keyframes drift { from { transform: translate(-30px, -6px) scale(1); } to { transform: translate(40px, 10px) scale(1.12); } }
html { --d1: rgba(45, 212, 191, 0.32); --d2: rgba(52, 211, 153, 0.22); --d3: rgba(59, 130, 246, 0.26); }
html[data-sky="dawn"] { --d1: rgba(255, 180, 162, 0.32); --d2: rgba(255, 214, 165, 0.28); --d3: rgba(255, 143, 163, 0.22); }
html[data-sky="dusk"] { --d1: rgba(255, 154, 118, 0.3); --d2: rgba(255, 196, 140, 0.24); --d3: rgba(232, 97, 140, 0.22); }
html[data-sky="day"] { --d1: rgba(255, 255, 255, 0.24); --d2: rgba(255, 255, 255, 0.18); --d3: rgba(191, 230, 255, 0.22); }

/* The status card's color slowly moves, and a sheen passes over it while Claude works. */
.status, .session-hero { background: linear-gradient(120deg, var(--g1), var(--g2), var(--g1)); background-size: 220% 220%; animation: flow 9s ease-in-out infinite alternate; position: relative; overflow: hidden; }
@keyframes flow { from { background-position: 0% 40%; } to { background-position: 100% 60%; } }
.status.tone-working::after, .session-hero.tone-working::after, .status.tone-manual::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.22) 50%, transparent 65%);
  transform: translateX(-120%); animation: sheen 4.5s ease-in-out 1.2s infinite;
}
@keyframes sheen { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }

@media (prefers-reduced-motion: reduce) {
  .drift i, .status, .session-hero, .avatar.working::after, .avatar.needs::after { animation: none !important; }
  .status::after, .session-hero::after { display: none; }
}

/* ===== Tidy list ===== */

/* Slim status bar for the normal, idle state. */
.status-bar { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 16px; color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.28); -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4); font-size: 14px; }
.status-bar svg { width: 24px; height: 24px; flex: none; opacity: 0.9; }
.status-bar b { font-weight: 600; color: #fff; }
.status-bar .sep, .status-line .sep { margin: 0 6px; opacity: 0.6; }

/* Rows: avatar | title, state and time, two lines of summary | chevron. Nothing sits in a squeezed right column. */
.row, .row.tap { grid-template-columns: 42px minmax(0, 1fr); align-items: start; }
.row.tap { grid-template-columns: 42px minmax(0, 1fr) 10px; }
.row.tap::after { grid-column: 3; grid-row: 1; align-self: center; }
.row .body { min-width: 0; }
.row .action { grid-column: auto; }
.status-line { display: flex; align-items: baseline; flex-wrap: wrap; font-size: 13px; margin-top: 1px; color: var(--t3); font-variant-numeric: tabular-nums; }
.status-line .state-word { font-size: 13px; }
.row .what { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; }
.card .headline { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.name-row .body { min-width: 0; }
.name-row .state-word { font-size: 12.5px; }

/* Status dot on the avatar. */
.avatar .badge { position: absolute; right: 2px; bottom: 2px; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px var(--card); }
.session-hero .avatar .badge { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); }

/* pull to refresh: an iPhone-style spinner in the gap above the page. Ticks fill in as you pull,
   then it turns in eight steps like the system one while it refreshes. */
.pull {
  position: fixed; left: 50%; top: 0; z-index: 20; width: 28px; height: 28px;
  color: rgba(255, 255, 255, 0.85); opacity: 0; transform: translate(-50%, -40px); pointer-events: none;
  transition: opacity 0.15s linear;
}
.pull svg { width: 100%; height: 100%; display: block; fill: currentColor; }
.pull rect { transition: opacity 0.08s linear; }
.pull.spinning svg { animation: tick 0.8s steps(8) infinite; }
.pull.spinning rect:nth-child(1) { opacity: 1; }    .pull.spinning rect:nth-child(2) { opacity: 0.88; }
.pull.spinning rect:nth-child(3) { opacity: 0.76; } .pull.spinning rect:nth-child(4) { opacity: 0.64; }
.pull.spinning rect:nth-child(5) { opacity: 0.52; } .pull.spinning rect:nth-child(6) { opacity: 0.4; }
.pull.spinning rect:nth-child(7) { opacity: 0.3; }  .pull.spinning rect:nth-child(8) { opacity: 0.22; }
.pull.closing { transition: opacity 0.25s ease-out, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1); opacity: 0 !important; }
@keyframes tick { to { transform: rotate(-360deg); } }
#app.settle { transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1); }
@media (prefers-reduced-motion: reduce) { .pull.spinning svg { animation-duration: 1.6s; } }
