@font-face {
  font-family: "Manrope";
  src: url("/static/vendor/manrope.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  /* xydata VI 2.0 — Deep Signal Cobalt + Amber-Vermilion on Cloudflare-inspired Crisp Canvas */
  --bg: #f6f7f9;
  --rail-bg: #fafbfd;
  --surface: #ffffff;
  --surface-subtle: #f1f3f7;
  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;
  --border: #e3e6ec;
  --border-input: #cbd1dc;
  --border-strong: #c2c9d6;

  --accent: #1d5bff;
  --accent-ink: #ffffff;
  --accent-hover: #1648d1;
  --accent-soft: rgba(29, 91, 255, 0.08);
  --accent-ring: rgba(29, 91, 255, 0.18);

  --brand-warm: #e05a2b;
  --brand-warm-hover: #c4481e;
  --brand-warm-soft: rgba(224, 90, 43, 0.10);

  --ok: #0f8a5f;
  --ok-bg: rgba(15, 138, 95, 0.10);
  --warn: #b45309;
  --warn-bg: rgba(217, 119, 6, 0.11);
  --danger: #d92d20;
  --danger-bg: rgba(217, 45, 32, 0.10);

  --code-surface: #f8fafc;
  --code-ink: #0f172a;
  --json-key: #1d4ed8;
  --json-str: #0f766e;
  --json-num: #c2410c;
  --json-bool: #7c3aed;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.16);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --sidebar-w: 228px;
  --sidebar-collapsed-w: 64px;
  --topbar-h: 52px;

  --font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
  --font-mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0b0e14;
  --rail-bg: #0e121b;
  --surface: #131823;
  --surface-subtle: #1a2130;
  --ink: #f1f5f9;
  --ink-2: #cbd5e1;
  --ink-3: #94a3b8;
  --border: #232b3b;
  --border-input: #364156;
  --border-strong: #323c50;

  --accent: #4d82ff;
  --accent-ink: #ffffff;
  --accent-hover: #6b98ff;
  --accent-soft: rgba(77, 130, 255, 0.15);
  --accent-ring: rgba(77, 130, 255, 0.28);

  --brand-warm: #f2784b;
  --brand-warm-hover: #ff8c61;
  --brand-warm-soft: rgba(242, 120, 75, 0.16);

  --ok: #34d399;
  --ok-bg: rgba(16, 185, 129, 0.16);
  --warn: #fbbf24;
  --warn-bg: rgba(245, 158, 11, 0.16);
  --danger: #f87171;
  --danger-bg: rgba(239, 68, 68, 0.16);

  --code-surface: #0e121b;
  --code-ink: #e2e8f0;
  --json-key: #93c5fd;
  --json-str: #5eead4;
  --json-num: #fdba74;
  --json-bool: #c4b5fd;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.65);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: var(--accent-hover); text-decoration: underline; }
code { font-family: var(--font-mono); font-size: 12px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tabular { font-variant-numeric: tabular-nums; }

/* ==================== Auth Screen ==================== */
.auth-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 420px at 15% -10%, var(--accent-soft), transparent 65%),
    radial-gradient(700px 360px at 90% 110%, var(--brand-warm-soft), transparent 65%),
    var(--bg);
}
.auth-box {
  width: min(408px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 34px 32px 28px;
  box-shadow: var(--shadow);
  animation: cfFadeUp 0.22s var(--ease) both;
}
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.auth-brand-left { display: flex; align-items: center; gap: 10px; }
.auth-box h1 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.025em;
}
.auth-sub {
  margin: 0 0 20px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.auth-switch {
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--ink-3);
  text-align: center;
}
.auth-switch button {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
}
.auth-switch button:hover { text-decoration: underline; }

/* ==================== Brand Mark ==================== */
.brand-mark-svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #0f172a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-wordmark {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.03em;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.brand-wordmark .brand-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-warm);
  display: inline-block;
}

/* ==================== Unified Cloudflare App Shell ==================== */
.cf-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: var(--bg);
}

.cf-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--rail-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 45;
  transition: width 0.2s var(--ease);
  overflow: hidden;
}
.cf-shell.sidebar-collapsed .cf-sidebar,
html.xy-sidebar-collapsed .cf-sidebar {
  width: var(--sidebar-collapsed-w);
}
html.xy-booting .cf-sidebar,
html.xy-booting .cf-nav-item,
html.xy-booting .cf-nav-section-title,
html.xy-booting .drawer,
html.xy-booting .card {
  transition: none !important;
  animation: none !important;
}
/* Pre-paint zero-flicker auth & admin nav hints */
html.xy-expect-auth #auth-screen { display: none !important; }
html.xy-expect-auth #app-shell.hidden { display: flex !important; }
html.xy-expect-admin #nav-admin.hidden { display: flex !important; }
html.xy-expect-admin #btn-scope-admin.hidden { display: inline-flex !important; }
html.xy-booting[data-init-hash] #admin-main > section[data-section="overview"],
html.xy-booting[data-init-hash] #account-main > section[data-section="profile"] {
  display: none !important;
}

.cf-sidebar-head {
  height: var(--topbar-h);
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.cf-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}
.cf-brand:hover { text-decoration: none; color: var(--ink); }
.cf-shell.sidebar-collapsed .cf-brand-text,
.cf-shell.sidebar-collapsed .cf-nav-label,
.cf-shell.sidebar-collapsed .cf-nav-section-title,
.cf-shell.sidebar-collapsed .cf-sidebar-meta,
html.xy-sidebar-collapsed .cf-brand-text,
html.xy-sidebar-collapsed .cf-nav-label,
html.xy-sidebar-collapsed .cf-nav-section-title,
html.xy-sidebar-collapsed .cf-sidebar-meta {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
  white-space: nowrap;
}
.cf-shell.sidebar-collapsed .cf-sidebar-head,
html.xy-sidebar-collapsed .cf-sidebar-head {
  justify-content: center;
  padding: 0 8px;
}
.cf-shell.sidebar-collapsed .cf-collapse-btn,
html.xy-sidebar-collapsed .cf-collapse-btn {
  display: none;
}

.cf-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cf-nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  padding: 12px 10px 6px;
  transition: opacity 0.15s var(--ease);
}
.cf-nav-section-title:first-child { padding-top: 2px; }

.cf-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.cf-nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.78;
  transition: opacity 0.15s var(--ease), color 0.15s var(--ease);
}
.cf-nav-item:hover {
  background: var(--surface-subtle);
  color: var(--ink);
  text-decoration: none;
}
.cf-nav-item:hover svg { opacity: 1; }
.cf-nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}
.cf-nav-item.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.cf-nav-item.active svg { opacity: 1; color: var(--accent); }
.cf-shell.sidebar-collapsed .cf-nav-item,
html.xy-sidebar-collapsed .cf-nav-item {
  justify-content: center;
  padding: 9px 0;
}
.cf-shell.sidebar-collapsed .cf-nav-item.active::before,
html.xy-sidebar-collapsed .cf-nav-item.active::before { left: -10px; }

.cf-sidebar-foot {
  padding: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cf-sidebar-meta {
  font-size: 11px;
  color: var(--ink-3);
  padding-left: 4px;
  white-space: nowrap;
}

.cf-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.cf-topbar {
  height: var(--topbar-h);
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.cf-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.cf-page-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cf-page-crumb .crumb-sep { color: var(--ink-3); font-weight: 400; }
.cf-page-crumb .crumb-sub { color: var(--ink-3); font-weight: 500; font-size: 12.5px; }

.cf-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cf-content {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 20px 24px 72px;
}
.cf-content-wide {
  max-width: 1680px;
  padding: 0;
}

/* Legacy topbar fallback (if any subpage uses it) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1380px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 16px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.nav-link:hover { background: var(--surface-subtle); color: var(--ink); text-decoration: none; }
.nav-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav-right { display: flex; align-items: center; gap: 8px; }

.subbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
}
.subbar-inner {
  max-width: 1680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px 64px;
}

/* ==================== Cards & Surfaces ==================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.card-interactive:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* Overview Strip */
.overview-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 16px 22px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.overview-strip::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--brand-warm));
}
.overview-strip:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* ==================== Buttons ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.1s var(--ease);
}
.btn:hover:not(:disabled) {
  background: var(--surface-subtle);
  border-color: var(--ink-3);
  text-decoration: none;
}
.btn:active:not(:disabled) { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.48; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(29, 91, 255, 0.22);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
}

.btn-warm {
  background: var(--brand-warm);
  color: #ffffff;
  border-color: var(--brand-warm);
}
.btn-warm:hover:not(:disabled) {
  background: var(--brand-warm-hover);
  border-color: var(--brand-warm-hover);
  color: #ffffff;
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(217, 45, 32, 0.28);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-2);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-subtle);
  border-color: transparent;
  color: var(--ink);
}

.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 11.5px; }
.btn-icon { width: 30px; height: 30px; padding: 0; }

/* ==================== Inputs & Forms ==================== */
.input, .select, .textarea {
  width: 100%;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}
.input, .select { height: 36px; }
.textarea { min-height: 92px; resize: vertical; font-family: var(--font-mono); font-size: 12.5px; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.input.invalid, .select.invalid, .textarea.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-bg);
}
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-error { color: var(--danger); font-size: 11.5px; margin-top: 4px; font-weight: 500; }

/* ==================== Segmented Control & Badges ==================== */
.segmented {
  display: inline-flex;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}
.segmented button {
  border: none;
  background: transparent;
  color: var(--ink-2);
  padding: 5px 12px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.segmented button:hover { color: var(--ink); }
.segmented button.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-xs);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-subtle);
  color: var(--ink-2);
  border: 1px solid var(--border);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.badge-ready { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge-info { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.badge-warm { background: var(--brand-warm-soft); color: var(--brand-warm); border-color: transparent; }
.badge-dark { background: var(--ink); color: var(--surface); border-color: transparent; }

.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-ok { background: var(--ok); }
.dot-info { background: var(--accent); }
.dot-warn { background: var(--warn); }
.dot-danger { background: var(--danger); }

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease);
}
.toggle-pill:hover { border-color: var(--accent); color: var(--ink); }
.toggle-pill input { accent-color: var(--accent); margin: 0; }

/* HTTP Method Badges */
.method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--ink-2);
}
.method-get { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.method-post { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.method-patch, .method-put { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.method-delete { background: var(--danger-bg); color: var(--danger); border-color: transparent; }

/* ==================== KPI & KV Grids ==================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.kpi .label { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-bottom: 4px; }
.kpi .val { font-size: 24px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.kv-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.kv-item .k { display: block; font-size: 11px; font-weight: 600; color: var(--ink-3); margin-bottom: 3px; }
.kv-item .v { font-size: 13px; font-weight: 600; color: var(--ink); word-break: break-word; }

/* Progress Bar with Shimmer */
.progress-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--surface-subtle);
  overflow: hidden;
  margin-top: 8px;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #4f85ff);
  transition: width 0.3s var(--ease);
  position: relative;
}
.progress-fill.animated::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: cfShimmer 1.4s infinite;
}

/* ==================== End-to-End Lookup & Batch Pipeline ==================== */
.e2e-bar { display: flex; gap: 10px; align-items: stretch; }
.e2e-input { flex: 1; min-width: 0; }
.e2e-input .input { height: 42px; font-size: 13.5px; padding: 0 14px; }
.e2e-result {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--bg);
  animation: cfFadeUp 0.18s var(--ease) both;
}

/* CSV / TXT Dropzone */
.dropzone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 10px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease);
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* Batch Status Bucket Strip */
.bucket-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
  margin: 14px 0 12px;
}
.bucket-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), transform 0.12s var(--ease);
}
.bucket-card:hover { border-color: var(--accent); background: var(--surface); }
.bucket-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.bucket-card .b-label { font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.bucket-card .b-val { font-size: 20px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.bucket-card.active .b-label, .bucket-card.active .b-val { color: var(--accent); }

/* Active Filter Chips */
.filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(29, 91, 255, 0.22);
}
.filter-chip button {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  opacity: 0.75;
}
.filter-chip button:hover { opacity: 1; }

/* ==================== High-Density Catalog Table & Cards ==================== */
.results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}

.paper-list { display: flex; flex-direction: column; gap: 0; }
.catalog-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  background: var(--surface);
}
table.catalog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.catalog-table th {
  text-align: left;
  padding: 9px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
table.catalog-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.catalog-table tbody tr {
  transition: background 0.12s var(--ease);
}
table.catalog-table tbody tr:last-child td { border-bottom: none; }
table.catalog-table tbody tr:hover { background: var(--surface-subtle); }
table.catalog-table tbody tr.row-selected { background: var(--accent-soft); }

.row-title-btn {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  text-align: left;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  line-height: 1.4;
  transition: color 0.14s var(--ease);
}
.row-title-btn:hover { color: var(--accent); }
.row-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: nowrap;
}

/* Floating Bottom Batch Action Dock */
.batch-dock {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 120%);
  opacity: 0;
  pointer-events: none;
  z-index: 65;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--surface);
  box-shadow: var(--shadow-lg);
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.batch-dock.open {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}
.batch-dock .btn {
  height: 30px;
  font-size: 12px;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.batch-dock .btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}
.batch-dock .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}
[data-theme="dark"] .batch-dock {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
}

/* Skeleton Loaders */
.skeleton {
  background: linear-gradient(90deg, var(--surface-subtle) 25%, var(--border) 50%, var(--surface-subtle) 75%);
  background-size: 200% 100%;
  animation: cfSkeleton 1.3s ease-in-out infinite;
  border-radius: 5px;
}
.skeleton-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.14s var(--ease), background 0.14s var(--ease), color 0.14s var(--ease);
}
.page-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: #ffffff; border-color: var(--accent); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ==================== Slide-Over Data Inspector & Reader Drawer ==================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
  z-index: 75;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
}
.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.drawer {
  width: min(920px, 96vw);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateX(28px);
  transition: transform 0.22s var(--ease), width 0.2s var(--ease);
}
.drawer-backdrop.open .drawer { transform: translateX(0); }
.drawer.wide { width: min(1240px, 98vw); }

.drawer-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.drawer-title { margin: 0 0 6px; font-size: 16px; font-weight: 800; line-height: 1.35; letter-spacing: -0.015em; }
.paper-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }

.drawer-tabs {
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  background: var(--rail-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.tab-group { display: flex; gap: 4px; }
.tab-btn {
  border: none;
  background: transparent;
  color: var(--ink-3);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.14s var(--ease), border-color 0.14s var(--ease);
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }

.drawer-body { flex: 1; overflow: auto; padding: 20px 24px; }

/* Reader Split with Auto TOC */
.reader-split {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.reader-toc {
  position: sticky;
  top: 0;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  padding-right: 12px;
  border-right: 1px solid var(--border);
}
.reader-toc-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.reader-toc a {
  display: block;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.4;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reader-toc a:hover { background: var(--surface-subtle); color: var(--accent); text-decoration: none; }
.reader-toc a.toc-h3 { padding-left: 16px; font-size: 11.5px; color: var(--ink-3); }

/* Academic Markdown Reader */
.md-reader {
  max-width: 780px;
  margin: 0 auto;
  font-family: var(--font-serif);
  font-size: 15.5px;
  line-height: 1.82;
  color: var(--ink);
}
.md-reader h1 { font-family: var(--font-sans); font-size: 21px; line-height: 1.3; margin: 0 0 14px; }
.md-reader h2 { font-family: var(--font-sans); font-size: 17px; margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.md-reader h3 { font-family: var(--font-sans); font-size: 15px; margin: 18px 0 8px; }
.md-reader p { margin: 0 0 13px; overflow-wrap: anywhere; }
.md-reader table { width: 100%; border-collapse: collapse; margin: 16px 0; font-family: var(--font-sans); font-size: 13px; }
.md-reader th, .md-reader td { border: 1px solid var(--border-strong); padding: 7px 10px; vertical-align: top; }
.md-reader th { background: var(--surface-subtle); font-weight: 700; }
.md-reader img { max-width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); margin: 10px 0; }
.md-reader blockquote { margin: 14px 0; padding: 10px 16px; border-left: 3px solid var(--accent); background: var(--surface-subtle); color: var(--ink-2); }
.md-reader pre { background: var(--code-surface); border: 1px solid var(--border); padding: 12px 14px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 12.5px; }

.doc-code-box {
  background: var(--code-surface);
  color: var(--code-ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  overflow: auto;
  max-height: calc(100vh - 240px);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
.jk { color: var(--json-key); font-weight: 600; }
.js { color: var(--json-str); }
.jn { color: var(--json-num); }
.jb { color: var(--json-bool); font-weight: 600; }

/* ==================== Modals ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.open { display: flex; animation: cfFadeIn 0.16s var(--ease) both; }
.modal {
  width: min(500px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 22px 24px;
  animation: cfFadeUp 0.18s var(--ease) both;
}
.modal-lg { width: min(760px, 100%); }
.modal-xl { width: min(960px, 100%); }
.modal-fixed-md {
  width: min(780px, 94vw);
  height: min(620px, 84vh);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-fixed-md .modal-scroll-body { flex: 1; overflow-y: auto; padding-right: 4px; }
.modal-fixed-xl {
  width: min(1100px, 95vw);
  height: min(86vh, 840px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-fixed-xl .modal-scroll-body { flex: 1; overflow-y: auto; padding-right: 4px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 800; }

/* ==================== Tables & Nodes ==================== */
.node-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.node-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--surface);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.node-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.node-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.node-name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }

.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table th {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 700;
  background: var(--bg);
  white-space: nowrap;
}
table.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover td { background: var(--surface-subtle); }

/* Legacy Admin Shell (when nested inside cf-content or standalone) */
.admin-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
}
.admin-nav { display: flex; flex-direction: column; gap: 3px; position: sticky; top: 72px; align-self: start; }
.admin-nav-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s var(--ease), color 0.14s var(--ease);
}
.admin-nav-btn svg { flex-shrink: 0; opacity: 0.78; }
.admin-nav-btn:hover { background: var(--surface-subtle); color: var(--ink); }
.admin-nav-btn.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.admin-nav-btn.active svg { opacity: 1; color: var(--accent); }

/* ==================== API Docs 3-Column Layout ==================== */
.docs-shell {
  --docs-left: 256px;
  --docs-right: 400px;
  width: 100%;
  display: grid;
  grid-template-columns: var(--docs-left) 6px minmax(340px, 1fr) 6px var(--docs-right);
  min-height: calc(100vh - var(--topbar-h) - 52px);
}
.docs-resizer { background: transparent; cursor: col-resize; position: relative; user-select: none; }
.docs-resizer::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 2px;
  width: 1px;
  background: var(--border);
  transition: background 0.15s, width 0.15s;
}
.docs-resizer:hover::after, .docs-resizer.dragging::after { background: var(--accent); width: 2px; }
.docs-sidebar {
  background: var(--surface);
  padding: 14px 12px;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}
.docs-group-title { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); margin: 14px 8px 6px; }
.docs-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 7px 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.docs-item:hover { background: var(--surface-subtle); color: var(--ink); }
.docs-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.docs-main { padding: 22px 26px 80px; min-width: 0; }
.doc-endpoint-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  scroll-margin-top: 70px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.doc-endpoint-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm); }
.docs-try {
  background: var(--rail-bg);
  padding: 16px;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}

.empty-box {
  text-align: center;
  padding: 36px 24px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--ink-3);
}

/* ==================== Toasts ==================== */
.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 110; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--ink);
  color: var(--surface);
  padding: 10px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: cfFadeUp 0.18s var(--ease) both;
}
.toast.success { background: var(--ok); color: #ffffff; }
.toast.error { background: var(--danger); color: #ffffff; }

/* ==================== Multi-Select & Autocomplete ==================== */
.suggest-wrap { position: relative; width: 100%; }
.multi-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.14s var(--ease), box-shadow 0.14s var(--ease);
  cursor: text;
}
.multi-field:hover { border-color: var(--ink-3); }
.multi-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.multi-field input {
  flex: 1;
  min-width: 84px;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 2px 4px !important;
  height: auto !important;
  font-size: 13px;
  color: var(--ink);
  font-family: inherit;
}
.multi-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 190px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
}
.multi-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-chip button { border: none; background: transparent; color: inherit; padding: 0; cursor: pointer; font-size: 13px; line-height: 1; opacity: 0.8; }
.multi-chip button:hover { opacity: 1; }

.mode-btn-group { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 16px; }
.mode-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.mode-btn:hover { border-color: var(--accent); background: var(--surface); }
.mode-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.mode-btn .mode-ico {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-2);
  flex-shrink: 0;
}
.mode-btn.active .mode-ico { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.mode-btn .mode-title { font-size: 13px; font-weight: 700; line-height: 1.3; }
.mode-btn .mode-desc { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.mode-btn.active .mode-desc { color: var(--ink-2); }

.suggest-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 95;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
}
.suggest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.suggest-item:hover, .suggest-item.active { background: var(--surface-subtle); }
.suggest-item.checked { background: var(--accent-soft); font-weight: 600; color: var(--accent); }
.suggest-item .sg-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.suggest-item .sg-chk {
  width: 15px; height: 15px; border-radius: 4px;
  border: 1.5px solid var(--border-input);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; flex-shrink: 0; background: var(--surface); color: transparent;
}
.suggest-item.checked .sg-chk { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.suggest-item .sg-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-item .sg-cnt { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); flex-shrink: 0; }
.suggest-footer {
  position: sticky; bottom: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 8px; margin-top: 4px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 11.5px; color: var(--ink-3);
}

.chart-tooltip {
  position: fixed;
  z-index: 110;
  pointer-events: none;
  background: var(--ink);
  color: var(--surface);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.55;
  box-shadow: var(--shadow-lg);
  max-width: 280px;
  display: none;
}
.chart-bar-g { cursor: pointer; }
.chart-bar-g:hover rect { opacity: 0.85; }

/* Password Visibility Toggle */
.pw-wrap { position: relative; display: flex; align-items: center; width: 100%; }
.pw-wrap > .input { width: 100%; padding-right: 40px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--ink-3); cursor: pointer;
  transition: color 0.14s var(--ease), background 0.14s var(--ease);
}
.pw-toggle:hover { color: var(--ink); background: var(--surface-subtle); }
.pw-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }

/* Cross-Page Select All Banner */
.select-all-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 14px;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid rgba(29, 91, 255, 0.24);
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.4;
}
.select-all-banner strong { color: var(--accent); font-variant-numeric: tabular-nums; }

.hidden { display: none !important; }

/* ==================== Animations ==================== */
@keyframes cfFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cfFadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cfSkeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes cfShimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ==================== Responsive ==================== */
@media (max-width: 1120px) {
  .docs-shell { grid-template-columns: 230px 1fr; }
  .docs-resizer { display: none; }
  .docs-try { position: static; height: auto; border-left: none; border-top: 1px solid var(--border); grid-column: 1 / -1; }
  .reader-split { grid-template-columns: 1fr; }
  .reader-toc { display: none; }
}
@media (max-width: 860px) {
  .cf-sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform 0.2s var(--ease); }
  .cf-shell.sidebar-mobile-open .cf-sidebar { transform: translateX(0); }
  .cf-topbar { padding: 0 14px; }
  .cf-content { padding: 16px 14px 72px; }
  .admin-shell, .docs-shell, .field-row { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
}
