/* Document / File Viewer surface — Apple/Finder-flavoured redesign.
   Ported from the reference mockup (.tmp/KKTermRedesign/fileviewer.css) but wired
   to the app's color-scheme tokens (src/styles/colorSchemes.css) so it themes
   across every scheme + dark mode. The viewer fills its Workspace pane (no
   floating card). Local aliases below map the redesign's palette names onto the
   shared tokens; JSON-tree colors derive from semantic tokens so they adapt. */

.file-viewer-workspace {
  /* redesign palette aliases → app tokens */
  --bg: var(--surface);
  --muted: var(--surface-muted);
  --chrome-2: var(--surface-muted);
  --text-2: var(--text-muted);
  --text-3: var(--text-faint);
  --gutter-bg: var(--surface-muted);
  --gutter-text: var(--text-faint);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo,
    Consolas, monospace;
  --mono-size: 12.5px;
  --row-h: 28px;

  display: none;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.file-viewer-workspace.active {
  display: flex;
}

.file-viewer-workspace * {
  box-sizing: border-box;
}

/* ============================== toolbar ============================== */
.fv-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  min-width: 0;
  padding: 0 10px 0 14px;
  background: var(--chrome);
  border-bottom: 1px solid var(--hairline);
  flex: 0 0 auto;
}
.fv-file {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1 1 180px;
  max-width: 340px;
}
.fv-file .glyph {
  display: inline-flex;
  flex: 0 0 auto;
}
.fv-file .name {
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.fv-dirty {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}
.fv-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--muted);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  flex: 0 0 auto;
}
.fv-pill .swatch {
  width: 8px;
  height: 8px;
  border-radius: 2.5px;
  flex: 0 0 auto;
}
.fv-tb-spacer {
  flex: 999 1 16px;
  min-width: 0;
}
.fv-tb-center {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
}
.fv-tb-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

/* icon button */
.fv-ibtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: transparent;
  border: 0;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  flex: 0 0 auto;
}
.fv-ibtn:hover {
  background: var(--hover);
  color: var(--text);
}
.fv-ibtn:active {
  background: var(--press);
}
.fv-ibtn.on {
  background: var(--accent);
  color: #fff;
}
.fv-ibtn[disabled] {
  color: var(--text-3);
  opacity: 0.5;
  cursor: default;
  background: transparent;
}

/* Font + Encoding menu (anchored popover off the toolbar hamburger) */
.fv-menu-wrapper {
  position: relative;
  flex: 0 0 auto;
}
.fv-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 230px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}
.fv-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
}
.fv-menu-label {
  color: var(--text-2);
  flex: 0 0 auto;
}
.fv-menu-select {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 150px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  font-size: 12.5px;
}
.fv-view-menu {
  gap: 4px;
  min-width: 180px;
  padding: 8px;
}
.fv-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  text-align: left;
}
.fv-menu-item:hover {
  background: var(--hover);
}
.fv-bg-popover {
  z-index: 260;
}

/* text button */
.fv-btn {
  --button-shadow-color: var(--border-strong);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: 8px;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 590;
  cursor: pointer;
  border: 0.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--button-shadow);
  transition: background 0.12s, transform 0.04s;
}
.fv-btn:hover {
  background: var(--hover);
}
.fv-btn:active {
  transform: translateY(0.5px);
}
.fv-btn.primary {
  --button-shadow-color: var(--accent);
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.fv-btn.primary:hover {
  background: var(--accent-press);
}
.fv-btn[disabled] {
  color: var(--text-3);
  opacity: 0.5;
  cursor: default;
}

/* segmented control */
.fv-seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: var(--chrome-2);
  box-shadow: inset 0 0 0 0.5px var(--border);
  flex: 0 0 auto;
}
.fv-seg button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 24px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 560;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}
.fv-seg button:hover {
  color: var(--text);
}
.fv-seg button.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
}

/* search field */
.fv-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  min-width: 150px;
  border-radius: 8px;
  background: var(--muted);
  color: var(--text-3);
  box-shadow: inset 0 0 0 0.5px var(--border);
}
.fv-search input {
  border: 0;
  background: transparent;
  outline: none;
  color: var(--text);
  font: inherit;
  width: 100%;
}
.fv-search input::placeholder {
  color: var(--text-3);
}

/* small select chip */
.fv-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 8px 0 10px;
  border-radius: 7px;
  background: var(--muted);
  color: var(--text);
  font-size: 12px;
  font-weight: 560;
  box-shadow: inset 0 0 0 0.5px var(--border);
  user-select: none;
}
.fv-chip[role="button"] {
  cursor: pointer;
}
.fv-chip .cv {
  color: var(--text-3);
  display: inline-flex;
}

/* ============================== body =============================== */
.fv-body {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  background: var(--bg);
  position: relative;
}
/* Column-fill wrapper for viewers that stack a sub-bar / notice over scroll. */
.fv-pane {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
}
/* Split panes (markdown split view). */
.fv-split {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
}
.fv-split > .fv-scroll + .fv-scroll {
  border-left: 1px solid var(--hairline);
}
.fv-scroll {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.fv-scroll::-webkit-scrollbar,
.fv-grid-wrap::-webkit-scrollbar,
.fv-logwrap::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}
.fv-scroll::-webkit-scrollbar-thumb,
.fv-grid-wrap::-webkit-scrollbar-thumb,
.fv-logwrap::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text-3) 48%, transparent);
  border-radius: 7px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
.fv-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
  background-clip: padding-box;
}
.fv-scroll::-webkit-scrollbar-corner {
  background: transparent;
}

/* ===================== status (in the global Status Bar) =========== */
/* The Document's status segments are portaled into the app's global Status Bar
   (`.status-bar-document`), not a per-Document footer. */
.status-bar-document {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
}
.status-bar-document-status {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  font-size: 11.5px;
  white-space: nowrap;
}
.status-bar-document-status .seg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.status-bar-document-status .seg b {
  color: var(--text);
  font-weight: 600;
}
.status-bar-document-status .seg.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.fv-footer-slot {
  display: contents;
}
.status-bar-document-status .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--green);
  font-weight: 600;
}
.status-bar-document-status .badge.ro {
  color: var(--text-3);
}
.status-bar-document-status .badge.warn {
  color: var(--amber);
}
.status-bar-document-status .badge .fv-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* ============================== status / notices ================== */
.file-viewer-status {
  padding: 24px;
  color: var(--text-2);
}
.file-viewer-status-error {
  color: var(--red);
  white-space: pre-wrap;
}
.file-viewer-notice {
  padding: 4px 14px;
  font-size: 12px;
  color: var(--text-2);
  background: var(--muted);
  border-bottom: 1px solid var(--hairline);
  flex: 0 0 auto;
}
.file-viewer-notice-warn {
  color: var(--amber);
}

/* ===================== mode: text & code (CodeMirror) ============== */
.file-viewer-codemirror {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
}
.file-viewer-codemirror .cm-editor {
  height: 100%;
}
.file-viewer-codemirror .cm-scroller {
  font-family: var(--fv-font-family, var(--mono));
  font-size: var(--fv-font-size, var(--mono-size));
}

/* ===================== mode: markdown ============================== */
.fv-md {
  padding: 36px 48px 56px;
  max-width: 760px;
  margin: 0 auto;
}
.fv-md h1 {
  font-size: 30px;
  font-weight: 680;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.fv-md h2 {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 30px 0 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--hairline);
}
.fv-md h3 {
  font-size: 16px;
  font-weight: 640;
  margin: 22px 0 8px;
}
.fv-md p {
  margin: 0 0 13px;
  color: var(--text);
}
.fv-md a {
  color: var(--accent);
  text-decoration: none;
}
.fv-md ul,
.fv-md ol {
  margin: 0 0 14px;
  padding-left: 22px;
}
.fv-md li {
  margin: 4px 0;
}
.fv-md code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--muted);
  padding: 1.5px 6px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 0.5px var(--border);
}
.fv-md pre {
  background: var(--gutter-bg);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 16px;
}
.fv-md pre code {
  background: none;
  box-shadow: none;
  padding: 0;
  font-size: var(--mono-size);
  line-height: 1.6;
  display: block;
}
.fv-md blockquote {
  margin: 0 0 16px;
  padding: 4px 16px;
  border-left: 3px solid var(--accent);
  color: var(--text-2);
}
.fv-md table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 16px;
  font-size: 12.5px;
}
.fv-md th,
.fv-md td {
  text-align: left;
  padding: 7px 12px;
  border-bottom: 1px solid var(--hairline);
}
.fv-md th {
  color: var(--text-2);
  font-weight: 640;
}
.fv-md hr {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 26px 0;
}
.fv-md img {
  max-width: 100%;
}
.fv-md-source {
  font-family: var(--fv-font-family, var(--mono));
  font-size: var(--fv-font-size, var(--mono-size));
  line-height: 1.7;
  padding: 20px 24px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ===================== mode: json tree ============================= */
.fv-json {
  padding: 12px 8px 18px 4px;
  font-family: var(--fv-font-family, var(--mono));
  font-size: var(--fv-font-size, var(--mono-size));
  line-height: 1.7;
}
.fv-jrow {
  display: flex;
  align-items: flex-start;
  padding: 0 14px;
  border-radius: 5px;
}
.fv-jrow:hover {
  background: var(--hover);
}
.fv-jtw {
  width: 16px;
  flex: 0 0 auto;
  color: var(--text-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fv-jtw.leaf {
  visibility: hidden;
}
/* JSON syntax colors derived from semantic tokens so they adapt to every scheme */
.fv-jkey {
  color: var(--accent);
}
.fv-jpunc {
  color: var(--text-3);
}
.fv-jstr {
  color: var(--green);
}
.fv-jnum {
  color: var(--amber);
}
.fv-jbool {
  color: var(--red);
}
.fv-jnull {
  color: var(--text-3);
}
.fv-jcount {
  color: var(--text-3);
  font-style: italic;
  margin-left: 8px;
}

/* ===================== mode: table (csv) ========================== */
.fv-grid-wrap {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}
.fv-table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  font-family: var(--fv-font-family, inherit);
  font-size: var(--fv-font-size, 12.5px);
}
.fv-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--chrome);
  color: var(--text-2);
  font-weight: 640;
  text-align: left;
  white-space: nowrap;
  padding: 0 12px;
  height: 30px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}
.fv-table thead th:hover {
  color: var(--text);
}
.fv-table thead th .sort {
  color: var(--accent);
  margin-left: 4px;
  display: inline-flex;
  vertical-align: middle;
}
.fv-table thead th.num,
.fv-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
}
.fv-table thead th.rownum,
.fv-table td.rownum {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 52px;
  text-align: right;
  background: var(--gutter-bg);
  color: var(--gutter-text);
  font-family: var(--mono);
  font-size: 11px;
  padding: 0 10px 0 12px;
  border-right: 1px solid var(--hairline);
  cursor: default;
}
.fv-table thead th.rownum {
  z-index: 4;
}
.fv-table td {
  padding: 0 12px;
  height: var(--row-h);
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
  color: var(--text);
}
.fv-table tbody tr:hover td {
  background: var(--hover);
}
.fv-table tbody tr:hover td.rownum {
  background: var(--chrome-2);
}

/* ===================== mode: log viewer =========================== */
.fv-logbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 12px;
  height: 42px;
  border-bottom: 1px solid var(--hairline);
  background: var(--chrome);
  flex: 0 0 auto;
}
.fv-log-parser {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 560;
}
.fv-log-parser select {
  height: 26px;
  max-width: 150px;
  padding: 0 6px;
  border: 0.5px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.fv-levels {
  display: inline-flex;
  gap: 4px;
}
.fv-lvl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 0.5px solid var(--border);
  background: var(--bg);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 640;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.fv-lvl .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.fv-lvl.error .dot {
  background: var(--red);
}
.fv-lvl.warn .dot {
  background: var(--amber);
}
.fv-lvl.info .dot {
  background: var(--accent);
}
.fv-lvl.debug .dot,
.fv-lvl.trace .dot {
  background: var(--text-3);
}
.fv-lvl.off {
  opacity: 0.45;
}
.fv-lvl.on {
  color: var(--text);
}
.fv-lvl.error.on {
  border-color: color-mix(in srgb, var(--red) 55%, transparent);
  background: color-mix(in srgb, var(--red) 11%, transparent);
}
.fv-lvl.warn.on {
  border-color: color-mix(in srgb, var(--amber) 55%, transparent);
  background: color-mix(in srgb, var(--amber) 12%, transparent);
}
.fv-lvl.info.on {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.fv-lvl.debug.on,
.fv-lvl.trace.on {
  border-color: var(--border);
  background: var(--muted);
}
.fv-follow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.fv-logwrap {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  font-family: var(--fv-font-family, var(--mono));
  font-size: var(--fv-font-size, var(--mono-size));
}
.fv-logrow {
  display: grid;
  grid-template-columns: max-content minmax(0, max-content) minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  padding: 3px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--hairline) 55%, transparent);
}
.fv-logrow:hover {
  background: var(--hover);
}
.fv-logrow .ln {
  justify-self: end;
  color: var(--gutter-text);
  text-align: right;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.fv-logrow .lv {
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.fv-logrow .lv.error {
  color: var(--red);
}
.fv-logrow .lv.warn {
  color: var(--amber);
}
.fv-logrow .lv.info {
  color: var(--accent);
}
.fv-logrow .lv.debug,
.fv-logrow .lv.trace,
.fv-logrow .lv.none {
  color: var(--text-3);
}
.fv-logrow .msg {
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.fv-logrow.error {
  background: color-mix(in srgb, var(--red) 7%, transparent);
}
.fv-logrow.error:hover {
  background: color-mix(in srgb, var(--red) 12%, transparent);
}
.fv-logrow.warn {
  background: color-mix(in srgb, var(--amber) 7%, transparent);
}

/* ===================== mode: image / media ======================== */
.fv-imgstage {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  position: relative;
  padding: 20px;
  background-color: var(--muted);
  background-image: linear-gradient(45deg, var(--hover) 25%, transparent 25%),
    linear-gradient(-45deg, var(--hover) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--hover) 75%),
    linear-gradient(-45deg, transparent 75%, var(--hover) 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
}
.fv-bg-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.fv-bg-fill,
.fv-bg-layer .dashboard-dynamic-background {
  position: absolute;
  inset: 0;
}
.fv-bg-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--fv-bg-dim-color, transparent);
}
.fv-bg-media video {
  width: 100%;
  height: 100%;
}
.fv-img {
  transform-origin: center;
  max-width: none;
  border-radius: 4px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.06);
  position: relative;
  z-index: 1;
}
.fv-img.fit {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ===================== mode: hex ================================== */
.fv-hex {
  padding: 12px 0;
  font-family: var(--mono);
  font-size: var(--mono-size);
  line-height: 1.85;
}
.fv-hexrow {
  display: grid;
  grid-template-columns: 92px 1fr 200px;
  gap: 22px;
  padding: 0 18px;
}
.fv-hexrow:hover {
  background: var(--hover);
}
.fv-hexrow .off {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.fv-hexrow .by {
  color: var(--text);
  letter-spacing: 0.5px;
  white-space: pre;
}
.fv-hexrow .as {
  color: var(--text-2);
  white-space: pre;
}
.fv-hexrow .as .np {
  color: var(--text-3);
}
.fv-hexhead {
  display: grid;
  grid-template-columns: 92px 1fr 200px;
  gap: 22px;
  padding: 0 18px 8px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 640;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 6px;
  font-family: var(--mono);
}

/* ===================== install gate (PDF) ======================== */
.fv-gate {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  gap: 4px;
}
.fv-gate .glyph {
  width: 78px;
  height: 78px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 18px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}
.fv-gate h3 {
  font-size: 18px;
  font-weight: 660;
  letter-spacing: -0.01em;
  margin: 0;
}
.fv-gate p {
  color: var(--text-2);
  font-size: 13.5px;
  max-width: 420px;
  margin: 6px 0 0;
  line-height: 1.5;
}
.fv-gate .tool {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 4px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--muted);
  box-shadow: inset 0 0 0 0.5px var(--border);
  text-align: left;
}
.fv-gate .tool .ti {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  box-shadow: inset 0 0 0 0.5px var(--border);
  flex: 0 0 auto;
}
.fv-gate .tool .tt {
  font-weight: 620;
  font-size: 13px;
}
.fv-gate .tool .ts {
  color: var(--text-2);
  font-size: 11.5px;
  margin-top: 1px;
}
.fv-gate .actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
  justify-content: center;
}
.fv-gate .uac {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  color: var(--text-3);
  font-size: 11.5px;
}

/* ===================== unsupported file choice ======================== */
.fv-unsupported {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.fv-unsupported-card {
  width: min(520px, 100%);
  border-radius: 20px;
  background: var(--panel);
  box-shadow:
    inset 0 0 0 1px var(--hairline),
    0 20px 48px color-mix(in srgb, var(--shadow) 38%, transparent);
  padding: 28px;
  text-align: center;
}
.fv-unsupported-card > svg,
.fv-unsupported-card > .file-glyph {
  margin-bottom: 16px;
}
.fv-unsupported-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 660;
  letter-spacing: -0.01em;
}
.fv-unsupported-card p {
  max-width: 420px;
  margin: 10px auto 0;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.5;
}
.fv-unsupported-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.fv-large-text-pane {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.fv-large-text-scroll {
  min-height: 0;
  flex: 1;
  overflow: auto;
  font-family: var(--fv-font-family, var(--mono));
  font-size: var(--fv-font-size, 13px);
  background: color-mix(in srgb, var(--surface) 94%, var(--surface-raised));
}

.fv-large-text-spacer {
  position: relative;
  min-width: max-content;
}

.fv-large-text-window {
  position: absolute;
  inset-inline: 0;
  top: 0;
}

.fv-large-text-line {
  display: grid;
  grid-template-columns: minmax(52px, max-content) 1fr;
  min-height: 20px;
  line-height: 20px;
  white-space: pre;
}

.fv-large-text-ln {
  position: sticky;
  left: 0;
  padding: 0 10px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface) 96%, var(--surface-raised));
  border-right: 1px solid var(--border-subtle);
  text-align: right;
  user-select: none;
}

.fv-large-text-code {
  padding: 0 12px;
}
