/* DossiPDF (eCTD PDF Processing Tool, by NextiFact) — one stylesheet.
   Standard enterprise palette: neutral greys, one blue accent, semantic green / amber / red.
   Flat surfaces with 1px borders, 6px corners, one button scale (36 / 30 px). Light + dark. */
[hidden] { display: none !important; }
:root {
  /* Company brand (DossiGo, from tp01 resources/brand + web/src/styles.css): navy #0B1B33, brand blue #2563EB,
     slate neutrals, status colours that pass WCAG AA on white. Change colours here only. */
  --canvas: #eef2f7; --bg: #f8fafc; --panel: #ffffff; --panel-2: #f8fafc; --hover: #f1f5f9; --head: #ffffff;
  --ink: #0f172a; --muted: #334155; --faint: #5b6779; --line: #e2e8f0; --line-2: #cbd5e1;
  --shell: #0b1b33; --shell-2: #132a4d; --shell-ink: #ffffff; --shell-muted: #a9b8cc; --shell-hover: rgba(255, 255, 255, .08); --shell-accent: #60a5fa;
  --accent: #2563eb; --accent-hover: #1d4ed8; --accent-press: #1e40af; --accent-ink: #ffffff; --accent-soft: #eff6ff; --accent-line: #bfdbfe;
  --ok: #15803d; --ok-soft: #f0fdf4; --warn: #b45309; --warn-soft: #fffbeb; --bad: #b91c1c; --bad-soft: #fef2f2; --info-soft: #f1f5f9;
  --pdf: #c4314b;
  --side: #f8fafc; --side-head: #f1f5f9; --side-line: #e2e8f0; --side-card: #ffffff; --side-title: #0b1b33;
  --focus: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); --radius: 6px; --card-radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .08);
  --font: "Inter Variable", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --canvas: #0b1220; --bg: #0b1220; --panel: #101a2c; --panel-2: #16233a; --hover: #1c2941; --head: #101a2c;
    --ink: #e2e8f0; --muted: #cbd5e1; --faint: #94a3b8; --line: #263449; --line-2: #334155;
    --shell: #0d1526; --shell-2: #13213a; --shell-ink: #ffffff; --shell-muted: #94a3b8; --shell-hover: rgba(255, 255, 255, .06); --shell-accent: #60a5fa;
    --side: #0e1729; --side-head: #0d1526; --side-line: #263449; --side-card: #16233a; --side-title: #e2e8f0;
    --accent: #3b82f6; --accent-hover: #60a5fa; --accent-press: #93c5fd; --accent-ink: #0b1220; --accent-soft: #1e3a5f; --accent-line: #2b4f80;
    --ok: #4ade80; --ok-soft: #14331f; --warn: #fbbf24; --warn-soft: #3a2c10; --bad: #f87171; --bad-soft: #3f1a1e; --info-soft: #1c2941;
    --pdf: #f87171; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 1px 3px rgba(0, 0, 0, .3);
    color-scheme: dark; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 14px/1.5 var(--font); min-height: 100vh; overflow-x: hidden; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; } h1 { font-size: 20px; font-weight: 600; } h2 { font-size: 15px; font-weight: 600; } p { margin: 4px 0 0; } code { font-family: ui-monospace, Menlo, Consolas, monospace; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .ok-t { color: var(--ok); font-weight: 600; } .bad-t { color: var(--bad); } .warn-t { color: var(--warn); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.i { flex: none; vertical-align: -3px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: 13px; } label small { font-weight: 400; color: var(--muted); }
input:not([type=checkbox]):not([type=file]), select { font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 7px 10px; min-height: 36px; }
input:hover:not([type=checkbox]), select:hover { border-color: var(--faint); }
input[type=checkbox] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex: none; }
:focus-visible { outline: none; box-shadow: var(--focus); }
input:focus-visible, select:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* ---- buttons: primary (filled), secondary (outlined), danger, link; sizes 36 / 30 px ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); border-radius: var(--radius); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s, color .12s; white-space: nowrap; }
.btn:not(:disabled):hover { background: var(--hover); border-color: var(--faint); }
.btn:not(:disabled):active { background: var(--line); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:not(:disabled):hover { background: var(--accent-hover); border-color: var(--accent-hover); } .btn.primary:not(:disabled):active { background: var(--accent-press); border-color: var(--accent-press); }
.btn.danger { color: var(--bad); } .btn.danger:not(:disabled):hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.quiet { background: transparent; border-color: transparent; color: var(--muted); padding: 0 10px; } .btn.quiet:not(:disabled):hover { background: var(--bad-soft); border-color: transparent; color: var(--bad); } .btn.wide { width: 100%; height: 40px; } .btn.big { height: 40px; padding: 0 24px; font-weight: 600; }
.btn:disabled { background: var(--hover); border-color: var(--line); color: var(--faint); cursor: not-allowed; }
.btn.primary:disabled { background: color-mix(in srgb, var(--accent) 35%, var(--panel)); border-color: transparent; color: var(--panel); opacity: .9; }
.link { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; text-decoration: none; border-radius: 2px; } .link:hover { text-decoration: underline; }
.icon-btn { background: none; border: none; color: var(--faint); cursor: pointer; border-radius: var(--radius); width: 30px; height: 30px; display: inline-grid; place-items: center; } .icon-btn:hover { background: var(--hover); color: var(--bad); }

/* ---- sign in ---- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.auth-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--shell); border-radius: 4px; padding: 32px; display: grid; gap: 14px; box-shadow: 0 4px 16px rgba(17, 24, 39, .08); }
.auth-card h1 { font-size: 20px; font-weight: 600; } .auth-card p { margin: 0; }
.brand-mark { width: 32px; height: 32px; border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 11px; letter-spacing: .3px; flex: none; }
.pw { display: flex; gap: 10px; align-items: center; } .pw input { flex: 1; }
.form-error { color: var(--bad); min-height: 1.3em; font-size: 13px; font-weight: 500; margin: 0; }
.form-ok { color: var(--ok); font-size: 13px; margin: 8px 0; } .form-ok code { background: var(--accent-soft); padding: 2px 6px; border-radius: 4px; user-select: all; color: var(--ink); }

/* ---- app bar: dark navy shell ---- */
.appbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 24px; padding: 0 20px; height: 48px; background: linear-gradient(90deg, var(--shell) 0%, var(--shell-2) 100%); color: var(--shell-ink); box-shadow: inset 0 -2px 0 var(--shell-accent); }
.brand { display: flex; align-items: center; gap: 10px; } .brand-name { font-size: 15px; font-weight: 600; letter-spacing: .1px; white-space: nowrap; }
.appbar .brand-mark { width: 28px; height: 28px; border-radius: 7px; background: none; display: block; }
.brand-text { display: grid; line-height: 1.15; } .brand-sub { font-size: 11px; color: var(--shell-muted); letter-spacing: .2px; white-space: nowrap; }
.by-nf { display: inline-flex; align-items: center; gap: 6px; color: var(--shell-muted); font-size: 11.5px; text-decoration: none; padding: 4px 8px; border-radius: 6px; opacity: .9; }
.by-nf:hover { background: var(--shell-hover); opacity: 1; } .by-nf img { display: block; height: 15px; width: auto; }
img.brand-mark { background: none; width: 40px; height: 40px; }
.built-by { justify-self: center; display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--faint); text-decoration: none; }
.built-by img { display: block; height: 16px; width: auto; } .built-by:hover { color: var(--ink); }
.tabs { display: flex; gap: 0; flex: 1; align-self: stretch; margin-left: 8px; }
.tab { background: none; border: none; border-bottom: 3px solid transparent; border-top: 3px solid transparent; font: inherit; font-weight: 500; color: var(--shell-muted); padding: 0 16px; cursor: pointer; transition: color .15s, background .15s; }
.tab:hover { color: var(--shell-ink); background: var(--shell-hover); }
.tab.active { color: var(--shell-ink); font-weight: 600; border-bottom-color: var(--shell-accent); }
.tab:focus-visible { box-shadow: inset 0 0 0 2px var(--shell-ink); }
.appbar .user-btn { color: var(--shell-ink); } .appbar .user-btn:not(:disabled):hover { background: var(--shell-hover); border-color: transparent; }
.appbar .avatar { background: var(--shell-hover); color: var(--shell-ink); border: 1px solid var(--shell-muted); }
.user-menu { position: relative; }
.user-btn { gap: 8px; padding: 0 10px 0 4px; height: 36px; border-color: transparent; background: transparent; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(17, 24, 39, .12); padding: 4px; display: grid; }
.menu-head { padding: 8px 10px; display: grid; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu button { background: none; border: none; text-align: left; padding: 8px 10px; border-radius: 4px; font: inherit; color: var(--ink); cursor: pointer; } .menu button:hover { background: var(--hover); }

/* ---- application frame: header, then a settings rail and the file list fill the window ---- */
#view-app:not([hidden]) { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
#view-history { flex: 1; overflow-y: auto; width: 100%; max-width: 1240px; margin: 0 auto; padding: 20px 24px 40px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.hint { color: var(--faint); font-size: 12.5px; font-weight: 400; margin: 0; } .hint.block { display: block; margin-top: 2px; } .dim { color: var(--faint); }
code { font-size: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; color: var(--ink); white-space: nowrap; }
.ws { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--lw, 320px) minmax(0, 1fr) var(--rw, 380px); gap: 8px; padding: 8px; background: var(--canvas); position: relative; transition: grid-template-columns .2s ease; }
body.left-off .ws { --lw: 44px; } body.right-off .ws { --rw: 44px; }
.pane { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--panel); border-radius: var(--card-radius); box-shadow: var(--shadow); overflow: hidden; }
.pane-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 52px; padding: 0 12px 0 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.pane-head h1, .pane-head h2 { font-size: 15px; font-weight: 600; letter-spacing: -.1px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pane-btn { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border: none; border-radius: var(--radius); background: transparent; color: var(--faint); cursor: pointer; transition: background .15s, color .15s; }
.pane-btn:hover { background: var(--hover); color: var(--ink); }
.pane-strip { display: none; flex: 1; flex-direction: column; align-items: center; gap: 12px; padding: 12px 0; border: none; background: var(--panel); color: var(--muted); cursor: pointer; font: inherit; border-radius: var(--card-radius); }
.pane-strip:hover { background: var(--hover); color: var(--ink); }
.strip-lbl { writing-mode: vertical-rl; font-size: 13px; font-weight: 600; letter-spacing: .3px; }
body.left-off #pane-left > :not(.pane-strip), body.right-off #inspector > :not(.pane-strip) { display: none !important; }
body.left-off #show-left, body.right-off #show-right { display: flex; }
.pane-right { }
.insp-empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 32px 36px; text-align: center; color: var(--muted); font-size: 13px; }
.insp-empty b { color: var(--ink); font-size: 14px; }
.ie-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--info-soft); color: var(--faint); margin-bottom: 6px; }
.dr { flex: 1; min-height: 0; }
.dr-close { display: none !important; }

/* side panels: cool slate surface, distinct from the white file list and the navy app bar */
#pane-left, #inspector { background: var(--side); }
#pane-left > .pane-head, #inspector > .pane-head { background: var(--side-head); border-bottom-color: var(--side-line); }
#pane-left .pane-head h2, #inspector .pane-head h2 { color: var(--side-title); }
#pane-left .rs + .rs { border-top-color: var(--side-line); }
#pane-left .picker.set, #pane-left .pi-line, #pane-left select, #pane-left .wide-btn { background-color: var(--side-card); }
#pane-left .picker:not(.set):not(.pending) { background: transparent; border-color: #b9c6d3; }
#pane-left .picker:not(.set):not(.pending):hover { background: var(--accent-soft); border-color: var(--accent); }
#pane-left .pk-ic { background: var(--side-card); }
#pane-left .runbox { background: var(--side-head); border-top-color: var(--side-line); }
#inspector .pane-strip, #pane-left .pane-strip { background: var(--side); }
#inspector .dr-foot { background: var(--side-head); border-top-color: var(--side-line); }
#inspector .props, #inspector .insp-empty .ie-icon { background: var(--side-card); }
/* settings rail */
.rail { }
.rail-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 0 20px 12px; }
.rs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 20px 0; } .rs + .rs { border-top: 1px solid var(--line); }
.rs-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rs-h { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--faint); } .rs-h .i { display: none; }
.rs-sub { font-size: 12px; color: var(--faint); }
.fld { display: grid; gap: 6px; font-weight: 400; min-width: 0; } .fld > span { font-size: 13px; font-weight: 600; color: var(--ink); }
.fld-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.rail select { width: 100%; min-width: 0; text-overflow: ellipsis; height: 36px; padding: 0 32px 0 11px; font-size: 14px; appearance: none; -webkit-appearance: none; cursor: pointer; border-radius: 6px; border-color: var(--line-2); border-bottom-color: var(--faint);
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23707070' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center; }
.rail select:focus-visible { border-bottom: 2px solid var(--accent); box-shadow: none; }
/* guidance line */
.pi-line { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 8px 8px 8px 12px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; }
.pi-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--faint); } .pi-dot.ok { background: var(--ok); } .pi-dot.note { background: var(--warn); }
.pi-text { flex: 1; min-width: 0; display: grid; line-height: 1.35; } .pi-text b { font-weight: 600; }
.pi-s { font-size: 12px; font-weight: 500; }
/* folder tiles */
.picker { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border: 1px dashed var(--line-2); border-radius: 8px; background: var(--panel-2); cursor: pointer; transition: border-color .15s, background-color .15s; min-width: 0; }
.picker:hover { border-color: var(--accent); background: var(--accent-soft); }
.pk-ic { width: 36px; height: 36px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--faint); }
.pk-text { flex: 1; min-width: 0; display: grid; line-height: 1.35; }
.pk-t { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-s { font-size: 12.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker .btn { height: 30px; padding: 0 12px; font-size: 13px; flex: none; }
.picker.set { border-style: solid; border-color: var(--line); background: var(--panel); }
.picker.set:hover { border-color: var(--line-2); background: var(--hover); }
.picker.set .pk-ic { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.picker.set .pk-s { color: var(--ink); font-weight: 500; }
.picker.pending { border-style: solid; border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); } .picker.pending .pk-s { color: var(--warn); }
.fld-links { display: flex; gap: 16px; font-size: 12.5px; margin: -6px 0 0 60px; } .fld-links:not(:has(> :not([hidden]))) { display: none; }
.more { border-top: 1px solid var(--line); padding-top: 2px; }
.more summary { cursor: pointer; padding: 8px 0 4px; font-size: 13px; font-weight: 600; color: var(--ink); list-style: none; display: flex; align-items: center; gap: 6px; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: ''; width: 7px; height: 7px; border-right: 1.6px solid var(--faint); border-bottom: 1.6px solid var(--faint); transform: rotate(-45deg); margin: 0 4px 0 2px; transition: transform .15s; }
.more[open] summary::before { transform: rotate(45deg); }
.more summary:hover { color: var(--accent); }
.more-body { display: grid; gap: 2px; padding: 2px 0 0; }
/* switch rows */
.sw-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; font-size: 13px; font-weight: 400; color: var(--ink); cursor: pointer; }
.sw-text { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.sw-row .switch { flex: none; }
.switch { position: relative; display: inline-flex; flex: none; width: 36px; height: 20px; margin-top: 1px; }
.switch input { position: absolute; inset: 0; width: 100% !important; height: 100% !important; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.slider { width: 36px; height: 20px; border-radius: 10px; border: 1px solid var(--muted); background: var(--panel); transition: background-color .15s, border-color .15s; position: relative; }
.slider::after { content: ''; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); transition: transform .15s; }
.switch input:checked + .slider { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .slider::after { transform: translateX(16px); background: #fff; }
.switch input:hover:not(:checked) + .slider { border-color: var(--ink); }
.switch input:focus-visible + .slider { box-shadow: var(--focus); }
@media (prefers-reduced-motion: reduce) { .slider, .slider::after, .picker { transition: none; } }
.wide-btn { width: 100%; justify-content: space-between; height: 36px; border-radius: 6px; } .wide-btn .i:first-child { color: var(--accent); }
.wide-btn .wb-t { flex: 1; text-align: left; } .wide-btn { gap: 8px; }
/* ⓘ info button + tooltip */
.info { flex: none; width: 16px; height: 16px; padding: 0; border-radius: 50%; border: 1.2px solid var(--faint); background: transparent; color: var(--faint); font: italic 700 10px/1 Georgia, "Times New Roman", serif; display: inline-grid; place-items: center; cursor: help; vertical-align: middle; position: relative; }
.info::after { content: ''; position: absolute; inset: -8px; }
.info:hover, .info:focus-visible { border-color: var(--accent); color: var(--accent); }
.tip { position: fixed; z-index: 100; max-width: 280px; padding: 8px 11px; border-radius: 6px; background: #0b1b33; color: #fff; font-size: 12.5px; line-height: 1.45; font-weight: 400; box-shadow: 0 4px 16px rgba(0, 0, 0, .2); pointer-events: none; }
@media (prefers-color-scheme: dark) { .tip { background: #e2e8f0; color: #0b1b33; } }

/* run box at the foot of the rail */
.runbox { flex: none; display: grid; gap: 12px; padding: 16px 20px 18px; border-top: 1px solid var(--line); background: var(--panel-2); }
.rb-sum { display: grid; font-size: 13px; line-height: 1.4; } .rb-sum b { font-size: 14px; } #sb-sub { color: var(--muted); } #sb-sub .link { font-size: 13px; }
.rb-prog { display: grid; gap: 4px; } .rb-act { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); } .rb-act #counts { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn.run { width: 100%; height: 42px; font-size: 15px; font-weight: 600; border-radius: var(--radius); }
.rb-out { display: flex; flex-wrap: wrap; gap: 6px; } .rb-out:not(:has(> :not([hidden]))) { display: none; } .rb-out .btn { flex: 1 1 auto; }

/* file list */
.files { background: var(--panel); }
.files.over .grid-wrap { box-shadow: 0 0 0 2px var(--accent); }
.files-head { flex-wrap: nowrap; }
.fh-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.count-pill { font-size: 12px; font-weight: 600; line-height: 20px; padding: 0 8px; border-radius: 10px; background: var(--info-soft); color: var(--muted); }
.files-cmd { display: flex; align-items: center; gap: 8px; } .files-cmd .link { margin-left: 6px; font-size: 13px; }
.btn.ghost-danger { background: transparent; border-color: transparent; color: var(--muted); } .btn.ghost-danger:not(:disabled):hover { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.files-bar { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.tabs-sm { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border-radius: 8px; background: var(--info-soft); }
.filter { background: transparent; border: none; border-radius: 6px; padding: 0 12px; height: 30px; font: inherit; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; }
.filter b { margin-left: 6px; font-weight: 600; color: var(--faint); }
.filter:hover { color: var(--ink); } .filter.active { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: 0 0 1px rgba(0,0,0,.2), 0 1px 2px rgba(0,0,0,.12); } .filter.active b { color: var(--accent); }
.filter.err b { color: var(--bad); }
.search { position: relative; display: block; } .search > span > .i { position: absolute; left: 10px; top: 9px; color: var(--faint); pointer-events: none; }
.search input { height: 32px; min-height: 32px !important; width: 240px; padding: 0 10px 0 32px !important; font-size: 13px; border-radius: 6px; }
.fc-note { flex: none; display: flex; align-items: center; gap: 8px; margin: 0; padding: 9px 16px; font-size: 13px; font-weight: 500; color: var(--ok); border-bottom: 1px solid var(--line); background: var(--panel); }
.fc-ic { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.fc-note.warn { color: var(--warn); }
.grid-wrap { flex: 1; min-height: 0; overflow: auto; margin-top: 0; background: var(--panel); border: none; border-radius: 0; display: flex; flex-direction: column; }
.grid { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 13.5px; }
.grid th { position: sticky; top: 0; z-index: 2; background: var(--panel); border-bottom: 1px solid var(--line-2); text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 0; height: 36px; white-space: nowrap; }
.sort { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 4px; width: 100%; height: 36px; padding: 0 12px; cursor: pointer; }
.sort:hover { color: var(--ink); } .sort:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
th[aria-sort="ascending"] .sort::after { content: '▲'; font-size: 8px; color: var(--accent); } th[aria-sort="descending"] .sort::after { content: '▼'; font-size: 8px; color: var(--accent); }
th[aria-sort="ascending"], th[aria-sort="descending"] { color: var(--ink); }
.c-ico { width: 48px; } .c-num { width: 62px; text-align: right; } .c-status { width: 156px; } .c-result { width: 26%; }
.grid th.c-num .sort { justify-content: flex-end; }
.grid td { padding: 0 12px; height: 54px; border-bottom: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.grid tr:last-child td { border-bottom: none; }
.grid td.c-ico { padding: 0 0 0 18px; } .grid td.c-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.grid td.c-result { color: var(--muted); } .grid td.c-result.bad-t { color: var(--bad); } .grid td.c-result.warn-t { color: var(--warn); }
#rows tr { cursor: pointer; } #rows tr:hover td { background: var(--panel-2); }
#rows tr.sel td { background: var(--accent-soft); } #rows tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
#rows tr:focus-visible { outline: none; } #rows tr:focus-visible td { box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
.c-name .nm { display: block; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; } .c-name .sub { display: block; margin-top: 2px; font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; }
.grid .fi::before { background: linear-gradient(225deg, var(--panel) 50%, var(--line-2) 50%); } #rows tr:hover .fi::before { background: linear-gradient(225deg, var(--panel-2) 50%, var(--line-2) 50%); } #rows tr.sel .fi::before { background: linear-gradient(225deg, var(--accent-soft) 50%, var(--line-2) 50%); }
.doc-ico { display: inline-grid; place-items: center; color: var(--faint); vertical-align: middle; } .doc-ico.ok { color: var(--ok); } .doc-ico.bad { color: var(--bad); }
.mini { display: flex; align-items: center; gap: 8px; } .mini .file-pct { width: 34px; text-align: right; font-size: 12px; color: var(--muted); }
.grid.is-empty { display: none; }
.empty-drop { flex: 1; margin: 20px; min-height: 260px; border: 1px dashed var(--line-2); border-radius: var(--card-radius); background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 16px 16px; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; padding: 32px 16px; cursor: pointer; color: var(--muted); transition: border-color .15s, background .15s; }
.empty-drop:hover { border-color: var(--accent); background: var(--accent-soft); } .empty-drop strong { font-size: 15px; font-weight: 600; color: var(--ink); }
.ed-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 8px; }
.empty { text-align: center; color: var(--muted); padding: 32px 0; margin: 0; }

/* details drawer: header (icon, name, status, close) · scrolling body · footer with the actions */
@keyframes slide-in { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.dr:not([hidden]) { display: flex; flex-direction: column; animation: fade-in .15s ease-out; }
.dr-head { flex: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 14px; padding: 18px 20px 16px; border-bottom: 1px solid var(--line); }
.dr-title { display: grid; gap: 8px; padding-top: 1px; min-width: 0; }
.dr-title h2 { font-size: 16px; font-weight: 600; line-height: 1.35; word-break: break-word; }
.dr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dr-close { width: 32px; height: 32px; margin-top: -4px; display: grid; place-items: center; border: none; border-radius: var(--radius); background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.dr-close:hover { background: var(--hover); color: var(--ink); }
.dr-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 20px 24px; }
.dr-sec { padding-top: 20px; }
.dr-h { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.dr-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--panel-2); }
.dr-foot-r { display: flex; gap: 8px; }
.cnt { font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--info-soft); border-radius: 10px; padding: 0 7px; line-height: 18px; } .cnt.warn { color: var(--warn); background: var(--warn-soft); }
.props { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 8px 12px; margin: 0; font-size: 13px; padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); }
.props dt { color: var(--faint); } .props dd { margin: 0; word-break: break-word; color: var(--ink); }
.msg { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; margin-top: 20px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); font-size: 13px; color: var(--muted); }
.msg.bad { border-color: color-mix(in srgb, var(--bad) 30%, transparent); background: var(--bad-soft); } .msg.bad > .i { color: var(--bad); } .msg > .i { margin-top: 2px; }
.msg b { display: block; margin-bottom: 2px; color: var(--ink); } .msg p { margin: 0; } .msg .hint { margin-top: 6px; }
.field { display: grid; gap: 6px; margin-top: 20px; } .field label { display: block; font-size: 13px; font-weight: 600; }
.dl { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13px; line-height: 1.45; }
.dl li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; }
.li-ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; } .li-ic.ok { background: var(--ok-soft); color: var(--ok); } .li-ic.warn { background: var(--warn-soft); color: var(--warn); }
.pw-input { width: 100%; min-height: 34px !important; padding: 4px 10px !important; }
.pw-row { display: flex; gap: 8px; align-items: center; } .pw-row .pw-input { flex: 1; }
/* status badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--muted); background: none; border: none; padding: 0; }
.badge .i { flex: none; } .b-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin: 0 2px; }
.b-ready { color: var(--ok); } .b-ready-with-notes { color: var(--warn); } .b-failed { color: var(--bad); }
.b-processing { color: var(--accent); } .b-new, .b-waiting, .b-stopped { color: var(--faint); font-weight: 500; }
.st { font-weight: 600; color: var(--muted); white-space: nowrap; font-size: 13px; }
/* PDF document icon */
.fi { position: relative; display: inline-block; width: 26px; height: 32px; border: 1px solid var(--line-2); border-radius: 3px 8px 3px 3px; background: var(--panel); vertical-align: middle; flex: none; }
.fi::before { content: ''; position: absolute; top: -1px; right: -1px; width: 9px; height: 9px; background: linear-gradient(225deg, var(--bg) 50%, var(--line-2) 50%); border-radius: 0 7px 0 2px; }
.fi > span { position: absolute; left: -4px; bottom: 5px; padding: 0 3px; font-size: 8px; font-weight: 700; line-height: 12px; letter-spacing: .3px; color: #fff; background: var(--pdf); border-radius: 2px; }
.fi.bad { border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.fi.lg { width: 34px; height: 42px; } .fi.lg > span { font-size: 9.5px; line-height: 14px; bottom: 7px; }
.pane-right .fi::before { background: linear-gradient(225deg, var(--panel) 50%, var(--line-2) 50%); }
.tag { display: inline-block; font-size: 12px; line-height: 20px; border: 1px solid var(--line); border-radius: 3px; padding: 0 6px; color: var(--muted); background: var(--panel); white-space: nowrap; }
.icon-btn.sm { width: 28px; height: 28px; }

/* ---- progress + status labels ---- */
.progress { width: 100%; height: 6px; background: var(--line); border-radius: 2px; overflow: hidden; } .progress.sm { height: 4px; flex: 1; }
.bar { height: 100%; width: 0; background: var(--accent); transition: width .35s ease; }
.bar.ready { background: var(--ok); } .bar.ready-with-notes { background: var(--warn); } .bar.failed, .bar.stopped { background: var(--bad); }
.chip { display: inline-block; font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--muted); }
.chip.ready { color: var(--ok); } .chip.ready-with-notes { color: var(--warn); } .chip.failed { color: var(--bad); } .chip.processing { color: var(--accent); }
.tag.guideline { color: var(--accent); border-color: var(--accent-line); }

/* ---- History ---- */
.hist-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; margin-bottom: 14px; } .hist-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; cursor: pointer; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; } .seg-btn { border: none; background: var(--panel); font: inherit; font-weight: 500; height: 34px; padding: 0 14px; cursor: pointer; color: var(--muted); } .seg-btn + .seg-btn { border-left: 1px solid var(--line-2); } .seg-btn.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.hist { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 8px; overflow: hidden; }
.hist-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; } .hist-main { flex: 1 1 220px; display: grid; } .hist-actions { display: flex; gap: 6px; }
.hist-files { list-style: none; margin: 0; padding: 4px 14px 10px; background: var(--panel-2); border-top: 1px solid var(--line); } .hist-files li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); } .hist-files li:last-child { border: none; }
.r-name { flex: 1 1 240px; min-width: 0; word-break: break-all; font-weight: 600; display: grid; } .r-note { color: var(--muted); font-size: 13px; font-weight: 400; margin: 4px 0 0; }
.pdf-ico { width: 30px; height: 34px; border-radius: 4px; background: var(--info-soft); color: var(--faint); font-size: 9px; font-weight: 700; display: grid; place-items: center; flex: none; }

/* ---- dialogs ---- */
dialog { color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 0; box-shadow: 0 16px 48px rgba(0, 0, 0, .24); } dialog::backdrop { background: rgba(17, 24, 39, .5); }
#dlg-password { width: min(430px, 94vw); padding: 24px; } .dlg-form { display: grid; gap: 12px; } .dlg-form p { margin: 0; } .dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
.wide-dlg { width: min(1000px, 96vw); max-height: 90vh; } .dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); } .dlg-body { padding: 16px 20px; }
.user-form h3 { margin-bottom: 8px; } .user-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: end; }
.table-wrap { overflow-x: auto; margin-top: 8px; } table.users { width: 100%; border-collapse: collapse; } .users th, .users td { border-bottom: 1px solid var(--line); padding: 9px 8px; text-align: left; vertical-align: middle; } .users th { font-size: 12px; color: var(--faint); font-weight: 600; background: var(--panel-2); }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.toast { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); background: #1f2937; color: #fff; padding: 10px 16px; border-radius: var(--radius); z-index: 60; max-width: min(560px, 90vw); box-shadow: 0 8px 24px rgba(0, 0, 0, .2); font-size: 13.5px; }
.stale-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 80; background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--warn); text-align: center; padding: 9px 16px; font-size: 13.5px; }
.stale-banner code, .stale-banner kbd { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; font-family: ui-monospace, Menlo, monospace; color: var(--ink); }

/* ---- Functions panel ---- */
.fn-badge { background: var(--warn); color: #fff; border-radius: 99px; padding: 0 7px; font-size: 11.5px; font-weight: 700; margin-left: 2px; }
.fn-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); flex: none; }
.fn-list { display: grid; gap: 16px; flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: start; padding-right: 6px; overscroll-behavior: contain; }
.fn-group h3 { font-size: 12px; font-weight: 600; color: var(--faint); margin: 0 0 6px; }
.fn-row { display: flex; gap: 14px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 6px; cursor: pointer; font-weight: 400; }
.fn-row:hover { background: var(--panel-2); } .fn-row.off { background: var(--panel-2); }
.fn-text { display: grid; gap: 2px; flex: 1; } .fn-name { font-weight: 600; }
.fn-warn { color: var(--warn); font-size: 12.5px; font-weight: 600; }
.tag.preference { color: var(--muted); }
.wide-dlg[open] { display: flex; flex-direction: column; max-height: min(90vh, 820px); overflow: hidden; }
.wide-dlg .dialog-head { flex: none; gap: 16px; }
.wide-dlg .dlg-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
#dlg-functions .dlg-body { display: flex; flex-direction: column; overflow: hidden; }

/* ---- smaller windows, tablets and phones ---- */
@media (max-width: 1280px) { .ws { --rw: 340px; } .grid .c-result { display: none; } }
@media (max-width: 1060px) { .ws { --lw: 270px; --rw: 300px; } .grid .c-num { display: none; } }
@media (max-width: 860px) {
  .appbar { padding: 0 12px; gap: 10px; } #user-name { display: none; } .tabs { margin-left: 0; } .tab { padding: 0 12px; }
  #view-app:not([hidden]) { height: auto; min-height: 100vh; }
  .ws { display: flex; flex-direction: column; padding-bottom: 120px; }
  .rail { border-right: none; } .rail-body { overflow: visible; padding: 0 16px; }
  .runbox { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; gap: 8px; padding: 10px 16px 12px; box-shadow: 0 -2px 8px rgba(16, 24, 40, .1); }
  .rail { border-top: none; border-bottom: 1px solid var(--line-2); }
  .rb-sum { display: none; }
  .grid-wrap { overflow: visible; } .grid th { top: 48px; }
  .grid .c-result { display: none; } .c-status { width: 130px; }
  /* phones: panels stack; the details open as a full-screen sheet; hiding panels is a desktop feature */
  #hide-left, .pane-strip { display: none !important; }
  body.left-off #pane-left > :not(.pane-strip) { display: flex !important; } body.left-off #pane-left > .rail-body { display: block !important; }
  .pane-head { padding: 0 8px 0 16px; }
  #inspector { display: none !important; }
  body.has-sel #inspector { display: flex !important; position: fixed; top: 48px; left: 0; right: 0; bottom: 0; z-index: 35; border-left: none; border-radius: 0; }
  body.has-sel #inspector > .pane-head { display: flex !important; } body.has-sel #insp-empty { display: none !important; } body.has-sel #inspector > .dr { display: flex !important; }
  .dr-head { padding: 16px; } .dr-body { padding: 0 16px 20px; }
}
@media (max-width: 600px) {
  .appbar .brand-name { display: none; }
  .grid .c-num { display: none; } .c-status { width: 128px; } .c-ico { width: 44px; } .grid td.c-ico { padding-left: 12px; } .grid td { padding: 0 8px; }
  .files-cmd { width: 100%; } .files-cmd .btn { flex: 1; }
  .search { width: 100%; } .search input { width: 100%; }
  #view-history { padding: 12px; }
}
@media (max-width: 600px) { .wide-dlg { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; margin: 0; } .wide-dlg .dialog-head { padding: 12px 14px; } .wide-dlg .dlg-body { padding: 12px 14px; } .fn-row { padding: 9px 10px; gap: 10px; } .fn-tools .btn { flex: 1 1 auto; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

@media (max-width: 600px) { .brand-sub, .by-nf span { display: none; } .by-nf img { height: 13px; } }
