/* Rewind workspace. Violet-to-electric-blue on deep charcoal (dark is the showcase);
   a cool, quiet paper-white for light. The memorable thing is the tape dock at the bottom. */
:root {
  --bg: #f7f7fb;
  --side: #f2f1f8;
  --raised: #ffffff;
  --sunk: #efeef6;
  --hover: #e9e8f3;
  --line: #e3e1ee;
  --line-2: #d2cfe2;
  --ink: #15131f;
  --ink-2: #3b3851;
  --muted: #6a6782;
  --faint: #9c99b0;
  --accent: #5f45f2;
  --accent-2: #4b31e0;
  --accent-soft: #efecff;
  --accent-line: #cdc5ff;
  --blue: #2f6bff;
  --on-accent: #ffffff;
  --grad: linear-gradient(120deg, #8656ff 0%, #5f45f2 48%, #2f74ff 100%);
  --fill: var(--grad);
  --glow: rgba(95, 69, 242, .38);
  --glass: rgba(255, 255, 255, .78);
  --glass-edge: rgba(255, 255, 255, .9);
  --danger: #d92d43;
  --danger-soft: #fdecee;
  --ok: #138a5a;
  --ok-soft: #e5f5ee;
  --warn: #b5650d;
  --warn-soft: #fdf1e1;
  --user: #1b1830;
  --user-ink: #ffffff;
  --shadow-1: 0 1px 2px rgba(27, 24, 48, .05);
  --shadow-2: 0 1px 2px rgba(27, 24, 48, .04), 0 8px 22px -10px rgba(40, 30, 110, .18);
  --shadow-3: 0 2px 6px rgba(27, 24, 48, .06), 0 28px 56px -22px rgba(40, 30, 110, .32);
  --page: radial-gradient(900px 520px at 78% -12%, rgba(120, 90, 255, .10), transparent 70%),
          radial-gradient(700px 460px at -10% 110%, rgba(47, 116, 255, .07), transparent 70%), #f7f7fb;
  --ui: "Schibsted Grotesk", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r-s: 6px; --r-m: 10px; --r-l: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0c13; --side: #111018; --raised: #17161f; --sunk: #1c1b26; --hover: #23212f;
    --line: #26242f; --line-2: #36333f; --ink: #eeedf6; --ink-2: #c6c3d6; --muted: #8f8ba5; --faint: #615e75;
    --accent: #a08fff; --accent-2: #b8abff; --accent-soft: #221d3d; --accent-line: #433a80; --blue: #5d8dff; --on-accent: #ffffff;
    --grad: linear-gradient(120deg, #8a57ff 0%, #6a4cff 48%, #3a74ff 100%);
    --glow: rgba(120, 88, 255, .55); --glass: rgba(23, 22, 33, .66); --glass-edge: rgba(255, 255, 255, .06);
    --danger: #ff6378; --danger-soft: #3a1a24; --ok: #4fd39a; --ok-soft: #13302a; --warn: #f0a650; --warn-soft: #33261a;
    --user: #2a2545; --user-ink: #f1efff;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-2: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 26px -12px rgba(0, 0, 0, .7);
    --shadow-3: 0 2px 8px rgba(0, 0, 0, .45), 0 30px 60px -22px rgba(0, 0, 0, .85);
    --page: radial-gradient(1000px 560px at 80% -14%, rgba(124, 84, 255, .16), transparent 70%),
            radial-gradient(800px 520px at -8% 112%, rgba(58, 116, 255, .10), transparent 70%), #0d0c13;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0c13; --side: #111018; --raised: #17161f; --sunk: #1c1b26; --hover: #23212f;
  --line: #26242f; --line-2: #36333f; --ink: #eeedf6; --ink-2: #c6c3d6; --muted: #8f8ba5; --faint: #615e75;
  --accent: #a08fff; --accent-2: #b8abff; --accent-soft: #221d3d; --accent-line: #433a80; --blue: #5d8dff; --on-accent: #ffffff;
  --grad: linear-gradient(120deg, #8a57ff 0%, #6a4cff 48%, #3a74ff 100%);
  --glow: rgba(120, 88, 255, .55); --glass: rgba(23, 22, 33, .66); --glass-edge: rgba(255, 255, 255, .06);
  --danger: #ff6378; --danger-soft: #3a1a24; --ok: #4fd39a; --ok-soft: #13302a; --warn: #f0a650; --warn-soft: #33261a;
  --user: #2a2545; --user-ink: #f1efff;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 26px -12px rgba(0, 0, 0, .7);
  --shadow-3: 0 2px 8px rgba(0, 0, 0, .45), 0 30px 60px -22px rgba(0, 0, 0, .85);
  --page: radial-gradient(1000px 560px at 80% -14%, rgba(124, 84, 255, .16), transparent 70%),
          radial-gradient(800px 520px at -8% 112%, rgba(58, 116, 255, .10), transparent 70%), #0d0c13;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { background: var(--bg); color: var(--ink); font: 400 14px/1.5 var(--ui); -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.grow { flex: 1; }
.num { font-variant-numeric: tabular-nums; }
.mobile-only { display: none !important; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr) 372px; height: 100vh; height: 100dvh; transition: grid-template-columns .22s ease; }
.app.co-off { grid-template-columns: 236px minmax(0, 1fr) 0; }
.app.co-off .copilot { visibility: hidden; }

.sidebar { display: flex; flex-direction: column; gap: 4px; padding: 16px 12px 14px; background: var(--side); border-right: 1px solid var(--line); min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.wordmark { font-weight: 750; font-size: 17px; letter-spacing: -.02em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; text-align: left; transition: background .12s, color .12s; }
.nav-item svg { width: 18px; height: 18px; color: var(--muted); }
.nav-item span { flex: 1; min-width: 0; }
.nav-item:hover { background: var(--hover); color: var(--ink); }
.nav-item:active { transform: translateY(.5px); }
.nav-item[aria-current="page"] { background: var(--raised); color: var(--ink); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
.nav-item[aria-current="page"] svg { color: var(--accent); }
.count { font-style: normal; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.badge { font-style: normal; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 600; background: var(--accent-soft); color: var(--accent); font-variant-numeric: tabular-nums; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.promise { display: flex; gap: 10px; padding: 12px; border-radius: var(--r-m); background: var(--raised); border: 1px solid var(--line); }
.promise svg { width: 16px; height: 16px; color: var(--accent); margin-top: 2px; }
.promise p { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

/* ---------- header bar ---------- */
.bar { border-bottom: 1px solid var(--line); background: transparent; }
.bar-row { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 18px 0 28px; }
.bar h1 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: blink 1s ease-in-out infinite alternate; }
.pill.err { background: var(--danger-soft); color: var(--danger); }
.pill.err::before { animation: none; }
@keyframes blink { from { opacity: .25; } }
.ibtn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--muted); transition: background .12s, color .12s, transform .08s; }
.ibtn svg { width: 18px; height: 18px; }
.ibtn:hover { background: var(--hover); color: var(--ink); }
.ibtn:active { transform: scale(.94); }
.ibtn[aria-pressed="true"] { color: var(--accent); }

/* one-click theme switch: the icon shows what you'll get */
.theme-toggle { border: 1px solid var(--line); background: var(--raised); box-shadow: var(--shadow-1); }
.theme-toggle .tt-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .tt-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .tt-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .tt-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .tt-moon { display: none; }
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent-line); }
.theme-toggle.flip svg { animation: flip .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes flip { from { transform: rotate(-120deg) scale(.4); opacity: 0; } }

/* ---------- the logo: a rewind loop around a tape reel ---------- */
.rw-logo { width: 30px; height: 30px; flex: none; overflow: visible; }
.rw-tile { fill: url(#rw-grad); }
.rw-loop path { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.rw-loop, .rw-reel { transform-box: view-box; transform-origin: 16px 16px; }
.rw-reel > circle:first-child { fill: #fff; }
.rw-hole { fill: #6a4cff; }
.rw-reel { animation: reel-idle 9s cubic-bezier(.6, 0, .3, 1) infinite; }
@keyframes reel-idle { 0%, 84% { transform: rotate(0); } 100% { transform: rotate(-360deg); } }
.brand .rw-logo { filter: drop-shadow(0 4px 12px var(--glow)); }
.brand:hover .rw-reel { animation: reel-rw .7s linear infinite; }
@keyframes reel-rw { to { transform: rotate(-360deg); } }
@keyframes loop-rw { to { transform: rotate(-360deg); } }
body.rewinding .rw-reel { animation: reel-rw .45s linear infinite; }
body.rewinding .rw-loop { animation: loop-rw 1.1s cubic-bezier(.5, 0, .5, 1) infinite; }

/* ---------- the dock: every point in time, along the bottom ---------- */
.dock { position: relative; flex: none; display: flex; align-items: center; gap: 6px; height: 78px; margin: 0 12px 12px; padding: 0 8px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow-2), inset 0 1px 0 var(--glass-edge); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); overflow: hidden; }
.transport { flex: none; display: flex; flex-direction: column; justify-content: center; gap: 2px; width: 280px; padding-right: 8px; border-right: 1px solid var(--line); height: 60px; }
.tbtn { display: flex; align-items: center; gap: 8px; width: 100%; height: 28px; padding: 0 10px 0 8px; border-radius: 9px; text-align: left; color: var(--ink); transition: background .12s, box-shadow .12s, transform .06s; }
.tbtn > svg { width: 16px; height: 16px; color: var(--accent); }
.tbtn .tl { display: flex; align-items: baseline; gap: 7px; min-width: 0; line-height: 1.2; }
.tbtn .tl b { flex: none; font-size: 12.5px; font-weight: 700; }
.tbtn .tl small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbtn:hover:not(:disabled) { background: var(--hover); }
.tbtn:active:not(:disabled) { transform: scale(.97); }
.tbtn:disabled { cursor: default; }
.tbtn:disabled > svg, .tbtn:disabled .tl b { color: var(--faint); }
.tbtn:disabled .tl small { color: var(--faint); }
.step { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 56px; height: 54px; padding: 0 6px 0 12px; border-left: 1px solid var(--line); font-size: 11px; color: var(--muted); line-height: 1.1; }
.step b { font-size: 22px; color: var(--ink); font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.step b.roll { animation: roll .35s ease-out; display: inline-block; }
@keyframes roll { from { transform: translateY(-40%); opacity: 0; } }

.strip { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-left: 26px; overflow-y: hidden; scrollbar-width: none; padding: 0 10px; mask-image: linear-gradient(90deg, transparent, #000 22px, #000 calc(100% - 22px), transparent); }
.strip::-webkit-scrollbar { display: none; }
#timeline { position: relative; list-style: none; margin: 0 auto 0 0; padding: 0 24px; display: flex; align-items: center; width: max-content; }
/* each frame owns the connector to the next one, so the line stops at every pill */
.frame { position: relative; flex: none; display: flex; align-items: center; padding-right: 34px; scroll-snap-align: start; }
.frame::after { content: ""; position: absolute; right: 6px; top: calc(50% - 1px); width: 22px; height: 2px; border-radius: 2px; background: var(--grad); opacity: .7; }
.frame:last-child { padding-right: 0; }
.frame:last-child::after { display: none; }
.frame.here::after, .frame.ahead::after { background: repeating-linear-gradient(90deg, var(--line-2) 0 4px, transparent 4px 8px); opacity: 1; }
.frame > button, .frame > div { position: relative; display: flex; align-items: center; gap: 9px; height: 46px; max-width: 230px; padding: 0 14px 0 7px; border-radius: 14px; border: 1px solid var(--line); background: var(--raised); color: var(--ink-2); white-space: nowrap; text-align: left; box-shadow: var(--shadow-1); transition: border-color .15s, color .15s, background .15s, transform .08s, box-shadow .15s; }
.frame .who { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--sunk); color: var(--ink-2); flex: none; }
.frame .who svg { width: 15px; height: 15px; }
.frame .who.ai { background: var(--grad); color: #fff; box-shadow: 0 4px 12px -4px var(--glow); }
.frame .who.restore { background: var(--ok-soft); color: var(--ok); }
.frame .who.start { background: transparent; border: 1.5px solid var(--line-2); color: var(--muted); }
.frame .txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.frame .act { font-size: 12.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.frame .tm { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.frame > button:hover { border-color: var(--accent-line); box-shadow: var(--shadow-2), 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent); transform: translateY(-1px); }
.frame > button:active { transform: translateY(0) scale(.98); }
.frame.ahead > button { border-style: dashed; background: transparent; box-shadow: none; }
.frame.ahead .act { color: var(--muted); }
.frame.here > div { background: var(--grad); border-color: transparent; box-shadow: 0 10px 28px -10px var(--glow), 0 0 0 1px color-mix(in srgb, #fff 14%, transparent) inset; }
.frame.here .act, .frame.here .tm { color: #fff; }
.frame.here .tm { opacity: .78; }
.frame.here .who { background: rgba(255, 255, 255, .2); color: #fff; border-color: transparent; box-shadow: none; }
.frame.next > div { justify-content: center; width: 46px; height: 46px; padding: 0; border: 1.5px dashed var(--line-2); background: transparent; box-shadow: none; color: var(--faint); font-size: 12.5px; font-weight: 500; }
.frame.next svg { width: 15px; height: 15px; }
.frame.empty > div { max-width: none; border-style: dashed; background: transparent; box-shadow: none; color: var(--muted); font-size: 12.5px; padding: 0 16px; }
.frame.landed > div { animation: land .9s ease-out; }
@keyframes land { from { box-shadow: 0 0 0 14px color-mix(in srgb, var(--accent) 35%, transparent); } }
/* the tape-rewind sweep while travelling */
.dock::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; background: linear-gradient(270deg, transparent 0, color-mix(in srgb, var(--accent) 26%, transparent) 50%, transparent 100%) no-repeat; background-size: 38% 100%; }
body.rewinding .dock::after { opacity: 1; animation: sweep .8s linear infinite; }
@keyframes sweep { from { background-position: 160% 0; } to { background-position: -60% 0; } }
body.rewinding #timeline { animation: jitter .16s steps(2) infinite; }
@keyframes jitter { 50% { transform: translateX(2px); } }
@media (prefers-reduced-motion: reduce) {
  body.rewinding .dock::after { display: none; }
  body.rewinding #timeline { animation: none; }
}

/* ---------- stage + views ---------- */
.stage { position: relative; flex: 1; min-height: 0; }
.view { position: absolute; inset: 0; overflow-y: auto; padding: 24px 28px 48px; scrollbar-width: thin; }
.lede { margin: 0; color: var(--muted); max-width: 60ch; }
h2 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 12px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--raised); color: var(--ink); font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; box-shadow: var(--shadow-1); transition: border-color .12s, background .12s, color .12s, transform .06s, filter .12s; }
.btn svg { width: 16px; height: 16px; }
.btn:hover:not(:disabled) { border-color: var(--faint); background: var(--hover); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--fill); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 1px 2px color-mix(in srgb, var(--accent) 40%, transparent), inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn.primary:hover:not(:disabled) { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover:not(:disabled) { filter: brightness(1.06); background: var(--danger); }
.btn.danger-ghost { color: var(--danger); }
.btn.danger-ghost:hover:not(:disabled) { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover:not(:disabled) { background: var(--hover); border-color: transparent; }
.btn.accent-ghost { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); box-shadow: none; }
.btn.accent-ghost:hover:not(:disabled) { background: var(--fill); color: var(--on-accent); border-color: var(--accent); }
.row { display: flex; flex-wrap: wrap; gap: 8px; }

/* segmented */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--sunk); }
.seg-b { display: inline-grid; place-items: center; height: 28px; min-width: 30px; padding: 0 8px; border-radius: 6px; color: var(--muted); font-size: 13px; font-weight: 500; }
.seg-b svg { width: 16px; height: 16px; }
.seg-b:hover { color: var(--ink); }
.seg-b[aria-pressed="true"], .seg-b[aria-checked="true"] { background: var(--raised); color: var(--ink); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
.seg.wide .seg-b { padding: 0 14px; }

/* ---------- intake ---------- */
.intake { display: flex; gap: 10px; margin-bottom: 18px; }
.drop { flex: 1; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 16px; border-radius: var(--r-m); border: 1.5px dashed var(--line-2); background: var(--bg); color: var(--ink); text-align: left; transition: border-color .15s, background .15s; }
.drop svg { width: 20px; height: 20px; color: var(--accent); }
.drop strong { font-weight: 600; }
.drop .muted { font-size: 13px; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.intake .btn { height: auto; min-height: 52px; border-radius: var(--r-m); padding: 0 16px; }
.intake.big { flex-direction: column; }
.intake.big .drop { flex-direction: column; justify-content: center; text-align: center; min-height: 220px; gap: 10px; padding: 32px; }
.intake.big .drop svg { width: 30px; height: 30px; }
.intake.big .drop strong { display: block; font-size: 17px; margin-bottom: 2px; }
.intake.big .btn { min-height: 40px; align-self: center; }

/* ---------- toolbar + chips ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.chips { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.chips::-webkit-scrollbar { display: none; }
.fchip { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); font-size: 13px; font-weight: 500; color: var(--ink-2); transition: border-color .12s, background .12s, color .12s; }
.fchip:hover { border-color: var(--line-2); color: var(--ink); }
.fchip em { font-style: normal; color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.fchip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.fchip[aria-pressed="true"] em { color: color-mix(in srgb, var(--bg) 65%, transparent); }
.fchip.bump { animation: bump .45s ease-out; }
@keyframes bump { 40% { transform: scale(1.08); border-color: var(--accent); } }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--faint)); flex: none; }

/* ---------- documents ---------- */
.sect { margin-bottom: 26px; }
.grid + .sect, .list + .sect { margin-top: 28px; }
.sect-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sect-h h2 { margin: 0; }
.sect-h .muted { font-size: 13px; }
.inbox { border: 1px solid var(--line); border-radius: var(--r-l); background: var(--side); padding: 14px; }
.inbox-row { display: flex; flex-wrap: wrap; gap: 8px; }
.icard { display: inline-flex; align-items: center; gap: 8px; height: 34px; max-width: 260px; padding: 0 12px 0 8px; border-radius: 8px; background: var(--raised); border: 1px solid var(--line); font-size: 13px; box-shadow: var(--shadow-1); }
.icard .ext { font-size: 10px; font-weight: 700; letter-spacing: .02em; color: var(--muted); background: var(--sunk); border-radius: 4px; padding: 3px 5px; }
.icard .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icard .st { font-size: 12px; color: var(--accent); white-space: nowrap; }
.icard.reading { border-color: var(--accent-line); }
.icard.reading .st::after { content: ""; display: inline-block; width: 9px; height: 9px; margin-left: 6px; vertical-align: -1px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.flyer { position: fixed; z-index: 40; pointer-events: none; margin: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 14px; }
.dcard { position: relative; display: flex; flex-direction: column; text-align: left; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--raised); overflow: hidden; box-shadow: var(--shadow-1); transition: border-color .15s, box-shadow .15s, transform .08s; }
.dcard:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.dcard:active { transform: translateY(1px); }
.dcard[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.thumb { position: relative; height: 128px; background: var(--sunk); border-bottom: 1px solid var(--line); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.paper { position: absolute; left: 50%; top: 18px; width: 96px; height: 124px; transform: translateX(-50%) rotate(-1.5deg); background: var(--raised); border-radius: 4px; box-shadow: var(--shadow-2); padding: 14px 12px; }
.paper i { display: block; height: 4px; border-radius: 2px; background: var(--line); margin-bottom: 6px; }
.paper i:first-child { width: 56%; height: 6px; background: var(--c, var(--line-2)); opacity: .7; margin-bottom: 10px; }
.paper i:nth-child(3) { width: 82%; } .paper i:nth-child(4) { width: 64%; } .paper i:nth-child(5) { width: 74%; }
.paper b { position: absolute; right: 8px; bottom: 30px; font-size: 9px; font-weight: 700; color: var(--faint); letter-spacing: .04em; }
.dbody { display: flex; flex-direction: column; gap: 3px; padding: 11px 13px 13px; min-width: 0; }
.dtitle { font-weight: 650; font-size: 14px; line-height: 1.3; letter-spacing: -.005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dparty { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dmeta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.amt { font-weight: 650; font-size: 13px; font-variant-numeric: tabular-nums; margin-right: auto; }
.cat { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--sunk); color: var(--ink-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.due { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--sunk); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.due.soon { background: var(--warn-soft); color: var(--warn); }
.due.late { background: var(--danger-soft); color: var(--danger); }
.fresh { animation: fresh 2.4s ease-out; }
@keyframes fresh { from { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); } }

.list { border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; background: var(--raised); }
.lrow { display: grid; grid-template-columns: 34px minmax(0, 2fr) minmax(0, 1.3fr) 110px 96px 108px; align-items: center; gap: 14px; width: 100%; padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13.5px; transition: background .12s; }
.lrow:last-child { border-bottom: 0; }
.lrow:hover { background: var(--hover); }
.lrow[aria-current="true"] { background: var(--accent-soft); }
.lrow .ico { display: grid; place-items: center; width: 30px; height: 34px; border-radius: 6px; background: var(--sunk); color: var(--muted); overflow: hidden; }
.lrow .ico svg { width: 16px; height: 16px; }
.lrow .ico img { width: 100%; height: 100%; object-fit: cover; }
.lrow .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .p { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .amt { margin: 0; text-align: right; }
.lhead { background: var(--side); color: var(--muted); font-size: 12px; font-weight: 500; cursor: default; }
.lhead:hover { background: var(--side); }

.utils { display: flex; flex-wrap: wrap; gap: 8px; }
.ucard { display: inline-flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--side); font-size: 13px; }
.ucard svg.u { width: 16px; height: 16px; color: var(--muted); }
.ucard b { font-weight: 600; }
.ucard small { color: var(--muted); font-size: 12px; }

.center-note { max-width: 56ch; margin: 4px auto 22px; text-align: center; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 56px 24px; color: var(--muted); }
.empty .eico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--sunk); color: var(--muted); margin-bottom: 4px; }
.empty .eico svg { width: 22px; height: 22px; }
.empty b { color: var(--ink); font-size: 15px; font-weight: 650; }
.empty p { margin: 0; max-width: 42ch; }
.empty .btn { margin-top: 8px; }

/* skeletons */
.sk { background: linear-gradient(90deg, var(--sunk) 0, var(--hover) 40%, var(--sunk) 80%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -150% 0; } }
.skcard { height: 214px; border-radius: var(--r-l); }
.skrow { height: 58px; border-radius: var(--r-m); margin: 0 0 10px 56px; }

/* ---------- overview ---------- */
.ov-hero { display: flex; align-items: flex-end; gap: 24px; justify-content: space-between; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ov-hero h2 { font-size: 26px; line-height: 1.15; letter-spacing: -.025em; font-weight: 700; margin: 0 0 6px; max-width: 30ch; text-wrap: balance; }
.stats { display: flex; gap: 28px; }
.stat { display: flex; flex-direction: column; }
.stat b { font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 12.5px; }
.stat.alert b { color: var(--danger); }
.ov-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.ulist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; background: var(--raised); }
.ulist li { border-bottom: 1px solid var(--line); }
.ulist li:last-child { border-bottom: 0; }
.urow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; text-align: left; font-size: 13.5px; transition: background .12s; }
.urow:hover { background: var(--hover); }
.urow .actor { min-width: 52px; justify-content: center; }
.urow .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.urow .t small { display: block; color: var(--muted); font-size: 12.5px; }
.urow time { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.linkbtn { color: var(--accent); font-weight: 600; font-size: 13px; }
.linkbtn:hover { text-decoration: underline; }

/* ---------- actor badges (shared by history, versions, overview) ---------- */
.actor { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px 0 5px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--sunk); color: var(--ink-2); }
.actor svg { width: 12px; height: 12px; }
.actor.ai { background: var(--accent-soft); color: var(--accent); }
.actor.restore { background: var(--ok-soft); color: var(--ok); }

/* ---------- Rewind history: the tape ---------- */
.hist-head { display: flex; align-items: center; gap: 16px; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; }
.hist-head > :first-child { flex: 1 1 320px; }
.tape { list-style: none; margin: 0; padding: 0 0 24px; position: relative; max-width: 860px; --gut: 64px; --spine: 84px; }
.tape > li { position: relative; }
/* the spine: solid for the past, dashed above the playhead (steps you can redo) */
.tape > li::before { content: ""; position: absolute; left: calc(var(--spine) - 1px); top: 0; bottom: 0; width: 2px; background: var(--line-2); }
.tape > li.ahead::before { background: repeating-linear-gradient(var(--line-2) 0 5px, transparent 5px 10px); }
.tape > li.first::before { top: 26px; }
.tape > li.last::before { bottom: calc(100% - 26px); }
.day { padding: 18px 0 8px; }
.day span { position: relative; z-index: 1; display: inline-block; margin-left: calc(var(--spine) + 26px); font-size: 12px; font-weight: 600; color: var(--muted); }
.ev { display: grid; grid-template-columns: var(--gut) 40px minmax(0, 1fr); align-items: start; column-gap: 0; padding: 4px 0; }
.ev time { padding-top: 15px; padding-right: 12px; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.node { position: relative; z-index: 1; justify-self: center; margin-top: 11px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--raised); border: 2px solid var(--line-2); color: var(--muted); }
.node svg { width: 13px; height: 13px; }
.node.you { border-color: var(--ink-2); color: var(--ink); }
.node.ai { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.node.restore { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.node.flag { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.ev.ahead .node { border-style: dashed; background: var(--bg); }
.ecard { margin-left: 8px; border: 1px solid transparent; border-radius: var(--r-m); transition: background .12s, border-color .12s, box-shadow .12s; }
.ecard:hover { background: var(--side); }
.ehead { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 12px; text-align: left; border-radius: var(--r-m); }
.etext { flex: 1; min-width: 0; }
.elabel { font-weight: 600; font-size: 14px; line-height: 1.35; }
.emeta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.ev .emeta .t-m { display: none; }
.ev.ahead .elabel { color: var(--muted); font-weight: 500; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11.5px; font-weight: 500; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.tag.cp { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.restore-btn { flex: none; background: transparent; border-color: transparent; color: var(--muted); }
.ev:hover .btn.restore-btn, .btn.restore-btn:focus-visible { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.ev .btn.restore-btn:hover { background: var(--fill); border-color: var(--accent); color: var(--on-accent); }
.herechip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--fill); color: var(--on-accent); font-size: 12px; font-weight: 600; }
.changes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.chg { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; font-size: 13px; }
.chg:hover { background: var(--side); }
.chg .k { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--sunk); color: var(--muted); }
.chg .k svg { width: 13px; height: 13px; }
.chg .k.add { background: var(--ok-soft); color: var(--ok); }
.chg .k.del { background: var(--danger-soft); color: var(--danger); }
.chg .k.mv { background: var(--accent-soft); color: var(--accent); }
.chg .pth { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chg .pth s { color: var(--muted); text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.chg .pth .to { color: var(--faint); margin: 0 4px; }
.chg .lk { display: flex; gap: 4px; }
.mini { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); border: 1px solid var(--line); background: var(--raised); }
.mini svg { width: 13px; height: 13px; }
.mini:hover { border-color: var(--accent-line); color: var(--accent); }
.enote { margin: 0; font-size: 13px; color: var(--muted); }
.plist .chg:hover { background: transparent; }

/* the playhead: where you are now */
.playhead { padding: 8px 0; }
.playhead .ph { position: relative; z-index: 1; display: grid; grid-template-columns: var(--gut) 40px minmax(0, 1fr); align-items: center; }
.playhead .ph::after { content: ""; position: absolute; left: var(--gut); right: 0; top: 50%; height: 2px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 0%, transparent)); }
.playhead .ph-l { text-align: right; padding-right: 12px; font-size: 11.5px; font-weight: 700; color: var(--accent); }
.playhead .ph-dot { justify-self: center; width: 16px; height: 16px; border-radius: 50%; background: var(--fill); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 20%, transparent), 0 0 18px color-mix(in srgb, var(--accent) 60%, transparent); }
.playhead .ph-tag { position: relative; z-index: 1; justify-self: start; margin-left: 8px; display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--fill); color: var(--on-accent); font-size: 12.5px; font-weight: 650; box-shadow: var(--shadow-2); }
.playhead.landed .ph-dot { animation: land 1.2s ease-out; }

/* abandoned branch: steps from an earlier timeline, forked off the spine */
.branch { padding: 6px 0 10px; }
.branch-box { position: relative; margin-left: calc(var(--spine) + 34px); border-radius: var(--r-l); border: 1px dashed var(--line-2); background: color-mix(in srgb, var(--sunk) 55%, transparent); padding: 6px 8px 8px; }
.branch-box::before { content: ""; position: absolute; left: -35px; top: -8px; width: 34px; height: 30px; border-left: 2px dashed var(--line-2); border-bottom: 2px dashed var(--line-2); border-bottom-left-radius: 14px; }
.branch-h { display: flex; align-items: center; gap: 8px; padding: 6px 6px 4px; font-size: 12.5px; color: var(--muted); }
.branch-h svg { width: 14px; height: 14px; }
.brow { display: grid; grid-template-columns: 68px 18px minmax(0, 1fr); align-items: center; gap: 8px; padding: 6px; border-radius: 8px; color: var(--muted); font-size: 13px; }
.brow time { font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.brow .bn { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--faint); justify-self: center; }
.brow .bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brow .bl .actor { margin-left: 6px; opacity: .8; }

/* ---------- trash ---------- */
.trow { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.trow:last-child { border-bottom: 0; }
.trow .ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--sunk); color: var(--muted); }
.trow .ico svg { width: 16px; height: 16px; }
.trow .t { flex: 1; min-width: 0; }
.trow .t b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .t small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

/* ---------- settings ---------- */
.set-group { max-width: 720px; margin-bottom: 28px; }
.set-group h2 { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--raised); }
.set-row b { font-weight: 600; }
.set-row p { margin: 2px 0 0; color: var(--muted); font-size: 13px; max-width: 52ch; }

/* ---------- preview pane ---------- */
.preview { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; background: var(--bg); animation: slidein .2s cubic-bezier(.2, .8, .2, 1); container-type: inline-size; }
@keyframes slidein { from { opacity: 0; transform: translateX(16px); } }
.pv-top { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.pv-top .ttl { flex: 1; min-width: 0; }
.pv-top .ttl b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-top .ttl small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-acts { display: flex; gap: 6px; }
.pv-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.viewer { position: relative; min-height: 0; background: var(--sunk); display: flex; flex-direction: column; }
.viewer iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.viewer .imgwrap { flex: 1; overflow: auto; display: grid; place-items: start center; padding: 24px; }
.viewer img { max-width: 100%; height: auto; border-radius: 4px; box-shadow: var(--shadow-3); background: #fff; }
.vbanner { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 500; }
.vbanner svg { width: 16px; height: 16px; }
.vbanner .linkbtn { color: inherit; margin-left: auto; text-decoration: underline; }
.side { overflow-y: auto; border-left: 1px solid var(--line); padding: 18px 18px 28px; }
.side h3 { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0 0 8px; }
.side section { margin-bottom: 22px; }
.fields { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 14px; font-size: 13.5px; }
.fields dt { color: var(--muted); }
.fields dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.summary { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.versions { list-style: none; margin: 0; padding: 0; position: relative; }
.versions li { position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; padding: 6px 0 10px; }
.versions li::before { content: ""; position: absolute; left: 7px; top: 22px; bottom: -6px; width: 2px; background: var(--line); }
.versions li:last-child::before { display: none; }
.versions .vd { width: 12px; height: 12px; margin: 5px 0 0 2px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--raised); }
.versions li.cur .vd { border-color: var(--accent); background: var(--fill); }
.versions .vl { font-weight: 600; font-size: 13px; }
.versions .vm { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 2px 0 6px; color: var(--muted); font-size: 12px; }
.noview { margin: auto; text-align: center; color: var(--muted); padding: 40px; }
@container (max-width: 760px) {
  .pv-body { grid-template-columns: 1fr; grid-template-rows: minmax(360px, 62%) auto; overflow-y: auto; }
  .side { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
}

/* ---------- copilot ---------- */
.copilot { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-left: 1px solid var(--line); background: var(--side); }
.co-head { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--line); flex: none; }
.co-head b { display: block; font-size: 14px; font-weight: 700; }
.co-head small { display: block; color: var(--muted); font-size: 12px; line-height: 1.2; }
.co-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.co-mark svg { width: 16px; height: 16px; }
.co-close { display: none; }
#log { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 16px 10px; display: flex; flex-direction: column; gap: 14px; scrollbar-width: thin; }
.msg { max-width: 100%; line-height: 1.5; overflow-wrap: anywhere; font-size: 13.5px; }
.msg.user { align-self: flex-end; max-width: 86%; background: var(--user); color: var(--user-ink); padding: 8px 13px; border-radius: 14px 14px 4px 14px; }
.msg.bot { align-self: stretch; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 9px; }
.msg.bot > .av { width: 22px; height: 22px; padding: 4px; border-radius: 7px; background: var(--raised); border: 1px solid var(--line); color: var(--accent); }
.msg.bot > .bd { min-width: 0; padding-top: 1px; }
.bd p { margin: 0 0 8px; white-space: pre-wrap; }
.bd > :last-child { margin-bottom: 0; }
.bd ul { margin: 0 0 8px; padding: 0; list-style: none; }
.bd li { position: relative; padding: 2px 0 2px 14px; }
.bd li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
.bd .when { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--accent); margin-right: 6px; }
.bd .head { font-weight: 700; margin: 4px 0 2px; }
.bd .head.overdue { color: var(--danger); }
.msg.busy .bd { color: var(--muted); }
.msg.busy .av { animation: blink .9s ease-in-out infinite alternate; }
.msg.error .bd { color: var(--danger); }
.msg.error .av { color: var(--danger); }
.sheet { position: relative; max-height: 240px; overflow: hidden; margin: 0 0 10px; padding: 16px 18px; border-radius: 8px; background: var(--raised); border: 1px solid var(--line); box-shadow: var(--shadow-2); font-size: 13px; white-space: pre-wrap; }
.sheet .ttl { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.sheet::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; background: linear-gradient(transparent, var(--raised)); }
.paths { margin: 4px 0 10px; padding: 8px 10px; border-radius: 8px; background: var(--danger-soft); }
.paths div { font-size: 12.5px; line-height: 1.6; overflow-wrap: anywhere; }
.srcs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--muted); }
.src { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 26px; padding: 0 9px 0 7px; border-radius: 7px; background: var(--raised); border: 1px solid var(--line); color: var(--ink); font-size: 12.5px; font-weight: 500; cursor: pointer; }
.src svg { width: 13px; height: 13px; color: var(--accent); }
.src span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src:hover { border-color: var(--accent-line); color: var(--accent); }
.actions { margin-top: 10px; }
.splice { align-self: stretch; display: flex; align-items: center; gap: 10px; color: var(--accent); font-size: 12px; font-weight: 600; }
.splice::before, .splice::after { content: ""; flex: 1; border-top: 1.5px dashed var(--accent-line); }
.compose { flex: none; padding: 8px 14px 14px; }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 10px; }
.chip { height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); font-size: 12.5px; white-space: nowrap; color: var(--ink-2); transition: border-color .12s, color .12s, background .12s; }
.chip:hover { border-color: var(--accent-line); color: var(--accent); }
.chip:active { transform: scale(.97); }
.chip.tt { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.ask { display: flex; align-items: center; gap: 6px; padding: 5px 5px 5px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--raised); box-shadow: var(--shadow-1); transition: border-color .12s, box-shadow .12s; }
.ask:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
#msg { flex: 1; min-width: 0; height: 34px; border: 0; background: transparent; outline: none; font-size: 14px; }
#send { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--fill); color: var(--on-accent); transition: background .12s, transform .06s; }
#send svg { width: 17px; height: 17px; }
#send:hover:not(:disabled) { background: var(--accent-2); }
#send:active:not(:disabled) { transform: scale(.95); }
#send:disabled { opacity: .45; cursor: default; }

/* ---------- popover, dialog, notices ---------- */
#pop { position: fixed; z-index: 60; width: min(300px, calc(100vw - 32px)); padding: 14px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); box-shadow: var(--shadow-3); }
#pop p { margin: 0 0 10px; font-weight: 600; line-height: 1.35; }
#pop small { display: block; margin: -4px 0 12px; color: var(--muted); font-size: 12.5px; }
#pop input { width: 100%; height: 36px; padding: 0 12px; margin-bottom: 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); outline: none; }
#pop input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.dlg { width: min(420px, calc(100vw - 32px)); padding: 22px; border-radius: 16px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); box-shadow: var(--shadow-3); }
.dlg::backdrop { background: rgba(15, 16, 20, .38); backdrop-filter: blur(2px); }
.dlg h3 { margin: 0 0 6px; font-size: 17px; letter-spacing: -.01em; }
.dlg p { margin: 0 0 18px; color: var(--muted); }
.dlg .row { justify-content: flex-end; }
.notices { position: fixed; z-index: 70; left: 50%; bottom: 112px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.notice { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 10px; background: var(--ink); color: var(--bg); font-weight: 500; font-size: 13.5px; box-shadow: var(--shadow-3); animation: notice 4.2s ease-in-out forwards; }
.notice svg { width: 16px; height: 16px; }
.notice.err { background: var(--danger); color: #fff; }
@keyframes notice { 0% { opacity: 0; transform: translateY(8px); } 6%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ---------- rewinding overlay + toast ---------- */
#overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(10px) saturate(1.2); animation: fadein .2s ease-out; }
@keyframes fadein { from { opacity: 0; } }
.ov-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
#overlay h2 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.03em; }
#overlay .watch { font-size: 40px; font-weight: 700; letter-spacing: -.03em; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.1; }
#overlay p { margin: 6px 0 0; color: var(--muted); max-width: 34ch; }
@keyframes spin { to { transform: rotate(360deg); } }
#toast { position: fixed; z-index: 75; left: 50%; top: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-radius: 12px; background: var(--ink); color: var(--bg); font-weight: 600; box-shadow: var(--shadow-3); animation: toast 4.5s ease-in-out forwards; }
#toast svg { width: 18px; height: 18px; color: var(--accent); }
#toast b { font-variant-numeric: tabular-nums; color: color-mix(in srgb, var(--accent) 55%, var(--bg)); }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -12px); } 8%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

.tabbar, .fab, .scrim { display: none; }

/* ---------- search panel ---------- */
.searchbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.sbox { flex: 1 1 280px; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--raised); box-shadow: var(--shadow-1); transition: border-color .12s, box-shadow .12s; }
.sbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.sbox svg { width: 18px; height: 18px; color: var(--muted); }
.sbox input { flex: 1; min-width: 0; height: 40px; border: 0; background: transparent; outline: none; font-size: 14px; }
.sbox input::-webkit-search-cancel-button { cursor: pointer; }
.sfilters { display: flex; gap: 6px; flex-wrap: wrap; }
.schip { display: inline-flex; align-items: center; height: 32px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); color: var(--ink-2); font-size: 13px; font-weight: 500; transition: border-color .12s; }
.schip:hover { border-color: var(--line-2); }
.schip .slbl { display: inline-flex; align-items: center; gap: 6px; height: 100%; padding: 0 12px 0 10px; border-radius: 999px; }
.schip .slbl svg { width: 14px; height: 14px; color: var(--muted); }
.schip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.schip.on .slbl { padding-right: 4px; }
.schip.on .slbl svg { color: var(--accent); }
.schip .sx { display: grid; place-items: center; width: 24px; height: 24px; margin-right: 4px; border-radius: 50%; color: var(--accent); }
.schip .sx svg { width: 12px; height: 12px; }
.schip .sx:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.results .rlist { display: flex; flex-direction: column; gap: 8px; }
.rcard { padding: 12px 16px; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--raised); cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.rcard:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.rtop { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rtop b { font-weight: 650; }
.rtop .muted { font-size: 13px; }
.snip { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
mark { background: color-mix(in srgb, var(--accent) 20%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }

/* ---------- duplicates banner + review ---------- */
.dupban { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 16px; border-radius: var(--r-l); border: 1px solid color-mix(in srgb, var(--warn) 30%, var(--line)); background: var(--warn-soft); flex-wrap: wrap; }
.dupban .dico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--raised); color: var(--warn); }
.dupban .dico svg { width: 17px; height: 17px; }
.dupban .dtext { display: flex; flex-direction: column; min-width: 0; flex: 1 1 260px; }
.dupban .dtext b { font-weight: 650; }
.dupban .dtext span { font-size: 12.5px; color: var(--muted); }
.dlg.wide { width: min(820px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; display: none; }
.dlg.wide[open] { display: flex; flex-direction: column; }
.duphead { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.duphead > div { flex: 1; }
.duphead p { margin: 4px 0 0; }
.dupbody { overflow-y: auto; padding: 16px 22px; display: flex; flex-direction: column; gap: 18px; }
.dgh { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.dcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.dcol { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--side); }
.dcol.keep { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.dcol.copy { border-style: dashed; }
.dcol .thumb { height: 120px; border-radius: 8px; border: 1px solid var(--line); }
.dcol .fields { font-size: 12.5px; gap: 4px 10px; }
.dcol .btn { align-self: flex-start; }
.dctitle { font-weight: 650; }
.dbadge { position: absolute; top: 16px; right: 16px; z-index: 1; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; box-shadow: var(--shadow-1); }
.dcol.keep .dbadge { background: var(--ok); color: #fff; }
.dcol.copy .dbadge { background: var(--warn); color: #fff; }
.dupfoot { justify-content: flex-end; padding: 14px 22px 18px; border-top: 1px solid var(--line); }

/* ---------- multi-select ---------- */
.selbar { position: sticky; top: -24px; z-index: 4; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; margin: 0 0 14px; border-radius: 12px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-3); flex-wrap: wrap; animation: slidein .16s ease-out; }
.selbar .sbtxt { font-size: 13.5px; }
.selbar .sbhint { color: color-mix(in srgb, var(--bg) 65%, transparent); font-size: 12.5px; }
.selbar .btn { border-color: transparent; box-shadow: none; }
.selbar .btn.ghost, .selbar .btn.danger-ghost { background: color-mix(in srgb, var(--bg) 12%, transparent); color: var(--bg); }
.selbar .btn.ghost:hover, .selbar .btn.danger-ghost:hover { background: color-mix(in srgb, var(--bg) 22%, transparent); }
.dcard, .lrow { cursor: pointer; }
.dcard:focus-visible, .lrow:focus-visible, .rcard:focus-visible, .rem:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pick { position: absolute; z-index: 2; top: 8px; left: 8px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: color-mix(in srgb, var(--raised) 92%, transparent); box-shadow: var(--shadow-1); opacity: 0; transition: opacity .12s; cursor: pointer; }
.pick input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.dcard:hover .pick, .dcard:focus-within .pick, #tree.selecting .pick, .dcard.selected .pick { opacity: 1; }
.dcard.selected { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.lrow { grid-template-columns: 22px 34px minmax(0, 2fr) minmax(0, 1.3fr) 110px 96px 108px; }
.lrow .pick { position: static; opacity: 1; width: 22px; height: 22px; background: none; box-shadow: none; }
.lrow.selected { background: var(--accent-soft); }
@media (hover: none) { .pick { opacity: 1; } }

/* ---------- proposal card ---------- */
.pcard { border: 1px solid var(--line); border-radius: 12px; background: var(--raised); overflow: hidden; box-shadow: var(--shadow-1); }
.phead { display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px; }
.phead b { flex: 1; font-size: 13.5px; }
.preply { padding: 0 12px 6px; color: var(--muted); font-size: 12.5px; }
.pnote { margin: 0; padding: 6px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 12.5px; font-weight: 500; }
.preply p { margin: 0; }
.plist { list-style: none; margin: 0; padding: 4px; max-height: 300px; overflow-y: auto; border-top: 1px solid var(--line); background: var(--raised); border-radius: 0; }
.bd .plist li.pitem { padding: 0; }
.bd .plist li.pitem::before { display: none; }
.prow { display: grid; grid-template-columns: auto 22px minmax(0, 1fr); align-items: start; gap: 8px; padding: 7px 8px; border-radius: 8px; cursor: default; }
label.prow { cursor: pointer; }
label.prow:hover { background: var(--side); }
div.prow { grid-template-columns: 22px minmax(0, 1fr); }
.prow input { width: 15px; height: 15px; margin: 3px 0 0; accent-color: var(--accent); }
.prow .k { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--sunk); color: var(--muted); }
.prow .k svg { width: 13px; height: 13px; }
.prow .k.mv { background: var(--accent-soft); color: var(--accent); }
.prow .k.del { background: var(--danger-soft); color: var(--danger); }
.prow .k.ed { background: var(--warn-soft); color: var(--warn); }
.ptext { display: flex; flex-direction: column; min-width: 0; font-size: 12.5px; line-height: 1.4; }
.pmain { overflow-wrap: anywhere; }
.pmain .to { color: var(--faint); }
.pmain b { font-weight: 600; }
.ptext small { color: var(--muted); font-size: 11.5px; }
.pdiff { margin: 0 8px 8px 38px; }
.pdiff summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--accent); padding: 2px 0 6px; }
.diff { border: 1px solid var(--line); border-radius: 8px; overflow: auto; max-height: 280px; font-size: 12px; line-height: 1.5; background: var(--bg); }
.diff .dl { display: grid; grid-template-columns: 18px minmax(0, 1fr); padding: 0 8px 0 4px; }
.diff .sg { color: var(--faint); text-align: center; user-select: none; }
.diff .tx { white-space: pre-wrap; overflow-wrap: anywhere; }
.diff .add { background: color-mix(in srgb, var(--ok) 13%, transparent); }
.diff .add .sg, .diff .add .tx { color: var(--ok); }
.diff .del { background: color-mix(in srgb, var(--danger) 11%, transparent); }
.diff .del .sg, .diff .del .tx { color: var(--danger); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.diff .del .sg { text-decoration: none; }
.diff .same .tx { color: var(--ink-2); }
.diff .fold { color: var(--faint); font-style: italic; background: var(--side); }

/* ---------- compare card ---------- */
.ccard { border: 1px solid var(--line); border-radius: 12px; background: var(--raised); overflow: hidden; box-shadow: var(--shadow-1); }
.chead { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.cside { display: flex; align-items: center; gap: 8px; padding: 10px 12px; min-width: 0; }
.cside + .cside { border-left: 1px solid var(--line); }
.cside b { font-size: 12.5px; line-height: 1.3; overflow-wrap: anywhere; }
.ctag { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--sunk); font-size: 11px; font-weight: 700; color: var(--muted); }
.cside + .cside .ctag { background: var(--accent-soft); color: var(--accent); }
.csum { margin: 0; padding: 10px 12px; font-size: 13px; }
.ccard .diff { margin: 0 12px 12px; }
.ctable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ctable th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; padding: 6px 12px; border-top: 1px solid var(--line); background: var(--side); }
.ctable td { padding: 7px 12px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.ctable td:first-child { font-weight: 600; width: 28%; }
.ctable td.was { color: var(--muted); }
.ctable td.now { color: var(--ink); font-weight: 600; }
.xfields { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--raised); font-size: 12.5px; margin-bottom: 8px; }

/* ---------- popover extras ---------- */
#pop.wide { width: min(360px, calc(100vw - 32px)); }
.pchoices { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip.on { background: var(--fill); border-color: var(--accent); color: var(--on-accent); }
.pfields.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pfield { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
#pop .pfield input { margin-bottom: 12px; }

/* ---------- preview extras ---------- */
.related { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.relrow { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border-radius: 9px; text-align: left; transition: background .12s; }
.relrow:hover { background: var(--hover); }
.relrow .ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--sunk); color: var(--muted); flex: none; }
.relrow .ico svg { width: 15px; height: 15px; }
.relrow .t { min-width: 0; display: flex; flex-direction: column; }
.relrow .t b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relrow .t small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.versions .row .btn { margin-bottom: 2px; }

/* ---------- history extras ---------- */
.btn.rewind-btn { flex: none; color: var(--ink-2); background: transparent; border-color: var(--line-2); box-shadow: none; }
.btn.rewind-btn:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--danger-soft); }
.tag.rv { background: var(--ok-soft); color: var(--ok); }

/* ---------- overview dashboard ---------- */
.rems { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.rem { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--raised); box-shadow: var(--shadow-1); cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .08s; }
.rem:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.rem:active { transform: translateY(1px); }
.rbig { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 58px; height: 58px; padding: 0 6px; border-radius: 12px; background: var(--sunk); color: var(--ink); }
.rbig b { font-size: 22px; font-weight: 750; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rbig span { font-size: 10.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.rem.soon .rbig { background: var(--warn-soft); }
.rem.soon .rbig b { color: var(--warn); }
.rem.late { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.rem.late .rbig { background: var(--danger-soft); }
.rem.late .rbig b, .rem.late .rbig span { color: var(--danger); }
.rtext { min-width: 0; }
.rtext p { margin: 0; font-weight: 600; font-size: 13.5px; line-height: 1.35; }
.rtext small { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.rem.late .rtext p { color: var(--danger); }
.bars { display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--raised); margin-bottom: 10px; }
.bcur { font-size: 12px; color: var(--muted); font-weight: 600; padding: 2px 6px 4px; }
.cbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "lab val" "track track"; align-items: end; gap: 6px 12px; width: 100%; padding: 8px 8px 10px; border-radius: 8px; text-align: left; transition: background .12s; }
.cbar .blab { grid-area: lab; flex-direction: row; align-items: baseline; gap: 8px; }
.cbar .btrack { grid-area: track; }
.cbar .bval { grid-area: val; }
.cbar:hover { background: var(--side); }
.blab { display: flex; flex-direction: column; min-width: 0; }
.blab b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blab small { font-size: 11.5px; color: var(--muted); }
.btrack { height: 10px; border-radius: 4px; background: var(--sunk); overflow: hidden; }
.bfill { display: block; height: 100%; border-radius: 4px; background: var(--fill); transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.cbar:hover .bfill { background: var(--accent-2); }
.bval { font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- v3.1 identity: page glow, glass panels, glowing primaries ---------- */
body { background: var(--page); background-attachment: fixed; }
.sidebar { background: color-mix(in srgb, var(--side) 70%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.brand { padding: 4px 6px 20px; }
.wordmark { font-weight: 760; font-size: 18px; letter-spacing: -.035em; }
.nav-item { position: relative; }
.nav-item[aria-current="page"] { background: var(--raised); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); box-shadow: 0 0 10px var(--glow); }
.promise { background: var(--glass); }
.copilot { overflow: hidden; background: color-mix(in srgb, var(--side) 74%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.co-mark { background: var(--grad); color: #fff; box-shadow: 0 4px 14px -4px var(--glow); }
.msg.bot > .av { color: var(--accent); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 22px -10px var(--glow), 0 1px 2px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .22); transition: box-shadow .18s, transform .06s, filter .15s; }
.btn.primary:hover:not(:disabled) { background: var(--grad); border-color: transparent; filter: brightness(1.08) saturate(1.05); box-shadow: 0 12px 30px -10px var(--glow), 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent), inset 0 1px 0 rgba(255, 255, 255, .26); }
.btn.primary:active:not(:disabled) { transform: translateY(1px) scale(.985); }
#send { box-shadow: 0 6px 16px -6px var(--glow); }
#send:hover:not(:disabled) { background: var(--grad); filter: brightness(1.1); }
.ask { background: var(--raised); }
.dcard, .rem, .ulist, .list, .set-row, .rcard, .pcard, .ccard, .bars { background: color-mix(in srgb, var(--raised) 88%, transparent); }
.dcard:hover, .rem:hover, .rcard:hover { border-color: var(--accent-line); box-shadow: var(--shadow-2), 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent); }
.notice { background: var(--ink); color: var(--bg); }
#toast { border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); box-shadow: var(--shadow-3), 0 0 32px -8px var(--glow); }
#toast svg { animation: tick-in .6s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes tick-in { from { transform: rotate(160deg) scale(.3); opacity: 0; } }

/* ---------- Rewind History: version list + selected checkpoint ---------- */
.vh { display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 44%, 400px); gap: 22px; align-items: start; container-type: inline-size; }
.vh .tape { max-width: none; --gut: 0px; --spine: 14px; }
.vh .ev { grid-template-columns: 0 28px minmax(0, 1fr); padding: 2px 0; }
.vh .ev time { display: none; }
.vh .ev .node, .vh .playhead .ph-dot { grid-column: 2; }
.vh .ev .ecard, .vh .playhead .ph-tag { grid-column: 3; }
.vh .ev .emeta .t-m { display: inline; order: -1; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.vh .ecard { margin-left: 6px; }
.vh .playhead .ph { grid-template-columns: 0 28px minmax(0, 1fr); }
.vh .playhead .ph-l { display: none; }
.vh .day span { margin-left: 42px; }
.vh .branch-box { margin-left: 42px; }
.vh .branch-box::before { left: -29px; width: 28px; }
.vh .node { margin-top: 12px; }
.ehead { cursor: pointer; }
.ev.sel .ecard { background: var(--raised); border-color: var(--accent-line); box-shadow: var(--shadow-2), 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.ev.sel .elabel { color: var(--ink); }
.ev.sel .node { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.vh-detail { position: sticky; top: 0; border-radius: 18px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); box-shadow: var(--shadow-3), inset 0 1px 0 var(--glass-edge); overflow: hidden; }
.vh-detail::before { content: ""; display: block; height: 3px; background: var(--grad); }
.hd { padding: 18px 20px 20px; }
.hd.enter { animation: hd-in .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes hd-in { from { opacity: 0; transform: translateY(4px); } }
.hd-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.hd-top .herechip { margin-left: auto; height: 22px; font-size: 11.5px; }
.herechip i { width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px #fff; }
.hd-title { margin: 0; font-size: 20px; line-height: 1.25; font-weight: 720; letter-spacing: -.022em; text-wrap: balance; outline: none; }
.hd-when { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.hd-sub { margin: 14px 0 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
.hd-h { margin: 18px 0 6px; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.hd .changes { max-height: 216px; overflow-y: auto; margin: 0 -8px; scrollbar-width: thin; }
.hd .enote { margin-top: 14px; }
.hd-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.hd-acts .btn { height: 38px; padding: 0 16px; }
.hd-acts .btn.primary { flex: 1 1 auto; }
.hd.inline { padding: 0 12px 14px; animation: none; }
.hd.inline .hd-sub { margin-top: 2px; }
.skdet { height: 260px; margin: 16px; border-radius: 12px; }

/* ---------- rewinding overlay: the reel spins backwards ---------- */
#overlay { background: color-mix(in srgb, var(--bg) 70%, transparent); }
.ov-deck { position: relative; display: flex; flex-direction: column; align-items: center; gap: 16px; margin-bottom: 10px; }
.ov-logo { width: 96px; height: 96px; filter: drop-shadow(0 16px 40px var(--glow)); }
.ov-tape { width: 180px; height: 6px; border-radius: 3px; background: repeating-linear-gradient(90deg, var(--accent) 0 10px, transparent 10px 18px); opacity: .55; mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent); animation: tape-rw .5s linear infinite; }
@keyframes tape-rw { from { background-position: 0 0; } to { background-position: 36px 0; } }
#overlay .watch { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- the dock spans the whole window, under all three columns ---------- */
.app { grid-template-rows: minmax(0, 1fr) auto; }
.dock { grid-column: 1 / -1; grid-row: 2; }
.app > .sidebar, .app > .main, .app > .copilot { grid-row: 1; }

/* ---------- upload progress ---------- */
.bar { position: relative; }
.upbar { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: color-mix(in srgb, var(--accent) 14%, transparent); overflow: hidden; }
.upbar i { display: block; width: 0; height: 100%; background: var(--grad); box-shadow: 0 0 12px var(--glow); transition: width .2s ease-out; }
.upbar.done { opacity: 0; transition: opacity .4s .1s; }
.icard.pending { border-style: dashed; color: var(--muted); }
.icard.pending .st { color: var(--muted); }
.icard.pending .st::after { content: ""; display: inline-block; width: 28px; height: 3px; margin-left: 7px; vertical-align: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--sunk), var(--accent), var(--sunk)) 0 0 / 200% 100%; animation: shimmer 1s linear infinite; }

/* ---------- notices: success, error, info ---------- */
.notice { gap: 10px; padding: 10px 16px 10px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); box-shadow: var(--shadow-3); animation: notice 4.2s cubic-bezier(.2, .8, .2, 1) forwards; max-width: min(520px, calc(100vw - 32px)); }
.notice .nico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; flex: none; background: var(--sunk); color: var(--muted); }
.notice .nico svg { width: 15px; height: 15px; }
.notice.ok .nico { background: var(--ok-soft); color: var(--ok); animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) .08s backwards; }
.notice.err { background: var(--raised); color: var(--ink); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.notice.err .nico { background: var(--danger-soft); color: var(--danger); }
.notice.info .nico { background: var(--accent-soft); color: var(--accent); }
@keyframes notice { 0% { opacity: 0; transform: translateY(10px) scale(.97); } 6%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(4px); } }
@keyframes pop { from { transform: scale(.2) rotate(-40deg); opacity: 0; } }

/* ---------- Global Rewind ---------- */
.chip.gr { background: var(--grad); border-color: transparent; color: #fff; font-weight: 600; box-shadow: 0 6px 16px -8px var(--glow); }
.chip.gr:hover { color: #fff; filter: brightness(1.08); border-color: transparent; }
.rw-done { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--line)); background: color-mix(in srgb, var(--ok-soft) 70%, var(--raised)); }
.rw-ring { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; flex: none; background: var(--ok); color: #fff; animation: pop .6s cubic-bezier(.2, 1.6, .4, 1); }
.rw-ring::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--ok); opacity: 0; animation: ripple 1.1s ease-out .2s; }
.rw-ring svg { width: 20px; height: 20px; stroke-dasharray: 24; stroke-dashoffset: 0; animation: draw .45s ease-out .25s backwards; }
@keyframes draw { from { stroke-dashoffset: 24; } }
@keyframes ripple { 0% { opacity: .7; transform: scale(.8); } 100% { opacity: 0; transform: scale(1.5); } }
.rw-text { display: flex; flex-direction: column; min-width: 0; }
.rw-text b { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
.rw-text span { font-size: 12.5px; color: var(--muted); }
.msg.done > .av { color: var(--ok); }
.runbar { padding: 10px 0 6px; }
.runbox { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-left: 42px; padding: 8px 8px 8px 10px; border-radius: 12px; border: 1px dashed var(--accent-line); background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.runico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--grad); color: #fff; flex: none; }
.runico svg { width: 13px; height: 13px; }
.runtext { flex: 1 1 150px; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.runtext b { font-size: 13px; }
.runtext small { font-size: 12px; color: var(--muted); }
.runbox .btn { flex: none; }

/* ---------- welcome card ---------- */
.welcome { position: relative; overflow: hidden; max-width: 860px; margin: 8px auto 0; padding: 34px 36px 30px; border-radius: 22px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow-3), inset 0 1px 0 var(--glass-edge); }
.welcome.compact { margin-top: 22px; padding: 26px 28px 24px; }
.welcome.compact .wl-points { display: none; }
.welcome.compact .wl-head h2 { font-size: 22px; }
.wl-glow { position: absolute; right: -120px; top: -160px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, #7c54ff 30%, transparent), transparent 65%); pointer-events: none; }
.wl-head { position: relative; }
.wl-head h2 { margin: 0 0 6px; font-size: 30px; line-height: 1.1; font-weight: 760; letter-spacing: -.035em; }
.wl-head .lede { font-size: 15px; }
.wl-points { position: relative; list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.wl-points li { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 14px; background: color-mix(in srgb, var(--raised) 80%, transparent); border: 1px solid var(--line); }
.wl-ico { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.wl-points li:nth-child(2) .wl-ico { background: var(--grad); color: #fff; box-shadow: 0 6px 16px -6px var(--glow); }
.wl-points li:nth-child(3) .wl-ico { background: var(--ok-soft); color: var(--ok); }
.wl-ico svg { width: 18px; height: 18px; }
.wl-points b { display: block; font-size: 14px; font-weight: 680; margin-bottom: 3px; }
.wl-points p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.wl-acts { position: relative; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 14px; border-radius: 12px; }
.btn.lg svg { width: 18px; height: 18px; }
.btn.loading { cursor: progress; }
.btn.loading svg { animation: blink .6s ease-in-out infinite alternate; }
.wl-note { position: relative; margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.wl-try { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.wl-try-l { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-right: 4px; }

/* ---------- About Rewind guide ---------- */
.view#about { container-type: inline-size; }
.guide { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 36px; max-width: 980px; }
.guide-toc { position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.guide-toc a { padding: 6px 10px; border-radius: 8px; font-size: 13px; color: var(--muted); text-decoration: none; border-left: 2px solid var(--line); border-radius: 0 8px 8px 0; }
.guide-toc a:hover { color: var(--ink); background: var(--hover); border-left-color: var(--accent); }
/* not enough room for a side contents list: it becomes a row of chips above the guide */
@container (max-width: 760px) {
  .guide { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .guide .guide-toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; padding: 0 0 22px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
  .guide .guide-toc a { padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--raised); font-size: 12.5px; }
  .guide .guide-toc a:hover { border-color: var(--accent-line); color: var(--accent); }
}
.guide-body { min-width: 0; max-width: 680px; }
.g-sec { padding: 0 0 34px; margin-bottom: 34px; border-bottom: 1px solid var(--line); scroll-margin-top: 12px; }
.g-sec:last-child { border-bottom: 0; }
.g-sec h2 { font-size: 20px; letter-spacing: -.02em; margin: 0 0 10px; }
.g-sec p { margin: 0 0 10px; color: var(--ink-2); line-height: 1.6; }
.g-intro h2 { font-size: 30px; line-height: 1.12; letter-spacing: -.035em; max-width: 18ch; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 2px; }
.layers { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin-top: 16px; }
.layer { min-width: 0; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: color-mix(in srgb, var(--raised) 88%, transparent); box-shadow: var(--shadow-1); }
.layer p { font-size: 13px; margin: 0; }
.layer-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.layer-h b { display: block; font-size: 14.5px; }
.layer-h small { color: var(--muted); font-size: 12px; }
.lnum { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--grad); color: #fff; font-weight: 750; font-size: 13px; }
.lane { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 56px; padding: 10px; margin-bottom: 14px; border-radius: 12px; background: var(--sunk); overflow: hidden; }
.lchip { flex: none; height: 26px; padding: 0 9px; border-radius: 8px; display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; background: var(--raised); border: 1px solid var(--line); color: var(--ink-2); }
.lchip.out { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: var(--danger-soft); text-decoration: line-through; animation: lout 3.2s ease-in-out infinite; }
@keyframes lout { 0%, 30% { opacity: 1; text-decoration-color: transparent; } 45%, 80% { opacity: .55; text-decoration-color: currentColor; } 100% { opacity: 1; text-decoration-color: transparent; } }
.lane.tl { justify-content: space-between; padding: 0 22px; }
.lane.tl::before { content: ""; position: absolute; left: 22px; right: 22px; top: 50%; height: 2px; background: var(--line-2); }
.ld { position: relative; z-index: 1; width: 12px; height: 12px; border-radius: 50%; background: var(--raised); border: 2px solid var(--line-2); }
.ld.on { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent); }
.ld.here { border-color: var(--faint); }
.arc { position: absolute; left: 12px; right: 12px; top: 2px; width: calc(100% - 24px); height: 24px; overflow: visible; }
.arc path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.arc path + path { stroke-dasharray: none; }
.aiwho { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.aiwho h3 { margin: 0 0 8px; font-size: 13px; }
.aiwho ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.aiwho li { position: relative; padding-left: 24px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.aiwho li::before { position: absolute; left: 0; top: 1px; width: 16px; height: 16px; border-radius: 5px; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.can, .never { padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: color-mix(in srgb, var(--raised) 88%, transparent); }
.can h3 { color: var(--ok); }
.never h3 { color: var(--danger); }
.can li::before { content: "+"; background: var(--ok-soft); color: var(--ok); }
.never li::before { content: "–"; background: var(--danger-soft); color: var(--danger); }
.facts { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.facts li { padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--raised) 88%, transparent); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.facts b { color: var(--ink); }
.faq { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: color-mix(in srgb, var(--raised) 88%, transparent); }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; padding: 13px 16px; font-weight: 600; font-size: 13.5px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; color: var(--muted); font-weight: 500; font-size: 18px; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); color: var(--accent); }
.faq summary:hover { background: var(--hover); }
.faq details p { margin: 0; padding: 0 16px 14px; font-size: 13.5px; }
.keys { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.keys div { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in srgb, var(--raised) 88%, transparent); }
.keys dt { min-width: 52px; }
.keys dd { margin: 0; font-size: 13px; color: var(--ink-2); }
kbd { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--raised); font: 600 12px/1 var(--ui); color: var(--ink); }
.built { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.built li { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: color-mix(in srgb, var(--raised) 88%, transparent); }
.built b { font-size: 14px; }
.built span { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* ---------- narrower desktops: the copilot floats over the stage ---------- */
@media (max-width: 1180px) and (min-width: 861px) {
  .app, .app.co-off { grid-template-columns: 212px minmax(0, 1fr); }
  .copilot { position: fixed; right: 12px; top: 68px; bottom: 102px; width: 372px; z-index: 50; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-3); overflow: hidden; }
  .app.co-off .copilot { display: none; }
  .co-close { display: inline-grid; }
}

/* ---------- phone: bottom tab bar, copilot as a sheet ---------- */
@media (max-width: 860px) {
  .app, .app.co-off { display: flex; flex-direction: column; height: 100dvh; }
  .sidebar, .desk-only { display: none !important; }
  .mobile-only { display: inline-grid !important; }
  .bar-row { height: 52px; padding: 0 10px 0 16px; gap: 8px; }
  .bar h1 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; }
  .tbtn { padding: 0 8px; }
  .tbtn .lbl, .step .lbl { display: none; }
  .strip { padding: 0 16px; }
  .main { flex: 1; min-height: 0; }
  .view { padding: 18px 16px 120px; }
  .intake { flex-direction: column; }
  .intake .btn { min-height: 42px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .thumb { height: 104px; }
  .paper { width: 80px; height: 104px; top: 14px; }
  .lrow { grid-template-columns: 22px 34px minmax(0, 1fr) auto; }
  .rems { grid-template-columns: 1fr; }
  .selbar { top: -18px; }
  .sbox { flex-basis: 100%; }
  .lrow .p, .lrow .c, .lrow .d { display: none; }
  .lhead { display: none; }
  .ov-cols { grid-template-columns: minmax(0, 1fr); }
  .ov-hero h2 { font-size: 22px; }
  .stats { gap: 20px; flex-wrap: wrap; }
  .tape { --gut: 0px; --spine: 14px; }
  .ev { grid-template-columns: 0 28px minmax(0, 1fr); }
  .ev time { display: none; }
  .ev .node, .playhead .ph-dot { grid-column: 2; }
  .ev .ecard, .playhead .ph-tag { grid-column: 3; }
  .ev { padding: 2px 0; }
  .ev .emeta .t-m { display: inline; }
  .ecard { margin-left: 4px; }
  .ehead { flex-wrap: wrap; }
  .ehead .etext { flex: 1 1 100%; }
  .playhead .ph { grid-template-columns: 0 28px minmax(0, 1fr); }
  .playhead .ph-l { display: none; }
  .day span { margin-left: 40px; }
  .branch-box { margin-left: 40px; }
  .branch-box::before { left: -27px; width: 26px; }
  .brow { grid-template-columns: 62px 14px minmax(0, 1fr); }
  .pv-top { padding: 10px 12px; }
  .pv-acts .lbl { display: none; }
  .set-row { flex-direction: column; align-items: flex-start; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); flex: none; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); z-index: 30; }
  .tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px; border-radius: 8px; color: var(--muted); font-size: 10.5px; font-weight: 500; }
  .tab svg { width: 21px; height: 21px; }
  .tab[aria-current="page"] { color: var(--accent); }
  .tab .badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; background: var(--fill); color: var(--on-accent); }
  .fab { position: fixed; right: 16px; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 35; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px 0 15px; border-radius: 999px; background: var(--fill); color: var(--on-accent); font-weight: 650; box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
  .fab svg { width: 18px; height: 18px; }
  .fab:active { transform: scale(.97); }
  .copilot { position: fixed; left: 0; right: 0; bottom: 0; height: 88dvh; z-index: 55; border: 0; border-radius: 18px 18px 0 0; box-shadow: var(--shadow-3); transform: translateY(105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); visibility: hidden; }
  .copilot::before { content: ""; position: absolute; left: 50%; top: 7px; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line-2); }
  .app.co-open .copilot { transform: none; visibility: visible; }
  .co-close { display: inline-grid; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 54; background: rgba(15, 16, 20, .35); }
  .compose { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .sugg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .preview { position: fixed; inset: 0; z-index: 45; }
  #overlay h2 { font-size: 24px; }
  .bar-row .theme-toggle { width: 34px; height: 34px; }
  .mlogo { display: inline-grid !important; }
  .mlogo .rw-logo { width: 28px; height: 28px; }
  /* the dock becomes a compact scroller just above the tab bar */
  .dock { flex: none; height: 58px; margin: 0 8px 6px; padding: 0 4px; border-radius: 14px; gap: 2px; }
  .transport { flex-direction: row; align-items: center; width: auto; height: 42px; padding-right: 4px; gap: 0; }
  .tbtn { height: 42px; width: 38px; padding: 0; justify-content: center; }
  .tbtn > svg { width: 19px; height: 19px; }
  .tbtn .tl { display: none; }
  .step { min-width: 40px; height: 42px; padding: 0 4px 0 8px; }
  .step b { font-size: 18px; }
  .strip { padding: 0 2px; }
  #timeline { padding: 0 8px; }
  .frame { padding-right: 24px; }
  .frame::after { width: 14px; right: 5px; }
  .frame > button, .frame > div { height: 38px; max-width: 168px; padding: 0 11px 0 5px; gap: 7px; border-radius: 11px; }
  .frame .who { width: 26px; height: 26px; border-radius: 8px; }
  .frame .who svg { width: 13px; height: 13px; }
  .frame .tm { display: none; }
  .frame.next > div { width: 38px; height: 38px; }
  .fab { bottom: calc(132px + env(safe-area-inset-bottom)); }
  .vh { grid-template-columns: minmax(0, 1fr); }
  .vh-detail { display: none; }
  .vh .ev .emeta .t-m { order: 0; }
  .notices { bottom: 150px; }
  .welcome { padding: 24px 18px 20px; border-radius: 18px; }
  .wl-head h2 { font-size: 24px; }
  .wl-points { grid-template-columns: 1fr; gap: 10px; margin-top: 18px; }
  .wl-points li { flex-direction: row; align-items: flex-start; padding: 12px; }
  .wl-acts .btn { flex: 1 1 auto; }
  .guide { grid-template-columns: 1fr; gap: 0; }
  .g-intro h2 { font-size: 26px; }
  .layers, .aiwho, .keys, .built { grid-template-columns: 1fr; }
  .runbox { margin-left: 42px; }
  .hd-acts .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ---------- account control ---------- */
.set-note { margin: -2px 0 8px; color: var(--muted); font-size: 12.5px; }
.acct-btn { flex: none; }
.acct-btn.on { width: 34px; padding: 0; border-radius: 50%; border: 0; color: #fff; background: linear-gradient(135deg, #9a6bff, #3d7bff); font-size: 14px; text-transform: uppercase; box-shadow: var(--shadow-1); }
.acct-btn.on:hover { filter: brightness(1.08); }
#acct-panel { position: fixed; z-index: 61; top: 60px; right: 14px; width: min(340px, calc(100vw - 24px)); padding: 16px; border-radius: 14px; background: var(--raised); border: 1px solid var(--line); box-shadow: var(--shadow-3); }
#acct-panel[hidden] { display: none; }
#acct-panel h3 { margin: 0 0 4px; font-size: 15px; letter-spacing: -.01em; }
#acct-panel .who { margin: 0 0 12px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
#acct-panel .priv { margin: 12px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.acct-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; margin-bottom: 14px; border-radius: 10px; background: var(--hover); }
.acct-tabs button { height: 30px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); }
.acct-tabs button[aria-selected="true"] { background: var(--raised); color: var(--ink); box-shadow: var(--shadow-1); }
.acct-form { display: flex; flex-direction: column; gap: 10px; }
.acct-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.acct-form input { width: 100%; height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); outline: none; font-size: 14px; }
.acct-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.acct-form input[aria-invalid="true"] { border-color: var(--danger); }
.acct-err { margin: 0; min-height: 0; color: var(--danger); font-size: 12.5px; line-height: 1.4; }
.acct-err:empty { display: none; }
.acct-form .btn { width: 100%; height: 36px; }
@media (max-width: 860px) { #acct-panel { top: 54px; right: 12px; } .acct-btn.on { width: 32px; height: 32px; } }

/* =====================================================================
   v5: live activity, before/after, answers, branches, getting ready
   ===================================================================== */

/* ---------- header pill: getting ready, then a one-line summary ---------- */
button.pill { border: 0; font: inherit; font-size: 12px; font-weight: 550; cursor: default; }
.pill.ready { background: color-mix(in srgb, var(--ok-soft) 80%, transparent); color: var(--ink-2); cursor: pointer; transition: background .12s, color .12s; }
.pill.ready::before { background: var(--ok); animation: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.pill.ready:hover { background: var(--ok-soft); color: var(--ink); }

/* ---------- getting your workspace ready: a skeleton of the workspace ---------- */
.warm { position: absolute; inset: 0; z-index: 6; padding: 24px 28px; background: var(--page); background-attachment: fixed; overflow: hidden; }
.warm-sk { display: flex; flex-direction: column; gap: 18px; max-width: 1100px; }
.warm-hero { height: 108px; border-radius: 16px; }
.warm-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.warm-row .sk { height: 86px; border-radius: 14px; }
.warm-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.warm-cols .sk { height: 220px; border-radius: 14px; }
.warm-note { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 14px; width: min(420px, calc(100% - 32px)); padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); box-shadow: var(--shadow-3), inset 0 1px 0 var(--glass-edge); }
.warm-note b { display: block; font-size: 15px; letter-spacing: -.01em; }
.warm-note small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }
.warm-spin { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-right-color: color-mix(in srgb, var(--blue) 70%, transparent); animation: spin .8s linear infinite; }

/* ---------- live agent activity: the stepper card ---------- */
.msg.activity > .av { color: var(--accent); }
.stepper { border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--raised) 90%, transparent); box-shadow: var(--shadow-1); overflow: hidden; }
.stepper.running { border-color: var(--accent-line); box-shadow: var(--shadow-2), 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent); }
.stepper.failed { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: color-mix(in srgb, var(--danger-soft) 45%, var(--raised)); }
.st-head { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; text-align: left; }
.stepper:not(.running) .st-head { cursor: pointer; }
.stepper:not(.running) .st-head:hover { background: color-mix(in srgb, var(--hover) 60%, transparent); }
.st-ring { position: relative; flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff; box-shadow: 0 6px 14px -6px var(--glow); }
.st-ring svg { width: 14px; height: 14px; }
.stepper.running .st-ring::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--accent); border-right-color: color-mix(in srgb, var(--blue) 80%, transparent); animation: spin .9s linear infinite; }
.stepper.done .st-ring { background: var(--ok); box-shadow: none; }
.stepper.failed .st-ring { background: var(--danger); box-shadow: none; }
.st-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.st-t b { font-size: 13.5px; font-weight: 680; letter-spacing: -.005em; }
.st-t small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepper.failed .st-t small { color: var(--danger); white-space: normal; }
.st-chev { width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
.stepper.open .st-chev { transform: rotate(180deg); }
.st-list { list-style: none; margin: 0; padding: 0 12px 10px; }
.stepper.done:not(.open) .st-list { display: none; }
.bd .st-list li { padding: 0; }
.bd .st-list li::before { display: none; }
.stp { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 28px; font-size: 12.5px; color: var(--ink-2); }
.bd .st-list .stp + .stp::before { content: ""; display: block; position: absolute; left: 10px; top: -8px; height: 12px; width: 2px; border-radius: 1px; background: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.st-ico { position: relative; z-index: 1; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.st-ico svg { width: 12px; height: 12px; }
.st-tx { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-ok { width: 14px; height: 14px; color: var(--ok); }
.stp.cur { color: var(--ink); font-weight: 600; animation: st-in .25s cubic-bezier(.2, .8, .2, 1); }
.stp.cur .st-ico { background: var(--grad); color: #fff; }
.stp.cur .st-ico::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--accent); animation: spin .8s linear infinite; }
.stp.end { font-weight: 650; color: var(--ink); }
.stp.end .st-tx { white-space: normal; }
.stp.end.good .st-ico { background: var(--ok); color: #fff; }
.stp.end.bad .st-ico { background: var(--danger); color: #fff; }
.stp.end.bad .st-tx { color: var(--danger); }
.bd .st-list .st-more { padding: 0 0 4px 31px; }
.st-morebtn { font-size: 12px; font-weight: 600; color: var(--muted); }
.st-morebtn:hover { color: var(--accent); text-decoration: underline; }
@keyframes st-in { from { opacity: 0; transform: translateY(4px); } }

/* the dock breathes while something is running */
.dock.busy { border-color: var(--accent-line); animation: dock-busy 1.8s ease-in-out infinite; }
@keyframes dock-busy { 50% { box-shadow: var(--shadow-2), 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent), 0 0 34px -8px var(--glow); } }
.dock.busy .step b { color: var(--accent); }

/* the travel overlay's own steps */
.ov-steps { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.ov-steps li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--faint); transition: color .2s; }
.ov-steps li.ok { color: var(--ink-2); }
.ov-steps li.cur { color: var(--ink); font-weight: 600; }
.ov-ico { position: relative; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--sunk); color: var(--faint); }
.ov-ico svg { width: 12px; height: 12px; }
.ov-steps li.ok .ov-ico { background: var(--ok); color: #fff; animation: pop .4s cubic-bezier(.2, 1.6, .4, 1); }
.ov-steps li.cur .ov-ico { background: var(--grad); color: #fff; }
.ov-steps li.cur .ov-ico::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--accent); animation: spin .8s linear infinite; }

/* ---------- search with answers ---------- */
.sbox { padding-right: 5px; }
.sgo { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 12px; border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 600; transition: background .12s, color .12s; }
.sgo kbd { height: 20px; min-width: 0; font-size: 10.5px; color: var(--muted); }
.sgo:hover { background: var(--hover); color: var(--ink); }
.sbox.typed .sgo { background: var(--grad); color: #fff; box-shadow: 0 6px 16px -8px var(--glow); }
.sbox.typed .sgo kbd { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .28); color: #fff; }
section.answer { position: relative; margin: 0 0 18px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--accent-line); background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 70%, var(--raised)), color-mix(in srgb, var(--raised) 92%, transparent) 70%); box-shadow: var(--shadow-2); overflow: hidden; }
section.answer.enter { animation: hd-in .22s cubic-bezier(.2, .8, .2, 1); }
section.answer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--grad); }
section.answer.err { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: color-mix(in srgb, var(--warn-soft) 55%, var(--raised)); }
section.answer.err::before { background: var(--warn); }
.ans-h { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; flex-wrap: wrap; }
.ans-h b { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.ans-h .muted { font-size: 12.5px; }
.ans-ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--grad); color: #fff; box-shadow: 0 6px 14px -6px var(--glow); }
.ans-ico svg { width: 14px; height: 14px; }
section.answer.err .ans-ico { background: var(--warn); box-shadow: none; }
section.answer.loading .ans-ico svg { animation: blink .7s ease-in-out infinite alternate; }
.ans-tx { font-size: 14.5px; line-height: 1.55; color: var(--ink); max-width: 72ch; }
.ans-tx p { margin: 0 0 6px; white-space: pre-wrap; }
.ans-tx ul { margin: 0 0 6px; padding-left: 18px; }
section.answer.err .ans-tx { font-size: 13.5px; color: var(--ink-2); }
.ans-sk { display: flex; flex-direction: column; gap: 9px; padding: 4px 0 2px; }
.ans-sk i { display: block; height: 12px; border-radius: 6px; }
section.answer .srcs { margin-top: 10px; }

/* ---------- before/after comparison ---------- */
.bacs { display: flex; flex-direction: column; gap: 10px; }
.bac { border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb, var(--raised) 92%, transparent); padding: 10px 12px 12px; }
.bac-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.bac-ttl { font-size: 13px; font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bdgs { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.bdg { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px 0 5px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap; background: var(--sunk); color: var(--ink-2); }
.bdg svg { width: 11px; height: 11px; }
.bdg.moved { background: var(--accent-soft); color: var(--accent); }
.bdg.renamed { background: color-mix(in srgb, var(--blue) 14%, var(--raised)); color: var(--blue); }
.bdg.edited { background: var(--warn-soft); color: var(--warn); }
.bdg.trashed, .bdg.removed { background: var(--danger-soft); color: var(--danger); }
.bdg.recovered, .bdg.added { background: var(--ok-soft); color: var(--ok); }
.pcmp { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; min-width: 0; }
.pc-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; line-height: 1.5; }
.pc-i { width: 13px; height: 13px; color: var(--faint); }
.trail { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; }
.seg { padding: 0 6px; border-radius: 5px; background: var(--sunk); color: var(--ink-2); font-weight: 550; }
.trail .sep, .pc-line > .sep { color: var(--faint); }
.trail.old .seg.ch { background: var(--danger-soft); color: var(--danger); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.trail.new .seg.ch { background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.trail.new .seg.ch.trash { background: var(--danger-soft); color: var(--danger); }
.pc-to { color: var(--accent); font-weight: 700; }
.pc-note { color: var(--faint); font-size: 11.5px; }
.nm-old, .nm-new, .nm-same { min-width: 0; overflow-wrap: anywhere; color: var(--ink-2); }
.nm-old { color: var(--muted); }
.pcmp del { background: var(--danger-soft); color: var(--danger); text-decoration: line-through; border-radius: 3px; padding: 0 1px; }
.pcmp ins { background: var(--ok-soft); color: var(--ok); text-decoration: none; font-weight: 700; border-radius: 3px; padding: 0 1px; }
.bac-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 10px; }
.bac-arrow { color: var(--faint); font-weight: 700; }
.bside { display: flex; flex-direction: column; gap: 5px; padding: 0; text-align: left; border-radius: 10px; min-width: 0; }
.bside:disabled { cursor: default; opacity: 1; }
.bthumb { position: relative; height: 92px; border-radius: 9px; border: 1px solid var(--line); background: var(--sunk); overflow: hidden; transition: border-color .12s, box-shadow .12s; }
.bthumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.bthumb .paper { top: 10px; width: 60px; height: 82px; padding: 9px 8px; }
.bthumb .paper i { height: 3px; margin-bottom: 4px; }
.bthumb .paper i:first-child { height: 4px; margin-bottom: 7px; }
.bthumb .paper b { bottom: 8px; right: 6px; font-size: 8px; }
.bthumb.none { display: grid; place-items: center; border-style: dashed; background: transparent; color: var(--faint); font-size: 12px; }
.bside:not(:disabled):hover .bthumb { border-color: var(--accent-line); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent); }
.bcap { font-size: 11.5px; font-weight: 650; color: var(--muted); }
.bside.after .bcap { color: var(--ink-2); }
.bside.trashed .bthumb { opacity: .55; filter: grayscale(.6); }
.bside.trashed .bthumb::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in srgb, var(--danger) 10%, transparent) 8px 10px); }
.bdiff { margin: 10px 0 0; }
.bmore { margin-top: 8px; }
.bmore summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--accent); padding: 4px 0; }
.bmore .changes { margin-top: 4px; }
/* in proposals */
.ptop { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.pttl { font-size: 12.5px; font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptext .pcmp { font-size: 12px; gap: 3px; }
.ptext .seg { padding: 0 5px; }
.prow.thumbed { grid-template-columns: auto 22px minmax(0, 1fr) 46px; }
div.prow.thumbed { grid-template-columns: 22px minmax(0, 1fr) 46px; }
.prow .bthumb { width: 46px; height: 58px; border-radius: 7px; }
.prow .bthumb .paper { top: 7px; width: 32px; height: 44px; padding: 6px 5px; }
.prow .bthumb .paper i { height: 2px; margin-bottom: 3px; }
.prow .bthumb .paper b { display: none; }

/* ---------- branches: the switcher in the dock ---------- */
.brbtn { --c: var(--accent); flex: none; display: flex; align-items: center; gap: 8px; height: 46px; max-width: 200px; padding: 0 9px 0 7px; margin: 0 2px 0 6px; border-radius: 13px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); text-align: left; box-shadow: var(--shadow-1); transition: border-color .12s, box-shadow .12s, transform .06s; }
.brbtn:hover { border-color: color-mix(in srgb, var(--c) 45%, var(--line)); box-shadow: var(--shadow-2), 0 0 0 3px color-mix(in srgb, var(--c) 10%, transparent); }
.brbtn:active { transform: scale(.98); }
.brbtn[aria-expanded="true"] { border-color: var(--c); }
.brbtn .bico { width: 30px; height: 30px; padding: 7px; border-radius: 10px; background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c); }
.brbtn .bt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brbtn .bt small { font-size: 10.5px; color: var(--muted); font-weight: 500; }
.brbtn .bt b { font-size: 12.5px; font-weight: 680; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
.brbtn .bcount { font-style: normal; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--c); color: #fff; font-variant-numeric: tabular-nums; }
.brbtn .bchev { width: 14px; height: 14px; color: var(--muted); transition: transform .2s; }
.brbtn[aria-expanded="true"] .bchev { transform: rotate(180deg); }
#brpanel { position: fixed; z-index: 62; width: min(380px, calc(100vw - 24px)); max-height: min(520px, calc(100dvh - 140px)); overflow-y: auto; padding: 14px; border-radius: 16px; background: var(--raised); border: 1px solid var(--line); box-shadow: var(--shadow-3); animation: hd-in .18s cubic-bezier(.2, .8, .2, 1); }
.brp-h b { display: block; font-size: 15px; letter-spacing: -.01em; }
.brp-h p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.brp-list { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.brp-empty { padding: 10px; font-size: 13px; color: var(--muted); }
.brp-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 9px 8px 9px 11px; border-radius: 11px; border: 1px solid transparent; transition: background .12s; }
.brp-row:hover { background: var(--side); }
.brp-row.cur { background: color-mix(in srgb, var(--c) 9%, var(--raised)); border-color: color-mix(in srgb, var(--c) 35%, var(--line)); }
.brp-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 20%, transparent); }
.brp-t { min-width: 0; }
.brp-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brp-name b { font-size: 13.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag.here-tag { background: var(--c); color: #fff; font-weight: 650; height: 18px; font-size: 11px; }
.brp-t small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brp-acts { display: flex; align-items: center; gap: 4px; }
.ibtn.sm-i { width: 30px; height: 30px; border-radius: 8px; }
.ibtn.sm-i svg { width: 15px; height: 15px; }
.brp-edit input { width: 100%; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--accent); background: var(--bg); color: var(--ink); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.brp-erow { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.brp-count { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.brp-err { display: block; margin-top: 4px; font-size: 12px; color: var(--danger); }
.brp-err:empty { display: none; }
.brp-foot { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding-top: 11px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); line-height: 1.45; }
.brp-foot svg { width: 14px; height: 14px; margin-top: 2px; color: var(--accent); }

/* ---------- branches: git-style lanes in Rewind History ---------- */
.lanelegend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -8px 0 16px; }
.ll-l { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-right: 4px; }
.llchip { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px 0 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); font-size: 12.5px; font-weight: 600; color: var(--ink-2); transition: border-color .12s; }
.llchip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.llchip:hover { border-color: color-mix(in srgb, var(--c) 50%, var(--line)); }
.llchip.cur { border-color: var(--c); color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 14%, transparent); cursor: default; }
.tape.laned { --ny: 27px; }
.tape.laned > li::before { display: none; }
.vh .tape.laned .ev { grid-template-columns: 0 calc(28px + var(--lx)) minmax(0, 1fr); }
.vh .tape.laned .playhead .ph { grid-template-columns: 0 calc(28px + var(--lx)) minmax(0, 1fr); }
.vh .tape.laned .playhead .ph-dot { justify-self: start; }
.vh .tape.laned .playhead .ph::after { left: 14px; }
.tape.laned .node.laned { justify-self: start; }
.tape.laned .node.laned:not(.flag) { border-color: var(--c); }
.vh .tape.laned .day span, .vh .tape.laned .branch-box, .tape.laned .runbox { margin-left: calc(42px + var(--lx)); }
.tape.laned .branch-box::before { display: none; }
.rails { position: absolute; left: 0; top: 0; bottom: 0; width: calc(28px + var(--lx)); pointer-events: none; }
.rl { position: absolute; top: 0; bottom: 0; width: 2px; border-radius: 2px; background: color-mix(in srgb, var(--c) 32%, var(--line)); }
.rl.on { background: var(--c); }
.rl.from { top: var(--ny); }
.rl.to { bottom: calc(100% - var(--ny)); }
.rl.dash { background: repeating-linear-gradient(var(--c) 0 5px, transparent 5px 10px); }
.fork { position: absolute; top: 0; height: var(--ny); border-right: 2px solid color-mix(in srgb, var(--c) 32%, var(--line)); border-bottom: 2px solid color-mix(in srgb, var(--c) 32%, var(--line)); border-bottom-right-radius: 12px; }
.fork.on { border-color: var(--c); }
.ev.other .ecard { opacity: .85; }
.ev.other .elabel { color: var(--ink-2); font-weight: 550; }
.ev.other .node { background: var(--bg); }
.tag.btag { gap: 5px; background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--ink-2); font-weight: 600; }
.tag.btag i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.btn.branch-btn-a { flex: none; color: var(--ink-2); background: transparent; border-color: var(--line-2); box-shadow: none; }
.btn.branch-btn-a svg { color: var(--accent); }
.btn.branch-btn-a:hover:not(:disabled) { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* ---------- settings: what each reset does ---------- */
.undoable { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--ok); }
.undoable svg { width: 13px; height: 13px; }
.set-row + .set-row { margin-top: 8px; }

@media (max-width: 860px) {
  .warm { padding: 18px 16px; }
  .warm-row { grid-template-columns: 1fr 1fr; }
  .warm-row .sk:last-child { display: none; }
  .warm-cols { grid-template-columns: 1fr; }
  #mem.ready { display: none; }
  .brbtn { height: 38px; padding: 0 6px 0 4px; margin: 0 2px 0 4px; gap: 4px; border-radius: 11px; }
  .brbtn .bt, .brbtn .bchev { display: none; }
  .brbtn .bico { width: 28px; height: 28px; padding: 6px; border-radius: 8px; }
  .bac-pair { gap: 6px; }
  .bthumb { height: 80px; }
  .sgo span { display: none; }
  .sgo kbd { display: none; }
  .sgo { padding: 0 9px; }
  .sgo::after { content: "Go"; }
}
.pcmp .whole del { background: none; color: var(--muted); padding: 0; }
.pcmp .whole ins { background: none; color: var(--ink); padding: 0; font-weight: 650; }
.vh-detail { max-height: calc(100dvh - 230px); overflow-y: auto; scrollbar-width: thin; }
.vh-detail::before { position: sticky; top: 0; z-index: 2; }
.sect-h h2 { white-space: nowrap; }
@media (max-width: 860px) { .results .sect-h { flex-wrap: wrap; } .results .sect-h .muted { flex: 1 1 0; min-width: 0; } }

/* chat replies never shrink or clip, whatever their kind */
#log > .msg { flex-shrink: 0; }
