:root {
  --bg: #f4f6f5; --panel: #fff; --text: #1b2421; --muted: #66736e; --line: #e2e7e4; --line-strong: #cfd7d3;
  --brand: #1f6f5c; --brand-dark: #165445; --brand-soft: #e5f2ee; --accent: #c77d1a;
  --ok: #1e7f4f; --ok-soft: #e3f4ea; --warn: #9a6200; --warn-soft: #fff4dc; --err: #b42318; --err-soft: #fdecea; --info: #2d5b9a; --info-soft: #e8f0fb;
  --radius: 10px; --shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 1px 3px rgba(16, 24, 20, .05);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif; font-size: 14px; color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); line-height: 1.45; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .code { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
h1 { font-size: 18px; margin: 0; font-weight: 650; display: flex; align-items: center; gap: 8px; min-width: 0; }
h2 { font-size: 17px; margin: 0 0 8px; }
h3 { font-size: 15px; margin: 0 0 12px; font-weight: 650; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .block { display: block; } .nowrap { white-space: nowrap; }
.mt { margin-top: 14px; } .ok-text { color: var(--ok); } .err-text { color: var(--err); }

/* layout */
.layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #12302a; color: #d8e6e1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; }
.brand strong { display: block; color: #fff; font-size: 15px; }
.brand small { color: #9fb8b0; font-size: 12px; }
.brand.big strong { color: var(--text); font-size: 20px; } .brand.big small { color: var(--muted); }
.sidebar nav { display: flex; flex-direction: column; padding: 4px 8px; gap: 1px; overflow-y: auto; flex: 1; }
.sidebar nav a { color: #d8e6e1; padding: 7px 10px; border-radius: 7px; font-size: 13.5px; }
.sidebar nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.sidebar nav a.active { background: var(--brand); color: #fff; }
.nav-group { text-transform: uppercase; font-size: 11px; letter-spacing: .06em; color: #7f9a92; padding: 14px 10px 4px; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.08); padding: 12px 14px; }
.me { display: flex; gap: 10px; align-items: center; }
.me strong { display: block; color: #fff; font-size: 13px; } .me small { color: #9fb8b0; font-size: 12px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
.foot-actions { display: flex; gap: 14px; margin-top: 8px; font-size: 12.5px; }
.foot-actions a, .foot-actions .link { color: #b9cec7; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 24px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar h1 { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.menu-btn { display: none; background: none; border: 0; font-size: 20px; cursor: pointer; }
.back { color: var(--muted); }
.content { padding: 20px 24px 40px; }
.banner { padding: 10px 14px; border-radius: 8px; margin: 12px 24px 0; font-size: 13.5px; }
.content .banner, .card .banner, .login-card .banner { margin: 0 0 12px; }
.banner.ok { background: var(--ok-soft); color: #14532d; } .banner.err { background: var(--err-soft); color: #7a1a12; } .banner.warn { background: var(--warn-soft); color: #6b4500; }
.banner ul { margin: 6px 0 0 18px; padding: 0; }

/* cards & controls */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.narrow { max-width: 460px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.card-head h3 { margin: 0; }
.table-card { padding: 0; overflow: hidden; }
.empty { text-align: center; padding: 48px 20px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: #fff; color: var(--text); padding: 7px 13px; border-radius: 8px; font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; line-height: 1.2; }
.btn:hover { background: #f3f6f5; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.primary:hover { background: var(--brand-dark); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--err); border-color: #f0c2bd; } .btn.danger:hover { background: var(--err-soft); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { padding: 4px 9px; font-size: 12.5px; } .btn.block { width: 100%; justify-content: center; padding: 10px; }
.btn:disabled { opacity: .6; cursor: wait; }
.link { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; }
.icon-btn { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 2px 5px; border-radius: 5px; font-size: 13px; }
.icon-btn:hover { background: #eef1f0; color: var(--err); }
input, select, textarea { font: inherit; color: inherit; border: 1px solid var(--line-strong); border-radius: 7px; padding: 7px 9px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(31,111,92,.25); border-color: var(--brand); }
input:disabled, select:disabled, textarea:disabled { background: #f6f8f7; color: #4e5a55; }
input[type=checkbox] { width: auto; }
label { display: block; font-size: 12.5px; font-weight: 550; color: #3d4945; margin-bottom: 10px; }
label > input, label > select, label > textarea { margin-top: 4px; font-weight: 400; }
label.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; white-space: nowrap; }
label.inline input, label.inline select { margin: 0; width: auto; }
label.check { display: flex; align-items: center; gap: 8px; }
.inline-form { display: inline; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .row-actions.end { justify-content: flex-end; margin-top: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tag { display: inline-block; background: #eef2f0; color: #3d4945; border-radius: 5px; padding: 1px 7px; font-size: 12px; font-weight: 550; }
.tag.accent { background: #fdf0dc; color: #8a5300; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 650; background: #eef2f0; color: #3d4945; white-space: nowrap; }
.st-done, .st-ok { background: var(--ok-soft); color: var(--ok); } .st-review { background: var(--warn-soft); color: var(--warn); }
.st-failed { background: var(--err-soft); color: var(--err); } .st-processing, .st-queued { background: var(--info-soft); color: var(--info); }
.st-approved { background: #dff1f6; color: #0f5f75; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #bbb; margin-right: 6px; }
.dot.st-ok, .dot.st-done { background: var(--ok); } .dot.st-review { background: #e0a100; } .dot.st-approved { background: #1b8aa8; } .dot.st-failed { background: var(--err); }

/* tables */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 9px 12px; border-bottom: 1px solid var(--line); background: #fafbfa; white-space: nowrap; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table.compact td { padding: 6px 10px; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .cb { width: 34px; }
.row-link { cursor: pointer; } .row-link:hover td { background: #f7faf9; }
.ellipsis { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; gap: 10px; flex-wrap: wrap; }
.pager div { display: flex; gap: 6px; }

/* list page */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { padding: 5px 12px; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--text); font-size: 13px; font-weight: 550; }
.chip span { color: var(--muted); margin-left: 4px; font-weight: 500; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; } .chip.active span { color: #cfe7df; }
.chip:hover { text-decoration: none; border-color: var(--line-strong); }
.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.filters input[type=search], .filters > input { flex: 1; min-width: 200px; width: auto; }
.filters select { width: auto; }
.bulkbar { display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--brand-soft); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dropdown { position: relative; }
.dropdown .menu { display: none; position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); min-width: 200px; z-index: 20; padding: 4px; }
.dropdown.open .menu { display: block; }
.dropdown .menu a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--text); }
.dropdown .menu a:hover { background: #f1f5f3; text-decoration: none; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 9px 13px; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; font-weight: 550; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab:hover { text-decoration: none; color: var(--text); }

/* upload */
.upload-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.dropzone { border: 2px dashed var(--line-strong); border-radius: 12px; padding: 40px 20px; text-align: center; color: var(--muted); transition: .15s; cursor: pointer; }
.dropzone.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.dropzone p { margin: 6px 0; } .dropzone strong { color: var(--text); }
.upload-list { list-style: none; padding: 0; margin: 14px 0 0; }
.upload-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: center; }
.upload-list .bar { grid-column: 1 / -1; height: 4px; background: #edf1ef; border-radius: 4px; overflow: hidden; }
.upload-list .bar span { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s; }
.help ol { padding-left: 18px; margin: 0; } .help li { margin-bottom: 8px; }

/* detail */
.detail-page .content { padding: 14px 18px 24px; }
.split { display: grid; gap: 16px; align-items: start; }
.viewer { position: sticky; top: 72px; height: calc(100vh - 96px); padding: 0; overflow: hidden; margin: 0; }
.viewer iframe { width: 100%; height: 100%; border: 0; }
.extract { min-width: 0; }
.meta-line { margin-bottom: 10px; }
.tenant-form { margin-bottom: 10px; }
.doc-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; }
.doc-tab { flex: 0 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; color: var(--text); font-weight: 600; font-size: 13px; }
.doc-tab small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; }
.doc-tab.active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(31,111,92,.15); }
.doc-tab:hover { text-decoration: none; }
.doc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.doc-head > div:first-child { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.flags { padding: 10px 12px; }
.flag { padding: 6px 10px; border-radius: 6px; margin-bottom: 4px; font-size: 13px; cursor: pointer; }
.flag.error { background: var(--err-soft); color: #7a1a12; } .flag.warning { background: var(--warn-soft); color: #6b4500; } .flag.info { background: var(--info-soft); color: #1f3f6b; cursor: default; }
.hgroups { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 2px; margin: 0; min-width: 0; }
legend { font-size: 12px; font-weight: 700; color: var(--brand); padding: 0 4px; text-transform: uppercase; letter-spacing: .04em; }
fieldset label { margin-bottom: 8px; }
.fi.flag-warning { border-color: #e0a100; background: #fffaf0; } .fi.flag-error { border-color: var(--err); background: #fff6f5; }
.items-scroll { max-height: 70vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.table.items th { position: sticky; top: 0; z-index: 1; }
.table.items td { padding: 4px 5px; }
.table.items input, .table.items select { padding: 4px 6px; font-size: 13px; border-color: transparent; background: transparent; min-width: 70px; }
.table.items input:hover, .table.items select:hover { border-color: var(--line-strong); }
.table.items input:focus, .table.items select:focus { background: #fff; }
.table.items .fi.flag-warning { border-color: #e0a100; background: #fffaf0; }
.table.items .num { text-align: right; min-width: 80px; }
.table.items .date { min-width: 96px; }
.table.items .col-description input { min-width: 320px; } .table.items .col-epr_fraction select { min-width: 90px; }
.table.items .col-booking_text input { min-width: 240px; }
.table.items .col-service_period_missing_reason input, .table.items .col-epr_fraction_reason input, .table.items .col-service_period_raw input,
.table.items .col-end_customer_name input { min-width: 200px; }
.history summary { cursor: pointer; font-weight: 600; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; margin: 0 auto 14px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* config */
.cfg-table td { padding: 5px 6px; } .cfg-table input, .cfg-table select, .cfg-table textarea { font-size: 13px; padding: 5px 7px; min-width: 70px; }
pre.code { background: #0f1f1b; color: #d5e7e1; padding: 12px; border-radius: 8px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0; }
pre.code.tall { max-height: 70vh; }
textarea.code { font-family: ui-monospace, monospace; font-size: 12.5px; }
dialog { border: 0; border-radius: 12px; padding: 0; box-shadow: 0 20px 60px rgba(0,0,0,.25); width: min(720px, 94vw); }
dialog.wide-dlg { width: min(1200px, 96vw); }
dialog::backdrop { background: rgba(10, 20, 17, .45); }
.dlg-form { padding: 20px; }
.copy-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; } .copy-row code { background: #fff; padding: 6px 8px; border-radius: 6px; word-break: break-all; }
.diff-old { background: var(--err-soft); text-decoration: line-through; } .diff-new { background: var(--ok-soft); }
.stat { display: inline-block; margin-right: 18px; } .stat b { font-size: 20px; display: block; }

/* login */
.login-page { background: linear-gradient(135deg, #12302a, #1f6f5c); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { background: #fff; border-radius: 14px; padding: 28px; width: min(400px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-card .brand { padding: 0 0 18px; }


@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; } .viewer { position: static; height: 60vh; }
  .upload-grid, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -260px; width: 250px; z-index: 30; transition: left .2s; }
  .sidebar.open { left: 0; }
  .menu-btn { display: block; }
  .content { padding: 14px; } .topbar { padding: 10px 14px; } .banner { margin: 10px 14px 0; }
  .table th:nth-child(n+8), .table td:nth-child(n+8) { display: none; }
}

/* ---- iteration 2: UX components ---- */
.nav-badge { margin-left: auto; float: right; background: #e0a100; color: #1b1300; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.sidebar nav a.nav-more { color: #9fb8b0; font-size: 12.5px; }
.callout { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fff8e6; border: 1px solid #f1d58a; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; flex-wrap: wrap; }
.step { display: inline-block; background: #fff; border: 1px solid #f1d58a; border-radius: 99px; padding: 0 8px; font-size: 12px; margin: 0 2px; }
.chip-sep { width: 1px; background: var(--line-strong); margin: 0 4px; }
.tag-other { background: #ece9fb; color: #4b3fa0; }
.tag.frac { background: var(--brand-soft); color: var(--brand-dark); margin: 0 3px 3px 0; }
.doc-table tr.subrow td { border-top: 0; }
.doc-table tr.subrow td:first-child { border-left: 3px solid var(--brand-soft); }
.menu-note { display: block; padding: 6px 10px 4px; }
.menu-btn-item { background: none; border: 0; width: 100%; text-align: left; padding: 7px 10px; border-radius: 6px; font: inherit; cursor: pointer; }
.menu-btn-item:hover { background: #f1f5f3; }
.danger-text { color: var(--err); }
.btn.danger-solid { background: var(--err); border-color: var(--err); color: #fff; }
.spinner.tiny { width: 14px; height: 14px; border-width: 2px; display: inline-block; margin: 0 6px -2px 0; }
kbd { font-family: inherit; font-size: 12px; background: #f1f4f3; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; }
.shortcuts td:first-child { white-space: nowrap; width: 150px; }
.tip { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: #e8eeec; color: var(--muted); font-size: 10px; font-weight: 700; margin-left: 5px; cursor: help; vertical-align: 1px; }

/* stepper */
.stepper { display: flex; gap: 0; list-style: none; padding: 0; margin: 0 0 12px; counter-reset: s; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 13px; padding: 8px 10px; background: #fff; border: 1px solid var(--line); }
.stepper li:first-child { border-radius: 8px 0 0 8px; } .stepper li:last-child { border-radius: 0 8px 8px 0; }
.stepper li + li { border-left: 0; }
.stepper li span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #eef2f0; font-size: 12px; }
.stepper li.current { color: var(--text); background: #fff8e6; } .stepper li.current span { background: #e0a100; color: #fff; }
.stepper li.done { color: var(--ok); } .stepper li.done span { background: var(--ok); color: #fff; }
.info-banner { background: #ece9fb; color: #35297a; margin: 0 0 12px !important; }
.flags h3 { margin-bottom: 8px; }
.flag { display: block; width: 100%; text-align: left; border: 0; font: inherit; }
.hints { margin: 0 0 12px; } .hints summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 4px 0; }
details.more { margin-top: 12px; } details.more > summary { cursor: pointer; font-weight: 600; color: var(--brand); padding: 6px 0; }
.g-empfaenger { border-color: #f1d58a; } .g-periode { border-color: #b9dccf; }
.fi.pulse { animation: pulse 1.4s ease; }
@keyframes pulse { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 4px rgba(224, 161, 0, .45); } }

/* toasts */
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: min(420px, 90vw); }
.toast { display: flex; gap: 10px; align-items: flex-start; background: #12302a; color: #fff; padding: 11px 14px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 13.5px; transition: opacity .35s, transform .35s; }
.toast.err { background: #7a1a12; } .toast.out { opacity: 0; transform: translateY(10px); }
.toast button { background: none; border: 0; color: #fff; opacity: .7; cursor: pointer; font-size: 16px; line-height: 1; }

/* settings hub */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.hub-card { display: flex; gap: 14px; color: var(--text); transition: border-color .15s, transform .15s; margin: 0; }
.hub-card:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-1px); }
.hub-card h3 { margin: 0 0 4px; } .hub-card p { margin: 0 0 6px; }
.hub-icon { font-size: 26px; width: 44px; height: 44px; display: grid; place-items: center; background: var(--brand-soft); border-radius: 10px; flex: 0 0 auto; }
dl.facts { display: grid; grid-template-columns: 120px 1fr; gap: 4px 12px; margin: 0 0 10px; font-size: 13px; }
dl.facts.wide { grid-template-columns: 180px 1fr; }
dl.facts dt { color: var(--muted); } dl.facts dd { margin: 0; }
.mailbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }

/* resizable split */
.split { grid-template-columns: var(--left, 46%) 8px minmax(0, 1fr); gap: 0; }
.split > .extract { padding-left: 8px; }
.split-handle { cursor: col-resize; align-self: stretch; position: sticky; top: 72px; height: calc(100vh - 96px); display: flex; align-items: center; justify-content: center; }
.split-handle::after { content: ""; width: 4px; height: 48px; border-radius: 4px; background: var(--line-strong); }
.split-handle:hover::after { background: var(--brand); }
body.resizing { cursor: col-resize; user-select: none; } body.resizing iframe, body.resizing canvas { pointer-events: none; }

/* pdf viewer */
.viewer { display: flex; flex-direction: column; }
.pdf-viewer { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.pv-toolbar { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: #fafbfa; flex-wrap: wrap; }
.pv-btn { background: none; border: 1px solid transparent; border-radius: 6px; padding: 3px 8px; cursor: pointer; font: inherit; color: var(--text); min-width: 28px; }
.pv-btn:hover { background: #eef2f0; border-color: var(--line); text-decoration: none; }
.pv-text { font-size: 12.5px; }
.pv-sep { width: 1px; height: 18px; background: var(--line-strong); margin: 0 4px; }
.pv-page { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.pv-pageinput { width: 38px; padding: 2px 4px; text-align: center; }
.pv-zoom { font-size: 12.5px; min-width: 46px; text-align: center; color: var(--muted); }
.pv-body { display: flex; flex: 1; min-height: 0; }
.pv-thumbs { width: 104px; overflow-y: auto; border-right: 1px solid var(--line); background: #f3f5f4; padding: 8px 6px; display: flex; flex-direction: column; gap: 8px; }
.pv-thumb { border: 2px solid transparent; background: #fff; border-radius: 4px; padding: 2px; cursor: pointer; position: relative; }
.pv-thumb img { width: 100%; display: block; } .pv-thumb span { position: absolute; right: 4px; bottom: 2px; font-size: 10px; color: var(--muted); background: #fff; padding: 0 3px; border-radius: 3px; }
.pv-thumb.active { border-color: var(--brand); }
.pv-scroll { flex: 1; overflow: auto; background: #525659; padding: 12px; outline: none; }
.pv-pages { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pv-page-wrap { position: relative; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.pv-page-wrap canvas { display: block; }
.pv-hl { position: absolute; inset: 0; pointer-events: none; }
.pv-box { position: absolute; background: rgba(255, 200, 0, .25); outline: 2px solid rgba(224, 161, 0, .8); border-radius: 2px; margin: -2px; padding: 2px; }
.pv-box.primary { background: rgba(255, 170, 0, .38); outline-color: #e07800; animation: pulse 1.2s ease 1; }
.pv-pno { position: absolute; right: -28px; top: 0; color: #ccc; font-size: 11px; }
.pv-loading { color: #eee; padding: 60px 20px; text-align: center; }

/* upload queue */
.upload-summary { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; }
.upload-list li .state a { margin-left: 4px; }
.upload-list .file-icon { color: var(--muted); margin-right: 6px; }

@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; } .split-handle { display: none; } .split > .extract { padding-left: 0; }
}

.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 12px; }
.fgrid .wide { grid-column: 1 / -1; }
.hgroups { grid-template-columns: 1fr; }
.doc-link { color: inherit; font-weight: 600; } .doc-link:hover { color: var(--brand); }
.viewswitch { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.seg { padding: 6px 14px; border: 1px solid var(--line-strong); background: #fff; color: var(--text); font-weight: 600; }
.seg:first-child { border-radius: 8px 0 0 8px; } .seg:nth-child(2) { border-radius: 0 8px 8px 0; margin-left: -11px; }
.seg.active { background: var(--brand); border-color: var(--brand); color: #fff; } .seg:hover { text-decoration: none; }
