/* ============================================================
   TXT File Viewer - scoped under .txv-root / .txv-* (rebuilt 2026-10-10)
   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"].
   ============================================================ */
.txv-root {
    --txv-accent: #3399cc;
    --txv-accent-strong: #237a9f;
    --txv-accent-soft: rgba(51, 153, 204, 0.09);
    --txv-accent-line: rgba(51, 153, 204, 0.45);
    --txv-go: #237a9f;
    --txv-go-hover: #1b6183;
    --txv-card: var(--bg-elevated, #fff);
    --txv-sunk: var(--card-tertiary, #f1f5f9);
    --txv-open: var(--card-secondary, #f8f9fa);
    --txv-line: var(--border-color, #e2e8f0);
    --txv-text-1: var(--text-primary, #1e293b);
    --txv-text-2: var(--text-secondary, #555);
    --txv-muted: var(--text-muted, #64748b);
    --txv-warn: #b45309;
    --txv-red: #c23b3b;
    --txv-red-soft: rgba(230, 78, 78, 0.08);
    --txv-red-line: rgba(230, 78, 78, 0.35);
    --txv-mono: ui-monospace, "Cascadia Mono", SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
    /* text surface */
    --txv-bg: #ffffff;
    --txv-fg: #1f2937;
    --txv-gut: #f6f8fa;
    --txv-gut-t: #94a3b8;
    --txv-gut-line: #e5e7eb;
    --txv-ws: #c0c7d2;
    --txv-ts: #0f7a8a;
    --txv-e: #c62828;
    --txv-w: #b45309;
    --txv-i: #1d6fa5;
    --txv-d: #8a94a6;
    --txv-row-err: rgba(230, 78, 78, 0.07);
    --txv-row-warn: rgba(217, 119, 6, 0.07);
    --txv-hit: rgba(250, 204, 21, 0.45);
    --txv-hit-cur: #facc15;
}
[data-theme="dark"] .txv-root {
    --txv-accent: #60a5fa;
    --txv-accent-strong: #93c5fd;
    --txv-accent-soft: rgba(96, 165, 250, 0.12);
    --txv-accent-line: rgba(96, 165, 250, 0.45);
    --txv-go: #2563eb;
    --txv-go-hover: #1d4ed8;
    --txv-sunk: #172033;
    --txv-open: #1a2438;
    --txv-warn: #fbbf24;
    --txv-red: #f87171;
    --txv-red-soft: rgba(248, 113, 113, 0.1);
    --txv-red-line: rgba(248, 113, 113, 0.4);
    --txv-bg: #0f172a;
    --txv-fg: #e2e8f0;
    --txv-gut: #131c30;
    --txv-gut-t: #64748b;
    --txv-gut-line: #24314a;
    --txv-ws: #475569;
    --txv-ts: #5eead4;
    --txv-e: #f87171;
    --txv-w: #fbbf24;
    --txv-i: #7dd3fc;
    --txv-d: #7c8aa3;
    --txv-row-err: rgba(248, 113, 113, 0.1);
    --txv-row-warn: rgba(251, 191, 36, 0.08);
    --txv-hit: rgba(250, 204, 21, 0.3);
}

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

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

/* ---------- error ---------- */
.txv-root .txv-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(--txv-red-line); background: var(--txv-red-soft); color: var(--txv-text-1); }
.txv-root .txv-error > svg { width: 20px; height: 20px; color: #e64e4e; flex-shrink: 0; margin-top: 2px; }
.txv-root .txv-error > div { flex: 1; min-width: 0; }
.txv-root .txv-error p { margin: 0; font-size: 0.92rem; line-height: 1.55; overflow-wrap: anywhere; }
.txv-root .txv-error p + p { margin-top: 0.3rem; color: var(--txv-muted); font-size: 0.86rem; }
.txv-root .txv-error a { color: var(--txv-red); font-weight: 600; }
.txv-root .txv-error-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.55rem; }
.txv-root .txv-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(--txv-muted); cursor: pointer; padding: 0; margin: 0; }
.txv-root .txv-x:hover { background: rgba(100, 116, 139, 0.12); color: var(--txv-text-1); }
.txv-root .txv-x svg { width: 17px; height: 17px; }

/* ---------- cards ---------- */
.txv-root .txv-card { background: var(--txv-card); border: 1px solid var(--txv-line); border-radius: 20px; padding: 1.25rem; box-shadow: var(--shadow-sm); margin-bottom: 1.25rem; min-width: 0; }
.txv-root .txv-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(--txv-muted); }
.txv-root .txv-caption svg { width: 14px; height: 14px; }

/* ---------- buttons ---------- */
.txv-root .txv-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;
}
.txv-root .txv-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.txv-root .txv-go { background: var(--txv-go); color: #fff; }
.txv-root .txv-go:hover:not(:disabled) { background: var(--txv-go-hover); color: #fff; }
.txv-root .txv-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.txv-root .txv-btn-lg { min-height: 50px; padding: 0.65rem 1.5rem; font-size: 1rem; }
.txv-root .txv-btn-sm { min-height: 36px; padding: 0.4rem 0.8rem; font-size: 0.85rem; border-radius: 10px; }
.txv-root .txv-btn-sm svg { width: 16px; height: 16px; }
.txv-root .txv-btn-ghost { background: var(--txv-sunk); color: var(--txv-text-2); border-color: var(--txv-line); }
.txv-root .txv-btn-ghost:hover:not(:disabled) { color: var(--txv-text-1); border-color: var(--txv-accent-line); }
.txv-root .txv-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(--txv-accent-strong); font-size: 0.85rem; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; }
[data-theme="dark"] .txv-root .txv-text-btn { color: var(--txv-accent); }
.txv-root .txv-text-btn:hover:not(:disabled) { background: var(--txv-accent-soft); }
.txv-root .txv-text-btn svg { width: 15px; height: 15px; }
.txv-root .txv-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(--txv-text-2); cursor: pointer; flex-shrink: 0; }
.txv-root .txv-icon-btn:hover:not(:disabled) { background: var(--txv-accent-soft); color: var(--txv-text-1); }
.txv-root .txv-icon-btn:disabled { opacity: 0.35; cursor: default; }
.txv-root .txv-icon-btn svg { width: 16px; height: 16px; }
.txv-root .txv-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(--txv-line); background: var(--txv-card); color: var(--txv-text-2); font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.txv-root .txv-seg-btn svg { width: 15px; height: 15px; color: var(--txv-accent); }
.txv-root .txv-seg-btn:hover { border-color: var(--txv-accent-line); color: var(--txv-text-1); }
.txv-root .txv-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(--txv-line); background: var(--txv-card); color: var(--txv-text-2); font-size: 0.8rem; font-weight: 700; cursor: pointer; min-width: 0; }
.txv-root .txv-chip:hover { border-color: var(--txv-accent-line); }
.txv-root .txv-chip.is-active { border-color: var(--txv-accent); background: var(--txv-accent-soft); color: var(--txv-accent-strong); }
[data-theme="dark"] .txv-root .txv-chip.is-active { color: var(--txv-accent); }
.txv-root .txv-chip svg { width: 15px; height: 15px; }
.txv-root .txv-quick { display: grid; gap: 0.35rem; }
.txv-root .txv-quick > * { min-width: 0; }
.txv-root .txv-quick-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.txv-root .txv-quick-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.txv-root .txv-quick-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.txv-root .txv-sub { margin: 0.75rem 0 0.35rem; font-size: 0.78rem; font-weight: 700; color: var(--txv-text-2); }
.txv-root .txv-sub:first-child { margin-top: 0.2rem; }

/* ---------- upload ---------- */
.txv-root .txv-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(--txv-accent-line); background: var(--txv-accent-soft); cursor: pointer; color: var(--txv-muted); font-size: 0.86rem; line-height: 1.5;
    transition: border-color 0.15s, background 0.15s; box-sizing: border-box; margin: 0;
}
.txv-root .txv-drop:hover, .txv-root .txv-drop.is-drag { border-color: var(--txv-accent); background: rgba(51, 153, 204, 0.14); }
.txv-root .txv-drop:focus-within { outline: 3px solid var(--txv-accent-soft); }
.txv-root .txv-drop strong { font-size: 1.08rem; color: var(--txv-text-1); }
.txv-root .txv-drop-link { color: var(--txv-accent-strong); text-decoration: underline; text-underline-offset: 3px; }
[data-theme="dark"] .txv-root .txv-drop-link { color: var(--txv-accent); }
.txv-root .txv-drop-icon { width: 58px; height: 58px; border-radius: 16px; display: flex; align-items: center; justify-content: center; margin-bottom: 0.35rem; background: var(--txv-card); color: var(--txv-accent); border: 1px solid var(--txv-line); }
.txv-root .txv-drop-icon svg { width: 28px; height: 28px; }
.txv-root .txv-types { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem; margin-top: 0.35rem; max-width: 560px; }
.txv-root .txv-types span { padding: 0.05rem 0.45rem; border-radius: 6px; background: var(--txv-card); border: 1px solid var(--txv-line); font: 600 0.72rem var(--txv-mono); color: var(--txv-text-2); }
.txv-root .txv-or { display: flex; align-items: center; gap: 0.75rem; margin: 1rem 0 0.6rem; color: var(--txv-muted); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.txv-root .txv-or::before, .txv-root .txv-or::after { content: ""; flex: 1; height: 1px; background: var(--txv-line); }
.txv-root .txv-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(--txv-line); background: var(--input-bg, #fff); color: var(--txv-text-1); font: 0.86rem/1.55 var(--txv-mono); tab-size: 4; }
.txv-root .txv-textarea:focus { outline: none; border-color: var(--txv-accent); box-shadow: 0 0 0 3px var(--txv-accent-soft); }
.txv-root .txv-input-bar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.7rem; }
.txv-root .txv-kbd-hint { margin-left: auto; font-size: 0.76rem; color: var(--txv-muted); }
.txv-root .txv-samples { margin-top: 1rem; }
.txv-root .txv-sample-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.txv-root .txv-under { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.6rem; margin-top: 1rem; }
.txv-root .txv-pill { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.22rem 0.65rem; border-radius: 999px; background: var(--txv-sunk); border: 1px solid var(--txv-line); font-size: 0.78rem; font-weight: 600; color: var(--txv-text-2); }
.txv-root .txv-pill svg { width: 14px; height: 14px; color: var(--txv-accent); }
.txv-root .txv-recent { margin-top: 1rem; padding-top: 0.85rem; border-top: 1px solid var(--txv-line); }
.txv-root .txv-recent-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.txv-root .txv-recent-head .txv-caption { margin: 0; }
.txv-root .txv-recent-list { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; }
.txv-root .txv-recent-list button { display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; width: 100%; padding: 0.5rem 0.7rem; margin: 0; border-radius: 10px; border: 1px solid var(--txv-line); background: var(--txv-sunk); cursor: pointer; text-align: left; min-width: 0; }
.txv-root .txv-recent-list button:hover { border-color: var(--txv-accent-line); }
.txv-root .txv-recent-name { font-size: 0.85rem; font-weight: 700; color: var(--txv-text-1); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.txv-root .txv-recent-meta { font-size: 0.74rem; color: var(--txv-muted); }

/* page-wide drop overlay */
.txv-root .txv-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; }
.txv-root .txv-overlay-box { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 2rem 2.5rem; border-radius: 20px; border: 2px dashed var(--txv-accent); background: var(--txv-card); color: var(--txv-text-1); font-weight: 700; font-size: 1.1rem; }
.txv-root .txv-overlay-box svg { width: 36px; height: 36px; color: var(--txv-accent); }

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

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

/* notes */
.txv-root .txv-notes { display: grid; gap: 0.5rem; margin-top: 0.75rem; }
.txv-root .txv-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(--txv-text-1); background: rgba(51, 153, 204, 0.08); border: 1px solid rgba(51, 153, 204, 0.3); }
.txv-root .txv-note.is-warn { background: rgba(217, 119, 6, 0.08); border-color: rgba(217, 119, 6, 0.35); }
.txv-root .txv-note > svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: var(--txv-accent); }
.txv-root .txv-note.is-warn > svg { color: var(--txv-warn); }
.txv-root .txv-note > div { flex: 1; min-width: 0; }
.txv-root .txv-note p { margin: 0; overflow-wrap: anywhere; }
.txv-root .txv-note a { color: var(--txv-accent-strong); font-weight: 600; }
[data-theme="dark"] .txv-root .txv-note a { color: var(--txv-accent); }
.txv-root .txv-alts { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; align-items: center; }

/* stats */
.txv-root .txv-stats { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.75rem; }
.txv-root .txv-stat { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.22rem 0.6rem; border-radius: 999px; background: var(--txv-sunk); border: 1px solid var(--txv-line); font-size: 0.78rem; color: var(--txv-text-2); max-width: 100%; }
.txv-root .txv-stat svg { width: 14px; height: 14px; color: var(--txv-accent); flex-shrink: 0; }
.txv-root .txv-stat strong { color: var(--txv-text-1); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.txv-root .txv-stat.is-busy svg { animation: txvSpinR 1.4s linear infinite; }
.txv-root .txv-stat-more { display: none; width: auto; margin: 0; cursor: pointer; font-weight: 700; color: var(--txv-accent-strong); border-style: dashed; }
[data-theme="dark"] .txv-root .txv-stat-more { color: var(--txv-accent); }
.txv-root .txv-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }

/* ---------- toolbar ---------- */
.txv-root .txv-toolbar { position: relative; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.txv-root .txv-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(--txv-line); background: var(--input-bg, #fff); box-sizing: border-box; }
.txv-root .txv-search:focus-within { border-color: var(--txv-accent); box-shadow: 0 0 0 3px var(--txv-accent-soft); }
.txv-root .txv-search > svg { width: 16px; height: 16px; color: var(--txv-muted); flex-shrink: 0; }
.txv-root .txv-search input { flex: 1; min-width: 0; width: auto; height: 100%; border: none; background: none; outline: none; box-shadow: none; color: var(--txv-text-1); font-size: 0.9rem; padding: 0 0 0 0.4rem; margin: 0; }
.txv-root .txv-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(--txv-muted); font: 700 0.75rem var(--txv-mono); cursor: pointer; flex-shrink: 0; }
.txv-root .txv-flag svg { width: 15px; height: 15px; }
.txv-root .txv-flag:hover { color: var(--txv-text-1); }
.txv-root .txv-flag[aria-pressed="true"] { border-color: var(--txv-accent); background: var(--txv-accent-soft); color: var(--txv-accent-strong); }
[data-theme="dark"] .txv-root .txv-flag[aria-pressed="true"] { color: var(--txv-accent); }
.txv-root .txv-search-count { font-size: 0.76rem; color: var(--txv-muted); white-space: nowrap; font-variant-numeric: tabular-nums; max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
.txv-root .txv-search-count.is-none { color: var(--txv-red); }
.txv-root .txv-sep { width: 1px; height: 20px; background: var(--txv-line); flex-shrink: 0; }
.txv-root .txv-goto { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: flex; align-items: center; gap: 0.4rem; padding: 0.6rem; border-radius: 12px; border: 1px solid var(--txv-line); background: var(--txv-card); box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18); }
.txv-root .txv-goto label { font-size: 0.82rem; font-weight: 700; color: var(--txv-text-2); white-space: nowrap; }
.txv-root .txv-input { width: 150px; height: 36px; padding: 0 0.7rem; margin: 0; border: 1px solid var(--txv-line); border-radius: 9px; background: var(--input-bg, #fff); color: var(--txv-text-1); font: 0.88rem var(--txv-mono); box-sizing: border-box; }
.txv-root .txv-input:focus { outline: none; border-color: var(--txv-accent); box-shadow: 0 0 0 3px var(--txv-accent-soft); }
.txv-root .txv-select { width: 100%; height: 40px; max-width: 100%; min-width: 0; padding: 0 0.6rem; margin: 0; border-radius: 9px; border: 1px solid var(--txv-line); background: var(--input-bg, #fff); color: var(--txv-text-1); font-size: 0.88rem; box-sizing: border-box; }

/* log bar */
.txv-root .txv-logbar { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 0.8rem; margin-top: 0.75rem; padding: 0.55rem 0.75rem; border-radius: 12px; border: 1px solid var(--txv-line); background: var(--txv-open); font-size: 0.82rem; color: var(--txv-text-2); }
.txv-root .txv-logbar > svg { width: 17px; height: 17px; color: var(--txv-accent); flex-shrink: 0; }
.txv-root .txv-logbar strong { color: var(--txv-text-1); font-variant-numeric: tabular-nums; }
.txv-root .txv-log-counts { min-width: 0; flex: 1 1 220px; }
.txv-root .txv-segs { display: inline-flex; flex-wrap: wrap; padding: 0.15rem; gap: 0.15rem; border-radius: 9px; background: var(--txv-sunk); border: 1px solid var(--txv-line); max-width: 100%; }
.txv-root .txv-segs button { display: inline-flex; align-items: center; gap: 0.3rem; width: auto; min-height: 30px; padding: 0.15rem 0.6rem; margin: 0; border: none; border-radius: 7px; background: none; color: var(--txv-muted); font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.txv-root .txv-segs button:hover:not(:disabled) { color: var(--txv-text-1); }
.txv-root .txv-segs button:disabled { opacity: 0.45; cursor: default; }
.txv-root .txv-segs button.is-active { background: var(--txv-card); color: var(--txv-accent-strong); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
[data-theme="dark"] .txv-root .txv-segs button.is-active { color: var(--txv-accent); background: #26334a; }
.txv-root .txv-dotc { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

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

/* ---------- the text panel ---------- */
.txv-root .txv-panel { position: relative; margin-top: 0.85rem; border: 1px solid var(--txv-line); border-radius: 14px; overflow: hidden; background: var(--txv-bg); }
.txv-root .txv-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); }
.txv-root .txv-panel.is-full .txv-view, .txv-root .txv-panel.is-full .txv-editor { flex: 1; height: auto; min-height: 0; }
body.txv-noscroll { overflow: hidden; }
.txv-root .txv-full-btn { position: absolute; top: 6px; right: 14px; z-index: 4; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; margin: 0; border-radius: 8px; border: 1px solid var(--txv-line); background: var(--txv-card); color: var(--txv-text-2); cursor: pointer; opacity: 0.85; }
.txv-root .txv-full-btn:hover { color: var(--txv-text-1); border-color: var(--txv-accent-line); opacity: 1; }
.txv-root .txv-full-btn svg { width: 16px; height: 16px; }

.txv-root .txv-view {
    --txv-fs: 14px; --txv-tab: 4; --txv-gd: 3ch;
    position: relative; height: 620px; overflow: auto; outline: none; overscroll-behavior: contain;
    background: var(--txv-bg); color: var(--txv-fg); font-family: var(--txv-mono); font-size: var(--txv-fs); line-height: 1.55; tab-size: var(--txv-tab); -moz-tab-size: var(--txv-tab);
}
.txv-root .txv-view:focus-visible { box-shadow: inset 0 0 0 2px var(--txv-accent-line); }
.txv-root .txv-view.txv-f-serif { font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "DejaVu Serif", "Noto Serif", serif; }
.txv-root .txv-view.txv-f-sans { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "DejaVu Sans", "Noto Sans", sans-serif; }
.txv-root .txv-space { position: relative; min-width: 100%; }
.txv-root .txv-win { position: absolute; top: 0; left: 0; min-width: 100%; will-change: transform; }
.txv-root .txv-view:not(.is-wrap) .txv-win { width: max-content; min-width: 100%; }
.txv-root .txv-view.is-wrap .txv-win { width: 100%; }
.txv-root .txv-l { display: flex; min-height: 1.55em; }
.txv-root .txv-g {
    position: sticky; left: 0; z-index: 1; flex-shrink: 0; min-width: calc(var(--txv-gd) + 1.4rem); padding: 0 0.7rem 0 0.5rem; box-sizing: border-box; text-align: right;
    background: var(--txv-gut); color: var(--txv-gut-t); border-right: 1px solid var(--txv-gut-line); user-select: none; -webkit-user-select: none;
    font-family: var(--txv-mono); font-size: 0.85em; font-variant-numeric: tabular-nums; cursor: pointer;
}
.txv-root .txv-g:hover { color: var(--txv-text-1); }
.txv-root .txv-view.no-ln .txv-g { display: none; }
.txv-root .txv-c { padding: 0 1.4rem 0 0.75rem; white-space: pre; }
.txv-root .txv-view.is-wrap .txv-c { white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; min-width: 0; flex: 1; }
.txv-root .txv-l.is-sel { background: var(--txv-accent-soft); }
.txv-root .txv-l.is-sel .txv-g { background: var(--txv-accent); color: #fff; }
.txv-root .txv-l.is-load .txv-c { position: relative; flex: 1; }
.txv-root .txv-l.is-load .txv-c::after { content: ""; position: absolute; left: 0.75rem; top: 35%; height: 30%; width: min(60%, 420px); border-radius: 4px; background: var(--txv-sunk); }
.txv-root .txv-trunc { color: var(--txv-muted); font-style: italic; font-family: system-ui, sans-serif; font-size: 0.82em; white-space: normal; }

/* reading mode: a calm, centred column */
.txv-root .txv-view.txv-m-reading { line-height: 1.75; }
.txv-root .txv-view.txv-m-reading .txv-l { justify-content: center; }
.txv-root .txv-view.txv-m-reading .txv-c { flex: 0 1 72ch; max-width: 72ch; padding: 0 1.25rem; }
/* NFO mode: DOS art, light on black, no gaps between rows */
.txv-root .txv-view.txv-m-nfo { font-kerning: none; text-rendering: optimizeSpeed; background: #0b0d10; color: #c9cdd3; line-height: 1; font-family: "Cascadia Mono", Consolas, "DejaVu Sans Mono", "Lucida Console", Menlo, monospace; }
.txv-root .txv-view.txv-m-nfo .txv-l { min-height: 1em; }
.txv-root .txv-view.txv-m-nfo .txv-c { padding: 0 1.5rem; }
.txv-root .txv-view.txv-m-nfo .txv-win { padding-top: 0; }

/* whitespace + invisible characters */
.txv-root .txv-view.is-ws .txv-sp, .txv-root .txv-view.is-ws .txv-tab { position: relative; }
.txv-root .txv-view.is-ws .txv-sp::before { content: "\00B7"; position: absolute; left: 0; right: 0; text-align: center; color: var(--txv-ws); pointer-events: none; }
.txv-root .txv-view.is-ws .txv-tab::before { content: "\2192"; position: absolute; left: 0.1em; color: var(--txv-ws); pointer-events: none; }
.txv-root .txv-view.is-ws .txv-nb { background: rgba(217, 119, 6, 0.22); border-radius: 2px; }
.txv-root .txv-view.is-ws .txv-zw::before { content: "ZW"; display: inline-block; margin: 0 1px; padding: 0 2px; border: 1px solid var(--txv-w); border-radius: 3px; color: var(--txv-w); font: 700 0.6em/1.3 system-ui, sans-serif; vertical-align: 0.15em; }
.txv-root .txv-cc { display: inline-block; margin: 0 1px; padding: 0 2px; border-radius: 3px; background: var(--txv-red-soft); color: var(--txv-e); font: 700 0.75em/1.3 var(--txv-mono); vertical-align: 0.05em; }
.txv-root .txv-eol { color: var(--txv-ws); font-size: 0.85em; padding-left: 0.15em; user-select: none; -webkit-user-select: none; }
.txv-root .txv-view.is-ws .txv-trail { background: var(--txv-red-soft); }
.txv-root .txv-ansi { display: none; }
.txv-root .txv-view.is-ws .txv-ansi { display: inline; color: var(--txv-d); }

/* log helpers */
.txv-root .txv-view.is-log .txv-l.is-err { background: var(--txv-row-err); }
.txv-root .txv-view.is-log .txv-l.is-warn { background: var(--txv-row-warn); }
.txv-root .txv-ts { color: var(--txv-ts); }
.txv-root .txv-lv-e { color: var(--txv-e); font-weight: 700; }
.txv-root .txv-lv-w { color: var(--txv-w); font-weight: 700; }
.txv-root .txv-lv-i { color: var(--txv-i); font-weight: 600; }
.txv-root .txv-lv-d { color: var(--txv-d); }

/* search hits */
.txv-root mark.txv-hit { background: var(--txv-hit); color: inherit; border-radius: 2px; padding: 0; }
.txv-root mark.txv-hit.is-cur { background: var(--txv-hit-cur); color: #111; box-shadow: 0 0 0 1px rgba(202, 138, 4, 0.8); }

.txv-root .txv-empty-filter { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; padding: 2rem; text-align: center; color: var(--txv-muted); font-size: 0.9rem; pointer-events: none; }
.txv-root .txv-empty-filter svg { width: 34px; height: 34px; color: var(--txv-accent); }
.txv-root .txv-empty-filter strong { color: var(--txv-text-1); }

/* status line under the text */
.txv-root .txv-status { display: flex; justify-content: space-between; gap: 0.5rem 1rem; flex-wrap: wrap; padding: 0.35rem 0.85rem; border-top: 1px solid var(--txv-line); background: var(--txv-sunk); font-size: 0.76rem; color: var(--txv-muted); font-variant-numeric: tabular-nums; }
.txv-root .txv-status span { min-width: 0; overflow-wrap: anywhere; }

/* editor */
.txv-root .txv-editor { display: block; width: 100%; height: 620px; box-sizing: border-box; margin: 0; padding: 0.75rem 1rem; border: none; resize: none; outline: none; background: var(--txv-bg); color: var(--txv-fg); font: 14px/1.55 var(--txv-mono); tab-size: var(--txv-tab, 4); -moz-tab-size: var(--txv-tab, 4); white-space: pre; overflow: auto; }
.txv-root .txv-editbar { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.75rem; padding: 0.55rem 0.75rem; border-radius: 12px; background: rgba(217, 119, 6, 0.08); border: 1px solid rgba(217, 119, 6, 0.35); font-size: 0.84rem; color: var(--txv-text-1); }
.txv-root .txv-editbar > svg { width: 17px; height: 17px; color: var(--txv-warn); flex-shrink: 0; }
.txv-root .txv-editbar span { flex: 1; min-width: 200px; }
.txv-root.is-editing .txv-toolbar, .txv-root.is-editing .txv-logbar, .txv-root.is-editing .txv-status { display: none; }

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

/* toast */
.txv-root .txv-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"] .txv-root .txv-toast { background: #e2e8f0; color: #0f172a; }
.txv-root .txv-toast.is-out { opacity: 0; }

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

/* ---------- responsive ---------- */
@media (max-width: 760px) {
    .txv-root .txv-search { flex-basis: 100%; min-width: 0; }
}
@media (max-width: 600px) {
    .txv-root.tool-container { padding: 1.1rem 16px; }
    .txv-root .tool-title { font-size: 1.55rem; }
    .txv-root .txv-title-icon { width: 46px; height: 46px; border-radius: 13px; }
    .txv-root .txv-title-icon svg { width: 25px; height: 25px; }
    .txv-root .tool-description { font-size: 0.98rem; }
    .txv-root .txv-card { padding: 1rem; border-radius: 16px; }
    .txv-root .txv-drop { min-height: 150px; }
    .txv-root .txv-kbd-hint { display: none; }
    .txv-root .txv-input-bar .txv-go { flex: 1 1 100%; }
    .txv-root .txv-input-bar .txv-btn-ghost { flex: 1; }
    .txv-root .txv-search-count { max-width: 92px; }
    .txv-root .txv-search { gap: 0.05rem; padding-left: 0.55rem; }
    .txv-root .txv-search .txv-sep { display: none; }
    .txv-root .txv-flag { min-width: 26px; padding: 0 0.15rem; }
    .txv-root .txv-stats:not(.is-open) .txv-stat:nth-child(n+5):not(.txv-stat-more) { display: none; }
    .txv-root .txv-stat-more { display: inline-flex; }
    .txv-root .txv-toolbar > .txv-btn { flex: 1; }
    .txv-root .txv-goto { left: 0; right: auto; flex-wrap: wrap; }
    .txv-root .txv-adv-head { padding: 0.55rem 0.75rem; }
    .txv-root .txv-adv-hint { display: none; }
    .txv-root .txv-adv-value { max-width: 110px; }
    .txv-root .txv-quick-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .txv-root .txv-view, .txv-root .txv-editor { height: 470px; }
    .txv-root .txv-c { padding-right: 0.9rem; }
    .txv-root .txv-actionbar .txv-go { flex: 1 1 100%; margin-left: 0; order: -1; }
    .txv-root .txv-actionbar .txv-btn-ghost { flex: 1 1 calc(33% - 0.5rem); padding: 0.45rem 0.4rem; }
    .txv-root .txv-recent-list { grid-template-columns: minmax(0, 1fr); }
    .txv-root .txv-features, .txv-root .txv-keys { grid-template-columns: minmax(0, 1fr); }
    .txv-root .txv-info-card { padding: 1.1rem; }
    .txv-root .txv-stage .txv-lbl { display: none; }
    .txv-root .txv-stage-line { width: 20px; margin: 0 0.3rem; }
    .txv-root .txv-panel.is-full { inset: 0; border-radius: 0; }
}

/* print: only the text (#txvPrintBox is added to <body> while printing) */
#txvPrintBox { display: none; }
@media print {
    body.txv-printing > *:not(#txvPrintBox) { display: none !important; }
    body.txv-printing #txvPrintBox { display: block !important; color: #000; background: #fff; }
    #txvPrintBox h1 { margin: 0 0 10px; font: 600 13px system-ui, sans-serif; }
    #txvPrintBox pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: 11px/1.45 ui-monospace, Consolas, monospace; tab-size: 4; }
}
