/* MyWorkBench — dark evidence cockpit. Zero dependencies, local assets only. */

:root {
  color-scheme: dark;
  --bg: #0a0d12;
  --bg-soft: #0c1017;
  --panel: #10151d;
  --panel-2: #131a24;
  --panel-3: #0d131b;
  --line: #1d2633;
  --line-strong: #2a3647;
  --text: #e8edf5;
  --text-2: #8b97aa;
  --text-3: #617084;
  --accent: #4cc9f0;
  --accent-strong: #7dd3fc;
  --accent-soft: rgba(76, 201, 240, 0.12);
  --observed: #38bdf8;
  --derived: #a78bfa;
  --suggested: #fbbf24;
  --confirmed: #34d399;
  --danger: #f87171;
  --warn: #fbbf24;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono",
    "Courier New", monospace;
  --radius-lg: 16px;
  --radius: 13px;
  --radius-sm: 9px;
  --shadow-panel: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 16px 34px -24px rgba(0, 0, 0, 0.95);
  --topbar-h: 64px;
  --pad: 24px;
  --shell-max: 1608px;
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 540px at 12% -10%, rgba(56, 189, 248, 0.085), transparent 58%),
    radial-gradient(920px 500px at 88% -4%, rgba(167, 139, 250, 0.07), transparent 55%),
    radial-gradient(900px 600px at 50% 115%, rgba(52, 211, 153, 0.035), transparent 62%),
    linear-gradient(180deg, #0a0d12 0%, #090c11 55%, #0a0d12 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.032) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(ellipse 85% 62% at 50% 0%, #000 18%, transparent 78%);
  mask-image: radial-gradient(ellipse 85% 62% at 50% 0%, #000 18%, transparent 78%);
  opacity: 0.6;
}

body.drawer-open {
  overflow: hidden;
}

h1,
h2,
h3,
p,
dl,
dd,
dt {
  margin: 0;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--accent);
}

::selection {
  background: rgba(76, 201, 240, 0.3);
  color: #fff;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #2a3647 transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-thumb {
  background: #2a3647;
  border-radius: 99px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.muted {
  color: var(--text-3);
}

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

.skip-link {
  position: fixed;
  left: 16px;
  top: -64px;
  z-index: 300;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: #101a24;
  color: #dff7ff;
  font-size: 12px;
  text-decoration: none;
  transition: top 0.16s ease;
}

.skip-link:focus {
  top: 12px;
}

.eyebrow {
  margin: 0 0 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: #5f7c8f;
  text-transform: uppercase;
}

.icon {
  display: block;
  flex: 0 0 auto;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 var(--pad) 44px;
}

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  margin: 0 calc(var(--pad) * -1);
  padding: 0 var(--pad);
  background: rgba(10, 13, 18, 0.8);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
  backdrop-filter: blur(16px) saturate(135%);
  border-bottom: 1px solid rgba(29, 38, 51, 0.9);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(76, 201, 240, 0.34), transparent);
  pointer-events: none;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar {
    background: #0b0f15;
  }
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 62px;
  max-width: var(--shell-max);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid #263345;
  background: linear-gradient(160deg, #17212d, #0d131c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 20px -12px rgba(76, 201, 240, 0.55);
  flex: 0 0 auto;
}

.brand-logo {
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #f1f6fc;
  white-space: nowrap;
}

.brand-sub {
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--text-3);
  white-space: nowrap;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  flex: 0 0 auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 31px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(20, 27, 38, 0.92), rgba(13, 18, 26, 0.92));
  color: var(--text-2);
  font-size: 11px;
  white-space: nowrap;
  min-width: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.pill-icon {
  display: flex;
  color: var(--text-3);
}

.pill-source .pill-icon {
  color: var(--accent);
}

.pill-text {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 210px;
}

.pill-text-short {
  display: none;
}

.pill-mode {
  font-size: 9px;
  letter-spacing: 0.05em;
  padding: 2px 5px;
  border-radius: 5px;
  border: 1px solid rgba(76, 201, 240, 0.2);
  background: rgba(76, 201, 240, 0.08);
  color: #91d9ec;
}

.pill-tz .mono {
  font-size: 10.5px;
  color: #a4b2c4;
}

.pill-sep {
  color: #46566b;
}

.pill-scan {
  color: var(--text-3);
}

.pill-offline {
  border-color: rgba(248, 113, 113, 0.3);
  color: #f0b4b4;
}

.pill-offline .pill-icon {
  color: #f87171;
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 27px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.32);
  background: rgba(251, 191, 36, 0.09);
  color: #f2cc70;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.demo-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.14);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #18202c, #111722);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.btn:hover {
  border-color: #35445a;
  background: linear-gradient(180deg, #1b2532, #131a24);
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.btn-refresh {
  padding: 0 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 24px -18px rgba(76, 201, 240, 0.7);
}

.btn-refresh.is-busy .refresh-icon {
  animation: spin 0.9s linear infinite;
}

.btn-primary {
  border-color: rgba(76, 201, 240, 0.45);
  background: linear-gradient(180deg, rgba(76, 201, 240, 0.24), rgba(76, 201, 240, 0.11));
  color: #d3f5ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 10px 26px -16px rgba(76, 201, 240, 0.85);
}

.btn-primary:hover {
  border-color: rgba(76, 201, 240, 0.72);
  background: linear-gradient(180deg, rgba(76, 201, 240, 0.3), rgba(76, 201, 240, 0.15));
  color: #fff;
}

.btn-ghost {
  background: #0d131c;
  color: var(--text-2);
  font-weight: 500;
}

.btn-small {
  min-height: 44px;
  padding: 0 12px;
  font-size: 11.5px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: #cfdae8;
}

.btn-small:hover {
  background: rgba(255, 255, 255, 0.07);
}

/* ---------------------------------------------------------------- notices */
.notice-root:empty {
  display: none;
}

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 9px 10px 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.08), rgba(251, 191, 36, 0.03));
  color: #e6c87e;
  font-size: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.notice-error {
  border-color: rgba(248, 113, 113, 0.32);
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.09), rgba(248, 113, 113, 0.03));
  color: #f3b1b1;
}

.notice-icon {
  display: flex;
  color: #fbbf24;
}

.notice-error .notice-icon {
  color: #f87171;
}

.notice-text {
  flex: 1 1 240px;
  min-width: 0;
  line-height: 1.55;
}

.notice-close {
  width: 44px;
  height: 44px;
  margin: -6px -6px -6px 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: currentColor;
  opacity: 0.7;
  cursor: pointer;
  flex: 0 0 auto;
}

.notice-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.05);
}

/* ------------------------------------------------------------- page lead */
.lead-sub {
  margin-top: 8px;
  max-width: 660px;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.65;
}

/* ----------------------------------------------------------------- stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.stat-card {
  position: relative;
  padding: 14px 16px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #121922, #0e141c);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
  isolation: isolate;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(var(--stat-rgb, 76, 201, 240), 0.55), transparent 72%);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -36px;
  top: -50px;
  width: 140px;
  height: 140px;
  z-index: -1;
  background: radial-gradient(circle, rgba(var(--stat-rgb, 76, 201, 240), 0.11), transparent 70%);
  pointer-events: none;
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stat-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-2);
}

.stat-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(var(--stat-rgb, 76, 201, 240), 0.18);
  background: rgba(var(--stat-rgb, 76, 201, 240), 0.09);
  color: rgb(var(--stat-rgb, 76, 201, 240));
}

.stat-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 9px;
}

.stat-num {
  font-family: var(--font-mono);
  font-size: clamp(26px, 2.4vw, 33px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #f2f7fd;
}

.stat-unit {
  font-size: 10.5px;
  color: var(--text-3);
}

.stat-hint {
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--text-3);
}

.stat-card.is-attention .stat-num {
  color: #f7d68a;
}

/* --------------------------------------------------------------- filters */
.filters-panel {
  margin-top: 15px;
  padding: 13px 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(18, 25, 35, 0.94), rgba(12, 17, 24, 0.94));
  box-shadow: var(--shadow-panel);
}

.filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.filters-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.filters-icon {
  display: flex;
  color: var(--accent);
}

.filters-title h2 {
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.filters-sub {
  font-size: 10px;
  color: var(--text-3);
}

.filters-result {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: var(--text-3);
  font-size: 10.5px;
}

.filters-result strong {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-row + .filter-row {
  margin-top: 9px;
}

.filter-label {
  flex: 0 0 auto;
  min-width: 56px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

.chip-group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-width: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #273242;
  background: #0d131c;
  color: var(--text-2);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.chip:hover {
  color: var(--text);
  border-color: #35445a;
}

.chip[aria-pressed="true"] {
  color: #eaf3fb;
  border-color: rgba(var(--chip-rgb), 0.5);
  background: linear-gradient(180deg, rgba(var(--chip-rgb), 0.16), rgba(var(--chip-rgb), 0.06));
  box-shadow: inset 0 0 0 1px rgba(var(--chip-rgb), 0.1), 0 0 20px -12px rgba(var(--chip-rgb), 0.9);
}

.chip[aria-pressed="false"] {
  opacity: 0.66;
}

.chip[aria-pressed="false"]:hover {
  opacity: 0.92;
}

.chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgb(var(--chip-rgb));
  box-shadow: 0 0 0 3px rgba(var(--chip-rgb), 0.13);
  flex: 0 0 auto;
}

.chip[aria-pressed="false"] .chip-dot {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px rgba(var(--chip-rgb), 0.8);
}

.chip-count {
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-2);
}

.chip[aria-pressed="true"] .chip-count {
  background: rgba(var(--chip-rgb), 0.16);
  color: #e6f2fa;
}

.chip-label-short {
  display: none;
}

.filter-row-split {
  justify-content: space-between;
}

.filter-field {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  margin-left: auto;
}

.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.select-wrap select {
  min-height: 44px;
  max-width: 214px;
  padding: 0 32px 0 32px;
  border-radius: 10px;
  border: 1px solid #273242;
  background: #0d131c;
  color: #d7e2ee;
  font-size: 11.5px;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.select-icon {
  position: absolute;
  left: 10px;
  display: flex;
  color: var(--text-3);
  pointer-events: none;
}

.select-chevron {
  position: absolute;
  right: 9px;
  display: flex;
  color: var(--text-3);
  pointer-events: none;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 230px;
  max-width: 300px;
  min-width: 170px;
}

.search-icon {
  position: absolute;
  left: 11px;
  display: flex;
  color: var(--text-3);
  pointer-events: none;
}

.search-wrap input[type="search"] {
  width: 100%;
  min-height: 44px;
  padding: 0 44px 0 35px;
  border-radius: 10px;
  border: 1px solid #273242;
  background: #0d131c;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.search-wrap input[type="search"]::placeholder {
  color: #59687b;
}

.search-wrap input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  position: absolute;
  right: 0;
  top: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
}

.search-clear:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

#clear-filters {
  white-space: nowrap;
}

#clear-filters:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

/* ---------------------------------------------------------------- layout */
.timeline-slot {
  min-width: 0;
}

/* -------------------------------------------------------------- timeline */
.timeline-panel {
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 2px 2px 10px;
  min-width: 0;
}

.panel-head-main {
  min-width: 0;
}

.panel-head h2 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: #eef4fb;
}

.panel-sub {
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--text-3);
  line-height: 1.5;
}

.head-count {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  color: var(--text-3);
  font-size: 9.5px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.head-count strong {
  font-family: var(--font-mono);
  font-size: 23px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #ecf3fa;
}

.day-group {
  margin-top: 16px;
}

.day-group:first-of-type {
  margin-top: 6px;
}

.day-head {
  position: sticky;
  top: var(--topbar-h);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px 9px;
  border-bottom: 1px solid rgba(29, 38, 51, 0.75);
  background: linear-gradient(180deg, rgba(10, 13, 18, 0.97) 68%, rgba(10, 13, 18, 0.84));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.day-head-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.day-weekday {
  font-size: 10px;
  color: var(--text-2);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #121923;
  white-space: nowrap;
}

.day-title {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: #eaf1f9;
  white-space: nowrap;
}

.day-year {
  font-size: 9.5px;
  color: var(--text-3);
}

.day-rel {
  font-size: 9.5px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(76, 201, 240, 0.25);
  background: rgba(76, 201, 240, 0.08);
  color: #94dcef;
  white-space: nowrap;
}

.day-head-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.day-levels {
  display: flex;
  width: 72px;
  height: 4px;
  border-radius: 99px;
  overflow: hidden;
  background: #161e29;
}

.day-levels i {
  display: block;
  height: 100%;
}

.day-count {
  font-size: 10px;
  color: var(--text-3);
  white-space: nowrap;
}

.day-count strong {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
}

.day-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 10px;
}

.ev-card {
  position: relative;
  padding: 12px 15px 11px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(19, 26, 36, 0.86), rgba(13, 18, 26, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025), 0 12px 28px -24px #000;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
  overflow: hidden;
}

.ev-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 2px;
  background: var(--lv-color, #38bdf8);
  opacity: 0.78;
}

.ev-card:hover {
  border-color: #2d3b4e;
  background: linear-gradient(180deg, rgba(22, 30, 41, 0.92), rgba(14, 20, 28, 0.94));
}

.ev-card.needs-review {
  border-color: rgba(251, 191, 36, 0.2);
}

.ev-card.needs-review::before {
  background: linear-gradient(180deg, #fbbf24, rgba(251, 191, 36, 0.22));
}

.ev-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.lv-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(var(--lv-rgb), 0.27);
  background: rgba(var(--lv-rgb), 0.1);
  color: rgb(var(--lv-rgb));
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.lv-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.lv-badge-lg {
  height: 26px;
  padding: 0 10px;
  font-size: 11px;
}

.ev-time {
  font-size: 11px;
  color: var(--text-2);
  letter-spacing: 0.01em;
}

.agent-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  background: rgba(255, 255, 255, 0.035);
  color: #c3cfe0;
  font-size: 10px;
  white-space: nowrap;
}

.agent-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgb(var(--agent-rgb, 139, 151, 170));
  box-shadow: 0 0 8px rgba(var(--agent-rgb, 139, 151, 170), 0.5);
  flex: 0 0 auto;
}

.ev-top-spacer {
  flex: 1 1 auto;
}

.review-flag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.1);
  color: #fcd34d;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.review-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.14);
  flex: 0 0 auto;
}

.ev-conf {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  color: var(--text-3);
  white-space: nowrap;
}

.ev-conf .mono {
  font-size: 10.5px;
  color: #aab8c9;
}

.ev-open-icon {
  display: flex;
  color: var(--text-3);
  opacity: 0.7;
}

.ev-title {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.42;
  letter-spacing: 0.005em;
  color: #e9f0f8;
}

.ev-title-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: -12.5px -2px;
  padding: 0 2px;
  appearance: none;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.ev-title-btn:hover {
  color: #fff;
}

.ev-summary {
  margin-top: 5px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.62;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.ev-card.is-expanded .ev-summary {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.ev-expand {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin: 2px 0 -9px -6px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  font-size: 10.5px;
  font-family: inherit;
  cursor: pointer;
}

.ev-expand:hover {
  color: #9ce6fa;
}

.ev-expand-icon {
  display: flex;
}

.ev-meta {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
  margin-top: 3px;
  padding-top: 8px;
  border-top: 1px solid rgba(29, 38, 51, 0.55);
}

.ev-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  font-size: 10px;
  color: var(--text-3);
}

.ev-meta-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 330px;
}

.ev-meta-item .mono {
  font-size: 9.5px;
}

.ev-confirm {
  color: #7ee2b8;
}

.ev-rule {
  color: #b9a8ee;
}

.rule-ver {
  opacity: 0.7;
}

/* ------------------------------------------------------------ states */
.state-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 14px;
  padding: 54px 22px;
  border: 1px dashed #2a3647;
  border-radius: var(--radius);
  background: radial-gradient(120% 120% at 50% 0%, rgba(76, 201, 240, 0.05), transparent 62%),
    rgba(13, 18, 26, 0.55);
  text-align: center;
}

.state-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 2px;
  border-radius: 14px;
  border: 1px solid rgba(76, 201, 240, 0.2);
  background: rgba(76, 201, 240, 0.08);
  color: var(--accent);
}

.state-panel h2,
.state-panel h3 {
  font-size: 15.5px;
  font-weight: 650;
  color: #e7eef7;
}

.state-panel p {
  max-width: 400px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.65;
}

.state-panel .btn {
  margin-top: 6px;
}

.state-error .state-icon {
  border-color: rgba(248, 113, 113, 0.25);
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
}

/* --------------------------------------------------------------- panel */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #111821, #0d1219);
  box-shadow: var(--shadow-panel);
}

.panel-head {
  padding: 14px 16px 10px;
}

.panel-count {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--text-2);
  line-height: 1;
}

/* heatmap */
.heatmap-panel .panel-head {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 8px;
}

.heat-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 2px;
  color: var(--text-3);
  font-size: 9px;
  white-space: nowrap;
}

.heat-legend .heat-cell {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex: 0 0 auto;
}

.heatmap-scroll {
  overflow-x: auto;
  padding: 2px 16px 4px;
  scrollbar-width: thin;
}

.heatmap {
  display: flex;
  gap: 6px;
  width: max-content;
  padding-bottom: 2px;
}

.heat-weekdays {
  display: grid;
  grid-template-rows: repeat(7, 13px);
  gap: 4px;
  width: 12px;
  flex: 0 0 auto;
  padding-top: 20px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 13px;
  text-align: right;
}

.heatmap-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.heat-months {
  display: grid;
  grid-template-columns: repeat(var(--heat-cols, 12), 13px);
  gap: 4px;
  height: 15px;
  color: #66788c;
  font-family: var(--font-mono);
  font-size: 8.5px;
}

.heat-month {
  overflow: visible;
  white-space: nowrap;
  line-height: 15px;
}

.heat-grid {
  display: grid;
  grid-template-rows: repeat(7, 13px);
  grid-auto-flow: column;
  grid-auto-columns: 13px;
  gap: 4px;
}

.heat-cell {
  display: block;
  width: 13px;
  height: 13px;
  border-radius: 3px;
  background: #19222f;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.028);
}

.heat-lv-0 {
  background: #19222f;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.028);
}

.heat-lv-1 {
  background: rgba(56, 189, 248, 0.22);
}

.heat-lv-2 {
  background: rgba(56, 189, 248, 0.42);
}

.heat-lv-3 {
  background: rgba(56, 189, 248, 0.68);
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.3);
}

.heat-lv-4 {
  background: #4cc9f0;
  box-shadow: 0 0 10px -4px rgba(76, 201, 240, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.heat-cell.is-today {
  outline: 1.5px solid #93a2b5;
  outline-offset: 1px;
}

.heat-cell.is-future {
  opacity: 0.55;
  background: #101620;
}

.heat-blank {
  width: 13px;
  height: 13px;
}

.heat-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 9px 16px 13px;
  border-top: 1px solid rgba(29, 38, 51, 0.6);
  color: var(--text-3);
  font-size: 10px;
}

.heat-summary strong {
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.heat-today {
  margin-left: auto;
}

.side-empty {
  padding: 4px 16px 16px;
  color: var(--text-3);
  font-size: 11px;
}

/* projects */
.project-count-unit {
  font-size: 9px;
  color: var(--text-3);
}
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.project-agent i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgb(var(--agent-rgb, 139, 151, 170));
  box-shadow: 0 0 6px rgba(var(--agent-rgb, 139, 151, 170), 0.5);
}

.project-bar {
  display: flex;
  height: 3px;
  border-radius: 99px;
  overflow: hidden;
  background: #182130;
}

.project-bar i {
  display: block;
  height: 100%;
}

.privacy-note {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(52, 211, 153, 0.16);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.055), rgba(52, 211, 153, 0.018));
}

.privacy-icon {
  display: flex;
  margin-top: 1px;
  color: #34d399;
}

.privacy-note strong {
  display: block;
  font-size: 11px;
  color: #a7e9ce;
  letter-spacing: 0.01em;
}

.privacy-note p {
  margin-top: 3px;
  color: var(--text-3);
  font-size: 10px;
  line-height: 1.55;
}

/* ---------------------------------------------------------------- footer */
.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 30px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 10px;
}

.footer-brand {
  color: #6f7f92;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 9.5px;
}

.footer-warn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #c9a75c;
}

/* ---------------------------------------------------------------- drawer */
#drawer-root {
  position: fixed;
  inset: 0;
  z-index: 200;
}

#drawer-root[hidden] {
  display: none;
}

.drawer-scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 11, 0.64);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

#drawer-root[data-open="true"] .drawer-scrim {
  opacity: 1;
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(580px, 100%);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #101722 0%, #0b1017 100%);
  border-left: 1px solid #263345;
  box-shadow: -28px 0 70px -26px rgba(0, 0, 0, 0.85);
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(0.22, 0.8, 0.3, 1);
  outline: none;
  overflow: hidden;
}

#drawer-root[data-open="true"] .drawer-panel {
  transform: translateX(0);
}

.drawer-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 23, 34, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.drawer-header-main {
  min-width: 0;
}

.drawer-header-main .eyebrow {
  margin-bottom: 2px;
}

.drawer-header-line {
  display: block;
  color: var(--text-3);
  font-size: 10.5px;
}

.drawer-close {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #273242;
  border-radius: 10px;
  background: #0e141d;
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.drawer-close:hover {
  color: var(--text);
  border-color: #35445a;
  background: #131b26;
}

.drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px;
}

.drawer-hero-top {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 11px;
}

.drawer-id {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-3);
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #0d131c;
}

.drawer-agent {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.035);
  color: #c3cfe0;
  font-size: 10.5px;
}

.drawer-title {
  margin-bottom: 8px;
  color: #f2f7fd;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.005em;
  overflow-wrap: anywhere;
}

.drawer-summary {
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.72;
  overflow-wrap: anywhere;
}

.drawer-level-desc {
  margin-top: 9px;
  color: var(--text-3);
  font-size: 10.5px;
  line-height: 1.55;
}

.drawer-section {
  margin-top: 19px;
  padding-top: 15px;
  border-top: 1px solid rgba(29, 38, 51, 0.8);
}

.drawer-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  color: #cfdae8;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.03em;
}

.drawer-section-title .mono {
  color: var(--text-3);
  font-size: 10px;
  font-weight: 400;
}

.time-compare {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
}

.tc-card {
  flex: 1 1 190px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #243040;
  border-radius: 10px;
  background: linear-gradient(180deg, #111822, #0d131b);
}

.tc-card.is-local {
  border-color: rgba(76, 201, 240, 0.26);
  background: linear-gradient(180deg, rgba(76, 201, 240, 0.07), rgba(13, 19, 27, 0.9));
}

.tc-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-3);
  font-size: 9.5px;
  letter-spacing: 0.08em;
}

.tc-value {
  display: block;
  color: #dbe6f2;
  font-size: 11.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.tc-meta {
  display: block;
  margin-top: 5px;
  color: var(--text-3);
  font-size: 9.5px;
  line-height: 1.5;
}

.tc-arrow {
  display: flex;
  align-self: center;
  flex: 0 0 auto;
  color: var(--text-3);
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.kv {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(29, 38, 51, 0.7);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
}

.kv dt {
  margin-bottom: 4px;
  color: var(--text-3);
  font-size: 9.5px;
  letter-spacing: 0.05em;
}

.kv dd {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: #dce6f1;
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

.kv-note {
  display: block;
  width: 100%;
  color: var(--text-3);
  font-size: 9.5px;
  line-height: 1.5;
}

.kv-confidence {
  gap: 7px;
}

.conf-meter {
  flex: 1 1 46px;
  height: 4px;
  border-radius: 99px;
  background: #1b2431;
  overflow: hidden;
}

.conf-meter i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #38bdf8, #4cc9f0);
}

.review-state {
  padding: 2px 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 10px;
}

.review-muted {
  color: var(--text-2);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.review-warn {
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.26);
  background: rgba(251, 191, 36, 0.09);
}

.review-ok {
  color: #7ee2b8;
  border-color: rgba(52, 211, 153, 0.26);
  background: rgba(52, 211, 153, 0.09);
}

.rule-description {
  margin-bottom: 8px;
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.65;
}

.rule-inputs {
  margin: 0;
  padding: 10px 11px;
  max-height: 210px;
  overflow: auto;
  border: 1px solid #223041;
  border-radius: 9px;
  background: #0a0f16;
  color: #93a5bd;
  font-size: 10px;
  line-height: 1.55;
  white-space: pre;
}

.prov-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.prov-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 9px;
  align-items: baseline;
}

.prov-row dt {
  color: var(--text-3);
  font-size: 9.5px;
}

.prov-row dd {
  min-width: 0;
}

.prov-row code {
  color: #a9bad0;
  font-size: 10px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.trail {
  position: relative;
  list-style: none;
  padding: 0;
}

.trail::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  bottom: 7px;
  width: 1px;
  background: linear-gradient(180deg, #2b3a4d, #1a2430);
}

.trail-item {
  position: relative;
  padding: 0 0 13px 21px;
  min-width: 0;
}

.trail-item:last-child {
  padding-bottom: 0;
}

.trail-dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgb(var(--trail-rgb));
  box-shadow: 0 0 0 3px rgba(var(--trail-rgb), 0.12);
}

.trail-main {
  min-width: 0;
}

.trail-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}

.trail-action {
  color: rgb(var(--trail-rgb));
  font-size: 10.5px;
  font-weight: 650;
}

.trail-actor {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text-3);
  font-size: 9px;
}

.trail-head time {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 9px;
}

.trail-note {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.trail-count {
  color: var(--text-3);
  font-size: 10px;
}

.drawer-footer {
  flex: 0 0 auto;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 19, 27, 0.94), #0a0f16);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.drawer-footer-inner {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.review-box {
  display: flex;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
}

.review-box-icon {
  display: flex;
  margin-top: 1px;
  color: var(--text-2);
}

.review-box strong {
  display: block;
  color: var(--text);
  font-size: 10.5px;
}

.review-box p {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 10px;
  line-height: 1.55;
}

.review-box-ok {
  border-color: rgba(52, 211, 153, 0.22);
  background: rgba(52, 211, 153, 0.05);
}

.review-box-ok .review-box-icon {
  color: #34d399;
}

.review-box-warn {
  border-color: rgba(251, 191, 36, 0.25);
  background: rgba(251, 191, 36, 0.05);
}

.review-box-warn .review-box-icon {
  color: #fbbf24;
}

.confirm-controls {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.confirm-note-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 190px;
  min-width: 0;
}

.confirm-note-field span {
  color: var(--text-3);
  font-size: 9.5px;
}

.confirm-note-field input {
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid #273242;
  border-radius: 9px;
  background: #0d131c;
  color: var(--text);
  font-size: 11.5px;
  font-family: inherit;
}

.confirm-error {
  color: #fca5a5;
  font-size: 10.5px;
  line-height: 1.5;
}

.drawer-loading {
  padding: 4px 0;
}

.drawer-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 52px 12px;
  text-align: center;
}

.drawer-state-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: 14px;
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
}

.drawer-state h2 {
  font-size: 16px;
}

.drawer-state p {
  max-width: 340px;
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------- skeleton */
.sk {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, #131b25 20%, #1b2634 38%, #131b25 60%);
  background-size: 320% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: 150% 0;
  }
  100% {
    background-position: -60% 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton-card {
  pointer-events: none;
}

.stat-card.skeleton-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  min-height: 124px;
}

.sk-label {
  width: 42px;
  height: 9px;
}

.sk-num {
  width: 68px;
  height: 28px;
}

.sk-hint {
  width: 104px;
  height: 8px;
}

.filters-skeleton .filters-head {
  margin-bottom: 12px;
}

.filters-skeleton .sk-pill {
  width: 108px;
  height: 24px;
  border-radius: 99px;
}

.sk-chip {
  width: 104px;
  height: 44px;
  border-radius: 999px;
}

.sk-input {
  width: 240px;
  height: 44px;
  border-radius: 10px;
  margin-left: auto;
}

.sk-kicker {
  width: 66px;
  height: 8px;
  margin-bottom: 8px;
}

.sk-title {
  width: 148px;
  height: 18px;
}

.sk-title-sm {
  width: 96px;
  height: 16px;
}

.panel-head .sk-pill {
  width: 108px;
  height: 34px;
  border-radius: 99px;
}

.skeleton-day {
  padding-top: 16px;
}

.sk-day {
  width: 128px;
  height: 16px;
  margin: 6px 0 12px;
}

.skeleton-day .ev-card {
  margin-bottom: 9px;
  min-height: 105px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
}

.sk-line-lg {
  width: 42%;
  height: 15px;
}

.sk-line {
  width: 92%;
  height: 9px;
}

.sk-line.w-90 {
  width: 90%;
}

.sk-line.w-80 {
  width: 80%;
}

.sk-line.w-70 {
  width: 70%;
}

.sk-line.w-60 {
  width: 60%;
}

.sk-line.w-40 {
  width: 40%;
}

.sk-block {
  height: 96px;
  margin: 16px 0;
  border-radius: 10px;
}

.skeleton-heat-grid {
  display: grid;
  grid-template-columns: repeat(12, 13px);
  grid-auto-rows: 13px;
  gap: 4px;
  padding: 6px 16px 16px;
}

.skeleton-heat-grid .sk {
  border-radius: 3px;
}

.skeleton-projects {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 13px 14px;
}

.skeleton-projects .sk {
  height: 82px;
  border-radius: 11px;
}

.noscript {
  position: fixed;
  inset: auto 16px 16px 16px;
  z-index: 300;
  padding: 12px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 10px;
  background: #191710;
  color: #f3d68a;
  font-size: 12px;
  text-align: center;
}

/* ---------------------------------------------------------- responsive */
@media (max-width: 1279px) {
}

@media (max-width: 1023px) {
  .heatmap-panel .panel-head {
    align-items: center;
  }

  .privacy-note {
    margin-top: 0;
  }
}

@media (max-width: 767px) {
  :root {
    --pad: 16px;
  }

  .topbar-inner {
    flex-wrap: wrap;
    gap: 8px;
    min-height: 0;
    padding: 9px 0 10px;
  }

  .brand {
    order: 1;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .brand-name {
    font-size: 14.5px;
  }

  .brand-sub {
    display: none;
  }

  .topbar-actions {
    order: 2;
    margin-left: auto;
  }

  .topbar-meta {
    order: 3;
    flex-basis: 100%;
    gap: 6px;
  }

  .pill {
    height: 29px;
    padding: 0 9px;
    font-size: 10px;
  }

  .pill-text {
    max-width: 136px;
  }

  .pill-mode {
    font-size: 8.5px;
  }

  .pill-tz .mono {
    font-size: 9.5px;
  }

  .refresh-label {
    display: none;
  }

  .export-label {
    display: none;
  }

  .btn-refresh {
    width: 44px;
    padding: 0;
  }

  .btn-export {
    width: 44px;
    padding: 0;
  }

  .lead-sub {
    font-size: 12px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .stat-card {
    padding: 11px 12px 12px;
  }

  .stat-num {
    font-size: 27px;
  }

  .stat-hint {
    font-size: 9.5px;
  }

  .filters-panel {
    padding: 11px 12px 12px;
  }

  .filter-row {
    gap: 7px;
  }

  .filter-label {
    flex-basis: 100%;
    min-width: 0;
  }

  .filter-row + .filter-row {
    margin-top: 8px;
  }

  .filter-row-split {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-controls {
    width: 100%;
    margin-left: 0;
    gap: 7px;
    flex-wrap: wrap;
  }

  .select-wrap {
    flex: 1 1 140px;
  }

  .select-wrap select {
    width: 100%;
    max-width: none;
  }

  .search-wrap {
    flex: 1 1 100%;
    max-width: none;
    order: 3;
    min-width: 0;
  }

  .chip {
    gap: 5px;
    padding: 0 8px;
  }

  .chip-count {
    padding: 2px 4px;
  }

  .chip {
    font-size: 11px;
    padding: 0 10px;
  }

  .chip-count {
    font-size: 9px;
  }

  .panel-head {
    padding: 0 1px 8px;
  }

  .day-head {
    padding: 7px 1px 8px;
    gap: 8px;
  }

  .day-title {
    font-size: 13.5px;
  }

  .day-levels {
    display: none;
  }

  .ev-card {
    padding: 11px 12px 10px 13px;
  }

  .ev-top {
    gap: 6px;
    margin-bottom: 5px;
  }

  .ev-open-icon {
    display: none;
  }

  .ev-title {
    font-size: 13.5px;
  }

  .ev-summary {
    font-size: 11.5px;
  }

  .ev-source,
  .ev-rule {
    display: none;
  }

  .ev-meta {
    gap: 8px;
    padding-top: 7px;
  }

  .ev-meta-item span {
    max-width: 190px;
  }

  .drawer-panel {
    width: 100%;
    border-left: 0;
  }

  .drawer-header {
    padding: 12px 14px;
  }

  .drawer-body {
    padding: 14px;
  }

  .drawer-footer {
    padding: 11px 14px calc(11px + env(safe-area-inset-bottom));
  }

  .drawer-title {
    font-size: 18.5px;
  }

  .kv-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .time-compare {
    flex-direction: column;
  }

  .tc-arrow {
    transform: rotate(90deg);
    align-self: flex-start;
    margin-left: 12px;
  }

  .tc-card {
    flex-basis: auto;
  }

  .confirm-note-field {
    flex-basis: 100%;
  }

  .confirm-controls .btn-primary {
    width: 100%;
  }

  .page-footer {
    margin-top: 22px;
  }

  .footer-meta {
    gap: 10px;
  }
}

@media (max-width: 420px) {
  .pill-text-full {
    display: none;
  }

  .pill-text-short {
    display: inline;
  }

  .pill-source .pill-text {
    max-width: none;
  }

  .pill-scan {
    display: none;
  }

  .pill-mode {
    display: none;
  }

  .stat-num {
    font-size: 24px;
  }

  .chip {
    padding: 0 8px;
  }

  .chip-label-full {
    display: none;
  }

  .chip-label-short {
    display: inline;
  }

  #clear-filters {
    padding: 0;
    width: 44px;
    flex: 0 0 44px;
  }

  #clear-filters .clear-label {
    display: none;
  }

  .search-wrap {
    min-width: 0;
  }

  .kv-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .drawer-id {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .sk {
    background: #161f2b;
  }
}

/* ================================================================
   三栏工作驾驶舱（2026-10-29）
   左：导航 / 中：热力图 + 当日时序 / 右：Point 常驻详情
   ================================================================ */
.workspace {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  gap: 18px;
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 var(--pad) 32px;
  align-items: start;
}

.workspace-main {
  min-width: 0;
}

.workspace-main .stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.workspace-main .stat-card {
  padding: 12px 14px 11px;
}

.workspace-main .stat-num {
  font-size: 27px;
}

.nav-rail {
  position: sticky;
  top: calc(var(--topbar-h, 70px) + 14px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 23, 32, 0.96), rgba(11, 16, 23, 0.96));
  box-shadow: var(--shadow-panel);
}

.nav-rail-head {
  padding: 2px 8px 8px;
  border-bottom: 1px solid var(--line);
}

.nav-rail-title {
  margin-top: 3px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #eef4fb;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.nav-item.is-active {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.26);
  color: #eaf6ff;
}

.nav-item .icon {
  opacity: 0.78;
}

.nav-item.is-active .icon {
  color: #7dd3fc;
  opacity: 1;
}

.nav-item-label {
  flex: 1;
  min-width: 0;
}

.nav-badge {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.4;
}

.nav-rail-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.nav-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 4px;
}

.nav-stat {
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
}

.nav-stat dt {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--text-3);
}

.nav-stat dd {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
}

.nav-privacy {
  margin: 0;
  padding: 0 4px;
  border: 0;
  background: none;
}

.nav-privacy p {
  font-size: 9.5px;
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 22px 0 14px;
}

.view-head-main h1 {
  margin-top: 4px;
  font-size: clamp(24px, 2.1vw, 30px);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
  background: linear-gradient(180deg, #f4f8fd 15%, #b9c8da 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.view-head-main .lead-sub {
  margin-top: 6px;
  max-width: 640px;
}

.view-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.view-slot {
  display: block;
}

.heatmap-slot {
  margin-bottom: 14px;
}

.heatmap-slot .heatmap-panel {
  padding-bottom: 12px;
}

/* 热力图格子改为可点击按钮，支持按日筛选 */
.heat-cell {
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.heat-cell.is-selected {
  outline: 2px solid rgba(125, 211, 252, 0.9);
  outline-offset: 2px;
}

.heat-cell:focus-visible {
  outline: 2px solid #fbbf24;
  outline-offset: 2px;
}

/* 右侧 Point 常驻详情 */
.workspace-detail {
  display: none;
  flex-direction: column;
  min-width: 0;
  position: sticky;
  top: calc(var(--topbar-h, 70px) + 14px);
  max-height: calc(100vh - var(--topbar-h, 70px) - 34px);
  padding: 16px 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(18, 25, 35, 0.97), rgba(11, 16, 23, 0.98));
  box-shadow: var(--shadow-panel);
  overflow: auto;
}

@media (min-width: 1360px) {
  .workspace {
    grid-template-columns: 218px minmax(0, 1fr) 392px;
  }

  .workspace-detail {
    display: flex;
  }
}

.detail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.detail-head h2 {
  font-size: 15px;
  font-weight: 650;
  color: #eef4fb;
}

.detail-body {
  min-height: 0;
}

.point-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 320px;
  padding: 30px 18px;
  text-align: center;
  color: var(--text-3);
}

.point-empty-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(125, 211, 252, 0.18);
  background: radial-gradient(circle at 50% 35%, rgba(56, 189, 248, 0.16), transparent 70%);
  color: #7dd3fc;
}

.point-empty h3 {
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
}

.point-empty p {
  max-width: 270px;
  font-size: 11.5px;
  line-height: 1.7;
}

.point-loading {
  padding: 4px 0;
}

.point-hero {
  padding: 14px 0 4px;
}

.point-badges {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.point-title {
  margin-top: 10px;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: #f1f6fc;
}

.point-summary {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.7;
}

.point-footer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.point-footer .review-box {
  margin-bottom: 10px;
}

.point-footer .confirm-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.point-footer .confirm-note-field {
  width: 100%;
}

.point-footer #confirm-btn {
  width: 100%;
  justify-content: center;
}

.point-error {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  padding: 16px 0;
}

/* 项目视图 */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.project-tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(18, 25, 35, 0.94), rgba(12, 17, 24, 0.94));
  box-shadow: var(--shadow-panel);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.project-tile:hover {
  border-color: rgba(125, 211, 252, 0.28);
  transform: translateY(-1px);
}

.project-tile-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.project-tile-name {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.project-tile-count {
  font-family: var(--font-mono);
  font-size: 18px;
  color: #dce8f5;
}

.project-tile-agents {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-tile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  color: var(--text-3);
}

.project-tile-review {
  color: #fbbf24;
}

.project-tile-empty {
  padding: 30px;
  text-align: center;
  color: var(--text-3);
}

/* 内容 / 数据说明视图 */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.guide-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(18, 25, 35, 0.94), rgba(12, 17, 24, 0.94));
}

.guide-card h3 {
  font-size: 13px;
  font-weight: 650;
  color: #eef4fb;
}

.guide-card p,
.guide-card li {
  margin-top: 7px;
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.75;
}

.guide-card ul {
  padding-left: 16px;
}

.guide-card code {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #b9d9f0;
  background: rgba(56, 189, 248, 0.08);
  border-radius: 4px;
  padding: 1px 4px;
}

.guide-section {
  margin-bottom: 14px;
}

.guide-section > h2 {
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 650;
  color: #eef4fb;
}

.guide-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 20px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-3);
}

.guide-empty strong {
  color: var(--text);
  font-size: 14px;
}

.guide-empty p {
  max-width: 460px;
  font-size: 11.5px;
  line-height: 1.75;
}

/* 中屏 / 移动端：详情由抽屉承载，导航折叠 */
@media (max-width: 1359px) {
  .workspace {
    grid-template-columns: 200px minmax(0, 1fr);
  }
}

@media (max-width: 1023px) {
  .workspace {
    grid-template-columns: 176px minmax(0, 1fr);
    gap: 12px;
  }

  .workspace-main .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .workspace {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 16px 26px;
  }

  .nav-rail {
    position: static;
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 7px;
    overflow-x: auto;
  }

  .nav-rail-head,
  .nav-rail-foot {
    display: none;
  }

  .nav-list {
    flex-direction: row;
    gap: 4px;
    overflow-x: auto;
    width: 100%;
  }

  .nav-item {
    min-height: 40px;
    padding: 0 10px;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .nav-badge {
    display: none;
  }

  .view-head {
    padding: 12px 0 10px;
  }

  .workspace-main .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .projects-grid,
  .guide-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.nav-stat-label {
  display: block;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--text-3);
}

.nav-stat-value {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  color: var(--text);
}

.ev-card.is-selected {
  border-color: rgba(125, 211, 252, 0.38);
  box-shadow: 0 0 0 1px rgba(125, 211, 252, 0.16), 0 10px 26px rgba(0, 0, 0, 0.28);
}

.ev-card.is-selected::before {
  background: #7dd3fc;
  opacity: 1;
}

@media (min-width: 1360px) {
  .workspace-detail {
    min-height: calc(100vh - var(--topbar-h, 70px) - 34px);
  }

  .detail-body {
    display: flex;
    flex: 1;
    flex-direction: column;
  }

  .detail-body .point-empty {
    flex: 1;
  }
}

@media (max-width: 767px) {
  .nav-rail {
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent 100%);
  }

  .view-head-main h1 {
    font-size: 26px;
  }
}

@media (min-width: 1360px) {
  .workspace-main .heatmap-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 220px);
    grid-template-areas:
      "head head"
      "scroll summary";
    column-gap: 22px;
  }

  .workspace-main .heatmap-panel .panel-head {
    grid-area: head;
  }

  .workspace-main .heatmap-panel .heatmap-scroll {
    grid-area: scroll;
  }

  .workspace-main .heatmap-panel .heat-summary {
    grid-area: summary;
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
    align-self: start;
    margin: 0;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.018);
  }

  .workspace-main .heat-grid {
    grid-template-rows: repeat(7, 15px);
    grid-auto-columns: 15px;
    gap: 4px;
  }

  .workspace-main .heat-cell,
  .workspace-main .heat-blank {
    width: 15px;
    height: 15px;
    border-radius: 3.5px;
  }

  .workspace-main .heat-weekdays {
    grid-template-rows: repeat(7, 15px);
    line-height: 15px;
  }

  .workspace-main .heat-months {
    grid-template-columns: repeat(var(--heat-cols, 12), 15px);
  }
}

@media (min-width: 1360px) {
  .workspace-main .heatmap {
    margin: 0 auto;
  }
}

.heat-hint {
  color: var(--text-3);
}

@media (max-width: 767px) {
  .heat-hint {
    display: none;
  }

  .nav-rail {
    flex-wrap: wrap;
    overflow: visible;
  }

  .nav-list {
    flex-wrap: wrap;
    overflow: visible;
    width: auto;
    flex: 1;
  }
}

@media (max-width: 420px) {
  .nav-list {
    gap: 2px;
  }

  .nav-item {
    padding: 0 8px;
    gap: 6px;
    font-size: 11.5px;
  }

  .nav-item .icon {
    width: 14px;
    height: 14px;
  }
}

/* 详情面板是阅读区域，程序化聚焦不显示焦点环，避免鼠标选择时出现高亮边框 */
.workspace-detail:focus,
.workspace-detail:focus-visible {
  outline: none;
}

/* ------------------------------------------------------------ search results */
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0e141d;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
}

.search-results[hidden] {
  display: none;
}

.search-results-head {
  padding: 5px 8px 6px;
  font-size: 10px;
  color: var(--text-3);
}

.search-result {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.search-result:hover,
.search-result.is-active {
  background: rgba(56, 189, 248, 0.09);
}

.search-result-title {
  font-size: 12px;
  font-weight: 650;
  color: #eef4fb;
}

.search-result-snippet {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-2);
}

.search-result mark {
  background: rgba(251, 191, 36, 0.28);
  color: #fde68a;
  border-radius: 2px;
  padding: 0 1px;
}

.search-results-group + .search-results-group {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.search-results-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px 5px;
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--text-3);
}

.search-results-group-head .mono {
  font-size: 10px;
  color: #7dd3fc;
}

.search-result-more {
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #7dd3fc;
  font: inherit;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.search-result-more:hover {
  background: rgba(56, 189, 248, 0.08);
}

/* ------------------------------------------------------------ iOS 安全区 */
/* PWA 从主屏启动时，灵动岛/刘海会盖住顶栏按钮；用安全区把内容顶下去。 */
@supports (padding: env(safe-area-inset-top)) {
  .topbar {
    padding-top: env(safe-area-inset-top, 0px);
  }

  body {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

/* ------------------------------------------------------------ 授权与试用 */
.license-card {
  display: grid;
  gap: 10px;
}

.license-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.license-input {
  flex: 1 1 260px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-3);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.license-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.license-status {
  margin: 0;
  color: var(--text-3);
  font-size: 11px;
}

.license-capabilities {
  margin: 0;
  color: var(--text-2);
  font-size: 11px;
}

.push-locked {
  border-color: var(--line-strong);
  opacity: 0.92;
}

/* ------------------------------------------------------------ 成本分摊 */
.quota-attribution .quota-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.attr-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.4fr) 2fr 64px 48px 64px;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.attr-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.attr-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-3);
}

.attr-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #4cc9f0, #f5b955);
}

.attr-tokens,
.attr-share,
.attr-sessions {
  color: var(--text-2);
  text-align: right;
}

.attr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.attr-chip {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--text-2);
  font-size: 11px;
}

.attr-chip b {
  color: var(--text);
}

.quota-export {
  margin-top: 12px;
  align-items: center;
}

.quota-export label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 12px;
}

.quota-export input[type='month'] {
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-3);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

@media (max-width: 640px) {
  .attr-row {
    grid-template-columns: minmax(90px, 1.4fr) 1.2fr 52px 38px;
  }

  .attr-sessions {
    display: none;
  }
}

/* ------------------------------------------------------------ 外部告警通道 */
.alert-channel-list {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.alert-channel-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12px;
}

.alert-channel-target {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-channel-form summary {
  margin: 6px 0;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
}

.alert-channel-form .quota-key-row {
  grid-template-columns: 90px 1fr 1fr;
}
