/* ============================================================
   SQL File Viewer - scoped under .sqv-root / .sqv-* (rebuilt 2026-10-11)
   Base styles shared with the ConvertICO TXT and Log File Viewers, plus the
   code view, structure outline, data grid and query panel below.
   Shared header, footer, FAQ and related pills come from custom_styles.css.
   Accent: blue #3399cc (viewers). Single colours, no gradients,
   no thick side borders. Light default, dark via [data-theme="dark"].
   ============================================================ */
.sqv-root {
    --sqv-accent: #3399cc;
    --sqv-accent-strong: #237a9f;
    --sqv-accent-soft: rgba(51, 153, 204, 0.09);
    --sqv-accent-line: rgba(51, 153, 204, 0.45);
    --sqv-go: #237a9f;
    --sqv-go-hover: #1b6183;
    --sqv-card: var(--bg-elevated, #fff);
    --sqv-sunk: var(--card-tertiary, #f1f5f9);
    --sqv-open: var(--card-secondary, #f8f9fa);
    --sqv-line: var(--border-color, #e2e8f0);
    --sqv-text-1: var(--text-primary, #1e293b);
    --sqv-text-2: var(--text-secondary, #555);
    --sqv-muted: var(--text-muted, #64748b);
    --sqv-warn: #b45309;
    --sqv-red: #c23b3b;
    --sqv-red-soft: rgba(230, 78, 78, 0.08);
    --sqv-red-line: rgba(230, 78, 78, 0.35);
    --sqv-mono: ui-monospace, "Cascadia Mono", SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
    /* text surface */
    --sqv-bg: #ffffff;
    --sqv-fg: #1f2937;
    --sqv-gut: #f6f8fa;
    --sqv-gut-t: #94a3b8;
    --sqv-gut-line: #e5e7eb;
    --sqv-ws: #c0c7d2;
    --sqv-ts: #0f7a8a;
    --sqv-e: #c62828;
    --sqv-w: #b45309;
    --sqv-i: #1d6fa5;
    --sqv-d: #8a94a6;
    --sqv-row-err: rgba(230, 78, 78, 0.07);
    --sqv-row-warn: rgba(217, 119, 6, 0.07);
    --sqv-hit: rgba(250, 204, 21, 0.45);
    --sqv-hit-cur: #facc15;
}
[data-theme="dark"] .sqv-root {
    --sqv-accent: #60a5fa;
    --sqv-accent-strong: #93c5fd;
    --sqv-accent-soft: rgba(96, 165, 250, 0.12);
    --sqv-accent-line: rgba(96, 165, 250, 0.45);
    --sqv-go: #2563eb;
    --sqv-go-hover: #1d4ed8;
    --sqv-sunk: #172033;
    --sqv-open: #1a2438;
    --sqv-warn: #fbbf24;
    --sqv-red: #f87171;
    --sqv-red-soft: rgba(248, 113, 113, 0.1);
    --sqv-red-line: rgba(248, 113, 113, 0.4);
    --sqv-bg: #0f172a;
    --sqv-fg: #e2e8f0;
    --sqv-gut: #131c30;
    --sqv-gut-t: #64748b;
    --sqv-gut-line: #24314a;
    --sqv-ws: #475569;
    --sqv-ts: #5eead4;
    --sqv-e: #f87171;
    --sqv-w: #fbbf24;
    --sqv-i: #7dd3fc;
    --sqv-d: #7c8aa3;
    --sqv-row-err: rgba(248, 113, 113, 0.1);
    --sqv-row-warn: rgba(251, 191, 36, 0.08);
    --sqv-hit: rgba(250, 204, 21, 0.3);
}

.sqv-root.tool-container { max-width: 1100px; margin: 0 auto; padding: 2rem; }
.sqv-root [hidden] { display: none !important; }
.sqv-root .sqv-main { background: none; border: none; box-shadow: none; border-radius: 0; overflow: visible; padding: 0; }
.sqv-root button { font: inherit; }
.sqv-root code { font-family: var(--sqv-mono); font-size: 0.86em; padding: 0.05rem 0.35rem; border-radius: 5px; background: var(--sqv-sunk); }
.sqv-root kbd {
    display: inline-block; padding: 0.05rem 0.4rem; border-radius: 5px; border: 1px solid var(--sqv-line); border-bottom-width: 2px;
    background: var(--sqv-card); font: 600 0.78em var(--sqv-mono); color: var(--sqv-text-1);
}
.sqv-root .sqv-muted { color: var(--sqv-muted); font-weight: 500; }
.sqv-root :focus-visible { outline: 3px solid var(--sqv-accent-line); outline-offset: 2px; }

/* ---------- title ---------- */
.sqv-root .tool-header { text-align: center; margin-bottom: 1.75rem; }
.sqv-root .sqv-title-row { display: flex; align-items: center; justify-content: center; gap: 0.9rem; margin-bottom: 0.9rem; }
.sqv-root .sqv-title-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--sqv-accent); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
[data-theme="dark"] .sqv-root .sqv-title-icon { color: #0b1e33; }
.sqv-root .sqv-title-icon svg { width: 30px; height: 30px; display: block; }
.sqv-root .tool-title { margin: 0; font-size: 2rem; font-weight: 700; color: var(--sqv-accent); line-height: 1.2; }
.sqv-root .tool-description { max-width: 800px; margin: 0 auto; font-size: 1.05rem; line-height: 1.65; color: var(--sqv-text-2); }
.sqv-root .tool-description a { color: var(--sqv-accent-strong); font-weight: 500; }
[data-theme="dark"] .sqv-root .tool-description a { color: var(--sqv-accent); }

/* ---------- error ---------- */
.sqv-root .sqv-error { display: flex; align-items: flex-start; gap: 0.7rem; margin: 0 0 1rem; padding: 0.9rem 1rem; border-radius: 12px; border: 1px solid var(--sqv-red-line); background: var(--sqv-red-soft); color: var(--sqv-text-1); }
.sqv-root .sqv-error > svg { width: 20px; height: 20px; color: #e64e4e; flex-shrink: 0; margin-top: 2px; }
.sqv-root .sqv-error > div { flex: 1; min-width: 0; }
.sqv-root .sqv-error p { margin: 0; font-size: 0.92rem; line-height: 1.55; overflow-wrap: anywhere; }
.sqv-root .sqv-error p + p { margin-top: 0.3rem; color: var(--sqv-muted); font-size: 0.86rem; }
.sqv-root .sqv-error a { color: var(--sqv-red); font-weight: 600; }
.sqv-root .sqv-error-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.55rem; }
.sqv-root .sqv-x { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex-shrink: 0; border: none; border-radius: 8px; background: none; color: var(--sqv-muted); cursor: pointer; padding: 0; margin: 0; }
.sqv-root .sqv-x:hover { background: rgba(100, 116, 139, 0.12); color: var(--sqv-text-1); }
.sqv-root .sqv-x svg { width: 17px; height: 17px; }

/* ---------- cards ---------- */
.sqv-root .sqv-card { background: var(--sqv-card); border: 1px solid var(--sqv-line); border-radius: 20px; padding: 1.25rem; box-shadow: var(--shadow-sm); margin-bottom: 1.25rem; min-width: 0; }
.sqv-root .sqv-caption { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0 0 0.45rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sqv-muted); }
.sqv-root .sqv-caption svg { width: 14px; height: 14px; }

/* ---------- buttons ---------- */
.sqv-root .sqv-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; width: auto; min-height: 44px; padding: 0.6rem 1.1rem; margin: 0;
    border-radius: 12px; border: 1px solid transparent; font-size: 0.95rem; font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.sqv-root .sqv-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.sqv-root .sqv-go { background: var(--sqv-go); color: #fff; }
.sqv-root .sqv-go:hover:not(:disabled) { background: var(--sqv-go-hover); color: #fff; }
.sqv-root .sqv-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.sqv-root .sqv-btn-lg { min-height: 50px; padding: 0.65rem 1.5rem; font-size: 1rem; }
.sqv-root .sqv-btn-sm { min-height: 36px; padding: 0.4rem 0.8rem; font-size: 0.85rem; border-radius: 10px; }
.sqv-root .sqv-btn-sm svg { width: 16px; height: 16px; }
.sqv-root .sqv-btn-ghost { background: var(--sqv-sunk); color: var(--sqv-text-2); border-color: var(--sqv-line); }
.sqv-root .sqv-btn-ghost:hover:not(:disabled) { color: var(--sqv-text-1); border-color: var(--sqv-accent-line); }
.sqv-root .sqv-text-btn { display: inline-flex; align-items: center; gap: 0.35rem; width: auto; padding: 0.35rem 0.6rem; margin: 0; border: none; border-radius: 8px; background: none; color: var(--sqv-accent-strong); font-size: 0.85rem; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; }
[data-theme="dark"] .sqv-root .sqv-text-btn { color: var(--sqv-accent); }
.sqv-root .sqv-text-btn:hover:not(:disabled) { background: var(--sqv-accent-soft); }
.sqv-root .sqv-text-btn svg { width: 15px; height: 15px; }
.sqv-root .sqv-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; margin: 0; border: none; border-radius: 7px; background: none; color: var(--sqv-text-2); cursor: pointer; flex-shrink: 0; }
.sqv-root .sqv-icon-btn:hover:not(:disabled) { background: var(--sqv-accent-soft); color: var(--sqv-text-1); }
.sqv-root .sqv-icon-btn:disabled { opacity: 0.35; cursor: default; }
.sqv-root .sqv-icon-btn svg { width: 16px; height: 16px; }
.sqv-root .sqv-seg-btn { display: inline-flex; align-items: center; gap: 0.4rem; width: auto; min-height: 36px; padding: 0.35rem 0.85rem; margin: 0; border-radius: 999px; border: 1px solid var(--sqv-line); background: var(--sqv-card); color: var(--sqv-text-2); font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.sqv-root .sqv-seg-btn svg { width: 15px; height: 15px; color: var(--sqv-accent); }
.sqv-root .sqv-seg-btn:hover { border-color: var(--sqv-accent-line); color: var(--sqv-text-1); }
.sqv-root .sqv-chip { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; width: auto; min-height: 34px; padding: 0.3rem 0.55rem; margin: 0; border-radius: 9px; border: 1px solid var(--sqv-line); background: var(--sqv-card); color: var(--sqv-text-2); font-size: 0.8rem; font-weight: 700; cursor: pointer; min-width: 0; }
.sqv-root .sqv-chip:hover { border-color: var(--sqv-accent-line); }
.sqv-root .sqv-chip.is-active { border-color: var(--sqv-accent); background: var(--sqv-accent-soft); color: var(--sqv-accent-strong); }
[data-theme="dark"] .sqv-root .sqv-chip.is-active { color: var(--sqv-accent); }
.sqv-root .sqv-chip svg { width: 15px; height: 15px; }
.sqv-root .sqv-quick { display: grid; gap: 0.35rem; }
.sqv-root .sqv-quick > * { min-width: 0; }
.sqv-root .sqv-quick-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sqv-root .sqv-quick-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sqv-root .sqv-quick-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sqv-root .sqv-sub { margin: 0.75rem 0 0.35rem; font-size: 0.78rem; font-weight: 700; color: var(--sqv-text-2); }
.sqv-root .sqv-sub:first-child { margin-top: 0.2rem; }

/* ---------- upload ---------- */
.sqv-root .sqv-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem; text-align: center; min-height: 180px; padding: 1.5rem 1.25rem;
    border-radius: 16px; border: 2px dashed var(--sqv-accent-line); background: var(--sqv-accent-soft); cursor: pointer; color: var(--sqv-muted); font-size: 0.86rem; line-height: 1.5;
    transition: border-color 0.15s, background 0.15s; box-sizing: border-box; margin: 0;
}
.sqv-root .sqv-drop:hover, .sqv-root .sqv-drop.is-drag { border-color: var(--sqv-accent); background: rgba(51, 153, 204, 0.14); }
.sqv-root .sqv-drop:focus-within { outline: 3px solid var(--sqv-accent-soft); }
.sqv-root .sqv-drop strong { font-size: 1.08rem; color: var(--sqv-text-1); }
.sqv-root .sqv-drop-link { color: var(--sqv-accent-strong); text-decoration: underline; text-underline-offset: 3px; }
[data-theme="dark"] .sqv-root .sqv-drop-link { color: var(--sqv-accent); }
.sqv-root .sqv-drop-icon { width: 58px; height: 58px; border-radius: 16px; display: flex; align-items: center; justify-content: center; margin-bottom: 0.35rem; background: var(--sqv-card); color: var(--sqv-accent); border: 1px solid var(--sqv-line); }
.sqv-root .sqv-drop-icon svg { width: 28px; height: 28px; }
.sqv-root .sqv-types { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem; margin-top: 0.35rem; max-width: 560px; }
.sqv-root .sqv-types span { padding: 0.05rem 0.45rem; border-radius: 6px; background: var(--sqv-card); border: 1px solid var(--sqv-line); font: 600 0.72rem var(--sqv-mono); color: var(--sqv-text-2); }
.sqv-root .sqv-or { display: flex; align-items: center; gap: 0.75rem; margin: 1rem 0 0.6rem; color: var(--sqv-muted); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.sqv-root .sqv-or::before, .sqv-root .sqv-or::after { content: ""; flex: 1; height: 1px; background: var(--sqv-line); }
.sqv-root .sqv-textarea { display: block; width: 100%; min-height: 130px; max-height: 60vh; resize: vertical; box-sizing: border-box; margin: 0; padding: 0.75rem 0.85rem; border-radius: 12px; border: 1px solid var(--sqv-line); background: var(--input-bg, #fff); color: var(--sqv-text-1); font: 0.86rem/1.55 var(--sqv-mono); tab-size: 4; }
.sqv-root .sqv-textarea:focus { outline: none; border-color: var(--sqv-accent); box-shadow: 0 0 0 3px var(--sqv-accent-soft); }
.sqv-root .sqv-input-bar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.7rem; }
.sqv-root .sqv-kbd-hint { margin-left: auto; font-size: 0.76rem; color: var(--sqv-muted); }
.sqv-root .sqv-samples { margin-top: 1rem; }
.sqv-root .sqv-sample-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.sqv-root .sqv-under { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.6rem; margin-top: 1rem; }
.sqv-root .sqv-pill { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.22rem 0.65rem; border-radius: 999px; background: var(--sqv-sunk); border: 1px solid var(--sqv-line); font-size: 0.78rem; font-weight: 600; color: var(--sqv-text-2); }
.sqv-root .sqv-pill svg { width: 14px; height: 14px; color: var(--sqv-accent); }
/* page-wide drop overlay */
.sqv-root .sqv-overlay { position: fixed; inset: 0; z-index: 10004; display: flex; align-items: center; justify-content: center; background: rgba(15, 23, 42, 0.45); pointer-events: none; }
.sqv-root .sqv-overlay-box { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 2rem 2.5rem; border-radius: 20px; border: 2px dashed var(--sqv-accent); background: var(--sqv-card); color: var(--sqv-text-1); font-weight: 700; font-size: 1.1rem; }
.sqv-root .sqv-overlay-box svg { width: 36px; height: 36px; color: var(--sqv-accent); }

/* ---------- progress ---------- */
.sqv-root .sqv-prog { padding: 1rem 1.1rem; }
.sqv-root .sqv-prog-top { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.sqv-root .sqv-prog-top .sqv-btn { margin-left: auto; }
.sqv-root .sqv-loader { display: block; width: 40px; height: 40px; flex-shrink: 0; overflow: visible; --cico-outer: #f2534e; --cico-outer-soft: #f8d3d1; --cico-mid: #31ae77; --cico-mid-soft: #d0e7dd; --cico-inner: #2b9edb; }
[data-theme="dark"] .sqv-root .sqv-loader { --cico-outer-soft: rgba(242, 83, 78, 0.22); --cico-mid-soft: rgba(49, 174, 119, 0.22); }
.sqv-root .sqv-loader circle { fill: none; stroke-width: 72; transform-box: fill-box; transform-origin: center; }
.sqv-root .sqv-loader .bp { stroke: var(--cico-outer-soft); }
.sqv-root .sqv-loader .gp { stroke: var(--cico-mid-soft); }
.sqv-root .sqv-loader .b { stroke: var(--cico-outer); stroke-linecap: round; stroke-dasharray: 35.3 100; animation: sqvSpinL 1.3s linear infinite; }
.sqv-root .sqv-loader .g { stroke: var(--cico-mid); stroke-linecap: round; stroke-dasharray: 75.8 100; animation: sqvSpinR 2.1s linear infinite; }
.sqv-root .sqv-loader .r { stroke: var(--cico-inner); animation: sqvBreathe 1.3s ease-in-out infinite; }
@keyframes sqvSpinL { from { transform: rotate(117deg); } to { transform: rotate(-243deg); } }
@keyframes sqvSpinR { from { transform: rotate(36deg); } to { transform: rotate(396deg); } }
@keyframes sqvBreathe { 50% { transform: scale(0.9); } }
@media (prefers-reduced-motion: reduce) {
    .sqv-root .sqv-loader .b { animation-duration: 4s; }
    .sqv-root .sqv-loader .g { animation-duration: 6s; }
    .sqv-root .sqv-loader .r { animation: none; }
}
.sqv-root .sqv-stages { display: flex; align-items: center; flex-wrap: wrap; row-gap: 0.4rem; }
.sqv-root .sqv-stage { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; font-weight: 700; color: var(--sqv-muted); }
.sqv-root .sqv-dot { display: inline-flex; align-items: center; justify-content: center; padding: 6px; border-radius: 50%; background: var(--sqv-card); border: 1px solid var(--sqv-line); color: var(--sqv-muted); }
.sqv-root .sqv-dot svg { width: 18px; height: 18px; display: block; }
.sqv-root .sqv-stage.active { color: var(--sqv-text-1); }
.sqv-root .sqv-stage.active .sqv-dot { background: var(--sqv-go); border-color: var(--sqv-go); color: #fff; }
.sqv-root .sqv-stage.done .sqv-dot { background: #339966; border-color: #339966; color: #fff; }
.sqv-root .sqv-stage-line { width: 28px; height: 2px; margin: 0 0.5rem; border-radius: 2px; background: var(--sqv-line); flex-shrink: 0; }
.sqv-root .sqv-stage-line.done { background: #339966; }
.sqv-root .sqv-prog-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin-top: 0.85rem; }
.sqv-root .sqv-prog-text { font-size: 0.86rem; color: var(--sqv-text-2); min-width: 0; overflow-wrap: anywhere; }
.sqv-root .sqv-prog-pct { font-size: 0.95rem; font-weight: 800; color: var(--sqv-text-1); font-variant-numeric: tabular-nums; }
.sqv-root .sqv-bar { position: relative; height: 8px; margin-top: 0.5rem; border-radius: 999px; background: var(--sqv-line); overflow: hidden; }
.sqv-root .sqv-bar-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--sqv-go); border-radius: 999px; transition: width 0.2s; }

/* ---------- viewer head ---------- */
.sqv-root .sqv-filehead { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.sqv-root .sqv-fileicon { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--sqv-accent-soft); color: var(--sqv-accent); }
.sqv-root .sqv-fileicon svg { width: 22px; height: 22px; }
.sqv-root .sqv-filetext { flex: 1; min-width: 0; }
.sqv-root .sqv-filetext strong { display: block; font-size: 1.02rem; color: var(--sqv-text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sqv-root .sqv-filetext span { display: block; font-size: 0.82rem; color: var(--sqv-muted); }
.sqv-root .sqv-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.sqv-root .sqv-badge { display: inline-flex; align-items: center; gap: 0.35rem; width: auto; margin: 0; padding: 0.25rem 0.7rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; white-space: nowrap; background: var(--sqv-accent-soft); border: 1px solid var(--sqv-accent-line); color: var(--sqv-accent-strong); cursor: pointer; }
[data-theme="dark"] .sqv-root .sqv-badge { color: var(--sqv-accent); }
.sqv-root .sqv-badge svg { width: 14px; height: 14px; }
.sqv-root .sqv-badge.is-plain { cursor: default; background: var(--sqv-sunk); border-color: var(--sqv-line); color: var(--sqv-text-2); }
.sqv-root .sqv-badge.is-edit { cursor: default; background: rgba(217, 119, 6, 0.1); border-color: rgba(217, 119, 6, 0.4); color: var(--sqv-warn); }

/* notes */
.sqv-root .sqv-notes { display: grid; gap: 0.5rem; margin-top: 0.75rem; }
.sqv-root .sqv-note { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.65rem 0.9rem; border-radius: 12px; font-size: 0.86rem; line-height: 1.5; color: var(--sqv-text-1); background: rgba(51, 153, 204, 0.08); border: 1px solid rgba(51, 153, 204, 0.3); }
.sqv-root .sqv-note.is-warn { background: rgba(217, 119, 6, 0.08); border-color: rgba(217, 119, 6, 0.35); }
.sqv-root .sqv-note > svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: var(--sqv-accent); }
.sqv-root .sqv-note.is-warn > svg { color: var(--sqv-warn); }
.sqv-root .sqv-note > div { flex: 1; min-width: 0; }
.sqv-root .sqv-note p { margin: 0; overflow-wrap: anywhere; }
.sqv-root .sqv-note a { color: var(--sqv-accent-strong); font-weight: 600; }
[data-theme="dark"] .sqv-root .sqv-note a { color: var(--sqv-accent); }
.sqv-root .sqv-alts { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; align-items: center; }

/* ---------- toolbar ---------- */
.sqv-root .sqv-toolbar { position: relative; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.sqv-root .sqv-search { flex: 1; min-width: 260px; display: flex; align-items: center; gap: 0.2rem; height: 42px; padding: 0 0.3rem 0 0.7rem; border-radius: 10px; border: 1px solid var(--sqv-line); background: var(--input-bg, #fff); box-sizing: border-box; }
.sqv-root .sqv-search:focus-within { border-color: var(--sqv-accent); box-shadow: 0 0 0 3px var(--sqv-accent-soft); }
.sqv-root .sqv-search > svg { width: 16px; height: 16px; color: var(--sqv-muted); flex-shrink: 0; }
.sqv-root .sqv-search input { flex: 1; min-width: 0; width: auto; height: 100%; border: none; background: none; outline: none; box-shadow: none; color: var(--sqv-text-1); font-size: 0.9rem; padding: 0 0 0 0.4rem; margin: 0; }
.sqv-root .sqv-flag { display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: 28px; height: 28px; padding: 0 0.3rem; margin: 0; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--sqv-muted); font: 700 0.75rem var(--sqv-mono); cursor: pointer; flex-shrink: 0; }
.sqv-root .sqv-flag svg { width: 15px; height: 15px; }
.sqv-root .sqv-flag:hover { color: var(--sqv-text-1); }
.sqv-root .sqv-flag[aria-pressed="true"] { border-color: var(--sqv-accent); background: var(--sqv-accent-soft); color: var(--sqv-accent-strong); }
[data-theme="dark"] .sqv-root .sqv-flag[aria-pressed="true"] { color: var(--sqv-accent); }
.sqv-root .sqv-input { width: 150px; height: 36px; padding: 0 0.7rem; margin: 0; border: 1px solid var(--sqv-line); border-radius: 9px; background: var(--input-bg, #fff); color: var(--sqv-text-1); font: 0.88rem var(--sqv-mono); box-sizing: border-box; }
.sqv-root .sqv-input:focus { outline: none; border-color: var(--sqv-accent); box-shadow: 0 0 0 3px var(--sqv-accent-soft); }
.sqv-root .sqv-select { width: 100%; height: 40px; max-width: 100%; min-width: 0; padding: 0 0.6rem; margin: 0; border-radius: 9px; border: 1px solid var(--sqv-line); background: var(--input-bg, #fff); color: var(--sqv-text-1); font-size: 0.88rem; box-sizing: border-box; }

/* ---------- options (collapsed rows) ---------- */
.sqv-root .sqv-adv { border: 1px solid var(--sqv-line); border-radius: 12px; overflow: hidden; background: var(--sqv-card); margin-top: 0.75rem; }
.sqv-root .sqv-adv-row + .sqv-adv-row { border-top: 1px solid var(--sqv-line); }
.sqv-root .sqv-adv-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; width: 100%; min-height: 52px; box-sizing: border-box; padding: 0.55rem 1rem; margin: 0; border: none; background: none; cursor: pointer; text-align: left; color: var(--sqv-text-1); font-weight: 400; }
.sqv-root .sqv-adv-left { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.sqv-root .sqv-adv-left > svg { width: 18px; height: 18px; color: var(--sqv-accent); flex-shrink: 0; }
.sqv-root .sqv-adv-text { display: flex; flex-direction: column; min-width: 0; }
.sqv-root .sqv-adv-title { font-size: 0.9rem; font-weight: 700; }
.sqv-root .sqv-adv-hint { font-size: 0.76rem; color: var(--sqv-muted); line-height: 1.35; }
.sqv-root .sqv-adv-right { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.sqv-root .sqv-adv-value { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0.2rem 0.55rem; border-radius: 999px; background: var(--sqv-accent-soft); color: var(--sqv-accent-strong); font-size: 0.76rem; font-weight: 700; }
[data-theme="dark"] .sqv-root .sqv-adv-value { color: var(--sqv-accent); }
.sqv-root .sqv-chevron { width: 17px; height: 17px; color: var(--sqv-muted); transition: transform 0.2s; }
.sqv-root .sqv-adv-row.open .sqv-chevron { transform: rotate(180deg); }
.sqv-root .sqv-adv-row.open .sqv-adv-head, .sqv-root .sqv-adv-row.open .sqv-adv-body { background: var(--sqv-open); }
.sqv-root .sqv-adv-body { padding: 0.2rem 1rem 1rem; }
.sqv-root .sqv-adv-note { margin: 0.5rem 0 0; font-size: 0.78rem; color: var(--sqv-muted); line-height: 1.45; }
.sqv-root .sqv-size { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.5rem; }
.sqv-root .sqv-size-val { min-width: 48px; text-align: center; font-weight: 800; font-size: 0.86rem; color: var(--sqv-text-1); font-variant-numeric: tabular-nums; }
.sqv-root .sqv-switch-text { font-size: 0.74rem; font-weight: 800; color: var(--sqv-muted); min-width: 26px; text-align: right; }
/* switch - beats the global .tool-container checkbox rules */
.tool-container.sqv-root input[type="checkbox"].sqv-switch {
    -webkit-appearance: none !important; appearance: none !important; position: relative; flex-shrink: 0;
    width: 40px !important; height: 22px !important; margin: 0 !important; padding: 0 !important;
    border: none !important; border-radius: 999px !important; background: #cbd5e1 !important; box-shadow: none !important; cursor: pointer; transition: background 0.2s;
}
[data-theme="dark"] .tool-container.sqv-root input[type="checkbox"].sqv-switch { background: #475569 !important; }
.tool-container.sqv-root input[type="checkbox"].sqv-switch::after, .tool-container.sqv-root input[type="checkbox"].sqv-switch:checked::after {
    content: '' !important; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; transform: none !important; transition: left 0.2s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); font-size: 0; line-height: 0; border: none;
}
.tool-container.sqv-root input[type="checkbox"].sqv-switch:checked { background: var(--sqv-go) !important; }
.tool-container.sqv-root input[type="checkbox"].sqv-switch:checked::after { left: 21px; }
.tool-container.sqv-root input[type="checkbox"].sqv-switch:focus-visible { outline: 3px solid var(--sqv-accent-line); outline-offset: 2px; }

/* action bar */
.sqv-root .sqv-actionbar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--sqv-line); }
.sqv-root .sqv-actionbar .sqv-btn-ghost { min-height: 40px; padding: 0.4rem 0.7rem; font-size: 0.86rem; gap: 0.35rem; }
.sqv-root .sqv-actionbar .sqv-btn-ghost svg { width: 16px; height: 16px; }
.sqv-root .sqv-actionbar .sqv-go { margin-left: auto; }
.sqv-root .sqv-dl-hint { font-weight: 600; font-size: 0.8rem; opacity: 0.85; }

/* toast */
.sqv-root .sqv-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 10003; max-width: calc(100vw - 32px); box-sizing: border-box; padding: 0.55rem 1rem; border-radius: 10px; background: #1e293b; color: #fff; font-size: 0.86rem; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); transition: opacity 0.25s; text-align: center; }
[data-theme="dark"] .sqv-root .sqv-toast { background: #e2e8f0; color: #0f172a; }
.sqv-root .sqv-toast.is-out { opacity: 0; }

/* ---------- content ---------- */
.sqv-root .sqv-info { margin-top: 2rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
.sqv-root .sqv-info > * { min-width: 0; }
.sqv-root .sqv-info-card { background: var(--bg-elevated, #fff); border: 1px solid var(--sqv-line); border-radius: var(--radius-md, 12px); padding: 1.4rem 1.5rem; }
.sqv-root .sqv-info-card h2 { display: flex; align-items: center; gap: 0.55rem; margin: 0 0 0.9rem; font-size: 1.25rem; color: var(--sqv-text-1); }
.sqv-root .sqv-info-card h2 svg { width: 22px; height: 22px; color: var(--sqv-accent); flex-shrink: 0; }
.sqv-root .sqv-info-card h3 { margin: 1.2rem 0 0.5rem; font-size: 1.05rem; color: var(--sqv-text-1); }
.sqv-root .sqv-info-card p, .sqv-root .sqv-info-card li { color: var(--sqv-text-2); line-height: 1.65; font-size: 0.97rem; }
.sqv-root .sqv-info-card p { margin: 0.8rem 0 0; }
.sqv-root .sqv-info-card h2 + p { margin-top: 0; }
.sqv-root .sqv-info a { color: var(--sqv-accent-strong); font-weight: 500; }
[data-theme="dark"] .sqv-root .sqv-info a { color: var(--sqv-accent); }
.sqv-root .sqv-steps, .sqv-root .sqv-list { margin: 0; padding-left: 1.3rem; display: grid; gap: 0.45rem; }
.sqv-root .sqv-features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.sqv-root .sqv-feature { padding: 0.9rem 1rem; border-radius: 12px; border: 1px solid var(--sqv-line); background: var(--sqv-open); min-width: 0; }
.sqv-root .sqv-feature > svg { width: 20px; height: 20px; color: var(--sqv-accent); }
.sqv-root .sqv-info-card .sqv-feature h3 { margin: 0.35rem 0 0.2rem; font-size: 0.95rem; }
.sqv-root .sqv-info-card .sqv-feature p { margin: 0; font-size: 0.88rem; line-height: 1.55; }
.sqv-root .sqv-table-wrap { overflow-x: auto; border: 1px solid var(--sqv-line); border-radius: 10px; margin-top: 0.9rem; }
.sqv-root .sqv-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 520px; margin: 0; }
.sqv-root .sqv-table th, .sqv-root .sqv-table td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid var(--sqv-line); color: var(--sqv-text-2); vertical-align: top; }
.sqv-root .sqv-table th { background: var(--sqv-sunk); color: var(--sqv-text-1); font-weight: 700; font-size: 0.82rem; }
.sqv-root .sqv-table tr:last-child td { border-bottom: none; }
.sqv-root .sqv-table td:first-child { font-weight: 700; color: var(--sqv-text-1); white-space: nowrap; }
.sqv-root .sqv-keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem 1rem; margin-top: 0.9rem; padding: 0; list-style: none; }
.sqv-root .sqv-keys li { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.35rem 0.6rem; border-radius: 8px; background: var(--sqv-open); font-size: 0.88rem; min-width: 0; }
.sqv-root .sqv-keys li span:last-child { text-align: right; white-space: nowrap; }
.sqv-root .sqv-faq .faq-question svg { width: 18px; height: 18px; flex-shrink: 0; }


/* ============================================================
   Log viewer components
   ============================================================ */
.sqv-root {
    --sqv-lv0: #94a3b8; --sqv-lv1: #64748b; --sqv-lv2: #3399cc; --sqv-lv3: #d97706; --sqv-lv4: #e64e4e; --sqv-lv5: #9f1239; --sqv-lv6: #cbd5e1;
    --sqv-row-fatal: rgba(159, 18, 57, 0.08);
    --sqv-rh: 30px;
    --sqv-sel: rgba(51, 153, 204, 0.16);
    --sqv-hover: rgba(51, 153, 204, 0.06);
    --sqv-ok: #2f8f5f;
}
[data-theme="dark"] .sqv-root {
    --sqv-lv0: #64748b; --sqv-lv1: #94a3b8; --sqv-lv2: #60a5fa; --sqv-lv3: #fbbf24; --sqv-lv4: #f87171; --sqv-lv5: #fb7185; --sqv-lv6: #475569;
    --sqv-row-fatal: rgba(251, 113, 133, 0.12);
    --sqv-sel: rgba(96, 165, 250, 0.2);
    --sqv-hover: rgba(96, 165, 250, 0.07);
    --sqv-ok: #4ade80;
}
.sqv-root.tool-container { max-width: 1200px; }
.sqv-root .sqv-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sqv-root .sqv-viewer { padding: 1.1rem; }

/* live parsing bar (big files) */

/* ---------- filters ---------- */
.sqv-root .sqv-filters { margin-top: 0.85rem; }
.sqv-root .sqv-filters .sqv-toolbar { margin-top: 0; }
.sqv-root .sqv-search-busy { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--sqv-line); border-top-color: var(--sqv-accent); animation: sqvSpinR 0.8s linear infinite; flex-shrink: 0; margin-right: 0.2rem; }
    display: inline-flex; align-items: center; gap: 0.4rem; width: auto; min-height: 32px; padding: 0.2rem 0.65rem 0.2rem 0.5rem; margin: 0;
    border-radius: 999px; border: 1px solid var(--sqv-line); background: var(--sqv-card); color: var(--sqv-text-1); font-size: 0.8rem; font-weight: 700; cursor: pointer;
}
.sqv-root .sqv-qlabel { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sqv-muted); margin-right: 0.15rem; }
.sqv-root .sqv-qchip { display: inline-flex; align-items: center; gap: 0.35rem; width: auto; min-height: 30px; padding: 0.15rem 0.65rem; margin: 0; border-radius: 999px; border: 1px dashed var(--sqv-accent-line); background: none; color: var(--sqv-accent-strong); font-size: 0.78rem; font-weight: 700; cursor: pointer; }
[data-theme="dark"] .sqv-root .sqv-qchip { color: var(--sqv-accent); }
.sqv-root .sqv-qchip svg { width: 14px; height: 14px; }
.sqv-root .sqv-qchip:hover { background: var(--sqv-accent-soft); }
.sqv-root .sqv-qchip[aria-pressed="true"] { border-style: solid; border-color: var(--sqv-accent); background: var(--sqv-accent-soft); }

/* pop-overs and menus */
.sqv-root .sqv-pop-wrap { position: relative; display: inline-flex; }
.sqv-root .sqv-pop { position: absolute; left: 0; top: calc(100% + 6px); z-index: 40; padding: 0.7rem; border-radius: 14px; border: 1px solid var(--sqv-line); background: var(--sqv-card); box-shadow: 0 14px 40px rgba(15, 23, 42, 0.2); }
.sqv-root .sqv-pop.sqv-menu-up { top: auto; bottom: calc(100% + 6px); }
.sqv-root .sqv-pop.sqv-menu-right, .sqv-root .sqv-tabs-right .sqv-pop { left: auto; right: 0; }
.sqv-root .sqv-menu { padding: 0.35rem; min-width: 280px; display: grid; gap: 0.15rem; }
.sqv-root .sqv-menu button { display: flex; align-items: flex-start; gap: 0.65rem; width: 100%; margin: 0; padding: 0.55rem 0.7rem; border: none; border-radius: 9px; background: none; color: var(--sqv-text-1); text-align: left; cursor: pointer; font: inherit; }
.sqv-root .sqv-menu button:hover, .sqv-root .sqv-menu button:focus-visible { background: var(--sqv-accent-soft); }
.sqv-root .sqv-menu button > svg { width: 18px; height: 18px; color: var(--sqv-accent); flex-shrink: 0; margin-top: 2px; }
.sqv-root .sqv-menu strong { display: block; font-size: 0.88rem; }
.sqv-root .sqv-menu small { display: block; font-size: 0.75rem; color: var(--sqv-muted); line-height: 1.35; }
.sqv-root .sqv-goto { display: flex; align-items: center; gap: 0.4rem; flex-wrap: nowrap; }
.sqv-root .sqv-goto .sqv-input { width: 120px; }
.sqv-root .sqv-goto-file { width: 150px; height: 36px; }

/* ---------- tabs ---------- */
.sqv-root .sqv-tabsbar { display: flex; align-items: center; gap: 0.5rem 0.75rem; flex-wrap: wrap; margin-top: 0.9rem; }
.sqv-root .sqv-tabs { display: inline-flex; padding: 0.2rem; gap: 0.2rem; border-radius: 11px; background: var(--sqv-sunk); border: 1px solid var(--sqv-line); }
.sqv-root .sqv-tab { display: inline-flex; align-items: center; gap: 0.4rem; width: auto; min-height: 34px; padding: 0.25rem 0.85rem; margin: 0; border: none; border-radius: 8px; background: none; color: var(--sqv-muted); font-size: 0.86rem; font-weight: 700; cursor: pointer; }
.sqv-root .sqv-tab svg { width: 16px; height: 16px; }
.sqv-root .sqv-tab:hover { color: var(--sqv-text-1); }
.sqv-root .sqv-tab.is-active { background: var(--sqv-card); color: var(--sqv-accent-strong); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
[data-theme="dark"] .sqv-root .sqv-tab.is-active { color: var(--sqv-accent); background: #26334a; }
.sqv-root .sqv-count { font-size: 0.84rem; color: var(--sqv-text-2); font-variant-numeric: tabular-nums; min-width: 0; }
.sqv-root .sqv-count strong { color: var(--sqv-text-1); }
.sqv-root .sqv-tabs-right { display: flex; gap: 0.4rem; margin-left: auto; }
.sqv-root .sqv-adv-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }

/* ---------- panel ---------- */
.sqv-root .sqv-panel { position: relative; margin-top: 0.75rem; border: 1px solid var(--sqv-line); border-radius: 14px; overflow: hidden; background: var(--sqv-bg); }
.sqv-root .sqv-panel.is-full { position: fixed; inset: 10px; z-index: 10000; margin: 0; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }
.sqv-root .sqv-panel.is-full .sqv-scroll, .sqv-root .sqv-panel.is-full .sqv-insights { flex: 1; height: auto; min-height: 0; }
body.sqv-noscroll { overflow: hidden; }
.sqv-root .sqv-full-btn { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 22px; padding: 0; margin: 0 0 0 0.6rem; border-radius: 6px; border: 1px solid var(--sqv-line); background: var(--sqv-card); color: var(--sqv-text-2); cursor: pointer; flex-shrink: 0; }
.sqv-root .sqv-status-r { display: inline-flex; align-items: center; margin-left: auto; }
.sqv-root .sqv-full-btn:hover { color: var(--sqv-text-1); border-color: var(--sqv-accent-line); opacity: 1; }
.sqv-root .sqv-full-btn svg { width: 14px; height: 14px; }
.sqv-root .sqv-scroll { position: relative; height: 560px; overflow: auto; outline: none; overscroll-behavior: contain; background: var(--sqv-bg); color: var(--sqv-fg); }
.sqv-root .sqv-scroll:focus-visible { box-shadow: inset 0 0 0 2px var(--sqv-accent-line); }
.sqv-root .sqv-space { position: relative; min-width: 100%; }
.sqv-root .sqv-layer { position: absolute; top: 0; left: 0; min-width: 100%; will-change: transform; }

/* table */
.sqv-root .sqv-thead, .sqv-root .sqv-tr { display: grid; grid-template-columns: var(--sqv-cols, 1fr); min-width: var(--sqv-tw, 100%); }
.sqv-root .sqv-thead { position: sticky; top: 0; z-index: 3; background: var(--sqv-gut); border-bottom: 1px solid var(--sqv-gut-line); }
.sqv-root .sqv-th { position: relative; display: flex; align-items: center; gap: 0.3rem; min-width: 0; height: 34px; padding: 0 0.6rem; box-sizing: border-box; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.02em; color: var(--sqv-text-2); white-space: nowrap; overflow: hidden; user-select: none; -webkit-user-select: none; }
.sqv-root .sqv-th > span { overflow: hidden; text-overflow: ellipsis; }
.sqv-root .sqv-th.is-sortable { cursor: pointer; }
.sqv-root .sqv-th.is-sortable:hover { color: var(--sqv-text-1); background: var(--sqv-hover); }
.sqv-root .sqv-th svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--sqv-accent); }
.sqv-root .sqv-th.is-sorted { color: var(--sqv-accent-strong); }
[data-theme="dark"] .sqv-root .sqv-th.is-sorted { color: var(--sqv-accent); }
.sqv-root .sqv-th .sqv-rs { position: absolute; top: 0; right: 0; width: 9px; height: 100%; cursor: col-resize; touch-action: none; z-index: 2; }
.sqv-root .sqv-th .sqv-rs::after { content: ""; position: absolute; top: 8px; bottom: 8px; right: 3px; width: 2px; border-radius: 2px; background: var(--sqv-gut-line); }
.sqv-root .sqv-th .sqv-rs:hover::after, .sqv-root .sqv-th .sqv-rs.is-drag::after { background: var(--sqv-accent); }
.sqv-root .sqv-tr { height: var(--sqv-rh); align-items: center; border-bottom: 1px solid var(--sqv-gut-line); cursor: pointer; box-sizing: border-box; }
.sqv-root .sqv-tr:hover { background: var(--sqv-hover); }
.sqv-root .sqv-td { min-width: 0; padding: 0 0.6rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 12.5px/1.35 var(--sqv-mono); color: var(--sqv-fg); box-sizing: border-box; }
.sqv-root .sqv-td.is-num { text-align: right; font-variant-numeric: tabular-nums; }
.sqv-root .sqv-td.is-time { color: var(--sqv-ts); }
.sqv-root .sqv-td.is-inf { color: var(--sqv-muted); font-style: italic; }
.sqv-root .sqv-td.is-msg { font-family: var(--sqv-mono); }
.sqv-root .sqv-td.is-file { color: var(--sqv-muted); }
.sqv-root.is-wrap .sqv-tr { --sqv-rh: 48px; }
.sqv-root.is-wrap .sqv-td.is-msg { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; line-height: 1.35; }
.sqv-root mark.sqv-hit { background: var(--sqv-hit); color: inherit; border-radius: 2px; padding: 0; }

/* raw lines */
.sqv-root .sqv-g { position: sticky; left: 0; z-index: 1; display: flex; align-items: center; justify-content: flex-end; gap: 0.35rem; flex-shrink: 0; min-width: var(--sqv-gw, 5ch); padding: 0 0.6rem 0 0.4rem; box-sizing: content-box; background: var(--sqv-gut); color: var(--sqv-gut-t); border-right: 1px solid var(--sqv-gut-line); font-size: 0.82em; font-variant-numeric: tabular-nums; user-select: none; -webkit-user-select: none; }
.sqv-root .sqv-g i { width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0; }
.sqv-root .sqv-c { padding: 0 1.4rem 0 0.7rem; }
.sqv-root .sqv-ts { color: var(--sqv-ts); }

/* empty state */
.sqv-root .sqv-empty { position: absolute; left: 0; right: 0; top: 34px; bottom: 28px; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.45rem; padding: 2rem; text-align: center; color: var(--sqv-muted); font-size: 0.9rem; background: var(--sqv-bg); }
.sqv-root .sqv-empty svg { width: 34px; height: 34px; color: var(--sqv-accent); }
.sqv-root .sqv-empty strong { color: var(--sqv-text-1); }
.sqv-root .sqv-status { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem 1rem; flex-wrap: wrap; min-height: 28px; box-sizing: border-box; padding: 0.2rem 0.5rem 0.2rem 0.85rem; border-top: 1px solid var(--sqv-line); background: var(--sqv-sunk); font-size: 0.76rem; color: var(--sqv-muted); font-variant-numeric: tabular-nums; }
.sqv-root .sqv-status span { min-width: 0; overflow-wrap: anywhere; }

/* details drawer */
.sqv-root .sqv-details { position: absolute; top: 0; right: 0; bottom: 28px; z-index: 6; width: min(500px, 100%); display: flex; flex-direction: column; background: var(--sqv-card); border-left: 1px solid var(--sqv-line); box-shadow: -12px 0 30px rgba(15, 23, 42, 0.14); }
.sqv-root .sqv-det-head { display: flex; align-items: center; gap: 0.25rem; padding: 0.5rem 0.5rem 0.5rem 0.9rem; border-bottom: 1px solid var(--sqv-line); }
.sqv-root .sqv-det-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; font-weight: 700; color: var(--sqv-text-1); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sqv-root .sqv-det-body { flex: 1; overflow: auto; padding: 0.85rem 0.95rem 1.2rem; overscroll-behavior: contain; }
.sqv-root .sqv-det-sec + .sqv-det-sec { margin-top: 1rem; }
.sqv-root .sqv-det-sec h4 { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 0 0 0.4rem; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sqv-muted); }
.sqv-root .sqv-pre { margin: 0; padding: 0.65rem 0.75rem; border-radius: 10px; background: var(--sqv-gut); border: 1px solid var(--sqv-gut-line); font: 12.5px/1.55 var(--sqv-mono); color: var(--sqv-fg); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; tab-size: 4; }
.sqv-root .sqv-pre.is-msg { max-height: 420px; }
.sqv-root .sqv-kv { width: 100%; border-collapse: collapse; font-size: 0.82rem; margin: 0; table-layout: fixed; }
.sqv-root .sqv-kv th, .sqv-root .sqv-kv td { padding: 0.35rem 0.4rem; border-bottom: 1px solid var(--sqv-line); text-align: left; vertical-align: top; }
.sqv-root .sqv-kv th { width: 34%; color: var(--sqv-text-2); font-weight: 700; overflow-wrap: anywhere; }
.sqv-root .sqv-kv td { font-family: var(--sqv-mono); font-size: 0.8rem; color: var(--sqv-text-1); overflow-wrap: anywhere; }
.sqv-root .sqv-kv td.sqv-kv-act { width: 62px; padding: 0.2rem 0; text-align: right; white-space: nowrap; }
.sqv-root .sqv-kv .sqv-icon-btn { width: 26px; height: 26px; }
.sqv-root .sqv-kv .sqv-icon-btn svg { width: 14px; height: 14px; }
.sqv-root .sqv-det-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
.sqv-root .sqv-j-k { color: var(--sqv-i); } .sqv-root .sqv-j-s { color: var(--sqv-ok); } .sqv-root .sqv-j-n { color: var(--sqv-w); } .sqv-root .sqv-j-b { color: var(--sqv-e); }
.sqv-root .sqv-det-meta { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.sqv-root .sqv-det-meta span { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.5rem; border-radius: 999px; background: var(--sqv-sunk); border: 1px solid var(--sqv-line); font-size: 0.76rem; color: var(--sqv-text-2); max-width: 100%; overflow-wrap: anywhere; }
.sqv-root .sqv-det-meta svg { width: 13px; height: 13px; color: var(--sqv-accent); flex-shrink: 0; }

/* insights */
.sqv-root .sqv-insights { height: 560px; overflow: auto; padding: 1rem; box-sizing: border-box; background: var(--sqv-open); overscroll-behavior: contain; }
.sqv-root .sqv-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; margin-bottom: 0.9rem; }
.sqv-root .sqv-kpi { padding: 0.7rem 0.8rem; border-radius: 12px; background: var(--sqv-card); border: 1px solid var(--sqv-line); min-width: 0; }
.sqv-root .sqv-kpi span { display: block; font-size: 0.72rem; font-weight: 700; color: var(--sqv-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.sqv-root .sqv-kpi strong { display: block; margin-top: 0.15rem; font-size: 1.15rem; color: var(--sqv-text-1); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sqv-root .sqv-kpi small { display: block; font-size: 0.72rem; color: var(--sqv-muted); overflow-wrap: anywhere; }
.sqv-root .sqv-kpi.is-bad strong { color: var(--sqv-e); }
.sqv-root .sqv-ins-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; align-items: start; }
.sqv-root .sqv-ins-card { padding: 0.85rem 0.95rem; border-radius: 12px; background: var(--sqv-card); border: 1px solid var(--sqv-line); min-width: 0; }
.sqv-root .sqv-ins-card.is-wide { grid-column: 1 / -1; }
.sqv-root .sqv-ins-card h3 { display: flex; align-items: center; gap: 0.45rem; margin: 0 0 0.6rem; font-size: 0.92rem; color: var(--sqv-text-1); }
.sqv-root .sqv-ins-card h3 svg { width: 16px; height: 16px; color: var(--sqv-accent); flex-shrink: 0; }
.sqv-root .sqv-ins-card h3 small { margin-left: auto; font-size: 0.74rem; font-weight: 600; color: var(--sqv-muted); }
.sqv-root .sqv-blist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.2rem; }
.sqv-root .sqv-blist li { position: relative; }
.sqv-root .sqv-blist button { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.6rem; align-items: center; width: 100%; margin: 0; padding: 0.3rem 0.5rem; border: none; border-radius: 7px; background: none; color: var(--sqv-text-1); cursor: pointer; text-align: left; font: 12.5px/1.4 var(--sqv-mono); overflow: hidden; }
.sqv-root .sqv-blist button:hover { background: var(--sqv-hover); }
.sqv-root .sqv-blist .sqv-bar-bg { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 7px; background: var(--sqv-accent-soft); pointer-events: none; }
.sqv-root .sqv-blist .sqv-bl-t { position: relative; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sqv-root .sqv-blist .sqv-bl-n { position: relative; font-family: system-ui, sans-serif; font-size: 0.78rem; font-weight: 700; color: var(--sqv-text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sqv-root .sqv-ins-empty { font-size: 0.84rem; color: var(--sqv-muted); margin: 0; }
.sqv-root .sqv-ins-loading { display: flex; align-items: center; gap: 0.6rem; font-size: 0.86rem; color: var(--sqv-muted); }

/* action bar */
.sqv-root .sqv-actionbar .sqv-export-wrap { margin-left: auto; }
.sqv-root .sqv-actionbar .sqv-go { margin-left: 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .sqv-root .sqv-ins-grid { grid-template-columns: minmax(0, 1fr); }
    .sqv-root .sqv-details { width: 100%; }
}
@media (max-width: 760px) {
    .sqv-root .sqv-search { flex-basis: 100%; min-width: 0; }
    .sqv-root .sqv-filters .sqv-toolbar .sqv-pop-wrap { flex: 1; }
    .sqv-root .sqv-filters .sqv-toolbar .sqv-pop-wrap > .sqv-btn { flex: 1; }
}
@media (max-width: 600px) {
    .sqv-root.tool-container { padding: 1.1rem 16px; }
    .sqv-root .tool-title { font-size: 1.55rem; }
    .sqv-root .sqv-title-icon { width: 46px; height: 46px; border-radius: 13px; }
    .sqv-root .sqv-title-icon svg { width: 25px; height: 25px; }
    .sqv-root .tool-description { font-size: 0.98rem; }
    .sqv-root .sqv-card { padding: 1rem; border-radius: 16px; }
    .sqv-root .sqv-viewer { padding: 0.85rem; }
    .sqv-root .sqv-drop { min-height: 150px; }
    .sqv-root .sqv-kbd-hint { display: none; }
    .sqv-root .sqv-input-bar .sqv-go { flex: 1 1 100%; }
    .sqv-root .sqv-input-bar .sqv-btn-ghost { flex: 1; }
    .sqv-root .sqv-search { gap: 0.05rem; padding-left: 0.55rem; }
    .sqv-root .sqv-flag { min-width: 26px; padding: 0 0.15rem; }
    .sqv-root .sqv-timeline { padding: 0.6rem 0.6rem 0.5rem; }
    .sqv-root .sqv-tabsbar { gap: 0.5rem; }
    .sqv-root .sqv-tabs { flex: 1 1 100%; }
    .sqv-root .sqv-tab { flex: 1; justify-content: center; padding: 0.25rem 0.4rem; }
    .sqv-root .sqv-tabs-right { margin-left: auto; }
    .sqv-root .sqv-tabs-right .sqv-btn span { display: none; }
    .sqv-root .sqv-count { flex: 1; font-size: 0.8rem; }
    .sqv-root .sqv-adv-head { padding: 0.55rem 0.75rem; }
    .sqv-root .sqv-adv-hint { display: none; }
    .sqv-root .sqv-adv-value { max-width: 110px; }
    .sqv-root .sqv-scroll, .sqv-root .sqv-insights { height: 470px; }
    .sqv-root .sqv-insights { padding: 0.7rem; }
    .sqv-root .sqv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sqv-root .sqv-actionbar .sqv-export-wrap { flex: 1 1 100%; order: -1; margin-left: 0; }
    .sqv-root .sqv-actionbar .sqv-export-wrap .sqv-btn { width: 100%; }
    .sqv-root .sqv-actionbar > .sqv-btn-ghost, .sqv-root .sqv-actionbar > .sqv-pop-wrap:not(.sqv-export-wrap) { flex: 1 1 calc(33% - 0.5rem); }
    .sqv-root .sqv-actionbar > .sqv-pop-wrap:not(.sqv-export-wrap) > .sqv-btn { width: 100%; }
    .sqv-root .sqv-actionbar .sqv-btn-ghost { padding: 0.45rem 0.4rem; }
    .sqv-root .sqv-menu { min-width: 0; width: calc(100vw - 64px); max-width: 340px; }
    .sqv-root .sqv-pop.sqv-menu-right { right: 0; }
    .sqv-root .sqv-actionbar > .sqv-pop-wrap:not(.sqv-export-wrap) .sqv-pop { left: 0; right: auto; }
    .sqv-root .sqv-features, .sqv-root .sqv-keys { grid-template-columns: minmax(0, 1fr); }
    .sqv-root .sqv-info-card { padding: 1.1rem; }
    .sqv-root .sqv-stage .sqv-lbl { display: none; }
    .sqv-root .sqv-stage-line { width: 20px; margin: 0 0.3rem; }
    .sqv-root .sqv-panel.is-full { inset: 0; border-radius: 0; }
    .sqv-root .sqv-goto { flex-wrap: wrap; width: 250px; }
}


/* ============================================================
   SQL viewer components
   ============================================================ */
.sqv-root {
    --sqv-fs: 13px;
    --sqv-rowh: 20px;
    --sqv-gh: 28px;
    --sqv-stmt: rgba(51, 153, 204, 0.07);
    /* syntax colours (light) */
    --sqv-t-kw: #1c64a8;
    --sqv-t-ty: #0f7a8a;
    --sqv-t-fn: #7c3aed;
    --sqv-t-str: #23744d;
    --sqv-t-num: #b45309;
    --sqv-t-cm: #7b8496;
    --sqv-t-id: #9d2a6c;
    --sqv-t-var: #c2410c;
    --sqv-t-ver: #94a3b8;
    --sqv-t-cp: #475569;
    --sqv-null: #94a3b8;
}
[data-theme="dark"] .sqv-root {
    --sqv-stmt: rgba(96, 165, 250, 0.09);
    --sqv-t-kw: #7cb7ff;
    --sqv-t-ty: #5eead4;
    --sqv-t-fn: #c4b5fd;
    --sqv-t-str: #86efac;
    --sqv-t-num: #fbbf24;
    --sqv-t-cm: #7c8aa3;
    --sqv-t-id: #f0abfc;
    --sqv-t-var: #fdba74;
    --sqv-t-ver: #64748b;
    --sqv-t-cp: #a5b4c8;
    --sqv-null: #64748b;
}
.sqv-root.tool-container { max-width: 1200px; }
.sqv-root .sqv-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sqv-root .sqv-viewer { padding: 1.1rem; }
.sqv-root .sqv-push { margin-left: auto; }
.sqv-root .sqv-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.sqv-root .sqv-sub { display: block; margin: 0.4rem 0 0.35rem; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--sqv-muted); }
.sqv-root .sqv-sub:first-child { margin-top: 0; }

/* stats under the file name */
.sqv-root .sqv-stats { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.8rem; }
.sqv-root .sqv-stat { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.7rem; border-radius: 10px; background: var(--sqv-open); border: 1px solid var(--sqv-line); font-size: 0.8rem; color: var(--sqv-text-2); min-width: 0; }
.sqv-root .sqv-stat svg { width: 15px; height: 15px; color: var(--sqv-accent); flex-shrink: 0; }
.sqv-root .sqv-stat strong { color: var(--sqv-text-1); font-variant-numeric: tabular-nums; }
.sqv-root button.sqv-stat { cursor: pointer; width: auto; margin: 0; font: inherit; font-size: 0.8rem; }
.sqv-root button.sqv-stat:hover { border-color: var(--sqv-accent-line); }

/* segmented toggle */
.sqv-root .sqv-seg { display: inline-flex; padding: 0.18rem; gap: 0.18rem; border-radius: 11px; background: var(--sqv-sunk); border: 1px solid var(--sqv-line); flex-shrink: 0; }
.sqv-root .sqv-seg-opt { display: inline-flex; align-items: center; gap: 0.35rem; width: auto; min-height: 34px; padding: 0.2rem 0.75rem; margin: 0; border: none; border-radius: 8px; background: none; color: var(--sqv-muted); font-size: 0.84rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.sqv-root .sqv-seg-opt svg { width: 15px; height: 15px; }
.sqv-root .sqv-seg-opt:hover { color: var(--sqv-text-1); }
.sqv-root .sqv-seg-opt.is-active { background: var(--sqv-card); color: var(--sqv-accent-strong); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
[data-theme="dark"] .sqv-root .sqv-seg-opt.is-active { color: var(--sqv-accent); background: #26334a; }
.sqv-root .sqv-search-count { font-size: 0.76rem; font-weight: 700; color: var(--sqv-muted); white-space: nowrap; font-variant-numeric: tabular-nums; padding: 0 0.2rem; }
.sqv-root .sqv-search-count.is-bad { color: var(--sqv-red); }
.sqv-root .sqv-search .sqv-icon-btn { width: 28px; height: 28px; }
.sqv-root .sqv-search-sm { height: 38px; min-width: 0; flex: none; }
.sqv-root .sqv-col-pick { width: auto; max-width: 130px; height: 30px; margin: 0; padding: 0 0.3rem; border: 1px solid var(--sqv-line); border-radius: 7px; background: var(--sqv-card); color: var(--sqv-text-2); font-size: 0.78rem; box-sizing: border-box; }
.sqv-root .sqv-table-pick { width: auto; min-width: 180px; max-width: 320px; height: 42px; flex: 0 1 auto; }
.sqv-root .sqv-pane { margin-top: 0.25rem; }

/* ---------- code view ---------- */
.sqv-root .sqv-view { position: relative; height: 560px; overflow: auto; outline: none; overscroll-behavior: contain; background: var(--sqv-bg); color: var(--sqv-fg); font: var(--sqv-fs)/var(--sqv-rowh) var(--sqv-mono); tab-size: 4; }
.sqv-root .sqv-view:focus-visible { box-shadow: inset 0 0 0 2px var(--sqv-accent-line); }
.sqv-root .sqv-space { position: relative; width: 1px; }
.sqv-root .sqv-win { position: absolute; top: 0; left: 0; min-width: 100%; will-change: transform; }
.sqv-root .sqv-l { display: flex; min-height: var(--sqv-rowh); white-space: pre; cursor: text; }
.sqv-root .sqv-l.is-load .sqv-c::after { content: ""; display: inline-block; width: 40%; height: 8px; border-radius: 4px; background: var(--sqv-sunk); vertical-align: middle; }
.sqv-root .sqv-l.is-stmt { background: var(--sqv-stmt); }
.sqv-root .sqv-l.is-cur { background: var(--sqv-sel); }
.sqv-root .sqv-view .sqv-g { min-width: var(--sqv-gd, 4ch); align-self: stretch; align-items: flex-start; justify-content: flex-end; cursor: pointer; }
.sqv-root .sqv-view .sqv-c { padding: 0 1.5rem 0 0.75rem; }
.sqv-root .sqv-view.is-wrap .sqv-l { white-space: pre-wrap; }
.sqv-root .sqv-view.is-wrap .sqv-c { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sqv-root .sqv-view.is-wrap .sqv-win { right: 0; }
.sqv-root .sqv-trunc { color: var(--sqv-muted); font-style: italic; font-family: system-ui, sans-serif; font-size: 0.85em; }
.sqv-root .sqv-t-kw { color: var(--sqv-t-kw); font-weight: 600; }
.sqv-root .sqv-t-ty { color: var(--sqv-t-ty); }
.sqv-root .sqv-t-fn { color: var(--sqv-t-fn); }
.sqv-root .sqv-t-str { color: var(--sqv-t-str); }
.sqv-root .sqv-t-num { color: var(--sqv-t-num); }
.sqv-root .sqv-t-cm { color: var(--sqv-t-cm); font-style: italic; }
.sqv-root .sqv-t-id { color: var(--sqv-t-id); }
.sqv-root .sqv-t-var { color: var(--sqv-t-var); }
.sqv-root .sqv-t-ver { color: var(--sqv-t-ver); }
.sqv-root .sqv-t-cp { color: var(--sqv-t-cp); }
.sqv-root .sqv-t-dl { color: var(--sqv-t-str); }
.sqv-root mark.sqv-hit { background: var(--sqv-hit); color: inherit; border-radius: 2px; padding: 0; }
.sqv-root mark.sqv-hit.is-cur { background: var(--sqv-hit-cur); color: #111827; box-shadow: 0 0 0 1px #ca8a04; }
.sqv-root .sqv-stmtbar { display: flex; align-items: center; gap: 0.4rem 0.8rem; flex-wrap: wrap; padding: 0.35rem 0.5rem 0.35rem 0.85rem; border-top: 1px solid var(--sqv-line); background: var(--sqv-card); font-size: 0.82rem; color: var(--sqv-text-2); }
.sqv-root .sqv-stmt-info { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.sqv-root .sqv-stmt-info strong { color: var(--sqv-text-1); }
.sqv-root .sqv-stmt-acts { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.15rem; }
.sqv-root .sqv-stmt-acts .sqv-text-btn { min-height: 30px; padding: 0.2rem 0.5rem; font-size: 0.8rem; }

/* ---------- structure ---------- */
.sqv-root .sqv-struct { display: grid; grid-template-columns: 270px minmax(0, 1fr); height: 620px; border: 1px solid var(--sqv-line); border-radius: 14px; overflow: hidden; background: var(--sqv-card); margin-top: 0.75rem; }
.sqv-root .sqv-outline { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; min-height: 0; padding: 0.6rem; border-right: 1px solid var(--sqv-line); background: var(--sqv-open); }
.sqv-root .sqv-outline .sqv-search { min-width: 0; }
.sqv-root .sqv-outline-list { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; margin: 0 -0.3rem; padding: 0 0.3rem; }
.sqv-root .sqv-og { margin: 0.5rem 0 0.2rem; padding: 0 0.4rem; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sqv-muted); display: flex; justify-content: space-between; gap: 0.4rem; }
.sqv-root .sqv-og:first-child { margin-top: 0.1rem; }
.sqv-root .sqv-oi { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 0.45rem; width: 100%; min-height: 32px; margin: 0; padding: 0.2rem 0.5rem; border: none; border-radius: 8px; background: none; color: var(--sqv-text-1); text-align: left; cursor: pointer; font-size: 0.84rem; }
.sqv-root .sqv-oi:hover { background: var(--sqv-hover); }
.sqv-root .sqv-oi.is-active { background: var(--sqv-accent-soft); box-shadow: inset 0 0 0 1px var(--sqv-accent-line); }
.sqv-root .sqv-oi svg { width: 15px; height: 15px; color: var(--sqv-accent); }
.sqv-root .sqv-oi .sqv-on { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--sqv-mono); font-size: 0.8rem; }
.sqv-root .sqv-oi .sqv-on small { color: var(--sqv-muted); }
.sqv-root .sqv-oi .sqv-oc { font-size: 0.72rem; font-weight: 700; color: var(--sqv-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sqv-root .sqv-oempty { padding: 0.6rem 0.5rem; font-size: 0.82rem; color: var(--sqv-muted); }
.sqv-root .sqv-detail { min-width: 0; min-height: 0; overflow: auto; padding: 1rem 1.1rem 1.4rem; overscroll-behavior: contain; outline: none; }
.sqv-root .sqv-dt-head { display: flex; align-items: flex-start; gap: 0.75rem; flex-wrap: wrap; }
.sqv-root .sqv-dt-title { flex: 1; min-width: 0; }
.sqv-root .sqv-dt-title h3 { margin: 0; font: 700 1.15rem/1.3 var(--sqv-mono); color: var(--sqv-text-1); overflow-wrap: anywhere; }
.sqv-root .sqv-dt-title p { margin: 0.3rem 0 0; font-size: 0.84rem; color: var(--sqv-text-2); }
.sqv-root .sqv-dt-acts { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.sqv-root .sqv-dt-meta { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.7rem; }
.sqv-root .sqv-dt-meta span { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--sqv-sunk); border: 1px solid var(--sqv-line); font-size: 0.76rem; color: var(--sqv-text-2); max-width: 100%; overflow-wrap: anywhere; }
.sqv-root .sqv-dt-meta span strong { color: var(--sqv-text-1); }
.sqv-root .sqv-dt-meta svg { width: 13px; height: 13px; color: var(--sqv-accent); flex-shrink: 0; }
.sqv-root .sqv-dsec { margin-top: 1.2rem; }
.sqv-root .sqv-dsec h4 { display: flex; align-items: center; gap: 0.4rem; margin: 0 0 0.5rem; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sqv-muted); }
.sqv-root .sqv-dsec h4 svg { width: 14px; height: 14px; color: var(--sqv-accent); }
.sqv-root .sqv-ctable-wrap { overflow-x: auto; border: 1px solid var(--sqv-line); border-radius: 10px; }
.sqv-root .sqv-ctable { width: 100%; border-collapse: collapse; margin: 0; font-size: 0.82rem; min-width: 560px; }
.sqv-root .sqv-ctable th, .sqv-root .sqv-ctable td { padding: 0.42rem 0.6rem; text-align: left; border-bottom: 1px solid var(--sqv-line); vertical-align: top; color: var(--sqv-text-2); }
.sqv-root .sqv-ctable th { background: var(--sqv-sunk); color: var(--sqv-text-1); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.03em; white-space: nowrap; }
.sqv-root .sqv-ctable tr:last-child td { border-bottom: none; }
.sqv-root .sqv-ctable td.is-name { font-family: var(--sqv-mono); color: var(--sqv-text-1); font-weight: 600; white-space: nowrap; }
.sqv-root .sqv-ctable td.is-type { font-family: var(--sqv-mono); color: var(--sqv-t-ty); overflow-wrap: anywhere; }
.sqv-root .sqv-ctable td.is-def { font-family: var(--sqv-mono); font-size: 0.78rem; overflow-wrap: anywhere; }
.sqv-root .sqv-ctable td.is-n { color: var(--sqv-muted); font-variant-numeric: tabular-nums; width: 1%; }
.sqv-root .sqv-ctable td.is-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sqv-root .sqv-ctable a, .sqv-root .sqv-ctable button.sqv-link { color: var(--sqv-accent-strong); font-weight: 600; }
.sqv-root button.sqv-link { display: inline; width: auto; margin: 0; padding: 0; border: none; background: none; cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 2px; }
[data-theme="dark"] .sqv-root .sqv-ctable a, [data-theme="dark"] .sqv-root .sqv-ctable button.sqv-link { color: var(--sqv-accent); }
.sqv-root .sqv-key { display: inline-block; margin: 0 0.2rem 0.1rem 0; padding: 0 0.35rem; border-radius: 5px; font: 800 0.66rem/1.6 system-ui, sans-serif; letter-spacing: 0.03em; border: 1px solid transparent; white-space: nowrap; }
.sqv-root .sqv-ctable td.is-keys { white-space: nowrap; }
.sqv-root .sqv-key.pk { background: rgba(217, 119, 6, 0.14); color: #a15c05; border-color: rgba(217, 119, 6, 0.35); }
.sqv-root .sqv-key.uq { background: rgba(124, 58, 237, 0.1); color: #6d28d9; border-color: rgba(124, 58, 237, 0.3); }
.sqv-root .sqv-key.fk { background: rgba(51, 153, 204, 0.12); color: #1b6183; border-color: rgba(51, 153, 204, 0.35); }
.sqv-root .sqv-key.ix { background: var(--sqv-sunk); color: var(--sqv-text-2); border-color: var(--sqv-line); }
.sqv-root .sqv-key.ai { background: rgba(51, 153, 102, 0.12); color: #23744d; border-color: rgba(51, 153, 102, 0.35); }
.sqv-root .sqv-key.nn { background: none; color: var(--sqv-muted); border-color: var(--sqv-line); }
[data-theme="dark"] .sqv-root .sqv-key.pk { color: #fbbf24; }
[data-theme="dark"] .sqv-root .sqv-key.uq { color: #c4b5fd; }
[data-theme="dark"] .sqv-root .sqv-key.fk { color: #7dd3fc; }
[data-theme="dark"] .sqv-root .sqv-key.ai { color: #86efac; }
.sqv-root .sqv-ilist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.sqv-root .sqv-ilist li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.6rem; padding: 0.45rem 0.65rem; border-radius: 9px; background: var(--sqv-open); border: 1px solid var(--sqv-line); font-size: 0.82rem; color: var(--sqv-text-2); min-width: 0; }
.sqv-root .sqv-ilist code { background: none; padding: 0; overflow-wrap: anywhere; }
.sqv-root .sqv-ilist .sqv-iname { font-family: var(--sqv-mono); font-weight: 700; color: var(--sqv-text-1); overflow-wrap: anywhere; }
.sqv-root .sqv-dnote { margin: 0.6rem 0 0; font-size: 0.84rem; color: var(--sqv-text-2); line-height: 1.55; }
.sqv-root .sqv-ov-intro { margin: 0 0 0.9rem; font-size: 0.9rem; color: var(--sqv-text-2); }
.sqv-root .sqv-ov-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; align-items: start; }
.sqv-root .sqv-ov-card { padding: 0.85rem 0.95rem; border-radius: 12px; background: var(--sqv-open); border: 1px solid var(--sqv-line); min-width: 0; }
.sqv-root .sqv-ov-card h4 { display: flex; align-items: center; gap: 0.45rem; margin: 0 0 0.6rem; font-size: 0.9rem; color: var(--sqv-text-1); }
.sqv-root .sqv-ov-card h4 svg { width: 16px; height: 16px; color: var(--sqv-accent); }

/* ---------- data grid ---------- */
.sqv-root .sqv-countbar { display: flex; align-items: center; gap: 0.5rem 1rem; flex-wrap: wrap; margin-top: 0.6rem; }
.sqv-root .sqv-sorthint { margin-left: auto; font-size: 0.76rem; color: var(--sqv-muted); }
.sqv-root .sqv-grid { position: relative; height: 540px; overflow: auto; outline: none; overscroll-behavior: contain; background: var(--sqv-bg); color: var(--sqv-fg); font: var(--sqv-fs)/1.35 var(--sqv-mono); }
.sqv-root .sqv-grid:focus-visible { box-shadow: inset 0 0 0 2px var(--sqv-accent-line); }
.sqv-root .sqv-gspace { position: relative; }
.sqv-root .sqv-ghead { position: sticky; top: 0; z-index: 3; height: var(--sqv-gh); background: var(--sqv-gut); border-bottom: 1px solid var(--sqv-gut-line); }
.sqv-root .sqv-glayer { position: absolute; left: 0; top: 0; will-change: transform; }
.sqv-root .sqv-grow { position: relative; height: var(--sqv-gr, 28px); border-bottom: 1px solid var(--sqv-gut-line); box-sizing: border-box; }
.sqv-root .sqv-grow:hover { background: var(--sqv-hover); }
.sqv-root .sqv-grow.is-sel { background: var(--sqv-sel); }
.sqv-root .sqv-gc, .sqv-root .sqv-gh { position: absolute; top: 0; height: 100%; padding: 0 0.55rem; box-sizing: border-box; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: flex; align-items: center; min-width: 0; }
.sqv-root .sqv-gc { border-right: 1px solid var(--sqv-gut-line); cursor: default; }
.sqv-root .sqv-gc > span { overflow: hidden; text-overflow: ellipsis; white-space: pre; }
.sqv-root .sqv-gc.is-num { justify-content: flex-end; font-variant-numeric: tabular-nums; }
.sqv-root .sqv-gc.is-null > span { color: var(--sqv-null); font-style: italic; font-size: 0.9em; }
.sqv-root .sqv-gc.is-cut::after { content: "…"; color: var(--sqv-muted); margin-left: 0.15rem; }
.sqv-root .sqv-gc.is-sel { box-shadow: inset 0 0 0 2px var(--sqv-accent); background: var(--sqv-accent-soft); }
.sqv-root .sqv-gh { gap: 0.3rem; font: 800 0.74rem/1.2 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--sqv-text-2); cursor: pointer; user-select: none; -webkit-user-select: none; border-right: 1px solid var(--sqv-gut-line); }
.sqv-root .sqv-gh:hover { background: var(--sqv-hover); color: var(--sqv-text-1); }
.sqv-root .sqv-gh .sqv-gh-n { overflow: hidden; text-overflow: ellipsis; }
.sqv-root .sqv-gh .sqv-gh-t { font-weight: 600; color: var(--sqv-muted); font-family: var(--sqv-mono); font-size: 0.68rem; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; }
.sqv-root .sqv-gh svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--sqv-accent); }
.sqv-root .sqv-gh.is-sorted { color: var(--sqv-accent-strong); }
[data-theme="dark"] .sqv-root .sqv-gh.is-sorted { color: var(--sqv-accent); }
.sqv-root .sqv-gh .sqv-rs { position: absolute; top: 0; right: 0; width: 9px; height: 100%; cursor: col-resize; touch-action: none; z-index: 2; }
.sqv-root .sqv-gh .sqv-rs::after { content: ""; position: absolute; top: 7px; bottom: 7px; right: 3px; width: 2px; border-radius: 2px; background: var(--sqv-gut-line); }
.sqv-root .sqv-gh .sqv-rs:hover::after, .sqv-root .sqv-gh .sqv-rs.is-drag::after { background: var(--sqv-accent); }
.sqv-root .sqv-gn { position: sticky; left: 0; z-index: 2; height: 100%; display: flex; align-items: center; justify-content: flex-end; padding: 0 0.5rem; box-sizing: border-box; background: var(--sqv-gut); color: var(--sqv-gut-t); border-right: 1px solid var(--sqv-gut-line); font-size: 0.82em; font-variant-numeric: tabular-nums; user-select: none; -webkit-user-select: none; }
.sqv-root .sqv-ghead .sqv-gn { z-index: 4; }
.sqv-root .sqv-grow.is-load .sqv-gc::after { content: ""; display: block; height: 8px; width: 65%; border-radius: 4px; background: var(--sqv-sunk); }
.sqv-root .sqv-gc mark { background: var(--sqv-hit); color: inherit; border-radius: 2px; padding: 0; }
.sqv-root .sqv-data-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.75rem; }
.sqv-root .sqv-menu-opt { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.7rem; border-top: 1px solid var(--sqv-line); margin-top: 0.2rem; font-size: 0.8rem; color: var(--sqv-text-2); cursor: pointer; }
.sqv-root .sqv-cellval { margin: 0; padding: 0.65rem 0.75rem; border-radius: 10px; background: var(--sqv-gut); border: 1px solid var(--sqv-gut-line); font: 12.5px/1.55 var(--sqv-mono); color: var(--sqv-fg); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 300px; overflow: auto; }
.sqv-root .sqv-kv td.is-null { color: var(--sqv-null); font-style: italic; }
.sqv-root .sqv-kv tr.is-cur th, .sqv-root .sqv-kv tr.is-cur td { background: var(--sqv-accent-soft); }
.sqv-root .sqv-kv tr { cursor: pointer; }

/* ---------- query ---------- */
.sqv-root .sqv-qsetup { margin-top: 0.75rem; padding: 1.1rem; border: 1px solid var(--sqv-line); border-radius: 14px; background: var(--sqv-open); }
.sqv-root .sqv-qhead { display: flex; gap: 0.8rem; align-items: flex-start; }
.sqv-root .sqv-qicon { width: 42px; height: 42px; border-radius: 12px; background: var(--sqv-accent); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
[data-theme="dark"] .sqv-root .sqv-qicon { color: #0b1e33; }
.sqv-root .sqv-qicon svg { width: 22px; height: 22px; }
.sqv-root .sqv-qhead h3 { margin: 0; font-size: 1.05rem; color: var(--sqv-text-1); }
.sqv-root .sqv-qhead p { margin: 0.25rem 0 0; font-size: 0.88rem; color: var(--sqv-text-2); line-height: 1.5; }
.sqv-root .sqv-qtables { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.4rem; margin-top: 0.9rem; max-height: 260px; overflow: auto; }
.sqv-root .sqv-qt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.5rem; padding: 0.45rem 0.6rem; border-radius: 10px; border: 1px solid var(--sqv-line); background: var(--sqv-card); cursor: pointer; font-size: 0.82rem; min-width: 0; }
.sqv-root .sqv-qt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--sqv-mono); color: var(--sqv-text-1); }
.sqv-root .sqv-qt small { font-size: 0.72rem; color: var(--sqv-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tool-container.sqv-root input[type="checkbox"].sqv-check {
    -webkit-appearance: none !important; appearance: none !important; width: 18px !important; height: 18px !important; margin: 0 !important; padding: 0 !important;
    border: 2px solid var(--sqv-line) !important; border-radius: 5px !important; background: var(--sqv-card) !important; box-shadow: none !important; position: relative; cursor: pointer; flex-shrink: 0;
}
.tool-container.sqv-root input[type="checkbox"].sqv-check::after { content: '' !important; transform: none !important; position: absolute; left: 4px; top: 0; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; opacity: 0; rotate: 45deg; background: none !important; }
.tool-container.sqv-root input[type="checkbox"].sqv-check:checked { background: var(--sqv-go) !important; border-color: var(--sqv-go) !important; }
.tool-container.sqv-root input[type="checkbox"].sqv-check:checked::after { opacity: 1; }
.tool-container.sqv-root input[type="checkbox"].sqv-check:focus-visible { outline: 3px solid var(--sqv-accent-line); outline-offset: 2px; }
.sqv-root .sqv-qacts { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem 1rem; margin-top: 0.9rem; }
.sqv-root .sqv-qest { font-size: 0.82rem; color: var(--sqv-text-2); }
.sqv-root .sqv-qest.is-warn { color: var(--sqv-warn); font-weight: 600; }
.sqv-root .sqv-qnote { margin: 0.8rem 0 0; font-size: 0.8rem; color: var(--sqv-muted); line-height: 1.5; }
.sqv-root .sqv-qrun { margin-top: 0.75rem; }
.sqv-root .sqv-qtext { min-height: 110px; height: 130px; font: var(--sqv-fs)/1.5 var(--sqv-mono); }
.sqv-root .sqv-qbar { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.sqv-root .sqv-qexamples { display: flex; flex-wrap: wrap; gap: 0.3rem; min-width: 0; }
.sqv-root .sqv-qex { display: inline-flex; align-items: center; width: auto; min-height: 30px; padding: 0.15rem 0.6rem; margin: 0; border-radius: 999px; border: 1px dashed var(--sqv-accent-line); background: none; color: var(--sqv-accent-strong); font-size: 0.76rem; font-weight: 700; cursor: pointer; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
[data-theme="dark"] .sqv-root .sqv-qex { color: var(--sqv-accent); }
.sqv-root .sqv-qex:hover { background: var(--sqv-accent-soft); }
.sqv-root .sqv-qmsg { min-height: 1.3em; margin: 0.6rem 0 0; font-size: 0.84rem; color: var(--sqv-text-2); overflow-wrap: anywhere; }
.sqv-root .sqv-qmsg.is-err { color: var(--sqv-red); font-weight: 600; }
.sqv-root .sqv-qmsg.is-ok strong { color: var(--sqv-text-1); }
.sqv-root #sqvQPanel .sqv-grid { height: 420px; }

/* print */
@media print {
    body.sqv-printing > *:not(.sqv-print) { display: none !important; }
    body.sqv-printing .sqv-print { display: block !important; }
}
.sqv-print { display: none; }
.sqv-print pre { font: 10pt/1.45 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.sqv-print h1 { font: 700 13pt system-ui, sans-serif; margin: 0 0 8pt; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
    .sqv-root .sqv-struct { grid-template-columns: minmax(0, 1fr); grid-template-rows: 210px minmax(0, 1fr); height: 760px; }
    .sqv-root .sqv-outline { border-right: none; border-bottom: 1px solid var(--sqv-line); }
    .sqv-root .sqv-ov-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .sqv-root .sqv-view, .sqv-root .sqv-grid { height: 470px; }
    .sqv-root .sqv-toolbar > .sqv-search { flex: 1 1 100%; }
    .sqv-root .sqv-toolbar > .sqv-seg { flex: 1; }
    .sqv-root .sqv-toolbar > .sqv-seg .sqv-seg-opt { flex: 1; justify-content: center; }
    .sqv-root .sqv-toolbar > .sqv-pop-wrap .sqv-btn span { display: none; }
    .sqv-root .sqv-table-pick { flex: 1 1 100%; max-width: none; }
    .sqv-root .sqv-col-pick { max-width: 90px; }
    .sqv-root .sqv-sorthint { display: none; }
    .sqv-root .sqv-tab { gap: 0.3rem; }
    .sqv-root .sqv-tab svg { display: none; }
    .sqv-root .sqv-detail { padding: 0.8rem; }
    .sqv-root .sqv-dt-acts { width: 100%; }
    .sqv-root .sqv-data-acts .sqv-push { margin-left: 0; flex: 1 1 100%; order: -1; }
    .sqv-root .sqv-data-acts .sqv-push .sqv-btn { width: 100%; }
    .sqv-root .sqv-data-acts > .sqv-btn { flex: 1; }
    .sqv-root .sqv-qbar .sqv-kbd-hint { display: none; }
    .sqv-root .sqv-qtables { grid-template-columns: minmax(0, 1fr); }
    .sqv-root .sqv-stmt-info { flex-basis: 100%; }
    .sqv-root .sqv-actionbar > .sqv-btn-ghost { flex: 1 1 calc(33% - 0.5rem); }
}
