/* Query Gate custom design system (no external dependencies) */
:root {
  --font:
    "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system,
    "Helvetica Neue", Arial, sans-serif;
  --mono:
    "Cascadia Code", "JetBrains Mono", Consolas, "SFMono-Regular", Menlo,
    monospace;
  --bg: #f5f6fb;
  --bg-elev: #ffffff;
  --bg-sunken: #eef0f8;
  --line: #e3e6f1;
  --line-strong: #cfd4e6;
  --text: #151a33;
  --text-dim: #5a6285;
  --text-faint: #8a91b0;
  --brand: #5b5bf0;
  --brand-2: #18b6e8;
  --brand-soft: #ececff;
  --brand-ink: #3a3ac7;
  --ok: #12a36b;
  --ok-soft: #dcf7ec;
  --warn: #d98a06;
  --warn-soft: #fff1d3;
  --bad: #e03e52;
  --bad-soft: #fde4e8;
  --info-soft: #dff3fc;
  --side: #0f1330;
  --side-2: #171c45;
  --side-text: #aeb4de;
  --side-active: #ffffff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow:
    0 1px 2px rgba(20, 26, 70, 0.06), 0 8px 24px -12px rgba(20, 26, 70, 0.18);
  --shadow-lg: 0 20px 60px -20px rgba(20, 26, 70, 0.35);
  --grad: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
}

/* Public homepage and documentation */
.public-site { min-height: 100vh; display: flex; flex-direction: column; }
.public-site > main { flex: 1; }
.public-header { border-bottom: 1px solid var(--line); background: var(--bg-elev); }
.public-header-inner { max-width: 1200px; min-height: 72px; margin: auto; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.public-site .public-brand { color: var(--text); padding: 0; text-decoration: none; flex-shrink: 0; }
.public-brand:hover { text-decoration: none; }
.public-nav { display: flex; align-items: center; justify-content: flex-end; gap: 24px; }
.public-nav > a:not(.btn) { color: var(--text-dim); font-weight: 600; }
.public-github-icon { display: none; }
.public-footer { max-width: 1200px; width: 100%; margin: auto; padding: 28px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid var(--line); color: var(--text-faint); }
.public-footer-nav { display: flex; gap: 20px; align-items: center; flex-shrink: 0; }
.public-footer-nav a { color: var(--text-dim); font-weight: 600; white-space: nowrap; }
.public-footer-nav a:hover { color: var(--text); }
.landing-wrap, .docs-page { max-width: 1200px; margin: auto; padding: 0 28px; }
.landing-hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 72px; align-items: center; padding: 110px 0 104px; }
.landing-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 100px; color: var(--brand-ink); background: var(--brand-soft); font-weight: 700; }
.landing-eyebrow svg { width: 16px; height: 16px; }
.landing-copy h1 { margin: 24px 0; font-size: clamp(2.5rem, 5vw, 4.5rem); letter-spacing: -0.05em; line-height: 1.08; }
.landing-copy h1 span { color: var(--brand); }
.landing-copy > p { max-width: 510px; color: var(--text-dim); font-size: 1.2rem; line-height: 1.7; }
.landing-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.landing-actions-primary { display: contents; }
.landing-actions-secondary { display: contents; }
.landing-button { min-height: 46px; padding: 10px 18px; font-size: 1rem; }
.landing-note { margin-top: 35px; color: var(--text-faint); font-weight: 600; }
.landing-note span { padding: 0 8px; color: var(--line-strong); }
.landing-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.badge-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 6px; background: var(--bg-elev); border: 1px solid var(--line); color: var(--text-dim); font-size: 0.8rem; font-weight: 600; }
.badge-chip svg { width: 14px; height: 14px; color: var(--brand-ink); }
.landing-preview { overflow: hidden; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--bg-elev); box-shadow: var(--shadow-lg); }
.preview-top { display: flex; align-items: center; gap: 7px; padding: 17px 20px; border-bottom: 1px solid var(--line); background: var(--bg-sunken); }
.preview-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.preview-title { margin-left: auto; color: var(--text-faint); font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.preview-body { padding: 28px; }
.preview-heading, .preview-check { display: flex; align-items: center; gap: 12px; }
.preview-heading strong, .preview-check strong { display: block; font-size: 1rem; }
.preview-heading small, .preview-check small { display: block; margin-top: 3px; color: var(--text-dim); }
.preview-icon, .landing-feature-icon { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; border-radius: 11px; background: var(--brand-soft); color: var(--brand-ink); }
.preview-icon svg, .landing-feature-icon svg { width: 20px; height: 20px; }
.preview-code { margin: 25px 0; padding: 21px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-sunken); color: var(--text); font-family: var(--mono); line-height: 2; }
.preview-code span { margin-right: 20px; color: var(--text-faint); }
.preview-check { padding: 15px; border-radius: 10px; background: var(--ok-soft); }
.preview-check > svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--ok); }

/* Interactive Query Gate Simulator */
.sim-window { overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--bg-elev); box-shadow: var(--shadow-lg); width: 100%; }
.sim-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg-sunken); flex-wrap: wrap; }
.sim-dots { display: flex; align-items: center; gap: 6px; }
.sim-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); display: inline-block; }
.sim-dot:nth-child(1) { background: #ef4444; }
.sim-dot:nth-child(2) { background: #f59e0b; }
.sim-dot:nth-child(3) { background: #10b981; }
.sim-header-title { color: var(--text-faint); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.sim-engine-badges { display: flex; gap: 4px; align-items: center; }
.sim-engine-btn { appearance: none; -webkit-appearance: none; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-elev); color: var(--text-dim); padding: 3px 8px; font-size: 0.72rem; font-weight: 600; font-family: inherit; cursor: pointer; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.sim-engine-btn:hover { border-color: var(--brand); color: var(--text); }
.sim-engine-btn.active { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand); font-weight: 700; }
.sim-scenarios { display: flex; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg-elev); flex-wrap: wrap; }
.sim-scenario-btn { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-sunken); color: var(--text-dim); font-size: 0.76rem; font-weight: 600; font-family: inherit; cursor: pointer; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.sim-scenario-btn svg { width: 13px; height: 13px; }
.sim-scenario-btn:hover { border-color: var(--line-strong); color: var(--text); }
.sim-scenario-btn.active { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand); font-weight: 700; }
.sim-code-area { padding: 14px 18px; background: #0f1330; color: #e2e8f0; font-family: var(--mono); font-size: 0.82rem; line-height: 1.6; border-bottom: 1px solid var(--line); overflow-x: auto; }
.sim-code-line { display: flex; align-items: flex-start; gap: 12px; }
.sim-line-num { color: #64748b; font-size: 0.75rem; user-select: none; min-width: 16px; }
.sql-kw { color: #60a5fa; font-weight: 700; }
.sql-str { color: #4ade80; }
.sql-comment { color: #94a3b8; font-style: italic; }
.sim-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--line); background: var(--bg-sunken); flex-wrap: wrap; }
.sim-toolbar-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sim-run-btn { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 6px; background: var(--brand); color: #ffffff; border: none; font-size: 0.78rem; font-weight: 700; font-family: inherit; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); transition: opacity 0.15s ease, transform 0.1s ease; }
.sim-run-btn svg { width: 12px; height: 12px; }
.sim-run-btn:hover { opacity: 0.92; }
.sim-run-btn:active { transform: translateY(1px); }
.sim-run-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.sim-unmask-toggle { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--bg-elev); color: var(--text-dim); font-size: 0.74rem; font-weight: 600; font-family: inherit; cursor: pointer; transition: all 0.15s ease; }
.sim-unmask-toggle svg { width: 13px; height: 13px; }
.sim-unmask-toggle:hover { border-color: var(--brand); color: var(--text); }
.sim-unmask-toggle.active { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); font-weight: 700; }
.sim-status-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--bg-elev); }
.sim-badge-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sim-status-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.sim-status-badge svg { width: 11px; height: 11px; }
.sim-badge-pass { background: var(--ok-soft); color: var(--ok); }
.sim-badge-block { background: var(--bad-soft); color: var(--bad); }
.sim-badge-mask { background: var(--warn-soft); color: var(--warn); }
.sim-badge-audit { background: var(--brand-soft); color: var(--brand-ink); }
.sim-output { padding: 12px 16px; min-height: 140px; max-height: 240px; overflow-y: auto; background: var(--bg-elev); }
.sim-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.sim-table th { text-align: left; padding: 6px 10px; font-weight: 700; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); border-bottom: 1px solid var(--line); }
.sim-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); color: var(--text); }
.sim-table tbody tr:last-child td { border-bottom: none; }
.mask-tag { display: inline-block; padding: 1px 6px; border-radius: 4px; background: var(--bg-sunken); border: 1px solid var(--line); font-family: var(--mono); font-size: 0.72rem; color: var(--text-dim); }
.sim-alert-block { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 8px; background: var(--bad-soft); border: 1px solid rgba(224, 62, 82, 0.25); color: var(--bad); font-size: 0.78rem; line-height: 1.5; }
.sim-alert-block svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.sim-alert-block strong { display: block; margin-bottom: 2px; }

/* Interactive Workspace Sandbox Preview */
.preview-window { overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--bg-elev); box-shadow: var(--shadow-lg); margin: 28px 0 16px; }
.preview-window-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--bg-sunken); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.preview-window-title { display: inline-flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 700; color: var(--text-dim); }
.preview-window-title svg { width: 14px; height: 14px; color: var(--brand); }
.preview-disclaimer-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; background: var(--bg-elev); border: 1px solid var(--line); font-size: 0.66rem; font-weight: 700; color: var(--text-faint); }
.preview-disclaimer-pill svg { width: 12px; height: 12px; }
.preview-shell { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: 520px; background: var(--bg); }
.preview-sidebar { background: linear-gradient(180deg, var(--side) 0%, var(--side-2) 100%); color: var(--side-text); padding: 16px 10px; display: flex; flex-direction: column; gap: 4px; }
.preview-sidebar-brand { display: flex; align-items: center; gap: 8px; color: #ffffff; font-weight: 800; font-size: 0.92rem; margin-bottom: 12px; padding: 0 4px; }
.preview-nav-section { font-size: 0.65rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.4); margin: 10px 0 4px; padding: 0 6px; }
.preview-nav-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 0.78rem; font-weight: 600; color: var(--side-text); user-select: none; }
.preview-nav-item svg { width: 14px; height: 14px; }
.preview-nav-item.active { background: linear-gradient(90deg, rgba(124, 124, 255, 0.28), rgba(24, 182, 232, 0.12)); color: var(--side-active); box-shadow: inset 2px 0 0 var(--brand-2); }
.preview-nav-badge { margin-left: auto; background: var(--brand); color: #ffffff; font-size: 0.65rem; font-weight: 700; padding: 1px 6px; border-radius: 999px; }
.preview-pin-btn { margin-top: auto; display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: transparent; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 6px; color: var(--side-text); font-size: 0.72rem; cursor: pointer; font-family: inherit; }
.preview-pin-btn svg { width: 13px; height: 13px; }
.preview-main-content { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.preview-topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--bg-elev); }
.preview-topbar-left { display: flex; align-items: center; gap: 10px; }
.preview-topbar-title { font-weight: 700; font-size: 0.88rem; color: var(--text); }
.preview-topbar-right { display: flex; align-items: center; gap: 14px; }
.preview-user-chip { display: flex; align-items: center; gap: 8px; padding: 3px 8px; border-radius: 999px; background: var(--bg-sunken); border: 1px solid var(--line); }
.preview-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #ffffff; display: grid; place-items: center; font-size: 0.65rem; font-weight: 800; }
.preview-ws { display: grid; grid-template-columns: 220px minmax(0, 1fr); flex: 1; min-height: 0; }
.preview-ws-side { border-right: 1px solid var(--line); padding: 10px; background: var(--bg-elev); display: flex; flex-direction: column; gap: 8px; }
.preview-ws-side-tabs { display: flex; border-bottom: 1px solid var(--line); gap: 4px; }
.preview-ws-side-tab { background: transparent; border: none; border-bottom: 2px solid transparent; padding: 5px 8px; font-size: 0.72rem; font-weight: 600; color: var(--text-dim); cursor: pointer; font-family: inherit; }
.preview-ws-side-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 700; }
.preview-filter-row { display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: var(--bg-sunken); border: 1px solid var(--line); border-radius: 6px; }
.preview-filter-input { border: none; background: transparent; font-size: 0.72rem; color: var(--text); outline: none; width: 100%; }
.preview-obj-icons { display: flex; gap: 4px; margin-top: 4px; }
.preview-obj-btn { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 4px; font-size: 0.68rem; font-weight: 600; color: var(--text-dim); background: var(--bg-sunken); cursor: pointer; user-select: none; }
.preview-obj-btn svg { width: 11px; height: 11px; }
.preview-obj-btn.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; }
.preview-ws-main { display: flex; flex-direction: column; background: var(--bg); min-width: 0; }
.preview-ws-tabs { display: flex; align-items: center; gap: 4px; background: var(--bg-sunken); border-bottom: 1px solid var(--line); padding: 4px 10px 0; overflow-x: auto; }
.preview-ws-tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--bg-elev); border: 1px solid var(--line); border-bottom: none; border-radius: 6px 6px 0 0; font-size: 0.74rem; font-weight: 600; color: var(--text-dim); cursor: pointer; font-family: inherit; user-select: none; }
.preview-ws-tab svg { width: 12px; height: 12px; }
.preview-ws-tab.active { color: var(--brand); font-weight: 700; background: var(--bg); }
.preview-ws-tab-close { display: grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; color: var(--text-faint); cursor: pointer; }
.preview-ws-tab-close:hover { background: var(--bg-sunken); color: var(--bad); }
.preview-ws-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--bg-elev); border-bottom: 1px solid var(--line); gap: 10px; flex-wrap: nowrap; overflow-x: auto; }
.preview-ws-bar-left { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; white-space: nowrap; }
.preview-ws-bar-left > * { flex-shrink: 0; }
.preview-ws-bar .btn { height: 30px; font-size: 0.8125rem; padding: 4px 10px; }
.preview-ws-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 5px; font-size: 0.74rem; font-weight: 700; cursor: pointer; border: none; font-family: inherit; }
.preview-ws-btn svg { width: 12px; height: 12px; }
.preview-ws-btn.primary { background: var(--brand); color: #ffffff; }
.preview-ws-btn.secondary { background: var(--bg-sunken); border: 1px solid var(--line); color: var(--text); }
.preview-db-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; background: var(--bg-sunken); border: 1px solid var(--line); font-size: 0.72rem; font-weight: 600; color: var(--text); font-family: inherit; }
.preview-db-btn svg { width: 12px; height: 12px; color: var(--brand); }
.preview-code-editor { background: #0f1330; color: #f8fafc; font-family: var(--mono); font-size: 0.8rem; padding: 12px 14px; line-height: 1.6; min-height: 110px; overflow-x: auto; }
.preview-code-row { display: flex; gap: 12px; }
.preview-code-num { color: #64748b; user-select: none; width: 20px; text-align: right; flex-shrink: 0; }
.preview-results-card { display: flex; flex-direction: column; border-top: 1px solid var(--line); background: var(--bg-elev); }
.preview-results-header { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--line); background: var(--bg-sunken); flex-wrap: nowrap; white-space: nowrap; overflow-x: auto; }
.preview-results-header .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.preview-results-header .badge,
.preview-results-header .muted { flex-shrink: 0; }
.preview-results-tabs { display: flex; gap: 4px; }
.preview-res-btn { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 5px; border: 1px solid transparent; background: transparent; font-size: 0.72rem; font-weight: 600; color: var(--text-dim); cursor: pointer; font-family: inherit; }
.preview-res-btn svg { width: 12px; height: 12px; }
.preview-res-btn:hover { color: var(--text); }
.preview-res-btn.active { background: var(--bg-elev); border-color: var(--line); color: var(--brand); font-weight: 700; }
.preview-results-body { padding: 12px; overflow: auto; max-height: 240px; background: var(--bg-elev); }
.preview-disclaimer-note { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--bg-elev); border: 1px solid var(--line); margin-top: 14px; }
.preview-disclaimer-note svg { width: 18px; height: 18px; color: var(--brand); flex-shrink: 0; margin-top: 2px; }
.preview-disclaimer-content { flex: 1; min-width: 0; }
.preview-disclaimer-lead { font-size: 0.82rem; line-height: 1.55; color: var(--text-dim); }
.preview-disclaimer-lead strong { color: var(--text); font-weight: 700; margin-right: 4px; }
.preview-disclaimer-expand { margin-top: 6px; }
.preview-disclaimer-more-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--brand); font-size: 0.78rem; font-weight: 700; cursor: pointer; user-select: none; list-style: none; padding: 2px 0; }
.preview-disclaimer-more-btn::-webkit-details-marker { display: none; }
.preview-disclaimer-more-btn svg { width: 12px; height: 12px; transition: transform 0.15s ease; }
.preview-disclaimer-expand[open] .preview-disclaimer-more-btn svg { transform: rotate(90deg); }
.preview-disclaimer-details-text { margin: 6px 0 0; font-size: 0.8rem; line-height: 1.55; color: var(--text-dim); }

/* Explain Tree */
.explain-tree { display: flex; flex-direction: column; gap: 6px; font-family: var(--mono); font-size: 0.75rem; }
.explain-node { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; background: var(--bg-sunken); border: 1px solid var(--line); border-radius: 6px; gap: 8px; flex-wrap: wrap; }
.explain-node-left { display: flex; align-items: center; gap: 8px; }
.explain-node-left svg { width: 13px; height: 13px; color: var(--brand); }
.explain-node-indent-1 { margin-left: 20px; border-left: 2px solid var(--line-strong); }
.explain-node-indent-2 { margin-left: 40px; border-left: 2px solid var(--line-strong); }
.explain-badge { padding: 1px 6px; border-radius: 4px; background: var(--brand-soft); color: var(--brand-ink); font-size: 0.68rem; font-weight: 700; }
.explain-cost { color: var(--text-faint); font-size: 0.7rem; }

/* Governance Lifecycle Stepper */
.lifecycle-stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.lifecycle-card { padding: 18px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg-elev); cursor: pointer; transition: all 0.15s ease; }
.lifecycle-card:hover { border-color: var(--line-strong); }
.lifecycle-card.active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: var(--bg-elev); }
.step-num { font-size: 0.7rem; font-weight: 800; font-family: var(--mono); color: var(--brand-ink); letter-spacing: 0.06em; }
.lifecycle-card h3 { font-size: 0.98rem; margin: 8px 0 6px; color: var(--text); }
.lifecycle-card p { font-size: 0.82rem; color: var(--text-dim); line-height: 1.5; margin: 0; }
.lifecycle-panel { padding: 28px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-elev); box-shadow: var(--shadow); }
.lifecycle-mobile-controls { display: none; }
.lifecycle-step-counter { font-size: 0.78rem; font-weight: 700; font-family: var(--mono); color: var(--text-dim); }

/* Dynamic Data Masking Lab */
.masking-lab { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); box-shadow: var(--shadow); overflow: hidden; }
.masking-lab-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--bg-sunken); flex-wrap: wrap; gap: 12px; }
.masking-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.mask-preset-btn { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-elev); color: var(--text-dim); font-size: 0.76rem; font-weight: 600; font-family: inherit; cursor: pointer; transition: all 0.15s ease; }
.mask-preset-btn:hover { border-color: var(--brand); color: var(--text); }
.mask-preset-btn.active { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand); font-weight: 700; }
.unmask-switch-container { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--text-dim); }
.unmask-switch-btn { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--bg-elev); color: var(--text-dim); font-size: 0.76rem; font-weight: 600; font-family: inherit; cursor: pointer; transition: all 0.15s ease; }
.unmask-switch-btn svg { width: 13px; height: 13px; }
.unmask-switch-btn:hover { border-color: var(--ok); color: var(--text); }
.unmask-switch-btn.active { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.masking-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Built for Teams Persona Tabs */
.persona-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.persona-tab-btn { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg-elev); cursor: pointer; transition: all 0.15s ease; }
.persona-tab-btn svg { width: 18px; height: 18px; color: var(--brand); flex-shrink: 0; }
.persona-tab-btn strong { display: block; font-size: 0.92rem; color: var(--text); }
.persona-desc { font-size: 0.75rem; color: var(--text-dim); }
.persona-tab-btn:hover { border-color: var(--line-strong); }
.persona-tab-btn.active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: var(--brand-soft); }
.persona-tab-btn.active strong { color: var(--brand-ink); }
.persona-panel { padding: 28px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-elev); box-shadow: var(--shadow); }
.persona-mobile-controls { display: none; }
.landing-features { padding: 0 0 100px; }
.landing-section-head { max-width: 600px; margin-bottom: 30px; }
.landing-kicker { color: var(--brand-ink); font-size: .75rem; font-weight: 800; letter-spacing: .12em; }
.landing-section-head h2, .docs-heading h1 { margin-top: 12px; font-size: clamp(2rem, 3vw, 2.8rem); letter-spacing: -.04em; }
.landing-section-head p, .docs-heading p { color: var(--text-dim); font-size: 1.1rem; line-height: 1.7; }
.landing-feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.landing-feature { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); }
.landing-feature-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.landing-feature-header h3 { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.landing-feature-icon { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px; background: var(--brand-soft); color: var(--brand-ink); }
.landing-feature-icon svg { width: 18px; height: 18px; }
.landing-feature p { margin: 0; color: var(--text-dim); line-height: 1.6; font-size: 0.92rem; }
.landing-section { padding: 0 0 100px; }
.landing-screenshot { margin: 0; }
.landing-screenshot img { display: block; width: 100%; height: auto; border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg); transition: border-color 0.2s ease, opacity 0.2s ease; }
[data-theme="dark"] .landing-screenshot img { opacity: 0.92; border-color: rgba(255, 255, 255, 0.16); }
.landing-screenshot figcaption { margin-top: 12px; color: var(--text-dim); }
.landing-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
.landing-steps li { padding: 22px 0; border-top: 2px solid var(--brand); }
.landing-steps span { color: var(--brand-ink); font-family: var(--mono); font-weight: 700; }
.landing-steps h3, .landing-audience-grid h3 { margin: 14px 0 8px; font-size: 1.1rem; }
.landing-steps p, .landing-audience-grid p, .landing-start > p, .landing-info-card p { margin: 0; color: var(--text-dim); line-height: 1.7; }
.landing-audience-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.landing-audience-grid article { padding: 0 20px; border-left: 1px solid var(--line-strong); }
.landing-audience-grid h3 { margin-top: 10px; }
.landing-audience-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-ink); }
.landing-audience-icon svg { width: 18px; height: 18px; }
.landing-scope-note { font-size: 0.9rem; color: var(--text-faint); }
.landing-scope-box { margin: 16px 0; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--bg-sunken); border: 1px solid var(--line); font-size: 0.9rem; }
.landing-scope-box ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-dim); }
.landing-scope-box li { margin-bottom: 4px; }
.landing-start, .landing-info-card { padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); }
.landing-start { margin-bottom: 100px; }
.landing-start .landing-section-head { margin-bottom: 12px; }
.landing-link-list { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 22px; font-weight: 700; }
.landing-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.landing-info-card h2 { margin: 12px 0; font-size: 1.5rem; }
.landing-info-card p + p { margin-top: 12px; }
.landing-info-card > a { display: inline-block; margin-top: 18px; font-weight: 700; }
.docs-heading { padding: 60px 0 36px; border-bottom: 1px solid var(--line); }
.docs-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 52px; padding: 36px 0 80px; align-items: start; }

/* Desktop sidebar */
.docs-sidebar { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; padding-right: 8px; }
.docs-sidebar::-webkit-scrollbar { width: 5px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }

.docs-nav { display: flex; flex-direction: column; gap: 20px; align-items: stretch; }
.docs-nav-group { display: flex; flex-direction: column; gap: 2px; }
.docs-nav-group-title { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 6px; padding: 0 10px; }

.docs-nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-dim); font-size: 0.88rem; font-weight: 600; text-decoration: none; padding: 7px 10px; border-left: 2px solid transparent; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease; }
.docs-nav a:hover { color: var(--text); background: var(--bg-hover, rgba(0,0,0,0.03)); border-left-color: var(--line-strong); }
.docs-nav a.active { color: var(--brand); background: var(--brand-soft); border-left-color: var(--brand); font-weight: 700; }
.docs-nav a.docs-nav-sub { padding-left: 20px; font-size: 0.84rem; }
.docs-nav-pill { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; padding: 2px 6px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); line-height: 1; }

/* Mobile Navigation Bar */
.docs-mobile-nav { display: none; }

.docs-mobile-toc { position: relative; width: 100%; }
.docs-mobile-toc-trigger { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--bg-elev); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; user-select: none; box-shadow: var(--shadow); font-family: inherit; font-size: 0.88rem; text-align: left; }
.docs-mobile-toc-icon { display: grid; place-items: center; color: var(--brand); font-size: 1.05rem; }
.docs-mobile-toc-label { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; text-align: left; }
.docs-mobile-toc-kicker { font-size: 0.65rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); line-height: 1; }
.docs-mobile-current-title { font-size: 0.88rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.docs-mobile-toc-arrow { display: grid; place-items: center; color: var(--text-dim); transition: transform 0.2s ease; }
.docs-mobile-toc-arrow svg { width: 14px; height: 14px; }
.docs-mobile-toc.is-open .docs-mobile-toc-arrow svg { transform: rotate(90deg); }

.docs-mobile-dropdown { display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: 65vh; overflow-y: auto; background: var(--bg-elev); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 14px; flex-direction: column; gap: 14px; z-index: 60; -webkit-overflow-scrolling: touch; }
.docs-mobile-toc.is-open .docs-mobile-dropdown { display: flex; }
.docs-mobile-dropdown .docs-nav-group-title { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 4px; padding: 0 8px; }
.docs-mobile-dropdown a { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; font-size: 0.88rem; font-weight: 600; color: var(--text-dim); text-decoration: none; border-radius: 6px; border-left: 2px solid transparent; }
.docs-mobile-dropdown a:hover { color: var(--text); background: var(--bg-hover, rgba(0,0,0,0.03)); }
.docs-mobile-dropdown a.active { color: var(--brand); font-weight: 700; background: var(--brand-soft); border-left-color: var(--brand); }
.docs-mobile-dropdown a.active::after { content: "✓"; font-weight: 800; color: var(--brand); margin-left: auto; padding-left: 8px; }
.docs-mobile-dropdown a.docs-nav-sub { padding-left: 20px; font-size: 0.84rem; }

/* Documentation Content */
.docs-content { max-width: 820px; font-size: 1.02rem; line-height: 1.72; min-width: 0; }
.docs-content section { scroll-margin-top: 36px; margin-bottom: 52px; }
.docs-content h2 { font-size: 1.6rem; margin-top: 0; margin-bottom: 12px; letter-spacing: -0.02em; }
.docs-content h3 { font-size: 1.25rem; margin-top: 20px; margin-bottom: 8px; color: var(--text); }
.docs-content h4 { font-size: 1.02rem; margin-top: 16px; margin-bottom: 6px; color: var(--text); }
.docs-content li { margin-bottom: 10px; }

/* Code Blocks & Copy Buttons */
.docs-code-block { position: relative; margin: 16px 0; }
.docs-code-block pre { position: relative; overflow-x: auto; margin: 0; padding: 16px 90px 16px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-sunken); max-width: 100%; box-sizing: border-box; }
.docs-code-block pre code { padding: 0; background: none; font-size: 0.88rem; line-height: 1.5; font-family: var(--mono); }
.btn-code-copy { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: 0.78rem; font-weight: 700; background: var(--bg-elev); border: 1px solid var(--line-strong); border-radius: 6px; color: var(--text-dim); cursor: pointer; transition: all 0.15s ease; z-index: 2; }
.btn-code-copy svg { width: 13px; height: 13px; color: var(--brand); }
.btn-code-copy:hover { background: var(--bg-hover); color: var(--text); border-color: var(--brand); }
.btn-code-copy.copied { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }
.btn-code-copy.copied svg { color: var(--ok); }

.inline-code-copy { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.btn-inline-copy { display: inline-flex; align-items: center; justify-content: center; padding: 2px 6px; font-size: 0.75rem; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 4px; color: var(--text-dim); cursor: pointer; transition: all 0.15s ease; }
.btn-inline-copy svg { width: 12px; height: 12px; color: var(--brand); }
.btn-inline-copy:hover { color: var(--text); border-color: var(--brand); }
.btn-inline-copy.copied { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }

/* Feature Cards */
.docs-guide-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.docs-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-elev); }
.docs-card h3 { margin: 0 0 8px; font-size: 1rem; display: flex; align-items: center; gap: 8px; color: var(--text); }
.docs-card h3 svg { width: 16px; height: 16px; color: var(--brand); }
.docs-card p { margin: 0; font-size: 0.9rem; color: var(--text-dim); line-height: 1.5; }

/* Grouped Deployment Section Styles */
.docs-deploy-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 20px 0 28px; }
.docs-deploy-card { display: flex; flex-direction: column; justify-content: space-between; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-elev); text-decoration: none; color: inherit; transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; position: relative; }
.docs-deploy-card:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow); text-decoration: none; }
.docs-deploy-card.featured { border-color: var(--brand); background: linear-gradient(180deg, var(--brand-soft) 0%, var(--bg-elev) 45%); }
.docs-deploy-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; min-height: 28px; }
.docs-deploy-badge { font-size: 0.65rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand-ink); background: var(--brand-soft); padding: 3px 8px; border-radius: 999px; border: 1px solid var(--brand); line-height: 1.2; flex-shrink: 0; }
.docs-deploy-icon { width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 6px; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
.docs-deploy-icon svg { width: 16px; height: 16px; }
.docs-deploy-card-body { display: contents; }
.docs-deploy-card-title { display: block; margin: 0 0 8px; font-size: 1.02rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.docs-deploy-card p { margin: 0 0 12px; font-size: 0.85rem; color: var(--text-dim); line-height: 1.45; flex-grow: 1; }
.docs-deploy-action { font-size: 0.8rem; font-weight: 700; color: var(--brand); display: inline-flex; align-items: center; gap: 4px; }
.docs-deploy-action svg { width: 12px; height: 12px; }

.docs-subsections { display: flex; flex-direction: column; gap: 24px; margin-top: 24px; }
.docs-subsection { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-elev); scroll-margin-top: 36px; }
.docs-subsection-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.docs-subsection h3 { margin: 0; font-size: 1.25rem; color: var(--text); }
.docs-subsection-pill { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; background: var(--bg-sunken); color: var(--text-dim); border: 1px solid var(--line); }
.docs-subsection-pill.recommended { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand); }

/* Table Wrapper & Hint */
.docs-table-wrap { position: relative; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 20px 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-elev); }
.docs-table-scroll-hint { display: none; padding: 8px 12px; font-size: 0.78rem; font-weight: 600; color: var(--text-dim); background: var(--bg-sunken); border-bottom: 1px solid var(--line); align-items: center; gap: 6px; }
.docs-table-scroll-hint svg { width: 13px; height: 13px; color: var(--brand); }
.docs-table-wrap .docs-table { min-width: 540px; margin: 0; border: none; }
.docs-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.docs-table th, .docs-table td { padding: 10px 14px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.docs-table th { background: var(--bg-sunken); color: var(--text); font-weight: 700; white-space: nowrap; }
.docs-table td { color: var(--text-dim); }
.docs-table code { font-size: 0.82rem; padding: 2px 5px; border-radius: 4px; background: var(--bg-sunken); border: 1px solid var(--line); word-break: break-all; white-space: normal; }

/* Troubleshooting Definition List */
.docs-dl { display: flex; flex-direction: column; gap: 14px; margin: 20px 0; }
.docs-dl-item { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-elev); }
.docs-dl dt { font-weight: 700; color: var(--text); font-size: 0.98rem; margin: 0 0 6px; }
.docs-dl dd { margin: 0; color: var(--text-dim); line-height: 1.6; font-size: 0.92rem; }

/* Resources List */
.docs-resources { margin: 16px 0; padding-left: 20px; }
.docs-resources li { margin-bottom: 12px; color: var(--text-dim); overflow-wrap: break-word; word-break: break-word; }
.docs-resources a { font-weight: 600; overflow-wrap: break-word; word-break: break-word; }

/* Floating Back to Top Button */
.docs-back-to-top { position: fixed; bottom: 24px; right: 24px; z-index: 50; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: 0.8rem; font-weight: 700; color: var(--text); background: var(--bg-elev); border: 1px solid var(--line-strong); border-radius: 999px; box-shadow: var(--shadow); text-decoration: none; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease, border-color 0.15s ease; }
.docs-back-to-top svg { transform: rotate(-90deg); width: 14px; height: 14px; color: var(--brand); }
.docs-back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.docs-back-to-top:hover { background: var(--bg-hover); border-color: var(--brand); text-decoration: none; color: var(--text); }

@media (max-width: 860px) {
  .landing-hero { grid-template-columns: 1fr; gap: 45px; padding: 70px 0; }
  .landing-preview, .sim-window { max-width: 680px; margin: 0 auto; width: 100%; }
  .landing-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .landing-steps, .landing-audience-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .landing-info-grid { grid-template-columns: 1fr; }
  .preview-shell { grid-template-columns: 1fr; }
  .preview-sidebar { display: none; }
  .preview-ws { grid-template-columns: 1fr; }
  .preview-ws-side { display: none; }
  .lifecycle-stepper, .persona-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lifecycle-panel > div, .persona-panel > div { grid-template-columns: 1fr !important; }
  .docs-layout { grid-template-columns: 1fr; gap: 24px; padding: 20px 0 60px; }
  .docs-sidebar { display: none; }
  .docs-mobile-nav { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 0; z-index: 30; background: var(--bg); padding: 10px 0 12px; margin: 0 -28px; padding-left: 28px; padding-right: 28px; border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
  .docs-content section, .docs-subsection { scroll-margin-top: 115px; }
  .docs-guide-cards, .docs-deploy-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .public-footer { flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 24px 20px; }
  .public-footer-nav { justify-content: center; flex-wrap: wrap; gap: 20px; }
}
@media (max-width: 768px) {
  .preview-topbar { display: none !important; }
}
@media (max-width: 640px) {
  .docs-guide-cards { grid-template-columns: 1fr; }

  /* Deployment Options on Mobile: Compact Quick-Jump Directory */
  .docs-deploy-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 14px 0 24px;
  }
  .docs-deploy-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    min-height: 48px;
  }
  .docs-deploy-card:hover {
    transform: none;
  }
  .docs-deploy-card-top {
    margin: 0;
    min-height: unset;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }
  .docs-deploy-badge {
    display: none;
  }
  .docs-deploy-card.featured .docs-deploy-card-title::after {
    content: "Recommended";
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--brand-ink);
    background: var(--brand-soft);
    border: 1px solid var(--brand);
    padding: 1px 6px;
    border-radius: 999px;
    margin-left: 6px;
  }
  .docs-deploy-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
  }
  .docs-deploy-card-title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }
  .docs-deploy-card p {
    display: none;
  }
  .docs-deploy-action {
    flex-shrink: 0;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
  }
  .docs-subsection {
    padding: 16px 14px;
    scroll-margin-top: 110px;
  }
  .docs-subsection h3 {
    font-size: 1.15rem;
  }
  .docs-subsection p, .docs-subsection li {
    font-size: 0.9rem;
    line-height: 1.6;
  }
  .docs-code-block pre {
    padding: 12px 50px 12px 12px;
    font-size: 0.8rem;
  }
  .btn-code-copy {
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    font-size: 0.74rem;
  }

  /* Hero Action Buttons on Mobile: Primary on line 1, Try live & Docs on line 2 */
  .landing-actions { display: flex; flex-direction: column; width: 100%; gap: 10px; }
  .landing-actions-primary { display: flex; width: 100%; }
  .landing-actions-primary .btn { width: 100%; justify-content: center; font-size: 0.96rem; min-height: 44px; }
  .landing-actions-secondary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .landing-actions-secondary .btn { width: 100%; justify-content: center; padding: 10px 6px; font-size: 0.82rem; min-height: 42px; white-space: nowrap; }

  /* Preview Disclaimer Pill Shortening on Mobile */
  .preview-disclaimer-extra { display: none; }

  /* Governance Stepper - Clean 2x2 Card Tiles on Mobile (Full text visible, zero clipping) */
  .lifecycle-stepper {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
  }
  .lifecycle-card {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    border: 1px solid var(--line);
    background: var(--bg-elev);
    text-align: left;
    min-height: 58px;
    min-width: 0;
    transition: all 0.15s ease;
  }
  .lifecycle-card .step-num {
    font-size: 0.65rem;
    font-weight: 800;
    font-family: var(--mono);
    color: var(--brand-ink);
    letter-spacing: 0.05em;
    margin: 0;
  }
  .lifecycle-card h3 {
    font-size: 0.82rem;
    margin: 0;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: normal;
  }
  .lifecycle-card p { display: none; }
  .lifecycle-card.active {
    background: var(--brand-soft);
    border-color: var(--brand);
    box-shadow: 0 0 0 1px var(--brand);
  }
  .lifecycle-card.active h3 { color: var(--brand-ink); }
  .lifecycle-panel { padding: 18px 14px; }
  .lifecycle-mobile-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }

  /* Built for Teams Persona Tabs on Mobile (Full text visible, zero clipping) */
  .persona-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
  }
  .persona-tab-btn {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    background: var(--bg-elev);
    text-align: left;
    min-height: 48px;
    min-width: 0;
    transition: all 0.15s ease;
  }
  .persona-tab-btn svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--brand); }
  .persona-tab-btn strong {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
  }
  .persona-desc { display: none; }
  .persona-tab-btn.active {
    border-color: var(--brand);
    box-shadow: 0 0 0 1px var(--brand);
    background: var(--brand-soft);
  }
  .persona-tab-btn.active strong { color: var(--brand-ink); }
  .persona-panel { padding: 18px 14px; }
  .persona-mobile-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }

  /* Control Without Friction Feature Grid on Mobile */
  .landing-feature-grid { grid-template-columns: 1fr; }
  .landing-feature { padding: 16px; }
  .landing-feature-header { gap: 10px; margin-bottom: 8px; }
  .landing-feature-header h3 { font-size: 0.98rem; }
  .landing-feature-icon { width: 34px; height: 34px; }
  .landing-feature-icon svg { width: 16px; height: 16px; }
  .landing-feature p { font-size: 0.88rem; line-height: 1.55; }

  /* Mobile and Tab View Usability Enhancements */
  .masking-table-wrap .sim-table { min-width: 480px; }
  .sim-output { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .preview-ws-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .preview-results-header { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .preview-window-top { padding: 8px 12px; gap: 8px; }
  .preview-window-title { font-size: 0.72rem; }
}
@media (max-width: 540px) {
  .public-header-inner { min-height: 60px; padding: 10px 12px; gap: 8px; }
  .public-nav { flex-wrap: nowrap; gap: 8px; }
  .public-doc-link, .public-github-text { display: none; }
  .public-github-icon { display: grid; place-items: center; width: 30px; height: 30px; }
  .public-github-icon svg { width: 19px; height: 19px; }
  .public-nav .btn { white-space: nowrap; }
  .landing-wrap, .docs-page { padding: 0 16px; }
  .landing-hero { padding: 55px 0; }
  .landing-section, .landing-features { padding-bottom: 64px; }
  .landing-start { padding: 24px; margin-bottom: 64px; }
  .landing-info-card { padding: 24px; }
  .landing-steps, .landing-audience-grid { grid-template-columns: 1fr; }
  .sim-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .sim-engine-badges { width: 100%; justify-content: flex-start; }
  .sim-toolbar { flex-direction: column; align-items: flex-start; }
  .sim-output { max-height: 200px; }
  .masking-lab-header { flex-direction: column; align-items: flex-start; }
  .docs-mobile-nav { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .docs-heading { padding: 32px 0 18px; }
  .docs-heading h1 { font-size: 1.75rem; }
  .docs-heading p { font-size: 0.95rem; line-height: 1.55; }
  .docs-content { font-size: 0.95rem; line-height: 1.65; }
  .docs-content pre { padding: 12px 42px 12px 12px; font-size: 0.82rem; }
  .docs-subsection { padding: 16px; }
  .docs-dl-item { padding: 14px; }
  .docs-dl dt, .docs-dl dd { overflow-wrap: break-word; word-break: break-word; }
  .docs-table { font-size: 0.8rem; min-width: 480px; }
  .docs-table th, .docs-table td { padding: 8px 10px; }
  .docs-back-to-top { bottom: 16px; right: 16px; padding: 6px 12px; font-size: 0.75rem; }
  .public-footer { padding: 24px 18px; flex-direction: column; }
}
[data-theme="dark"] {
  --bg: #0b0e24;
  --bg-elev: #141836;
  --bg-sunken: #0f1330;
  --line: #232950;
  --line-strong: #323a6b;
  --text: #e8ebff;
  --text-dim: #a2a9d6;
  --text-faint: #737bad;
  --brand: #7c7cff;
  --brand-soft: #23275a;
  --brand-ink: #b3b3ff;
  --ok-soft: #0f3a2c;
  --warn-soft: #3d2d08;
  --bad-soft: #451923;
  --info-soft: #0d3445;
  --side: #080a1e;
  --side-2: #10143a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
h4 {
  margin: 0 0 0.4em;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
h1 {
  font-size: 1.3rem;
  font-weight: 700;
}
h2 {
  font-size: 1.1rem;
  font-weight: 650;
}
h3 {
  font-size: 0.98rem;
  font-weight: 650;
}
p {
  margin: 0 0 0.8em;
}
a {
  color: var(--brand-ink);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
code,
pre,
.mono {
  font-family: var(--mono);
  font-size: 0.88em;
}
code {
  background: var(--bg-sunken);
  padding: 0.1em 0.4em;
  border-radius: 5px;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1rem 0;
}
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}
::selection {
  background: color-mix(in srgb, var(--brand) 30%, transparent);
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}

/* ---------- App shell ---------- */
.shell {
  --nav-w: 60px;
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
  min-height: 100vh;
}
html[data-nav="pinned"] .shell {
  --nav-w: 232px;
}
.shell > .main {
  grid-column: 2;
}
.sidebar {
  background: linear-gradient(180deg, var(--side) 0%, var(--side-2) 100%);
  color: var(--side-text);
  display: flex;
  flex-direction: column;
  padding: 12px 10px;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--nav-w);
  z-index: 40;
  overflow-x: hidden;
  overflow-y: auto;
  transition:
    width 0.18s ease,
    box-shadow 0.18s;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar {
  display: none;
}
html[data-nav="compact"] .sidebar:hover,
html[data-nav="compact"] .sidebar:has(:focus-visible) {
  width: 232px;
  box-shadow: 8px 0 30px -8px rgba(0, 0, 0, 0.45);
}
.sidebar .lbl {
  white-space: nowrap;
}
html[data-nav="compact"] .sidebar:not(:hover):not(:has(:focus-visible)) .lbl {
  display: none;
}
.nav-item {
  position: relative;
}
.pin-btn {
  margin-top: auto;
  background: none;
  border: 0;
  width: 100%;
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
html[data-nav="pinned"] .pin-btn {
  color: var(--side-active);
}
html[data-nav="compact"]
  .sidebar:not(:hover):not(:has(:focus-visible))
  .nav-section {
  font-size: 0;
  padding: 6px 12px;
  margin-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
html[data-nav="compact"]
  .sidebar:not(:hover):not(:has(:focus-visible))
  .nav-section:first-child {
  border-top: 0;
}
html[data-nav="compact"]
  .sidebar:not(:hover):not(:has(:focus-visible))
  .nav-item
  .count {
  position: absolute;
  top: 4px;
  left: 26px;
  font-size: 0;
  min-width: 9px;
  height: 9px;
  padding: 0;
  line-height: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 3px 12px;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 0.95rem;
  white-space: nowrap;
}
.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  background: var(--grad);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px -4px rgba(91, 91, 240, 0.7);
}
.brand-mark svg {
  width: 19px;
  height: 19px;
  stroke: #fff;
}
.brand small {
  display: block;
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--side-text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nav-section {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6c73a8;
  padding: 12px 12px 4px;
  white-space: nowrap;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 11px;
  border-radius: 9px;
  color: var(--side-text);
  font-weight: 500;
  transition:
    background 0.15s,
    color 0.15s;
  text-decoration: none !important;
}
.nav-item svg {
  width: 18px;
  height: 18px;
  flex: none;
  opacity: 0.85;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.nav-item.active {
  background: linear-gradient(
    90deg,
    rgba(124, 124, 255, 0.28),
    rgba(24, 182, 232, 0.12)
  );
  color: var(--side-active);
  box-shadow: inset 2px 0 0 var(--brand-2);
}
.nav-item .count {
  margin-left: auto;
  background: var(--bad);
  color: #fff;
  border-radius: 99px;
  font-size: 0.7rem;
  padding: 0 7px;
  line-height: 18px;
  font-weight: 600;
}
.side-foot {
  margin-top: auto;
  padding: 12px 10px 4px;
  font-size: 0.75rem;
  color: #6c73a8;
}
.shell > .main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .spacer {
  flex: 1;
}
.icon-btn {
  position: relative;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}
.icon-btn:hover {
  color: var(--brand);
  border-color: var(--brand);
}
.icon-btn svg {
  width: 16px;
  height: 16px;
}
.icon-btn.sm {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}
.icon-btn.sm svg {
  width: 14px;
  height: 14px;
}
.icon-btn .dot {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--bad);
  color: #fff;
  font-size: 0.65rem;
  min-width: 18px;
  height: 18px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  font-weight: 700;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 10px 2px 2px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--bg-elev);
  cursor: pointer;
}
.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.78rem;
}
.user-chip .who {
  line-height: 1.15;
}
.user-chip .who b {
  display: block;
  font-size: 0.83rem;
}
.user-chip .who span {
  font-size: 0.7rem;
  color: var(--text-faint);
}
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 210px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 50;
}
.menu a,
.menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}
.menu a:hover,
.menu button:hover {
  background: var(--bg-sunken);
  text-decoration: none;
}
.menu svg {
  width: 16px;
  height: 16px;
  color: var(--text-dim);
}
.rel {
  position: relative;
}
.content {
  padding: 16px 20px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}
.content:has(.ws) {
  max-width: none;
  padding: 8px 10px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.page-head p {
  color: var(--text-dim);
  margin: 0;
}
.page-head .actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Surfaces ---------- */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad {
  padding: 14px;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.card-head h2,
.card-head h3 {
  margin: 0;
}
.card-head .actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}
.grid {
  display: grid;
  gap: 12px;
}
.g2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.g3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.g4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.split {
  display: grid;
  gap: 12px;
  grid-template-columns: 2fr 1fr;
}
@media (max-width: 1100px) {
  .g4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .g3,
  .split {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    width: auto;
    height: auto;
  }
  .sidebar .lbl {
    display: inline;
  }
  .shell > .main {
    grid-column: 1;
  }
  .pin-btn {
    display: none;
  }
  .g2,
  .g4 {
    grid-template-columns: 1fr;
  }
  .content {
    padding: 16px;
  }
}
.stat {
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute;
  inset: auto -30px -40px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--grad);
  opacity: 0.08;
}
.stat .label {
  color: var(--text-dim);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.stat .value {
  font-size: 1.6rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  margin-top: 4px;
}
.stat .hint {
  font-size: 0.78rem;
  color: var(--text-faint);
}
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
}
.empty svg {
  width: 36px;
  height: 36px;
  opacity: 0.4;
  margin-bottom: 8px;
}
.hero {
  padding: 16px 20px;
  border-radius: var(--radius);
  color: #fff;
  background:
    radial-gradient(
      1200px 300px at 90% -20%,
      rgba(24, 182, 232, 0.55),
      transparent 60%
    ),
    linear-gradient(120deg, #2a2a9e, #5b5bf0 60%, #2aa4e6);
  box-shadow: var(--shadow-lg);
  margin-bottom: 12px;
}
.hero h1 {
  margin-bottom: 6px;
}
.hero p {
  opacity: 0.85;
  margin: 0;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.hero-actions .btn {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
  color: #fff;
  backdrop-filter: blur(4px);
}
.hero-actions .btn:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.5);
  color: #fff;
  text-decoration: none;
}
.hero-actions .btn-primary,
.hero .hero-actions a.btn-primary,
.hero .hero-actions a.btn-primary:visited {
  background: #fff !important;
  color: #1e1b4b !important;
  font-weight: 600 !important;
  border-color: transparent !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.hero-actions .btn-primary svg,
.hero .hero-actions a.btn-primary svg {
  color: #1e1b4b !important;
  stroke: #1e1b4b !important;
}
.hero-actions .btn-primary:hover,
.hero .hero-actions a.btn-primary:hover {
  background: rgba(255,255,255,0.92) !important;
  color: #1e1b4b !important;
}
.hero-actions .btn-primary:hover svg,
.hero .hero-actions a.btn-primary:hover svg {
  color: #1e1b4b !important;
  stroke: #1e1b4b !important;
}

/* ---------- Controls ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.08s,
    box-shadow 0.15s,
    background 0.15s,
    border-color 0.15s;
  text-decoration: none !important;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--brand);
  color: var(--brand-ink);
}
.btn:active {
  transform: translateY(1px);
}
.btn svg {
  width: 14px;
  height: 14px;
}
.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--grad);
  color: #fff !important;
  border-color: transparent;
  box-shadow: 0 6px 16px -6px rgba(91, 91, 240, 0.8);
}
.btn-primary:hover {
  filter: brightness(1.07);
  border-color: transparent;
}
.btn-danger {
  background: var(--bad);
  color: #fff !important;
  border-color: transparent;
}
.btn-danger:hover {
  background: #c92f43;
  border-color: transparent;
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-dim);
}
.btn-ghost:hover {
  background: var(--bg-sunken);
}
.btn-sm {
  padding: 2px 8px;
  font-size: 0.85rem;
  border-radius: 7px;
}
.btn-lg {
  padding: 9px 16px;
  font-size: 1rem;
  border-radius: 10px;
}
.btn-link {
  background: none;
  border: 0;
  color: var(--brand-ink);
  padding: 4px;
  box-shadow: none;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
}
.field > label,
.label {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.input,
input:not([type]),
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="datetime-local"],
input[type="search"],
select,
textarea,
.form-control {
  width: 100%;
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
input[type="date"] {
  width: 100%;
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.9;
}
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}
textarea {
  resize: vertical;
  min-height: 64px;
}
select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 55%,
    calc(100% - 12px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
input:-webkit-autofill,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 100px var(--bg-elev) inset;
  caret-color: var(--text);
}
.input:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
}
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}
.check-grid .check {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-sunken);
}
.check-grid .check:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.validation-message,
.text-danger,
.field-error {
  color: var(--bad);
  font-size: 0.82rem;
}
.row-inline {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.row-inline.end {
  justify-content: flex-end;
}
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.toolbar .grow {
  flex: 1;
  min-width: 180px;
}

/* ---------- Data ---------- */
.table-wrap {
  overflow: auto;
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  font-weight: 700;
  padding: 6px 10px;
  background: var(--bg-sunken);
  position: sticky;
  top: 0;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover td {
  background: color-mix(in srgb, var(--brand-soft) 45%, transparent);
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
td.wrap {
  white-space: normal;
  max-width: 420px;
}
.cell-sql {
  font-family: var(--mono);
  font-size: 0.8rem;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 0.74rem;
  font-weight: 650;
  background: var(--bg-sunken);
  color: var(--text-dim);
  white-space: nowrap;
}
.badge.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.badge.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.badge.info {
  background: var(--info-soft);
  color: #0a7fa8;
}
.badge.brand {
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.badge.env-dev {
  background: #e1f7ea;
  color: #108a55;
}
.badge.env-qa {
  background: #fff1d3;
  color: #b97500;
}
.badge.env-prod {
  background: #fde4e8;
  color: #b21835;
}
[data-theme="dark"] .badge.env-dev {
  background: #0f3a2c;
  color: #4fdca0;
}
[data-theme="dark"] .badge.env-qa {
  background: #3d2d08;
  color: #ffc65c;
}
[data-theme="dark"] .badge.env-prod {
  background: #451923;
  color: #ff8ea0;
}
.badge.engine-sqlserver {
  background: #e6f0fa;
  color: #0b62a4;
}
.badge.engine-postgres {
  background: #ede9fe;
  color: #6366f1;
}
.badge.engine-mysql {
  background: #ffedd5;
  color: #c2410c;
}
.badge.engine-mariadb {
  background: #e0f2fe;
  color: #0369a1;
}
[data-theme="dark"] .badge.engine-sqlserver {
  background: #172d47;
  color: #60a5fa;
}
[data-theme="dark"] .badge.engine-postgres {
  background: #2e1065;
  color: #a78bfa;
}
[data-theme="dark"] .badge.engine-mysql {
  background: #431407;
  color: #fb923c;
}
[data-theme="dark"] .badge.engine-mariadb {
  background: #082f49;
  color: #38bdf8;
}
.alert {
  padding: 8px 12px;
  border-radius: 9px;
  margin-bottom: 10px;
  border: 1px solid transparent;
  font-size: 0.9rem;
}
.alert.ok,
.alert-success {
  background: var(--ok-soft);
  color: var(--ok);
}
.alert.bad,
.alert-danger {
  background: var(--bad-soft);
  color: var(--bad);
}
.alert.warn,
.alert-warning {
  background: var(--warn-soft);
  color: var(--warn);
}
.alert.info,
.alert-info {
  background: var(--info-soft);
  color: #0a7fa8;
}
.secret {
  font-family: var(--mono);
  background: var(--bg-sunken);
  border: 1px dashed var(--brand);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  user-select: all;
}
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 0;
  background: none;
  color: var(--text-dim);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.tab .badge {
  font-size: 0.72rem;
  padding: 1px 6px;
}
.tab.active {
  color: var(--brand-ink);
  border-color: var(--brand);
}
.muted {
  color: var(--text-dim);
}
.faint {
  color: var(--text-faint);
}
.small {
  font-size: 0.82rem;
}
.right {
  text-align: right;
}
.nowrap {
  white-space: nowrap;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 30, 0.55);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade 0.15s;
}
.modal {
  width: min(560px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--bg-elev);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  animation: pop 0.18s;
}
.modal.wide {
  width: min(860px, 100%);
}
.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
}
.modal-head h2 {
  margin: 0;
}
.modal-body {
  padding: 20px 22px;
}
.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}
.toast-stack {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 10000;
  pointer-events: none;
  width: max-content;
  max-width: min(620px, 92vw);
}
@keyframes toastDropIn {
  0% {
    opacity: 0;
    transform: translateY(-28px) scale(0.92);
  }
  65% {
    transform: translateY(3px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes toastDrain {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}
.toast {
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  min-width: 320px;
  max-width: min(580px, 92vw);
  padding: 12px 16px 14px 14px;
  border-radius: var(--radius-md, 10px);
  background: var(--bg-elev);
  color: var(--text);
  border: 1.5px solid var(--line-strong);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.48), 0 0 1px rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  animation: toastDropIn 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 12px;
}
.toast.toast-ok {
  border-color: rgba(46, 204, 113, 0.7);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.5), 0 0 28px rgba(46, 204, 113, 0.32);
}
.toast.toast-bad {
  border-color: rgba(231, 76, 60, 0.8);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.5), 0 0 28px rgba(231, 76, 60, 0.36);
}
.toast.toast-warn {
  border-color: rgba(243, 156, 18, 0.8);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.5), 0 0 28px rgba(243, 156, 18, 0.32);
}
.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}
.toast-icon svg {
  width: 17px;
  height: 17px;
}
.toast-ok .toast-icon {
  background: var(--ok-soft);
  color: var(--ok);
  border: 1.5px solid rgba(46, 204, 113, 0.45);
}
.toast-bad .toast-icon {
  background: var(--bad-soft);
  color: var(--bad);
  border: 1.5px solid rgba(231, 76, 60, 0.45);
}
.toast-warn .toast-icon {
  background: var(--warn-soft);
  color: var(--warn);
  border: 1.5px solid rgba(243, 156, 18, 0.45);
}
.toast-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.toast-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.toast-ok .toast-title {
  color: var(--ok);
}
.toast-bad .toast-title {
  color: var(--bad);
}
.toast-warn .toast-title {
  color: var(--warn);
}
.toast-msg {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}
.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-faint);
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.toast-close svg {
  width: 14px;
  height: 14px;
}
.toast-close:hover {
  color: var(--text);
  background: var(--bg-sunken);
}
.toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: var(--ok);
  animation: toastDrain 4s linear forwards;
  opacity: 0.9;
}
.toast-bad .toast-progress {
  background: var(--bad);
}
.toast-warn .toast-progress {
  background: var(--warn);
}
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-sunken),
    var(--line),
    var(--bg-sunken)
  );
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 8px;
  height: 16px;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ---------- Query workspace ---------- */
.ws {
  --ws-side-w: 230px;
  display: grid;
  grid-template-columns: var(--ws-side-w) 6px minmax(0, 1fr);
  column-gap: 0;
  row-gap: 8px;
  height: calc(100vh - 58px);
  min-height: 420px;
}
.ws.side-hidden {
  grid-template-columns: minmax(0, 1fr);
}
.ws.side-hidden .ws-side,
.ws.side-hidden .ws-side-split {
  display: none;
}
.ws-bar {
  flex: none;
  gap: 8px;
}
.ws-split {
  flex: none;
  height: 6px;
  margin: -3px 0;
  cursor: row-resize;
  border-radius: 3px;
  position: relative;
  z-index: 2;
}
.ws-split:hover {
  background: var(--brand-soft);
}
.ws-side {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ws-side .scroll {
  overflow: auto;
  flex: 1;
  padding: 8px;
}
.ws-side-split {
  cursor: col-resize;
  border-radius: 3px;
  margin: 0;
}
.ws-side-split:hover {
  background: var(--brand-soft);
}
.obj-filters {
  gap: 6px;
}
.obj-filter.active {
  color: var(--brand-ink);
  border-color: var(--brand);
  background: var(--brand-soft);
}
.tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.86rem;
}
.tree-item:hover {
  background: var(--bg-sunken);
}
.tree-item svg {
  width: 14px;
  height: 14px;
  color: var(--text-faint);
  flex: none;
}
.tree-col {
  padding-left: 30px;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-family: var(--mono);
}
.ws-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  gap: 6px;
}
.ws-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
}
.ws-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 10px 10px 0 0;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-bottom: 0;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.ws-tab.active {
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: inset 0 2px 0 var(--brand);
}
.ws-tab button {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  opacity: 0.6;
}
.tab-rename-input {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm, 4px);
  padding: 1px 6px;
  font-size: 0.82rem;
  font-weight: 600;
  width: 120px;
  outline: none;
}

/* Database Selector Component */
.db-selector-wrap {
  position: relative;
  display: inline-flex;
}
.db-selector-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  max-width: 480px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.db-selector-btn:hover {
  background: var(--bg-hover);
  border-color: var(--line-strong, var(--line));
}
.db-selector-btn .db-name {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.db-selector-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 400px;
  max-width: 90vw;
  max-height: 420px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.db-selector-search {
  width: 100%;
  padding: 5px 9px;
  font-size: 0.82rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  margin-bottom: 4px;
}
.db-selector-list {
  overflow-y: auto;
  max-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.db-selector-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  background: none;
  border: 0;
  text-align: left;
  color: var(--text);
  width: 100%;
  transition: background 0.1s ease;
}
.db-selector-item:hover {
  background: var(--bg-hover);
}
.db-selector-item.selected {
  background: var(--brand-soft);
}
.db-selector-item .db-info {
  min-width: 0;
  flex: 1;
}
.db-selector-item .db-title {
  font-weight: 600;
  font-size: 0.85rem;
  word-break: break-word;
}
.db-selector-item .db-desc {
  font-size: 0.75rem;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-selector-item .db-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.db-selector-footer {
  border-top: 1px solid var(--line);
  padding-top: 6px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.db-selector-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
}

/* Object Explorer Context Menu */
.context-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1050;
}
.context-menu {
  position: fixed;
  z-index: 1051;
  min-width: 220px;
  max-width: 320px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 5px;
}
.context-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  border-radius: 4px;
  color: var(--text);
  background: none;
  border: 0;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s ease;
}
.context-menu button:hover {
  background: var(--bg-hover);
  color: var(--brand);
}
.context-menu-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}
.context-menu-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
  padding: 4px 8px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.editor-box {
  flex: 1 1 50%;
  min-height: 100px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev);
}
.editor-box .fallback {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  font-family: var(--mono);
}
.results.maximized {
  position: fixed;
  inset: 0;
  z-index: 90;
  border-radius: 0;
  margin: 0;
  max-height: none;
}
.results {
  flex: 1 1 50%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.results .table-wrap {
  flex: 1;
}
.results td,
.results th {
  padding: 3px 10px;
  font-size: 0.85rem;
  white-space: nowrap;
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.results th.sortable:hover {
  background: color-mix(in srgb, var(--brand-soft) 70%, var(--bg-sunken));
  color: var(--text);
}
.export-dropdown {
  position: relative;
  display: inline-block;
}
.export-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 2px);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 170px;
  z-index: 1000;
  padding: 4px 0;
}
.export-dropdown-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 0;
  right: 0;
  height: 6px;
}
.export-dropdown:hover .export-dropdown-menu,
.export-dropdown:focus-within .export-dropdown-menu {
  display: block;
}
.export-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 14px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
}
.export-dropdown-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-faint);
}
.export-dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--brand);
}
.export-dropdown-item:hover svg {
  color: var(--brand);
}
.export-dropdown-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 4px 0;
}
.null {
  color: var(--text-faint);
  font-style: italic;
}
kbd {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--bg-elev);
}

/* ---------- Auth ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.auth-art {
  position: relative;
  overflow: hidden;
  padding: 56px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #0b0e2e;
}
.auth-art::before,
.auth-art::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.7;
  animation: float 14s ease-in-out infinite;
}
.auth-art::before {
  width: 520px;
  height: 520px;
  background: #5b5bf0;
  top: -120px;
  left: -100px;
}
.auth-art::after {
  width: 440px;
  height: 440px;
  background: #18b6e8;
  bottom: -120px;
  right: -80px;
  animation-delay: -6s;
}
@keyframes float {
  50% {
    transform: translate(40px, 30px) scale(1.08);
  }
}
.auth-art > * {
  position: relative;
  z-index: 1;
}
.auth-art h2 {
  font-size: 2.3rem;
  line-height: 1.1;
  font-weight: 750;
  letter-spacing: -0.03em;
  max-width: 440px;
}
.auth-art p {
  opacity: 0.8;
  max-width: 420px;
}
.feature {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 18px;
  max-width: 420px;
}
.feature .ic {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  flex: none;
  backdrop-filter: blur(6px);
}
.feature .ic svg {
  width: 18px;
  height: 18px;
}
.feature b {
  display: block;
}
.feature span {
  opacity: 0.75;
  font-size: 0.85rem;
}
.auth-form {
  display: grid;
  place-items: center;
  padding: 32px;
  background: var(--bg);
}
.auth-card {
  width: min(420px, 100%);
}
.auth-card h1 {
  font-size: 1.9rem;
}
.auth-card .sub {
  color: var(--text-dim);
  margin-bottom: 26px;
}
.auth-brand:hover, .auth-mobile-brand:hover { text-decoration: none; }
.auth-mobile-brand { display: none; }
.auth-legal { opacity: 0.6; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-faint); font-size: 0.8rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-passkey { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; background: var(--bg-elev); color: var(--text); border: 1px solid var(--line-strong); font-weight: 600; }
.btn-passkey:hover { background: var(--bg-hover); border-color: var(--brand); color: var(--brand); }
.passkey-form { margin-bottom: 0; }
[data-passkey-btn] { display: none; }
.login-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.login-hint { margin-top: 22px; }
.mobile-nav-toggle, .mobile-nav-close, .mobile-nav-backdrop, .mobile-panel-close { display: none; }
.sidebar-brand { display: flex; align-items: flex-start; justify-content: space-between; }
@media (max-width: 900px) {
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-art {
    display: none;
  }
  .auth-mobile-brand { display: flex; color: var(--text); margin-bottom: 32px; }
}

@media (max-width: 860px) {
  .sidebar,
  html[data-nav="compact"] .sidebar:hover,
  html[data-nav="compact"] .sidebar:has(:focus-visible) {
    display: none;
    position: fixed;
    width: min(280px, 85vw);
    height: 100dvh;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.mobile-open,
  html[data-nav="compact"] .sidebar.mobile-open:hover,
  html[data-nav="compact"] .sidebar.mobile-open:has(:focus-visible) { display: flex; }
  html[data-nav="compact"] .sidebar.mobile-open:not(:hover):not(:has(:focus-visible)) .lbl { display: inline; }
  html[data-nav="compact"] .sidebar.mobile-open:not(:hover):not(:has(:focus-visible)) .nav-section {
    font-size: .68rem;
    padding: 12px 12px 4px;
    margin-top: 0;
    border: 0;
  }
  html[data-nav="compact"] .sidebar.mobile-open:not(:hover):not(:has(:focus-visible)) .nav-item .count {
    position: static;
    font-size: inherit;
    min-width: 0;
    height: auto;
    padding: 0 7px;
    line-height: 18px;
  }
  .mobile-nav-toggle, .mobile-nav-close { display: grid; }
  .mobile-nav-backdrop { display: block; position: fixed; inset: 0; z-index: 35; border: 0; background: rgba(0, 0, 0, .55); }
  .ws, .ws.side-auto, .ws.side-open { position: relative; grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 58px); }
  .ws.side-auto .ws-side, .ws.side-hidden .ws-side, .ws-side-split { display: none; }
  .ws.side-open .ws-side {
    display: flex;
    position: absolute;
    inset: 0 auto 0 0;
    width: min(300px, 90%);
    z-index: 10;
    box-shadow: var(--shadow-lg);
  }
  .mobile-panel-close { display: grid; margin-left: auto; flex: none; }
  .ws-bar { flex-wrap: wrap; }
  .ws-bar select { max-width: 100%; }
}

#blazor-error-ui {
  color-scheme: light only;
  background: var(--warn-soft);
  color: var(--warn);
  bottom: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
  display: none;
  left: 0;
  padding: 0.6rem 1.25rem 0.7rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
}
#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 0.75rem;
  top: 0.5rem;
}
.blazor-error-boundary {
  background: var(--bad);
  padding: 1rem;
  color: #fff;
}
.blazor-error-boundary::after {
  content: "An error has occurred.";
}

/* ---------- Compatibility layer for scaffolded account pages ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.col-lg-3 {
  flex: 0 0 220px;
}
.col-lg-9 {
  flex: 1;
  min-width: 300px;
}
.col-lg-6,
.col-md-6,
.col-md-4 {
  flex: 1;
  min-width: 280px;
}
.col-xl-6 {
  flex: 1;
  min-width: 280px;
  max-width: 560px;
}
.form-floating {
  display: flex;
  flex-direction: column-reverse;
  gap: 5px;
  margin-bottom: 14px;
}
.form-floating > label,
.form-label {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text-dim);
}
.form-floating input::placeholder {
  color: var(--text-faint);
}
.btn-lg.btn-primary,
.w-100 {
  width: 100%;
}
.btn-secondary {
  background: var(--bg-sunken);
}
.btn-outline-danger {
  color: var(--bad);
  border-color: var(--bad);
}
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.form-check-input {
  width: 16px;
  height: 16px;
}
.nav {
  list-style: none;
  display: flex;
  padding: 0;
  margin: 0;
  gap: 4px;
}
.flex-column {
  flex-direction: column;
}
.nav-link {
  display: block;
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--text-dim);
  font-weight: 600;
  text-decoration: none !important;
}
.nav-link:hover {
  background: var(--bg-sunken);
}
.nav-link.active {
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.d-flex {
  display: flex;
}
.flex-column {
  flex-direction: column;
}
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}
.text-secondary {
  color: var(--text-dim);
}
.text-center {
  text-align: center;
}
.fw-bold {
  font-weight: 700;
}
.mb-3 {
  margin-bottom: 1rem;
}
.mt-2 {
  margin-top: 0.5rem;
}
.mt-3 {
  margin-top: 1rem;
}
.mb-0 {
  margin-bottom: 0;
}
.px-4 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.me-2 {
  margin-right: 0.5rem;
}
.table {
  width: 100%;
}
.list-group {
  list-style: none;
  padding: 0;
}
.badge-secondary {
  background: var(--bg-sunken);
}
.dl-horizontal dt {
  float: left;
}

.personal-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.personal-actions form {
  margin: 0;
}

.audit-key-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.audit-key-filters input,
.audit-key-filters select {
  width: 150px;
  min-width: 0;
  max-width: 100%;
}
.logs-toolbar {
  flex-wrap: wrap;
}
.logs-level {
  flex: 1 1 140px;
  min-width: 140px;
}
.logs-search {
  flex: 3 1 220px;
  min-width: 0;
}
.cache-head {
  flex-wrap: wrap;
}
.settings-grid > .card {
  min-width: 0;
}
.cache-head h3 {
  white-space: nowrap;
}
.cache-head .actions {
  flex-wrap: wrap;
}
@media (max-width: 540px) {
  .audit-key-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .audit-key-filters input,
  .audit-key-filters select {
    width: 100%;
  }
  .audit-key-filters input[type="search"] {
    grid-column: 1 / -1;
  }
  .audit-toolbar .grow,
  .logs-toolbar > * {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }
  .cache-head .actions {
    flex-basis: 100%;
    margin-left: 0;
  }
}

.theme-moon {
  display: none;
}
.theme-sun,
.theme-moon {
  display: grid;
  place-items: center;
}
[data-theme="dark"] .theme-sun {
  display: none;
}
[data-theme="dark"] .theme-moon {
  display: grid;
}
[data-theme="light"] .theme-moon,
:root:not([data-theme]) .theme-moon {
  display: none;
}
summary::-webkit-details-marker {
  display: none;
}
summary {
  list-style: none;
}
.auth-card .btn-primary {
  width: 100%;
}

/* Execution Plan (Showplan) styles */
.plan-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.plan-metric {
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.plan-metric-label {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.plan-metric-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--mono);
}
.plan-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.plan-cost-bar {
  background: var(--bg-sunken);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  width: 100%;
}
.plan-cost-fill {
  background: var(--brand);
  height: 100%;
  border-radius: 4px;
  transition: width 0.2s ease;
}
.plan-cost-fill.cost-med {
  background: var(--warn);
}
.plan-cost-fill.cost-high {
  background: var(--bad);
}

/* Minimalist Toolbar Chips & Expandable Buttons */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.btn-hover-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  height: 30px;
  border-radius: var(--radius);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-hover-expand svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.btn-hover-expand .btn-lbl {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.24s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, margin 0.2s ease;
  margin-left: 0;
  font-size: 0.8125rem;
  font-weight: 500;
}
.btn-hover-expand:hover,
.btn-hover-expand:focus-visible {
  padding: 4px 10px;
}
.btn-hover-expand:hover .btn-lbl,
.btn-hover-expand:focus-visible .btn-lbl {
  max-width: 110px;
  opacity: 1;
  margin-left: 6px;
}

.chip-toggle {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  height: 28px;
  border-radius: 9999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text-faint);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.chip-toggle:hover {
  border-color: var(--brand);
  color: var(--text);
}
.chip-toggle.active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 600;
}
.chip-toggle.chip-warn.active {
  background: color-mix(in srgb, #f59e0b 16%, var(--bg-elev));
  border-color: #f59e0b;
  color: #f59e0b;
}

.chip-input {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 2px 7px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.chip-input svg {
  width: 13px;
  height: 13px;
  color: var(--text-faint);
  flex-shrink: 0;
}
.chip-input input {
  width: 44px;
  height: 20px;
  border: none;
  background: transparent;
  padding: 0 2px;
  font-size: 0.78rem;
  color: var(--text);
  outline: none;
  text-align: right;
}
.chip-input .unit {
  font-size: 0.75rem;
  color: var(--text-faint);
}
.chip-input:focus-within {
  border-color: var(--brand);
}

/* Disable increment / decrement spinners on numeric chip inputs */
.chip-input input::-webkit-outer-spin-button,
.chip-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.chip-input input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Password Visibility Toggle & Disable Browser Default Reveal Icons (Edge, IE) */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.password-wrapper input {
  padding-right: 40px !important;
  width: 100%;
}
.btn-toggle-password {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm, 4px);
  transition: color 0.15s ease, background 0.15s ease;
  z-index: 2;
}
.btn-toggle-password:hover {
  color: var(--text);
  background: var(--bg-hover);
}
.btn-toggle-password svg {
  width: 16px !important;
  height: 16px !important;
  pointer-events: none !important;
}
.btn-toggle-password .eye-closed {
  display: none !important;
}
.btn-toggle-password .eye-open {
  display: block !important;
}
.btn-toggle-password:hover .eye-open,
.btn-toggle-password.is-visible .eye-open {
  display: none !important;
}
.btn-toggle-password:hover .eye-closed,
.btn-toggle-password.is-visible .eye-closed {
  display: block !important;
}

/* Gated Form Controls (Permission sequential unlocks) */
.field-gated {
  position: relative;
  user-select: none;
}
.gated-control-wrap.is-locked {
  pointer-events: none;
  opacity: 0.65;
  cursor: pointer;
}
.gated-control-wrap.is-locked select,
.gated-control-wrap.is-locked input {
  cursor: pointer;
  background: var(--bg-sunken);
}

/* Audit Log Table & Details */
.audit-table-wrap {
  max-height: calc(100vh - 250px);
  overflow: auto;
}
.audit-table {
  width: 100%;
  border-collapse: collapse;
}
.audit-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-sunken);
  z-index: 2;
  box-shadow: 0 1px 0 var(--line);
}
.audit-row {
  cursor: pointer;
  transition: background 0.12s ease;
}
.audit-row:hover {
  background: var(--bg-hover) !important;
}
.audit-user-cell {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audit-db-cell {
  min-width: 150px;
  max-width: 230px;
  vertical-align: middle;
}
.audit-db-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
}
.audit-db-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.audit-detail-cell {
  min-width: 280px;
  max-width: 460px;
  vertical-align: middle;
  position: relative;
}
.audit-detail-cell .audit-cell-content {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  max-width: calc(100% - 75px);
  overflow: hidden;
  vertical-align: middle;
}
.audit-snippet {
  font-size: 0.76rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: flex;
  align-items: center;
}
.audit-snippet code {
  font-family: var(--font-mono);
  color: var(--brand);
  background: var(--bg-sunken);
  padding: 1px 4px;
  border-radius: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audit-snippet-text {
  color: var(--text-faint);
  font-size: 0.75rem;
}
.audit-client-info {
  font-size: 0.72rem;
  color: var(--text-faint);
  opacity: 0.8;
}
.audit-open-btn {
  float: right;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 0.72rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.audit-open-btn:hover {
  background: var(--bg-hover);
  border-color: var(--line-focus);
}

/* Audit Metadata Grid */
.audit-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.audit-meta-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.audit-meta-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}
.audit-meta-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Code Viewer for Big Queries */
.code-viewer-block {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-sunken);
}
.code-viewer-block.grow-flex {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.code-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 8px;
}
.code-viewer-title {
  font-weight: 600;
  font-size: 0.8125rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}
.code-viewer-container {
  display: flex;
  max-height: 420px;
  overflow: auto;
  background: var(--bg-sunken);
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.code-viewer-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.code-viewer-container::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--bg-sunken) 50%, var(--bg));
}
.code-viewer-container::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}
.code-viewer-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-faint);
}
.code-viewer-container.maximized-viewer {
  max-height: calc(85vh - 220px);
  flex: 1;
}
.code-gutter {
  position: sticky;
  left: 0;
  z-index: 2;
  user-select: none;
  text-align: right;
  color: var(--text-faint);
  opacity: 0.55;
  padding: 10px 8px 10px 10px;
  border-right: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  background: color-mix(in srgb, var(--bg-sunken) 85%, var(--bg-elev));
  display: flex;
  flex-direction: column;
  min-width: 42px;
  flex-shrink: 0;
}
.gutter-num {
  display: block;
}
.code-area {
  flex: 1;
  overflow: visible !important;
  padding: 10px 14px;
  min-width: 0;
}
.code-pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text);
  tab-size: 4;
  overflow: visible !important;
}
.code-viewer-container.nowrap .code-pre {
  white-space: pre;
  word-break: normal;
  overflow: visible !important;
}
.code-viewer-container.wrap .code-pre {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  overflow: visible !important;
}
.code-viewer-container.code-viewer-err {
  border-color: rgba(239, 68, 68, 0.4);
}
.code-pre.audit-log-err {
  color: #f87171;
}

/* Permission Guide Toolbar & Popovers */
.perm-guide-toolbar {
  padding: 4px 0;
}
.perm-guide-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
  outline: none;
}
.perm-guide-item:hover .badge,
.perm-guide-item:focus .badge {
  filter: brightness(1.15);
  box-shadow: 0 0 0 1px var(--brand);
}
.perm-popover {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong, var(--line));
  box-shadow: var(--shadow-md, 0 4px 14px rgba(0, 0, 0, 0.25));
  border-radius: var(--radius, 6px);
  padding: 8px 12px;
  width: max-content;
  max-width: 280px;
  z-index: 1050;
  pointer-events: none;
  white-space: normal;
  text-align: left;
}
.perm-popover::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: var(--bg-elev) transparent transparent transparent;
}
.perm-guide-item:hover .perm-popover,
.perm-guide-item:focus-within .perm-popover {
  display: block;
}
.perm-popover-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.perm-popover-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Autocomplete Combobox */
.combobox-wrapper {
  position: relative;
}
.combobox-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.combobox-input {
  width: 100%;
}
.combobox-clear {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  font-size: 16px;
  line-height: 1;
  color: var(--text-faint);
  cursor: pointer;
  padding: 2px 4px;
}
.combobox-clear:hover {
  color: var(--text);
}
.combobox-caret {
  position: absolute;
  right: 10px;
  font-size: 10px;
  color: var(--text-faint);
  pointer-events: none;
}
.combobox-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1040;
}
.combobox-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong, var(--line));
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 1050;
  padding: 4px 0;
}
.combobox-group-title {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-sunken);
}
.combobox-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 0.8125rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s ease;
}
.combobox-option svg {
  width: 14px;
  height: 14px;
  color: var(--text-faint);
  flex-shrink: 0;
}
.combobox-option:hover {
  background: var(--bg-hover);
  color: var(--brand);
}
.combobox-option:hover svg {
  color: var(--brand);
}
.combobox-option.selected {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.combobox-option.highlighted {
  background: var(--brand-soft) !important;
  color: var(--brand) !important;
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}
.combobox-option.highlighted svg {
  color: var(--brand) !important;
}
.combobox-empty {
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-faint);
  font-style: italic;
}

/* Effective Permissions Modernized Tiles */
.effective-stat-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 0.8125rem;
}
.effective-stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.effective-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.effective-tile {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s ease;
  position: relative;
}
.effective-tile:hover {
  border-color: var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.effective-tile.allowed {
  border-color: rgba(34, 197, 94, 0.25);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.04) 0%, transparent 100%), var(--bg-card);
}
.effective-tile.allowed.highrisk {
  border-color: rgba(249, 115, 22, 0.35);
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.04) 0%, transparent 100%), var(--bg-card);
}
.effective-tile.denied {
  opacity: 0.65;
  background: var(--bg-sunken);
  border-color: var(--line);
}
.effective-tile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.effective-perm-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.effective-scope-trigger {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-family: monospace;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--brand);
  cursor: pointer;
  width: fit-content;
  transition: all 0.15s ease;
}
.effective-scope-trigger:hover {
  background: var(--brand);
  color: #fff;
}
.effective-source-pill {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-sunken);
  color: var(--text-muted);
  border: 1px solid var(--line);
  font-weight: 500;
}

/* Access Matrix Scope Pill & Table Styles */
.matrix-cell-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.matrix-check-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.matrix-check-pill.ok {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.35);
}
.matrix-check-pill.warn {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.35);
}
.matrix-scoped-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 600;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--brand);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  line-height: 1;
}
.matrix-scoped-btn:hover {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}
.matrix-scoped-btn.warn {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
  border-color: rgba(249, 115, 22, 0.4);
}
.matrix-scoped-btn.warn:hover {
  background: #f97316;
  color: #fff;
}
.matrix-scoped-count {
  font-size: 10px;
  font-family: monospace;
  background: rgba(255, 255, 255, 0.12);
  padding: 1px 5px;
  border-radius: 6px;
}
.matrix-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 12px;
  background: var(--bg-sunken);
  border-radius: var(--radius-sm);
  margin-top: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.matrix-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Access Matrix Sticky Pinned Columns */
.matrix-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  width: max-content;
  min-width: 100%;
}
.matrix-table th,
.matrix-table td {
  border-bottom: 1px solid var(--line);
}
.matrix-table th.col-user,
.matrix-table td.col-user {
  position: sticky;
  left: 0;
  z-index: 4;
  background: var(--bg-elev);
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  box-shadow: 1px 0 0 var(--line);
}
.matrix-table th.col-user {
  z-index: 10;
  background: var(--bg-sunken);
}
.matrix-table th.col-status,
.matrix-table td.col-status {
  position: sticky;
  left: 220px;
  z-index: 4;
  background: var(--bg-elev);
  width: 95px;
  min-width: 95px;
  max-width: 95px;
  box-shadow: 4px 0 8px -3px rgba(0, 0, 0, 0.25), 1px 0 0 var(--line);
  border-right: 1px solid var(--line);
}
.matrix-table th.col-status {
  z-index: 10;
  background: var(--bg-sunken);
}
.matrix-table tbody tr:hover td.col-user,
.matrix-table tbody tr:hover td.col-status {
  background: color-mix(in srgb, var(--brand-soft) 45%, var(--bg-elev));
}

/* Permission Fieldsets with Legends */
.perm-fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px 14px;
  margin: 0 0 16px 0;
  background: var(--bg-sunken);
}
.perm-fieldset.perm-fieldset-highrisk {
  border-color: rgba(239, 68, 68, 0.4);
  background: color-mix(in srgb, #ef4444 4%, var(--bg-sunken));
}
.perm-legend {
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0 8px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.perm-legend.perm-legend-highrisk {
  color: #f87171;
}
.highrisk-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.highrisk-icon-wrap svg {
  width: 14px !important;
  height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  flex-shrink: 0 !important;
  display: inline-block;
}
.highrisk-reason svg {
  width: 13px !important;
  height: 13px !important;
  max-width: 13px !important;
  max-height: 13px !important;
  flex-shrink: 0 !important;
}

/* High Risk Permissions (Red Background & Reason) */
.badge.badge-highrisk,
.badge-highrisk {
  background: #dc2626 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: 1px solid #b91c1c !important;
  letter-spacing: 0.02em;
}
.perm-check-wrapper.highrisk-card {
  border: 1px solid color-mix(in srgb, #ef4444 45%, var(--line));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, #ef4444 8%, var(--bg-elev));
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.check-highrisk {
  display: flex;
  align-items: center;
  gap: 8px;
}
.highrisk-text {
  font-weight: 700;
  color: #ef4444;
}
.highrisk-reason,
.highrisk-inline-reason,
.highrisk-warning-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.72rem;
  color: #f87171;
  line-height: 1.35;
}
.highrisk-reason svg,
.highrisk-inline-reason svg,
.highrisk-warning-note svg {
  width: 13px;
  height: 13px;
  color: #ef4444;
  flex-shrink: 0;
  margin-top: 1px;
}
.perm-highrisk-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.perm-popover.highrisk-popover {
  border-color: #ef4444;
}
.highrisk-warning-note {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed color-mix(in srgb, #ef4444 50%, transparent);
}



