/* 公司微信紀錄中心 — manager console. Self-contained: no external fonts or assets (CSP default-src 'self'). */
:root {
  color-scheme: light;
  --font: "Segoe UI Variable Text", "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei UI", "Microsoft JhengHei", system-ui, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei UI", "Microsoft JhengHei", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", "Consolas", "SFMono-Regular", ui-monospace, monospace;
  --bg: #f3f1ea;
  --bg-deep: #e9e6dc;
  --surface: #ffffff;
  --surface-2: #faf9f5;
  --surface-3: #f2f0e9;
  --ink: #0f1d17;
  --ink-2: #33433b;
  --muted: #69766f;
  --faint: #8b958f;
  --line: #e4e1d6;
  --line-2: #d6d2c4;
  --accent: #12704f;
  --accent-strong: #0b573c;
  --accent-ink: #ffffff;
  --accent-soft: #e3efe7;
  --accent-tint: #f0f6f1;
  --glow: rgba(18, 112, 79, .16);
  --good: #0ca30c; --good-text: #0b6b2a; --good-soft: #e6f4e6;
  --warn: #fab219; --warn-text: #865600; --warn-soft: #fdf3dc;
  --serious: #ec835a; --serious-text: #9c3e18; --serious-soft: #fcebe3;
  --critical: #d03b3b; --critical-text: #9f2727; --critical-soft: #fbe7e6;
  --info: #2a78d6; --info-text: #1c5cab; --info-soft: #e5effb;
  --shadow-1: 0 1px 2px rgba(15, 29, 23, .05), 0 5px 14px -8px rgba(15, 29, 23, .10);
  --shadow-2: 0 1px 2px rgba(15, 29, 23, .05), 0 22px 46px -26px rgba(15, 29, 23, .30);
  --shadow-3: 0 2px 8px rgba(15, 29, 23, .08), 0 40px 90px -34px rgba(15, 29, 23, .50);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --rail: 256px;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b100e; --bg-deep: #070b09; --surface: #121a16; --surface-2: #161f1b; --surface-3: #1b2621;
    --ink: #eef2ee; --ink-2: #c6d0ca; --muted: #93a19a; --faint: #6f7d76; --line: #222e28; --line-2: #2f3d36;
    --accent: #3fbf8a; --accent-strong: #67d3a4; --accent-ink: #06130d; --accent-soft: rgba(63, 191, 138, .14); --accent-tint: rgba(63, 191, 138, .07);
    --glow: rgba(63, 191, 138, .18);
    --good-text: #62d47a; --good-soft: rgba(12, 163, 12, .16); --warn-text: #f5c75c; --warn-soft: rgba(250, 178, 25, .14);
    --serious-text: #f3a07d; --serious-soft: rgba(236, 131, 90, .15); --critical-text: #f28b8b; --critical-soft: rgba(208, 59, 59, .17);
    --info: #3987e5; --info-text: #8dbdf2; --info-soft: rgba(57, 135, 229, .15);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 16px -8px rgba(0, 0, 0, .5); --shadow-2: 0 2px 6px rgba(0, 0, 0, .4), 0 24px 48px -26px rgba(0, 0, 0, .72); --shadow-3: 0 2px 10px rgba(0, 0, 0, .5), 0 40px 90px -34px rgba(0, 0, 0, .82);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b100e; --bg-deep: #070b09; --surface: #121a16; --surface-2: #161f1b; --surface-3: #1b2621;
  --ink: #eef2ee; --ink-2: #c6d0ca; --muted: #93a19a; --faint: #6f7d76; --line: #222e28; --line-2: #2f3d36;
  --accent: #3fbf8a; --accent-strong: #67d3a4; --accent-ink: #06130d; --accent-soft: rgba(63, 191, 138, .14); --accent-tint: rgba(63, 191, 138, .07);
  --glow: rgba(63, 191, 138, .18);
  --good-text: #62d47a; --good-soft: rgba(12, 163, 12, .16); --warn-text: #f5c75c; --warn-soft: rgba(250, 178, 25, .14);
  --serious-text: #f3a07d; --serious-soft: rgba(236, 131, 90, .15); --critical-text: #f28b8b; --critical-soft: rgba(208, 59, 59, .17);
  --info: #3987e5; --info-text: #8dbdf2; --info-soft: rgba(57, 135, 229, .15);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 16px -8px rgba(0, 0, 0, .5); --shadow-2: 0 2px 6px rgba(0, 0, 0, .4), 0 24px 48px -26px rgba(0, 0, 0, .72); --shadow-3: 0 2px 10px rgba(0, 0, 0, .5), 0 40px 90px -34px rgba(0, 0, 0, .82);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0; }
.muted { color: var(--muted); }
.num, .tabular { font-variant-numeric: tabular-nums; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.eyebrow { font-size: 11.5px; font-weight: 650; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.eyebrow.light { color: rgba(255, 255, 255, .72); }

/* ---------- controls ---------- */
button { cursor: pointer; border: 0; background: none; }
button:disabled { cursor: not-allowed; opacity: .45; }
.primary, .ghost, .danger-btn, .chip-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: 11px; font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: transform .18s var(--ease), background-color .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 8px 18px -10px var(--accent); }
.primary:hover:not(:disabled) { background: var(--accent-strong); transform: translateY(-1px); }
.primary:active:not(:disabled) { transform: translateY(0); }
.ghost { background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-2); }
.ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.danger-btn { background: var(--surface); border: 1px solid color-mix(in srgb, var(--critical) 35%, var(--line)); color: var(--critical-text); }
.danger-btn:hover:not(:disabled) { background: var(--critical-soft); }
.wide { width: 100%; min-height: 48px; font-size: 15px; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: var(--muted); transition: background-color .18s, color .18s; }
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
input, select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--surface); color: var(--ink); transition: border-color .18s, box-shadow .18s;
}
select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
input::placeholder, textarea::placeholder { color: var(--faint); }

.tag, .chip, .pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap; max-width: 100%;
}
.tag { background: var(--accent-soft); color: var(--accent); }
.chip { background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--line); }
.chip .ic { width: 13px; height: 13px; }
.chip.text-overflow, .chip > span { overflow: hidden; text-overflow: ellipsis; }
.pill { border: 1px solid transparent; }
.pill .ic { width: 14px; height: 14px; }
.pill.good { background: var(--good-soft); color: var(--good-text); }
.pill.warn { background: var(--warn-soft); color: var(--warn-text); }
.pill.serious { background: var(--serious-soft); color: var(--serious-text); }
.pill.critical { background: var(--critical-soft); color: var(--critical-text); }
.pill.info { background: var(--info-soft); color: var(--info-text); }
.pill.neutral { background: var(--surface-3); color: var(--muted); border-color: var(--line); }
.pill.ai { background: linear-gradient(120deg, var(--accent-soft), var(--info-soft)); color: var(--ink-2); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, .85fr); }
.login-art { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 85% 10%, #1f8a62 0%, #0d5a3e 38%, #07291d 100%); color: #fff; display: flex; align-items: flex-end; padding: clamp(32px, 6vw, 88px); }
.login-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(120% 80% at 70% 20%, #000 20%, transparent 75%); }
.login-art::after { content: ""; position: absolute; width: 520px; height: 520px; right: -140px; top: -160px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 0 0 70px rgba(255, 255, 255, .03), 0 0 0 140px rgba(255, 255, 255, .025); }
.login-statement { position: relative; max-width: 560px; animation: rise .9s var(--ease) both; }
.statement { margin: 18px 0 34px; font-family: var(--font-display); font-weight: 700; font-size: clamp(34px, 4.4vw, 60px); line-height: 1.12; letter-spacing: -.03em; }
.statement-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; color: rgba(255, 255, 255, .82); }
.statement-points li { display: flex; gap: 14px; align-items: baseline; font-size: 15px; }
.statement-points span { font-family: var(--font-mono); font-size: 12px; color: rgba(255, 255, 255, .5); }
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 6vw, 80px); background: var(--surface); }
.login-panel h1 { font-size: 26px; font-weight: 700; margin: 26px 0 8px; }
.login-panel form { display: grid; gap: 10px; margin-top: 30px; max-width: 380px; }
.login-panel label { font-size: 13px; font-weight: 600; color: var(--muted); }
.pin { height: 58px; font-size: 26px; letter-spacing: .5em; text-align: center; font-family: var(--font-mono); padding-left: .5em; }
.login-error { min-height: 22px; margin-top: 12px; color: var(--critical-text); font-weight: 600; }
.fine { margin-top: 24px; font-size: 12.5px; color: var(--faint); }
.mark { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 25px;
  background: linear-gradient(145deg, #23a072, #0c5a3e); box-shadow: 0 10px 24px -12px rgba(12, 90, 62, .8), inset 0 1px 0 rgba(255, 255, 255, .25); }
.mark.small { width: 36px; height: 36px; border-radius: 11px; font-size: 18px; }

/* ---------- shell ---------- */
.shell { min-height: 100vh; display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 10px; padding: 20px 14px; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, var(--bg)); }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; text-decoration: none; }
.brand-text { display: grid; line-height: 1.25; }
.brand-text strong { font-size: 15px; }
.brand-text small { font-size: 12px; color: var(--muted); }
.nav { display: grid; gap: 2px; }
.nav-label { margin: 16px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--faint); }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 11px; color: var(--ink-2); text-decoration: none; font-weight: 550; transition: background-color .18s, color .18s; }
.nav a:hover { background: var(--surface-3); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav a[aria-current="page"] .ic { color: var(--accent); }
.count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700; background: var(--surface-3); color: var(--muted); font-variant-numeric: tabular-nums; }
.count.hot { background: var(--critical-soft); color: var(--critical-text); }
.rail-foot { margin-top: auto; display: grid; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.pulse-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.live { background: var(--good); box-shadow: 0 0 0 0 rgba(12, 163, 12, .5); animation: pulse 2.4s infinite; }
.dot.busy { background: var(--info); animation: pulse-info 1.4s infinite; }
.dot.stale { background: var(--warn); }
.rail-actions { display: flex; gap: 4px; }

.main { min-width: 0; padding: 30px clamp(18px, 3.2vw, 48px) 40px; outline: none; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 22px; }
.title-block h1 { font-size: clamp(26px, 2.6vw, 34px); font-weight: 700; letter-spacing: -.025em; margin-top: 6px; }
.lede { margin-top: 6px; color: var(--muted); max-width: 640px; }
.health { display: grid; grid-template-columns: repeat(4, auto); gap: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-1); }
.health > div { padding: 10px 18px; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.health > div:first-child { border-left: 0; }
.health span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.health strong { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.health strong.small { font-size: 14px; padding-top: 3px; }

.scope { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 0 calc(-1 * clamp(18px, 3.2vw, 48px)) 22px; padding: 12px clamp(18px, 3.2vw, 48px);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.scope.stuck { border-bottom-color: var(--line); }
.scope .field { flex: 1 1 150px; max-width: 220px; }
.scope .field.grow { flex: 2 1 220px; max-width: 380px; }
.scope .ghost { min-height: 40px; }
.note { font-size: 13px; color: var(--muted); margin: 0 0 16px; max-width: 900px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 22px; min-width: 0; }
.narrow { max-width: 640px; }
.stack { display: grid; gap: 10px; }
.stack:empty { display: none; }
.view { animation: fade .45s var(--ease) both; }
.foot { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); text-align: center; }

/* ---------- banners ---------- */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; line-height: 1.65; margin-bottom: 16px; }
.stack .banner { margin: 0; }
.banner .ic { margin-top: 2px; width: 20px; height: 20px; }
.banner strong { margin-right: 6px; }
.banner .banner-actions { margin-left: auto; display: flex; gap: 8px; flex: none; }
.banner.calm { background: var(--accent-tint); border-color: color-mix(in srgb, var(--accent) 22%, var(--line)); color: var(--ink-2); }
.banner.calm .ic { color: var(--accent); }
.banner.critical { background: var(--critical-soft); border-color: color-mix(in srgb, var(--critical) 30%, transparent); color: var(--critical-text); }
.banner.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); color: var(--warn-text); }
.banner.serious { background: var(--serious-soft); border-color: color-mix(in srgb, var(--serious) 35%, transparent); color: var(--serious-text); }
.banner.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--info-text); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .9fr); border-radius: 22px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-2); margin-bottom: 18px; }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(60% 120% at 100% 0%, var(--glow), transparent 60%), radial-gradient(40% 60% at 0% 100%, var(--accent-tint), transparent 70%); }
.hero-main { position: relative; padding: clamp(22px, 3vw, 36px); display: grid; gap: 18px; align-content: start; }
.hero-date { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.hero-day { font-family: var(--font-display); font-weight: 750; font-size: clamp(54px, 6.4vw, 92px); line-height: .86; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.hero-day .sep { color: var(--accent); }
.hero-weekday { display: grid; gap: 4px; padding-bottom: 6px; }
.hero-weekday strong { font-size: 17px; }
.hero-weekday span { font-size: 13px; color: var(--muted); }
.hero-headline { font-family: var(--font-display); font-size: clamp(19px, 1.7vw, 23px); font-weight: 650; line-height: 1.45; letter-spacing: -.012em; max-width: 720px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13px; color: var(--muted); }
.hero-meta div { display: flex; align-items: center; gap: 7px; }
.hero-meta .ic { width: 15px; height: 15px; color: var(--faint); }
.hero-meta b { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-side { position: relative; padding: clamp(22px, 3vw, 32px); border-left: 1px solid var(--line); display: grid; gap: 16px; align-content: start; background: color-mix(in srgb, var(--surface-2) 65%, transparent); }
.next-label { font-size: 12px; font-weight: 650; color: var(--muted); letter-spacing: .06em; }
.next-time { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.next-rel { font-size: 13px; color: var(--muted); }
.ribbon { display: grid; gap: 10px; }
.ribbon-bar { display: flex; gap: 2px; height: 10px; border-radius: 6px; overflow: hidden; background: var(--surface-3); }
.ribbon-bar span { flex: var(--w) 1 0; min-width: 4px; transition: flex-grow .6s var(--ease); }
.ribbon-bar .done { background: var(--good); }
.ribbon-bar .failed { background: var(--critical); }
.ribbon-bar .unknown { background: var(--serious); }
.ribbon-bar .deferred { background: var(--warn); }
.ribbon-bar .other { background: var(--line-2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.legend .done i { background: var(--good); } .legend .failed i { background: var(--critical); }
.legend .unknown i { background: var(--serious); } .legend .deferred i { background: var(--warn); } .legend .other i { background: var(--line-2); }
.meters { display: grid; gap: 12px; }
.meter { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); }
.meter-top { display: flex; justify-content: space-between; gap: 10px; }
.meter-top b { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 650; }
.meter-track { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.meter-fill { height: 100%; width: var(--p); border-radius: 4px; background: var(--accent); transition: width .8s var(--ease); }
.meter-fill.high { background: var(--serious); }
.tiles { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); grid-column: 1 / -1; }
.tile { padding: 18px clamp(18px, 2.4vw, 28px); border-left: 1px solid var(--line); display: grid; gap: 4px; }
.tile:first-child { border-left: 0; }
.tile span { font-size: 12px; color: var(--muted); font-weight: 600; }
.tile strong { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.tile small { font-size: 12px; color: var(--faint); }
.state-pill { justify-self: start; }
.live-ring { position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.live-ring::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid currentColor; opacity: .5; animation: ring 1.6s var(--ease) infinite; }

/* ---------- runs & groups ---------- */
.runs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.run-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.run-tab[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.groups { columns: 2 420px; column-gap: 16px; }
.groups > .empty, .groups > .skeleton { break-inside: avoid; margin-bottom: 16px; }
.group { position: relative; padding: 0; overflow: hidden; break-inside: avoid; margin-bottom: 16px; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.group-head { padding: 18px 20px 14px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.group-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.group-title h2 { font-size: 17px; line-height: 1.4; overflow-wrap: anywhere; }
.group-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.group-body { padding: 16px 20px 20px; display: grid; gap: 16px; }
.overview { font-size: 15px; line-height: 1.8; color: var(--ink); }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.section-title .n { font-variant-numeric: tabular-nums; color: var(--faint); font-weight: 600; letter-spacing: 0; }
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.items li { position: relative; padding-left: 16px; line-height: 1.7; font-size: 14px; color: var(--ink-2); }
.items li::before { content: ""; position: absolute; left: 2px; top: .72em; width: 5px; height: 5px; border-radius: 50%; background: var(--line-2); }
.items.todo-items li::before { width: 7px; height: 7px; border-radius: 2px; border: 1.5px solid var(--accent); background: none; top: .62em; left: 0; }
.items.question li::before { background: var(--info); }
.items.risk li::before { background: var(--serious); }
.items.update li::before { background: var(--accent); }
.item-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cites { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 6px; vertical-align: 1px; }
.cite { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); background: var(--accent-tint); color: var(--accent); font-size: 11px; font-weight: 700; font-family: var(--font-mono); transition: transform .15s var(--ease), background-color .15s; }
.cite:hover { background: var(--accent-soft); transform: translateY(-1px); }
.cite.missing { border-style: dashed; color: var(--faint); background: none; cursor: not-allowed; }
.group-fail { display: grid; gap: 10px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-2); font-size: 13.5px; color: var(--ink-2); }
.group-fail .row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.group-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
details.more summary { cursor: pointer; list-style: none; font-size: 12.5px; font-weight: 650; color: var(--accent); }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary { margin-bottom: 12px; }

.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 56px 24px; border: 1px dashed var(--line-2); border-radius: 18px; color: var(--muted); background: color-mix(in srgb, var(--surface) 55%, transparent); grid-column: 1 / -1; }
.empty svg { width: 120px; height: 96px; fill: none; stroke: var(--line-2); stroke-width: 2.2; stroke-linecap: round; }
.empty strong { color: var(--ink); font-size: 16px; }
.empty p { max-width: 520px; font-size: 13.5px; }

.skeleton { position: relative; overflow: hidden; background: var(--surface-3); border-radius: 10px; min-height: 14px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent); animation: shimmer 1.3s infinite; }
.sk-card { height: 260px; border-radius: var(--radius); }
.sk-hero { height: 300px; border-radius: 22px; margin-bottom: 18px; }

/* ---------- todos ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 13px; background: var(--surface-3); border: 1px solid var(--line); }
.segmented button { min-height: 34px; padding: 0 12px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; transition: background-color .18s, color .18s, box-shadow .18s; }
.segmented button:hover { color: var(--ink); }
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.segmented .n { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.search { position: relative; display: block; width: min(320px, 100%); }
.search .ic { position: absolute; left: 12px; top: 11px; color: var(--faint); }
.search input { padding-left: 38px; }
.todo-list { display: grid; gap: 10px; }
.todo { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 18px; align-items: start; width: 100%; text-align: left; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-1); transition: border-color .18s, transform .18s var(--ease), box-shadow .18s; animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.todo:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); transform: translateY(-1px); box-shadow: var(--shadow-2); }
.todo-task { font-size: 15.5px; font-weight: 650; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.todo-where { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.todo-facts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 16px; padding-top: 12px; margin-top: 4px; border-top: 1px dashed var(--line); }
.fact { display: grid; gap: 2px; min-width: 0; }
.fact span { font-size: 11.5px; color: var(--faint); font-weight: 600; }
.fact b { font-size: 13px; font-weight: 600; color: var(--ink-2); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.fact b.missing { color: var(--warn-text); }
.fact b.late { color: var(--critical-text); }
.todo-side { display: grid; justify-items: end; gap: 6px; }

/* ---------- followups ---------- */
.lane-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.lane-stat { text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); display: grid; gap: 4px; transition: border-color .18s, box-shadow .18s; }
.lane-stat:hover, .lane-stat[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }
.lane-stat span { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.lane-stat span i { width: 8px; height: 8px; border-radius: 50%; }
.lane-stat strong { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.lanes { display: grid; gap: 22px; }
.lane h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 15px; }
.lane h2 i { width: 10px; height: 10px; border-radius: 50%; }
.lane-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 12px; }
.c-overdue i, i.c-overdue { background: var(--critical); } .c-new_evidence i, i.c-new_evidence { background: var(--serious); }
.c-insufficient i, i.c-insufficient { background: var(--warn); } .c-internal i, i.c-internal { background: var(--info); }
.c-waiting_customer i, i.c-waiting_customer { background: var(--faint); }
.follow { display: grid; gap: 10px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-1); border-top: 3px solid var(--tone, var(--line-2)); animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.follow.c-overdue { --tone: var(--critical); } .follow.c-new_evidence { --tone: var(--serious); } .follow.c-insufficient { --tone: var(--warn); }
.follow.c-internal { --tone: var(--info); } .follow.c-waiting_customer { --tone: var(--line-2); }
.follow h3 { font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.basis { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.basis li { display: flex; gap: 8px; }
.basis li::before { content: "—"; color: var(--faint); }
.integrity { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.integrity .ic { width: 15px; height: 15px; }
.integrity.ok .ic { color: var(--good-text); }
.integrity.gap { color: var(--warn-text); background: var(--warn-soft); }
.follow-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.follow-actions .ghost, .follow-actions .primary { min-height: 34px; font-size: 13px; padding: 0 12px; }

/* ---------- records & devices ---------- */
.filters { display: grid; grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)) auto; gap: 12px; align-items: end; margin-bottom: 14px; }
.columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 16px; align-items: start; }
.list-card { padding: 18px 0 14px; }
.list-card h2 { padding: 0 20px 12px; display: flex; align-items: center; gap: 10px; }
.row { display: block; width: 100%; text-align: left; padding: 14px 20px; border-top: 1px solid var(--line); transition: background-color .15s; }
.row:hover { background: var(--surface-2); }
.row.selected { background: var(--accent-tint); box-shadow: inset 3px 0 0 var(--accent); }
.row strong { font-size: 13.5px; }
.row p { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 66px; overflow: hidden; line-height: 1.55; color: var(--ink-2); font-size: 14px; }
.meta { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px 0; font-size: 13px; color: var(--muted); }
.detail-card { position: sticky; top: 92px; }
.body-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.85; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin: 16px 0; font-size: 15px; }
dl.meta-grid { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px 14px; margin: 0; font-size: 13px; }
dl.meta-grid dt { color: var(--faint); }
dl.meta-grid dd { margin: 0; overflow-wrap: anywhere; color: var(--ink-2); font-variant-numeric: tabular-nums; }
dl.meta-grid dd.mono { font-family: var(--font-mono); font-size: 12px; }
.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.device { display: grid; gap: 12px; }
.device-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.device-top h2 { font-size: 16px; }
.stack-form { display: grid; gap: 14px; margin: 18px 0; }
#provision-output { font-family: var(--font-mono); font-size: 12px; }

/* ---------- drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 60; }
.scrim { position: absolute; inset: 0; background: rgba(8, 15, 12, .38); backdrop-filter: blur(3px); animation: fade .25s ease both; }
.panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-3); animation: slide .38s var(--ease) both; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel-title { flex: 1; min-width: 0; }
.panel-title h2 { font-size: 18px; margin-top: 2px; overflow-wrap: anywhere; }
.panel-body { flex: 1; overflow: auto; padding: 20px; display: grid; gap: 18px; align-content: start; overscroll-behavior: contain; }
.thread { display: grid; gap: 10px; padding: 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.bubble { max-width: 88%; justify-self: start; display: grid; gap: 4px; }
.bubble.out { justify-self: end; text-align: right; }
.bubble .who { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.bubble .say { padding: 10px 13px; border-radius: 4px 14px 14px 14px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; font-size: 14px; text-align: left; }
.bubble.out .say { border-radius: 14px 4px 14px 14px; background: var(--accent-tint); }
.bubble.focus .say { border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); background: var(--surface); font-size: 15px; }
.bubble.focus .who { color: var(--accent); font-weight: 650; }
.verify { display: flex; flex-wrap: wrap; gap: 8px; }
.attachments { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.attach-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; color: var(--muted); }
.attach-title svg { width: 15px; height: 15px; }
.attach-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.attach-name { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.form-grid { display: grid; gap: 14px; }
.status-picker { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.status-picker label { position: relative; }
.status-picker input { position: absolute; opacity: 0; pointer-events: none; }
.status-picker span { display: grid; place-items: center; min-height: 40px; padding: 4px 6px; border-radius: 10px; border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 650; color: var(--ink-2); text-align: center; cursor: pointer; transition: all .18s var(--ease); }
.status-picker input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.status-picker input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.hint { font-size: 12.5px; color: var(--muted); }
.hint.warn { color: var(--warn-text); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 14px; }
.timeline li { position: relative; display: grid; gap: 2px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-2); }
.timeline li.manager::before { border-color: var(--accent); background: var(--accent); }
.timeline li.ai::before { border-color: var(--info); }
.timeline time { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.source-list { display: grid; gap: 8px; }
.source-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; transition: border-color .15s; }
.source-row:hover { border-color: var(--accent); }
.source-row .ic { color: var(--accent); }
.source-row small { color: var(--faint); font-variant-numeric: tabular-nums; }
.sticky-actions { position: sticky; bottom: -20px; margin: 0 -20px -20px; padding: 14px 20px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

.toast { position: fixed; z-index: 80; left: 50%; bottom: 28px; transform: translateX(-50%); max-width: min(560px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 13px; background: var(--ink); color: var(--surface); font-size: 14px; font-weight: 550; box-shadow: var(--shadow-3); animation: toast .35s var(--ease) both; }
.tabbar { display: none; }

/* ---------- motion ---------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes slide { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(12, 163, 12, .45); } 70% { box-shadow: 0 0 0 8px rgba(12, 163, 12, 0); } 100% { box-shadow: 0 0 0 0 rgba(12, 163, 12, 0); } }
@keyframes pulse-info { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes ring { from { transform: scale(.6); opacity: .7; } to { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .lane-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .health { grid-template-columns: repeat(2, auto); }
  .health > div:nth-child(3) { border-left: 0; }
  .health > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 1100px) {
  :root { --rail: 84px; }
  .brand-text, .nav span, .nav-label, .pulse-line span:last-child { display: none; }
  .nav { width: 100%; }
  .nav a { justify-content: center; padding: 0; }
  .nav a[aria-current="page"]::before { left: -10px; }
  .nav a .count { position: absolute; top: 2px; right: 6px; min-width: 18px; height: 18px; font-size: 10px; padding: 0 5px; }
  .rail { align-items: center; padding: 18px 10px; }
  .brand { padding: 4px 0 14px; }
  .rail-actions { flex-direction: column; }
  .pulse-line { justify-content: center; }
  .hero { grid-template-columns: 1fr; }
  .hero-side { border-left: 0; border-top: 1px solid var(--line); }
  .columns { grid-template-columns: 1fr; }
  .detail-card { position: static; }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters .grow { grid-column: 1 / -1; }
  .todo-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: 38vh; padding: 32px 22px; }
  .statement { font-size: 34px; margin: 12px 0 20px; }
  .statement-points { display: none; }
  .login-panel { padding: 30px 22px 40px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; top: 0; left: 0; right: 0; height: 60px; z-index: 40; flex-direction: row; align-items: center; padding: 0 12px; border-right: 0; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px); }
  .nav { display: none; }
  .brand { padding: 0; }
  .brand-text { display: grid; }
  .rail-foot { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
  .rail-actions { flex-direction: row; }
  .pulse-line { display: none; }
  .main { padding: 80px 16px calc(96px + env(safe-area-inset-bottom)); }
  .topbar { flex-direction: column; align-items: stretch; gap: 16px; }
  .lede { display: none; }
  .title-block h1 { font-size: 26px; }
  .health { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .health > div, .health > div:nth-child(n+3) { padding: 9px 10px; border-top: 0; border-left: 1px solid var(--line); }
  .health > div:first-child { border-left: 0; }
  .health span { font-size: 10.5px; }
  .health strong { font-size: 15px; }
  .health strong.small { font-size: 11.5px; padding-top: 2px; }
  .scope { position: static; margin: 0 -16px 16px; padding: 0 16px 4px; gap: 8px; background: none; backdrop-filter: none; border: 0;
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  .scope::-webkit-scrollbar { display: none; }
  .scope .field, .scope .field.grow { width: auto; flex: 0 0 auto; max-width: none; scroll-snap-align: start; }
  .scope .field > span { display: none; }  /* compact row: each select's current value is its own label */
  .scope .field select, .scope .field input { min-width: 132px; height: 40px; }
  .scope .ghost { width: auto; flex: 0 0 auto; min-height: 40px; white-space: nowrap; }
  .hero-day { font-size: 60px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile:nth-child(3) { border-left: 0; }
  .tile:nth-child(n+3) { border-top: 1px solid var(--line); }
  .groups { grid-template-columns: minmax(0, 1fr); }
  .lane-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters .primary { grid-column: 1 / -1; }
  .todo { grid-template-columns: minmax(0, 1fr); }
  .todo-side { justify-items: start; grid-auto-flow: column; justify-content: start; }
  .status-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .banner { flex-wrap: wrap; }
  .banner .banner-actions { margin-left: 32px; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .tabbar a { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 0; border-radius: 10px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; }
  .tabbar a .ic { width: 21px; height: 21px; }
  .tabbar a[aria-current="page"] { color: var(--accent); background: var(--accent-tint); }
  .tabbar .count { position: absolute; top: 0; right: calc(50% - 22px); min-width: 17px; height: 17px; font-size: 10px; padding: 0 4px; }
  .panel { width: 100vw; }
  .foot { margin-bottom: 8px; }
}
@media (max-width: 420px) {
  .hero-day { font-size: 52px; }
  .tile strong { font-size: 24px; }
  .lane-stat strong { font-size: 24px; }
  .brand-text small { display: none; }
}
@media print {
  .rail, .tabbar, .scope, .drawer, .toast { display: none !important; }
  .shell { display: block; }
  .card, .hero, .group { box-shadow: none; break-inside: avoid; }
}

/* ---------- confirm dialog ---------- */
dialog.ask { border: 1px solid var(--line); border-radius: 18px; padding: 24px; width: min(460px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-3); }
dialog.ask[open] { animation: rise .3s var(--ease) both; }
dialog.ask::backdrop { background: rgba(8, 15, 12, .45); backdrop-filter: blur(3px); }
dialog.ask h2 { font-size: 19px; margin-bottom: 10px; }
dialog.ask .check { display: flex; gap: 10px; align-items: center; margin-top: 16px; font-size: 13.5px; font-weight: 600; }
dialog.ask .check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }
.ask-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.subtitle { font-size: 13px; font-weight: 650; color: var(--accent); letter-spacing: .02em; }

/* ---------- hero highlights ---------- */
.highlights { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 2px; }
.highlights ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.highlights li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 4px; animation: rise .5s var(--ease) both; animation-delay: calc(140ms + var(--i, 0) * 70ms); }
.hl-index { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--accent); padding-top: 3px; }
.hl-text { font-size: 14.5px; line-height: 1.6; color: var(--ink); font-weight: 550; }
.hl-meta { display: flex; align-items: center; gap: 7px; margin-top: 2px; font-size: 12px; color: var(--faint); }
.dot-tone { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-tone.serious { background: var(--serious); } .dot-tone.warn { background: var(--warn); } .dot-tone.info { background: var(--info); }
.lane-stat.zero strong { color: var(--faint); }
details.raw summary { font-size: 12px; color: var(--muted); }
.raw-text { margin: 0; max-height: 220px; overflow: auto; padding: 12px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--line); font-family: var(--font-mono); font-size: 11.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }

/* real-data review pass */
.banner-text { flex: 1; min-width: 0; }
.banner-text .banner-actions { margin: 10px 0 0; }
.more-cites { border-style: dashed; color: var(--muted); background: none; }
details.fold { margin-top: 2px; }
details.fold > summary { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; list-style: none; font-size: 12.5px; font-weight: 650; color: var(--accent); padding: 4px 0; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold .chev { width: 15px; height: 15px; transform: rotate(-90deg); transition: transform .2s var(--ease); }
details.fold[open] > summary .chev { transform: rotate(90deg); }
details.fold[open] > summary { margin-bottom: 6px; }
details.fold > section:first-of-type { margin-top: 4px; }
.caveat { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--line); }
.caveat .ic { width: 15px; height: 15px; flex: none; color: var(--faint); }
.items .caveat-item { opacity: .68; }
.items .caveat-item::before { background: var(--line-2) !important; border-color: var(--line-2) !important; }
.chip.direct { background: var(--info-soft); color: var(--info-text); border-color: color-mix(in srgb, var(--info) 28%, var(--line)); }
.row-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-head h2 { font-size: 18px; }
.row .row-head strong { font-size: 13.5px; }

/* ============================================================ award polish pass
   Visual-only elevation, typographic rhythm and micro-interaction refinements.
   All same-origin / inline (CSP default-src 'self'); no markup or behaviour
   changes. Everything here either overrides a tone/shadow/transform or adds a
   decorative pseudo-element — layout boxes and breakpoints are left untouched. */

/* ---- custom scrollbars (slim, themed, both engines) ---- */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: padding-box; }

/* ---- rail: active indicator springs in, hover nudges ---- */
.nav a { transition: background-color .18s var(--ease), color .18s var(--ease), transform .2s var(--ease-out); }
.nav a:hover { transform: translateX(2px); }
.nav a[aria-current="page"] { transform: none; }
.nav a[aria-current="page"]::before { animation: tick-in .4s var(--ease-out) both; }
@keyframes tick-in { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
.nav a .ic { transition: transform .2s var(--ease-out); }
.nav a:hover .ic { transform: scale(1.08); }
.icon-btn { transition: background-color .18s, color .18s, transform .18s var(--ease-out); }
.icon-btn:hover { transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0) scale(.94); }
.brand .mark { transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out); }
.brand:hover .mark { transform: rotate(-4deg) scale(1.05); box-shadow: 0 12px 26px -12px rgba(12, 90, 62, .9), inset 0 1px 0 rgba(255, 255, 255, .3); }

/* ---- hero: the signature surface — layered glow, highlighted rim, display numeral ---- */
.hero { border-color: color-mix(in srgb, var(--accent) 12%, var(--line)); }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
:root[data-theme="dark"] .hero::after, :root:not([data-theme="light"]) .hero::after { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
.hero-day { background: linear-gradient(176deg, var(--ink) 20%, color-mix(in srgb, var(--ink) 58%, var(--accent)) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-day .sep { color: var(--accent); -webkit-text-fill-color: var(--accent); animation: sep-pulse 3.4s var(--ease) infinite; }
@keyframes sep-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.hero-headline { letter-spacing: -.015em; }
.hero-side { background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 80%, transparent), color-mix(in srgb, var(--accent-tint) 55%, transparent)); }
.next-time { background: linear-gradient(176deg, var(--ink), color-mix(in srgb, var(--ink) 55%, var(--accent))); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---- ribbon + meters: rounder, softer, with a sheen on fills ---- */
.ribbon-bar { height: 12px; border-radius: 7px; padding: 2px; background: var(--surface-3); box-shadow: inset 0 1px 2px rgba(15, 29, 23, .08); }
.ribbon-bar span { border-radius: 4px; }
.ribbon-bar .done { background: linear-gradient(180deg, color-mix(in srgb, var(--good) 88%, white), var(--good)); }
.meter-track { height: 6px; border-radius: 6px; box-shadow: inset 0 1px 2px rgba(15, 29, 23, .07); }
.meter-fill { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 78%, white), var(--accent)); box-shadow: 0 0 10px -2px var(--glow); }
.meter-fill.high { background: linear-gradient(90deg, color-mix(in srgb, var(--serious) 82%, white), var(--serious)); box-shadow: none; }

/* ---- "先看這幾件": index numerals become quiet accent badges ---- */
.hl-index { display: inline-grid; place-items: center; width: 24px; height: 24px; padding-top: 0; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; letter-spacing: 0; }
.highlights li { grid-template-columns: 30px minmax(0, 1fr); align-items: start; gap: 10px; }

/* ---- section titles: a small accent lead tick ---- */
.section-title::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--accent); opacity: .7; }

/* ---- cards lift as one family on hover ---- */
.group, .follow, .device, .lane-stat { transition: border-color .2s var(--ease), transform .22s var(--ease-out), box-shadow .22s var(--ease-out); }
.group:hover, .follow:hover, .device:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: color-mix(in srgb, var(--accent) 26%, var(--line)); }
.follow:hover { border-top-color: var(--tone, var(--line-2)); }
.lane-stat:hover { transform: translateY(-2px); }

/* ---- buttons: gradient primary, crisper press feedback ---- */
.primary { background: linear-gradient(176deg, color-mix(in srgb, var(--accent) 90%, white) 0%, var(--accent) 60%, var(--accent-strong) 100%); box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 10px 22px -12px var(--accent); }
.primary:hover:not(:disabled) { box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 14px 26px -12px var(--accent); }
.primary:active:not(:disabled) { transform: translateY(0) scale(.985); }
.ghost:active:not(:disabled), .chip-btn:active:not(:disabled) { transform: scale(.985); }

/* ---- segmented & run tabs: smoother selection ---- */
.segmented button { transition: background-color .2s var(--ease-out), color .2s var(--ease-out), box-shadow .2s var(--ease-out), transform .16s var(--ease-out); }
.segmented button:active { transform: scale(.97); }
.run-tab { transition: background-color .2s var(--ease-out), color .2s var(--ease-out), border-color .2s, transform .16s var(--ease-out); }
.run-tab:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line-2)); color: var(--accent); }
.run-tab[aria-pressed="true"]:hover { color: var(--surface); }

/* ---- AI pill: gentle living sheen (stilled under reduced-motion) ---- */
.pill.ai { background: linear-gradient(120deg, var(--accent-soft), var(--info-soft), var(--accent-soft)); background-size: 200% 100%; animation: ai-sheen 6s linear infinite; }
@keyframes ai-sheen { to { background-position: -200% 0; } }

/* ---- drawer: deeper scrim, smoother panel entrance ---- */
.panel { animation: panel-in .42s var(--ease-out) both; }
@keyframes panel-in { from { transform: translateX(44px); opacity: 0; } to { transform: none; opacity: 1; } }
.source-row { transition: border-color .18s, background-color .18s, transform .16s var(--ease-out); }
.source-row:hover { transform: translateX(2px); background: var(--surface); }
.status-picker span { transition: border-color .18s var(--ease-out), background-color .18s var(--ease-out), color .18s var(--ease-out), transform .14s var(--ease-out); }
.status-picker label:active span { transform: scale(.96); }

/* ---- scope filter bar gains a soft shadow once pinned ---- */
.scope.stuck { box-shadow: 0 10px 24px -22px rgba(15, 29, 23, .5); }

/* ---- login: slow aurora drift behind the statement (motion-safe) ---- */
.login-art::after { animation: orb-drift 26s var(--ease) infinite alternate; }
@keyframes orb-drift { from { transform: translate(0, 0); } to { transform: translate(-26px, 22px) scale(1.04); } }
.login-panel .primary.wide { transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), background-color .18s; }
.pin { transition: border-color .18s, box-shadow .22s var(--ease-out); }

/* ---- todo rows: an accent tick slides in on hover/focus, lifting them above a flat table ---- */
.todo { position: relative; }
.todo::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); opacity: 0; transform: scaleY(.35); transform-origin: center; transition: opacity .2s var(--ease-out), transform .24s var(--ease-out); }
.todo:hover::before, .todo:focus-visible::before { opacity: 1; transform: scaleY(1); }

/* ---- drawer thread: bubbles gain quiet depth, focused one stays the hero ---- */
.bubble .say { box-shadow: 0 1px 2px rgba(15, 29, 23, .04); }
.bubble.focus .say { box-shadow: 0 0 0 4px var(--glow), 0 6px 16px -10px var(--accent); }
.sticky-actions { box-shadow: 0 -8px 20px -18px rgba(15, 29, 23, .4); }

/* ---- empty + skeleton: warmer shimmer, gentler illustration ---- */
.empty svg { transition: stroke .3s; animation: empty-float 5s var(--ease) infinite; }
@keyframes empty-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.empty strong { letter-spacing: -.01em; }
.skeleton::after { animation-duration: 1.5s; }

/* ---- tiles & health numerals: tighter optical tracking on the big figures ---- */
.tile strong, .health strong, .lane-stat strong { letter-spacing: -.02em; }

/* ---- login: first impression — panel settles in, mark and field feel tactile ---- */
.login-panel { animation: panel-rise .8s var(--ease-out) both; }
.login-panel > * { animation: panel-rise .7s var(--ease-out) both; }
.login-panel .mark { animation-delay: 0ms; } .login-panel h1 { animation-delay: 60ms; }
.login-panel .muted { animation-delay: 110ms; } .login-panel form { animation-delay: 160ms; }
.login-panel .fine { animation-delay: 220ms; }
@keyframes panel-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.login-panel .mark { transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out); }
.login-panel .mark:hover { transform: translateY(-2px) rotate(-3deg); }
.pin:focus { box-shadow: 0 0 0 4px var(--glow), 0 10px 22px -14px var(--accent); }
.statement-points li { transition: color .2s; }
.statement-points span { transition: color .2s; }
.login-statement .statement-points li { animation: rise .7s var(--ease-out) both; }
.statement-points li:nth-child(1) { animation-delay: .35s; }
.statement-points li:nth-child(2) { animation-delay: .46s; }
.statement-points li:nth-child(3) { animation-delay: .57s; }

/* ---- finishing touches: calmer chips, crisp focus rings on interactive cards ---- */
.chip { box-shadow: 0 1px 1px rgba(15, 29, 23, .02); }
.todo:focus-visible, .row:focus-visible, .lane-stat:focus-visible, .source-row:focus-visible, .follow-actions .primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cite:focus-visible { outline-offset: 2px; }
.toast { border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.state-pill { letter-spacing: .01em; }


/* ---------- neutral company database login ---------- */
.login {
  min-height: 100vh;
  min-height: 100svh;
  grid-template-columns: minmax(0, 420px);
  place-content: center;
  padding: 40px 24px;
  background: #f1f4f3;
}
.login .login-panel {
  width: 100%;
  min-width: 0;
  padding: 40px 36px 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 3px 8px rgba(21, 48, 36, .025), 0 24px 64px -36px rgba(21, 48, 36, .22);
}
.login .login-panel, .login .login-panel > * { animation: none; }
.login .login-panel .mark {
  width: 46px;
  height: 46px;
  margin-inline: auto;
  border-radius: 13px;
  font-size: 22px;
  background: #145c43;
  box-shadow: none;
  transition: none;
}
.login .login-panel .mark:hover { transform: none; }
.login .login-panel h1 {
  margin: 22px 0 8px;
  font-size: 26px;
  line-height: 1.4;
  text-align: center;
  letter-spacing: .04em;
}
.login .login-panel > .muted { text-align: center; font-size: 14px; letter-spacing: .12em; }
.login .login-panel form { max-width: none; margin-top: 32px; gap: 10px; }
.login .login-panel label { font-size: 13px; color: var(--ink-2); }
.login .login-panel .pin { height: 52px; font-size: 23px; border-radius: 10px; }
.login .login-panel .primary { min-height: 48px; margin-top: 8px; border-radius: 10px; box-shadow: none; }
.login .login-panel .login-error { min-height: 20px; margin-top: 10px; font-size: 13px; }
.login .login-panel .fine { margin-top: 14px; padding-top: 20px; border-top: 1px solid var(--line); text-align: center; font-size: 12px; }
:root[data-theme="dark"] .login { background: #0c1510; }
@media (max-width: 480px) {
  .login { padding: 28px 18px; }
  .login .login-panel { padding: 34px 24px 24px; border-radius: 18px; }
  .login .login-panel h1 { font-size: 24px; }
}

/* Device control and integrity: server receipts and client reports stay separate. */
.integrity-overview { grid-column: 1 / -1; }
.integrity-overview .device-top { align-items: baseline; }
.integrity-overview h2 { margin: 0; font-size: 18px; }
.integrity-overview .integrity-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; }
.integrity-device { min-width: 0; align-content: start; }
.integrity-device .device-top > div { min-width: 0; }
.integrity-device .device-top h2, .integrity-device .device-top p { overflow-wrap: anywhere; }
.integrity-device .device-top .state-pill { flex-shrink: 0; }
.integrity-control-state { border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.integrity-control-state strong { font-size: 13px; }
.integrity-control-state p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.integrity-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 16px; margin: 0; }
.integrity-facts > div { min-width: 0; }
.integrity-facts dt { margin: 0 0 4px; color: var(--faint); font-size: 11px; font-weight: 600; line-height: 1.5; }
.integrity-facts dd { margin: 0; color: var(--ink-2); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.integrity-note { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.integrity-media { border-top: 1px solid var(--line); padding-top: 14px; }
.integrity-media h3, .integrity-profile h3 { margin: 0 0 12px; font-size: 13px; }
.integrity-details, .integrity-admin { border-top: 1px solid var(--line); padding-top: 12px; }
.integrity-details > summary, .integrity-admin > summary { color: var(--accent); font-size: 12px; font-weight: 600; cursor: pointer; line-height: 1.7; }
.integrity-profile { border-top: 1px dashed var(--line); margin-top: 14px; padding-top: 14px; min-width: 0; }
.integrity-profile:first-of-type { border-top: 0; }
.integrity-profile .integrity-facts + .integrity-facts { margin-top: 14px; }
.integrity-source { overflow-wrap: anywhere; font-size: 11px; }
.integrity-actions { display: grid; gap: 8px; padding-top: 4px; }
.integrity-actions > button { width: 100%; }
.integrity-admin > button { margin-top: 12px; width: 100%; }
.integrity-control-notice { margin: 0; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; line-height: 1.7; }
.integrity-note.error-note { color: var(--warn-text); }
.integrity-metrics-status { margin: 0; font-size: 11px; line-height: 1.65; color: var(--muted); }
.integrity-metrics-status.stale { color: var(--warn-text); }
@media (max-width: 640px) {
  .integrity-overview .device-top { flex-direction: column; gap: 5px; }
  .integrity-overview .integrity-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .integrity-device .device-top { flex-wrap: wrap; }
}

