/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com */
*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:'JetBrains Mono',ui-monospace,SFMono-Regular,monospace;font-feature-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:var(--text-muted);opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}

/* ═══════════════════════════════════════════════════════════════
   OBSIDIAN TERMINAL — Design System
   A refined dark interface with electric teal accents
   ═══════════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;
  --bg-void:      #06070b;
  --bg-primary:   #0a0b10;
  --bg-secondary: #0f1016;
  --bg-card:      #13141c;
  --bg-elevated:  #191b25;
  --bg-hover:     #1e2030;
  --border:       #1c1e2e;
  --border-subtle:#161828;
  --border-hover: #2a2d42;
  --text-primary: #e0e2ea;
  --text-secondary:#8a8ea0;
  --text-muted:   #52566a;
  --accent:       #00d4aa;
  --accent-dim:   #00a888;
  --accent-hover: #00f0c0;
  --accent-foreground: #000;
  --accent-contrast: var(--accent-foreground);
  --accent-glow:  rgba(0,212,170,0.12);
  --accent-glow-strong: rgba(0,212,170,0.25);
  --warning:      #f0b429;
  --warning-dim:  rgba(240,180,41,0.12);
  --warning-border: rgba(240,180,41,0.25);
  --error:        #ef4444;
  --error-dim:    rgba(239,68,68,0.12);
  --error-border: rgba(239,68,68,0.2);
  --success:      #10b981;
  --success-dim:  rgba(16,185,129,0.12);
  --success-border: rgba(16,185,129,0.2);
  --purple:       #a78bfa;
  --purple-dim:   rgba(167,139,250,0.12);
  --purple-border: rgba(167,139,250,0.25);
  --radius:       8px;
  --radius-lg:    12px;
  --radius-xl:    16px;
  --font-display: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-body:    'Outfit', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --transition:   180ms cubic-bezier(0.4, 0, 0.2, 1);
  --blue:         #58a6ff;
  --blue-dim:     rgba(56,139,253,0.1);
  --blue-border:  rgba(56,139,253,0.2);
  --shadow-glow:  0 0 20px var(--accent-glow);
  --bg-surface: var(--bg-card);
  --bg-surface-hover: var(--bg-hover);
  --bg-tertiary: var(--bg-elevated);
  --border-color: var(--border);
  --danger: var(--error);
  --green: var(--success);
  --red: var(--error);
  --nav-bg: rgba(10,11,16,0.85);
  --glass-bg: rgba(19,20,28,0.7);
  --glass-border: rgba(255,255,255,0.04);
  --feature-bg: rgba(19,20,28,0.5);
  --login-glow: rgba(0,212,170,0.04);
  --pattern-dot: rgba(255,255,255,0.03);
  --chart-text: #8a8ea0;
  --chart-grid: rgba(255,255,255,0.04);
  --modal-overlay: rgba(0,0,0,0.6);
  --overlay-bg: rgba(10,11,16,0.78);
  --overlay-foreground: #fff;
  --latency-route: var(--blue);
  --latency-route-foreground: #000;
  --latency-upstream: var(--success);
  --latency-upstream-foreground: #000;
  --latency-overhead: var(--text-muted);
  --latency-overhead-foreground: #fff;
  --surface-shadow: 0 8px 24px rgba(0,0,0,0.45);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg-void:      #f6f8fa;
  --bg-primary:   #ffffff;
  --bg-secondary: #f6f8fa;
  --bg-card:      #ffffff;
  --bg-elevated:  #eef1f4;
  --bg-hover:     #eaeef2;
  --border:       #d0d7de;
  --border-subtle:#d8dee4;
  --border-hover: #afb8c1;
  --text-primary: #1f2328;
  --text-secondary:#59636e;
  --text-muted:   #656d76;
  --accent:       #0969da;
  --accent-dim:   #0550ae;
  --accent-hover: #0550ae;
  --accent-foreground: #fff;
  --accent-glow:  rgba(9,105,218,0.1);
  --accent-glow-strong: rgba(9,105,218,0.18);
  --warning:      #9a6700;
  --warning-dim:  rgba(154,103,0,0.1);
  --warning-border: rgba(154,103,0,0.24);
  --error:        #cf222e;
  --error-dim:    rgba(207,34,46,0.08);
  --error-border: rgba(207,34,46,0.2);
  --success:      #1a7f37;
  --success-dim:  rgba(26,127,55,0.1);
  --success-border: rgba(26,127,55,0.2);
  --purple:       #8250df;
  --purple-dim:   rgba(130,80,223,0.1);
  --purple-border: rgba(130,80,223,0.2);
  --blue:         #0969da;
  --blue-dim:     rgba(9,105,218,0.1);
  --blue-border:  rgba(9,105,218,0.2);
  --shadow-glow:  none;
  --nav-bg: rgba(255,255,255,0.94);
  --glass-bg: rgba(255,255,255,0.92);
  --glass-border: rgba(31,35,40,0.12);
  --feature-bg: rgba(255,255,255,0.88);
  --login-glow: rgba(9,105,218,0.07);
  --pattern-dot: rgba(31,35,40,0.07);
  --chart-text: #59636e;
  --chart-grid: rgba(31,35,40,0.09);
  --modal-overlay: rgba(31,35,40,0.35);
  --overlay-bg: rgba(31,35,40,0.84);
  --overlay-foreground: #fff;
  --latency-route-foreground: #fff;
  --latency-upstream-foreground: #fff;
  --latency-overhead-foreground: #fff;
  --surface-shadow: 0 8px 24px rgba(31,35,40,0.12);
}

/* ── Base ─────────────────────────────────────────────────── */

html {
  background: var(--bg-primary);
}

body {
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.5;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent-glow-strong);
  color: var(--text-primary);
}

/* ── Noise texture overlay ────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px;
}

/* ── Animations ───────────────────────────────────────────── */

/* NOTE: the `to` keyframes end at `transform: none` (NOT translateY(0)).
   With `animation-fill-mode: both` the final value is retained forever; a
   retained non-none transform leaves a PERMANENT stacking context on every
   animated section, which made later siblings paint over popovers (the
   integration page's .ob-select-menu rendered "under" the sections below
   it). `none` is visually identical and dissolves the stacking context
   once the entrance animation finishes. */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

@keyframes dotPulse {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 0.8; }
}

.animate-fade-in-up {
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.animate-fade-in {
  animation: fadeIn 0.4s ease both;
}
.animate-slide-down {
  animation: slideDown 0.3s ease both;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

/* ── Card ─────────────────────────────────────────────────── */

.ob-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.ob-card:hover {
  border-color: var(--border-hover);
}

.ob-card-glow:hover {
  box-shadow: var(--shadow-glow);
  border-color: var(--accent-glow-strong);
}

.ob-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

/* ── Buttons ──────────────────────────────────────────────── */

.ob-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.ob-btn-primary {
  background: var(--accent);
  color: var(--accent-foreground);
}
.ob-btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  padding: 0;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  cursor: pointer;
  transition: color var(--transition), background-color var(--transition), border-color var(--transition);
}
.theme-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--border-hover);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.theme-toggle-icon {
  font-size: 17px;
  line-height: 1;
}
.theme-toggle-floating {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 300;
  width: 44px;
  height: 44px;
  background: var(--bg-card);
}

.ob-btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.ob-btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.ob-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0 8px;
  height: 28px;
  font-size: 12px;
}
.ob-btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.ob-btn-danger {
  background: transparent;
  color: var(--text-secondary);
  padding: 0 8px;
  height: 28px;
  font-size: 12px;
}
.ob-btn-danger:hover {
  color: var(--error);
  background: var(--error-dim);
}

.ob-btn-success {
  background: transparent;
  color: var(--text-secondary);
  padding: 0 8px;
  height: 28px;
  font-size: 12px;
}
.ob-btn-success:hover {
  color: var(--success);
  background: var(--success-dim);
}

/* ── Inputs ───────────────────────────────────────────────── */

.ob-input {
  height: 40px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font-mono);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
}
.ob-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.ob-input::placeholder {
  color: var(--text-muted);
}

/* ── Labels ───────────────────────────────────────────────── */

.ob-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* ── Navigation ───────────────────────────────────────────── */

.ob-nav {
  height: 52px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.ob-nav-tab {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  text-decoration: none;
  position: relative;
}
.ob-nav-tab:hover {
  color: var(--text-primary);
}
.ob-nav-tab.active {
  color: var(--accent);
}
.ob-nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow-strong);
  border-radius: 1px;
}

/* ── Sub-tabs ─────────────────────────────────────────────── */

.ob-subtab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
}
.ob-subtab:hover {
  color: var(--text-primary);
}
.ob-subtab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Tables ───────────────────────────────────────────────── */

.ob-table {
  width: 100%;
  font-size: 13px;
}
.ob-table thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}
.ob-table thead th:last-child { text-align: right; }
.ob-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition);
}
.ob-table tbody tr:hover td {
  background: var(--bg-hover);
}
.ob-table tbody tr:last-child td {
  border-bottom: none;
}
.ob-table .text-right {
  text-align: right;
}
.ob-table .text-center {
  text-align: center;
}

/* ── Badges / Tags ────────────────────────────────────────── */

.ob-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  border-radius: 6px;
  letter-spacing: 0.02em;
}
.ob-badge-teal {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent-glow-strong);
}
.ob-badge-green {
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid var(--success-border);
}
.ob-badge-red {
  background: var(--error-dim);
  color: var(--error);
  border: 1px solid var(--error-border);
}
.ob-badge-yellow {
  background: var(--warning-dim);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}
.ob-badge-purple {
  background: var(--purple-dim);
  color: var(--purple);
  border: 1px solid var(--purple-border);
}
.ob-badge-blue {
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid var(--blue-border);
}

/* ── Capability badges (xs, flat) ─────────────────────────── */
/* Tiny protocol chips shown after model names (integration page):
   OpenAI = chat-completions, Claude = /v1/messages, Codex = /v1/responses */

.ob-badge-xs {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  border-radius: 5px;
  line-height: 1;
  flex-shrink: 0;
}
.ob-badge-xs-teal {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent-glow-strong);
}
.ob-badge-xs-amber {
  background: var(--warning-dim);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}
.ob-badge-xs-purple {
  background: var(--purple-dim);
  color: var(--purple);
  border: 1px solid var(--purple-border);
}
.ob-badge-xs-blue {
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid var(--blue-dim);
}

/* ── Select (shadcn-style flat dropdown) ──────────────────── */
/* Replaces native <select> popups (OS-styled, clash with the dark theme).
   Markup: .ob-select > .ob-select-trigger + .ob-select-menu[role=listbox]
   with .ob-select-item rows. Behavior wired by obSelectInit(). */

.ob-select {
  position: relative;
  width: 100%;
}
.ob-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-mono);
  text-align: left;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.ob-select-trigger:hover {
  border-color: var(--border-hover);
}
.ob-select-trigger:focus-visible,
.ob-select-trigger[aria-expanded="true"] {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.ob-select-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--transition);
}
.ob-select-trigger[aria-expanded="true"] .ob-select-chevron {
  transform: rotate(180deg);
}
.ob-select-value {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ob-select-value > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ob-select-value.ob-select-placeholder {
  color: var(--text-muted);
}
.ob-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  padding: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--surface-shadow);
  max-height: 320px;
  overflow-y: auto;
  animation: obSelectIn 120ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes obSelectIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.ob-select-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  column-gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}
.ob-select-item.active {
  background: var(--bg-hover);
}
.ob-select-check {
  grid-column: 1;
  color: var(--accent);
  visibility: hidden;
}
.ob-select-item.selected .ob-select-check {
  visibility: visible;
}
.ob-select-item-label {
  grid-column: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ob-select-badges {
  grid-column: 3;
  display: inline-flex;
  gap: 4px;
}
.ob-select-item-desc {
  grid-column: 2 / 4;
  font-size: 11px;
  font-family: var(--font-body);
  color: var(--text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ob-select-empty {
  padding: 12px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ── Progress bars ────────────────────────────────────────── */

.ob-progress {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}
.ob-progress-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.ob-progress-bar.teal { background: var(--accent); }
.ob-progress-bar.green { background: var(--success); }
.ob-progress-bar.yellow { background: var(--warning); }
.ob-progress-bar.red { background: var(--error); }
.ob-progress-bar.blue { background: var(--blue); }

/* ── Codex quota subrow ──────────────────────────────────── */
.ob-quota-mini-bar {
  display: inline-block;
  width: 42px;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
  vertical-align: middle;
}
.ob-quota-mini-fill {
  display: block;
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.ob-quota-refresh-link:hover { text-decoration: underline; }

/* Fixed-width slot for the optional "套餐 PLUS" badge so the first
   window label (5h / 周) always starts at the same x position even
   when the provider has no plan_type (claude_code). */
.ob-quota-plan-slot {
  display: inline-flex;
  align-items: center;
  min-width: 96px;
  flex-shrink: 0;
}

/* Visually fuse the quota subrow with its parent row:
   - Parent row drops its bottom border so the two look like one block.
   - Subrow has zero top padding and no top border.
   - A vertical accent line on the inner div signals "belongs to row above". */
.ob-table tbody tr.ob-row-has-quota td { border-bottom: none; padding-bottom: 4px; }
.ob-quota-row td {
  border-top: none;
  padding: 0 14px 12px 14px;
  background: transparent;
}
.ob-quota-inner {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  border-left: 2px solid var(--accent-glow-strong, rgba(0,212,170,0.25));
  padding: 2px 0 2px 10px;
  margin-left: 6px;
}
.ob-table tbody tr.ob-quota-row:hover td { background: transparent; }

/* ── Modal ────────────────────────────────────────────────── */

.ob-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--modal-overlay);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.ob-modal-overlay.hidden { display: none; }

.ob-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  max-width: 440px;
  width: 100%;
  margin: 0 16px;
  box-shadow: var(--surface-shadow);
  animation: fadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ob-modal h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

/* ── Providers workbench component layer ─────────────────── */

/* Sheet drawer — keep overlay and panel as direct #content children so
   animated page sections cannot create an intervening stacking context. */
.ob-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: var(--modal-overlay);
  backdrop-filter: blur(4px);
  transition: opacity 250ms ease, visibility 0s linear 250ms;
}
.ob-sheet-overlay.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0s;
}

.ob-sheet {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 201;
  display: flex;
  flex-direction: column;
  width: min(440px, 100vw);
  visibility: hidden;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  box-shadow: var(--surface-shadow);
  transform: translateX(100%);
  transition: transform 250ms ease, visibility 0s linear 250ms;
}
.ob-sheet.open {
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}
.ob-sheet-header {
  position: relative;
  flex: 0 0 auto;
  padding: 24px 64px 20px 24px;
  border-bottom: 1px solid var(--border);
}
.ob-sheet-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}
.ob-sheet-desc {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.ob-sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 24px;
  overflow-y: auto;
}
.ob-sheet-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}
.ob-sheet-close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: color var(--transition), background-color var(--transition);
}
.ob-sheet-close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.ob-sheet-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Switch */
.ob-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}
.ob-switch input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.ob-switch-track {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 36px;
  height: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: 999px;
  transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.ob-switch-thumb {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 16px;
  height: 16px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: background-color var(--transition), transform var(--transition);
}
.ob-switch input[type="checkbox"]:checked + .ob-switch-track {
  background: var(--accent);
  border-color: var(--accent);
}
.ob-switch input[type="checkbox"]:checked + .ob-switch-track .ob-switch-thumb {
  background: var(--accent-foreground);
  transform: translateX(16px);
}
.ob-switch input[type="checkbox"]:focus-visible + .ob-switch-track {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.ob-switch:has(input[type="checkbox"]:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.ob-switch-sm .ob-switch-track {
  width: 28px;
  height: 16px;
}
.ob-switch-sm .ob-switch-thumb {
  width: 12px;
  height: 12px;
}
.ob-switch-sm input[type="checkbox"]:checked + .ob-switch-track .ob-switch-thumb {
  transform: translateX(12px);
}

/* Segmented tabs */
.ob-seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ob-seg-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 14px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--transition), background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.ob-seg-item:hover {
  color: var(--text-primary);
}
.ob-seg-item.active {
  color: var(--text-primary);
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: 0 1px 2px var(--border-subtle);
}
.ob-seg-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Button additions — use together with the .ob-btn base class. */
.ob-btn-outline {
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border);
}
.ob-btn-outline:hover {
  background: var(--bg-secondary);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}
.ob-btn-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 6px;
}
.ob-btn-icon:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.ob-btn-icon svg {
  width: 15px;
  height: 15px;
}
.ob-btn-outline:focus-visible,
.ob-btn-icon:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Empty and loading states */
.ob-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 120px;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}
.ob-empty-icon {
  width: 24px;
  height: 24px;
  color: var(--text-muted);
}
@keyframes obSpin {
  to { transform: rotate(360deg); }
}
.ob-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-hover);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: obSpin 0.7s linear infinite;
}
.ob-panel-loading {
  transition: opacity 0.15s;
}
.htmx-request .ob-panel-loading,
.ob-panel-loading.htmx-request {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.15s;
}

/* Providers workbench layout */
.pv-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.pv-summary-action {
  display: flex;
  align-items: center;
}
.pv-summary > * {
  min-width: 0;
  padding: 18px 20px;
}
.pv-summary > * + * {
  border-left: 1px solid var(--border);
}
.pv-summary-value,
.pv-summary > * > :first-child {
  display: block;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
}
.pv-summary-label,
.pv-summary > * > :last-child {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.pv-workbench {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}
.pv-sidebar {
  padding: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.pv-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 10px;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition), background-color var(--transition), box-shadow var(--transition);
}
.pv-sidebar-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.pv-sidebar-item.active {
  color: var(--text-primary);
  background: var(--bg-hover);
  box-shadow: inset 2px 0 0 var(--accent);
}
.pv-sidebar-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.pv-sidebar-item.inactive {
  opacity: 0.55;
}
.pv-sidebar-item.inactive .pv-sidebar-icon {
  color: var(--text-muted);
}
.pv-sidebar-item.inactive:hover,
.pv-sidebar-item.inactive.active {
  opacity: 0.8;
}
.pv-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.pv-dot.on {
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-dim);
}
.pv-dot.off {
  background: var(--text-muted);
  opacity: 0.6;
}
.pv-sidebar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}
.pv-cred-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 30px;
  height: 20px;
  margin-left: auto;
  padding: 0 7px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
}
.pv-panel {
  min-width: 0;
}
.pv-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

@media (max-width: 900px) {
  .pv-workbench {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .pv-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pv-summary > :nth-child(3) {
    border-left: none;
  }
  .pv-summary > :nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }
  .pv-summary-action {
    grid-column: 1 / -1;
    border-left: none;
  }
  .pv-panel-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ob-sheet-overlay,
  .ob-sheet {
    transition: none;
  }
  .ob-switch-track,
  .ob-switch-thumb,
  .ob-btn-outline,
  .ob-spinner {
    transition: none;
  }
  .ob-spinner {
    animation-duration: 1.4s;
  }
}

/* ── Stat cards ───────────────────────────────────────────── */

.ob-stat {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  min-width: 160px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.ob-stat:hover {
  border-color: var(--border-hover);
}
.ob-stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.ob-stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}
.ob-stat-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── Code blocks ──────────────────────────────────────────── */

.ob-code {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  color: var(--text-primary);
}

/* ── Tool selector pills ──────────────────────────────────── */

.ob-pill {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-mono);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.ob-pill:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
}
.ob-pill.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Callout / Note box ───────────────────────────────────── */

.ob-callout {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 13px;
}
.ob-callout b, .ob-callout strong {
  color: var(--text-primary);
}
.ob-callout ul {
  margin-top: 8px;
  margin-left: 16px;
  list-style: disc;
  color: var(--text-secondary);
}
.ob-callout li {
  margin-bottom: 4px;
}

/* ── Health dot ───────────────────────────────────────────── */

.ob-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.ob-dot-green {
  background: var(--success);
  box-shadow: 0 0 8px var(--success-dim);
}
.ob-dot-yellow {
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning-dim);
}
.ob-dot-red {
  background: var(--error);
  box-shadow: 0 0 8px var(--error-dim);
}

/* ── Landing page specifics ───────────────────────────────── */

.landing-gradient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0,212,170,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(167,139,250,0.05) 0%, transparent 60%),
    var(--bg-primary);
}

.landing-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 30%, black 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 30%, black 0%, transparent 80%);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.hero-title .accent {
  color: var(--accent);
  position: relative;
}
.hero-title .accent::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  opacity: 0.4;
}

.hero-subtitle {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 480px;
}

.feature-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--feature-bg);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}
.feature-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--surface-shadow);
}
.feature-card .icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
}

/* ── Login page ───────────────────────────────────────────── */

.login-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 50% at 50% 50%, var(--login-glow) 0%, transparent 70%),
    var(--bg-void);
}
.login-dots {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, var(--pattern-dot) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ── Scrollbar styling ────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

html[data-theme="light"] body::before {
  display: none;
}

html[data-theme="light"] #godrays {
  visibility: hidden;
  pointer-events: none;
}

html[data-theme="light"] .ob-nav-tab.active::after,
html[data-theme="light"] .ob-dot-green,
html[data-theme="light"] .ob-dot-yellow,
html[data-theme="light"] .ob-dot-red {
  box-shadow: none;
}

/* ── Page headings ────────────────────────────────────────── */

.ob-page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.ob-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ── Feature card heading ─────────────────────────────────── */

.feature-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 6px;
}

/* ── Focus-visible for interactive elements ───────────────── */

.ob-btn:focus-visible,
.ob-btn-primary:focus-visible,
.ob-btn-secondary:focus-visible,
.ob-btn-ghost:focus-visible,
.ob-btn-danger:focus-visible,
.ob-btn-success:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ob-nav-tab:focus-visible,
.ob-subtab:focus-visible,
.ob-pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* ── Hover utilities ──────────────────────────────────────── */

.hover-accent:hover { color: var(--accent); }
.hover-error:hover { color: var(--error); }
.hover-underline:hover { text-decoration: underline; }

/* ── Small button variant ─────────────────────────────────── */

.ob-btn-sm {
  height: 26px;
  padding: 0 8px;
  font-size: 11px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  cursor: pointer;
  background: none;
  display: inline-flex;
  align-items: center;
  transition: all var(--transition);
}

/* ── Alert ────────────────────────────────────────────────── */

.ob-alert-error {
  background: var(--error-dim);
  border: 1px solid var(--error-border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--error);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Utility ──────────────────────────────────────────────── */

.font-display { font-family: var(--font-display); }
.font-mono { font-family: var(--font-mono); }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-success { color: var(--success); }
.text-purple { color: var(--purple); }
.bg-primary { background: var(--bg-primary); }
.bg-card { background: var(--bg-card); }
.bg-elevated { background: var(--bg-elevated); }

/* ── Dashboard ───────────────────────────────────────────── */

.dashboard-page {
  --dashboard-accent: var(--blue, #58a6ff);
  font-family: var(--font-mono);
}

.dashboard-page [hidden] {
  display: none;
}

.dashboard-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  color: var(--warning);
  background: var(--warning-dim);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius);
}

.dashboard-alert-icon {
  flex: 0 0 auto;
}

.dashboard-alert-content {
  font-size: 13px;
}

.dashboard-alert-item {
  margin-left: 8px;
}

.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.dashboard-title {
  margin: 0;
  font-family: var(--font-mono);
}

.usage-period-selector {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.usage-period-btn {
  min-width: 76px;
  min-height: 44px;
  padding: 0 14px;
  color: var(--text-secondary);
  background: transparent;
  border-right: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: color var(--transition), background-color var(--transition);
}

.usage-period-btn:last-child {
  border-right: none;
}

.usage-period-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.usage-period-btn.active {
  color: var(--bg-primary);
  background: var(--dashboard-accent);
  font-weight: 600;
}

.usage-period-btn:focus-visible,
.usage-group-select:focus-visible,
.usage-export-btn:focus-visible,
.usage-retry-btn:focus-visible {
  outline: 2px solid var(--dashboard-accent);
  outline-offset: -2px;
}

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.usage-card {
  min-height: 136px;
  padding: 24px;
  border-radius: var(--radius);
  transition: border-color var(--transition);
}

.usage-card-title {
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.usage-card-value {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.usage-kpi-status {
  min-height: 18px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.usage-kpi-status.is-error {
  color: var(--error);
}

.usage-breakdown-card {
  padding: 20px;
  margin-bottom: 20px;
  border-radius: var(--radius);
}

.usage-breakdown-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.usage-breakdown-title {
  margin-bottom: 0;
}

.usage-breakdown-controls {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.usage-control-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.usage-control-label {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.usage-group-select {
  width: auto;
  min-width: 148px;
  height: 44px;
  padding: 0 30px 0 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  appearance: auto;
}

.usage-export-btn,
.usage-retry-btn {
  min-height: 44px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.usage-export-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.usage-breakdown-bar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.usage-breakdown-bar {
  display: flex;
  width: 100%;
  height: 24px;
  overflow: hidden;
  margin-bottom: 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
}

.usage-breakdown-segment {
  flex-grow: 0;
  flex-shrink: 0;
  min-width: 1px;
}

.usage-breakdown-table {
  width: 100%;
}

.usage-breakdown-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(96px, 0.38fr));
  align-items: center;
  gap: 16px;
  min-height: 42px;
  padding: 8px 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
}

.usage-breakdown-header-row {
  min-height: 34px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-top: none;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.usage-breakdown-row > :not(:first-child) {
  text-align: right;
}

.usage-breakdown-name {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  color: var(--text-primary);
}

.usage-breakdown-name > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-legend-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.usage-breakdown-value {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.usage-panel-state {
  display: flex;
  min-height: 152px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.usage-panel-state[data-state="error"],
.usage-chart-state[data-state="error"] {
  color: var(--error);
}

.dash-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.ob-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color var(--transition);
}

.dashboard-page .ob-chart-card {
  border-radius: var(--radius);
}

.ob-chart-card:hover {
  border-color: var(--border-hover);
}

.ob-chart-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.ob-chart-wrap {
  position: relative;
  height: 220px;
}

.usage-chart-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* ── Claude Code Desktop guide ────────────────────────────── */

.ccd-guide {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ccd-step {
  display: flex;
  gap: 20px;
  padding: 20px;
  align-items: flex-start;
}

.ccd-step-body {
  flex: 1;
  min-width: 0;
}

.ccd-step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ccd-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.ccd-step-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.ccd-step-desc {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0;
}

.ccd-step-desc code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--accent);
}

.ccd-step-img-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  flex-shrink: 0;
  width: 280px;
}

.ccd-step-img {
  width: 100%;
  display: block;
  cursor: zoom-in;
  transition: opacity var(--transition);
}

.ccd-step-img:hover {
  opacity: 0.9;
}

.ccd-img-hint {
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-size: 11px;
  color: var(--overlay-foreground);
  background: var(--overlay-bg);
  padding: 2px 8px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
}

.ccd-step-img-wrap:hover .ccd-img-hint {
  opacity: 1;
}

.ccd-step-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  border-style: dashed;
}

.ccd-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
  vertical-align: middle;
  border-radius: 3px;
  transition: all var(--transition);
}

.ccd-copy-btn:hover {
  color: var(--accent);
  background: var(--accent-glow);
}

@media (max-width: 768px) {
  .ccd-step {
    flex-direction: column;
  }
  .ccd-step-img-wrap {
    width: 100%;
  }
}

.ccd-lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: fadeIn 0.2s ease;
}

.ccd-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  cursor: default;
}

/* ── Responsive (keep Tailwind's breakpoints) ─────────────── */

@media (max-width: 1024px) {
  .dash-chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .hero-title { font-size: 2rem; }
  .landing-nav { padding: 0 16px !important; }
  .landing-nav-cta { display: none; }
  .ob-nav-inner {
    padding: 0 64px 0 8px !important;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .ob-nav-inner::-webkit-scrollbar { display: none; }
  .ob-nav-brand {
    flex: 0 0 auto;
    margin-right: 8px !important;
  }
  .ob-nav-brand-label { display: none; }
  #nav-tabs,
  .ob-nav-actions { flex: 0 0 auto; }
  .ob-nav .theme-toggle {
    position: fixed;
    top: 4px;
    right: 8px;
    z-index: 110;
    background: var(--bg-card);
  }
  .ob-stat-value { font-size: 22px; }
  .ob-nav-tab { padding: 0 12px; font-size: 12px; }
  .dash-kpi-grid { grid-template-columns: 1fr; }

  .dashboard-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .usage-period-selector {
    width: 100%;
  }

  .usage-period-btn {
    min-width: 0;
    flex: 1 1 0;
    padding: 0 8px;
  }

  .usage-card {
    min-height: 116px;
    padding: 20px;
  }

  .usage-card-value {
    font-size: 36px;
  }

  .usage-breakdown-card,
  .dashboard-page .ob-chart-card {
    padding: 16px;
  }

  .usage-breakdown-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .usage-breakdown-controls {
    width: 100%;
  }

  .usage-control-field {
    min-width: 0;
    flex: 1 1 auto;
  }

  .usage-group-select {
    width: 100%;
  }

  .usage-breakdown-header-row {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .usage-breakdown-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 0;
  }

  .usage-breakdown-row > :not(:first-child) {
    text-align: left;
  }

  .usage-breakdown-name {
    grid-column: 1 / -1;
  }

  .usage-breakdown-value::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
}

@media (max-width: 420px) {
  .usage-breakdown-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .usage-export-btn {
    width: 100%;
  }

  .dashboard-alert {
    align-items: flex-start;
  }

  .dashboard-alert-item {
    display: block;
    margin: 4px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-page .animate-fade-in-up {
    animation: none;
  }

  .dashboard-page .usage-period-btn,
  .dashboard-page .usage-card,
  .dashboard-page .ob-chart-card {
    transition: none;
  }
}

/* ── Notification bell (nav) ──────────────────────────────── */

.notif-bell-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
}
.notif-bell-btn:hover {
  background: var(--bg-hover, rgba(255,255,255,.04));
  color: var(--text-primary);
}
.notif-badge-dot {
  display: none;
  position: absolute;
  top: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--error);
  border: 1.5px solid var(--bg-surface, var(--bg-elevated));
}
.notif-badge-dot.show {
  display: block;
  animation: dotPulse 1.8s ease-in-out infinite;
}
.notif-panel {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  width: 340px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--surface-shadow);
  z-index: 20;
}
.notif-panel.show { display: block; }
.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
}
.notif-panel-header button {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.notif-item {
  display: block;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  width: 100%;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-hover, rgba(255,255,255,.04)); }
.notif-item-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.notif-item.unread .notif-item-title::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.notif-item-body {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 3px;
  white-space: pre-wrap;
  word-break: break-word;
}
.notif-item-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}
.notif-panel-empty {
  padding: 32px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}
