:root {
  --ink: #20252b;
  --muted: #68717c;
  --line: #e1e4e8;
  --paper: #fff;
  --green: #285bba;
  --red: #b33232;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
a { color: inherit; }
:focus-visible { outline: 2px solid #285bba; outline-offset: 3px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.boot { padding: 60px; font-size: 24px; font-weight: 600; }
.boot span { display: block; margin-top: 12px; font-size: 14px; font-weight: 400; color: var(--muted); }
.layout { display: grid; grid-template-columns: 210px minmax(0,1fr); min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 210px; padding: 24px 14px 18px; border-right: 1px solid var(--line); background: #f8f9fa; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 9px; margin: 0 10px; font-size: 23px; letter-spacing: -.7px; font-weight: 650; }
.brandmark { display: flex; color: #303841; }
.brandmark svg { width: 24px; height: 24px; }
.brand-sub { margin: 8px 10px 32px; font-size: 12px; color: var(--muted); }
.nav-label { display: none; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav :is(button,a) { border: 0; background: transparent; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 4px; text-align: left; font-size: 13px; font-weight: 500; color: #58616b; }
.nav :is(button,a):hover { background: #eceff2; }
.nav :is(button,a).active { background: #e8edf5; color: #224b8b; }
.nav .badge { margin-left: auto; font-size: 11px; color: #49576d; font-variant-numeric: tabular-nums; }
.sidebar-bottom { margin-top: auto; }
.device-card { padding: 16px 10px; margin-top: 32px; border-top: 1px solid var(--line); }
.device-card .printer-icon { display: none; }
.device-card strong { display: block; font-size: 12px; font-weight: 550; }
.device-card p { margin: 6px 0 0; font-size: 11px; color: var(--muted); line-height: 1.8; }
.dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #79887b; margin-right: 5px; }
.user-block { border-top: 1px solid var(--line); padding: 16px 5px 0; display: flex; align-items: center; gap: 9px; }
.avatar { width: 29px; height: 29px; border: 1px solid #d7dce2; border-radius: 4px; display: grid; place-items: center; font-size: 10px; color: #505b68; background: #eef0f3; flex-shrink: 0; }
.user-block strong { display: block; font-size: 11px; font-weight: 550; }
.user-block small { font-size: 10px; color: var(--muted); }
.logout { margin-left: auto; border: 0; background: none; color: var(--muted); padding: 4px; }
.main { grid-column: 2; min-width: 0; }
.topbar { height: 57px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; border-bottom: 1px solid var(--line); font-size: 12px; }
.breadcrumb { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.breadcrumb span { color: #414b56; }
.top-right { display: flex; align-items: center; gap: 15px; font-size: 11px; color: var(--muted); }
.demo-select { font-size: 11px; padding: 5px 7px; border: 1px solid #d4dae1; border-radius: 3px; background: #fff; color: #566171; }
.workspace { max-width: 1600px; margin: auto; padding: 29px 32px; }
.eyebrow { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
h1 { font-size: 26px; line-height: 1.25; letter-spacing: -.6px; font-weight: 600; margin: 0 0 8px; }
h2 { margin: 0; font-size: 13px; font-weight: 600; }
p.subtitle { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.actions { display: flex; align-items: center; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 12px; border: 1px solid #cfd5dd; border-radius: 4px; color: #35404e; background: #fff; font-size: 12px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #f4f6f8; }
.btn.primary { background: #285bba; border-color: #285bba; color: #fff; }
.btn.primary:hover { background: #204eaa; }
.btn.danger { color: var(--red); }
.btn.small { padding: 6px 9px; font-size: 11px; }
.btn svg { width: 15px; height: 15px; }
.queue-controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 11px; color: var(--muted); margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(4,1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0; margin-bottom: 25px; }
.stat { padding: 0 22px; border-right: 1px solid var(--line); }
.stat:first-child { padding-left: 0; }
.stat:last-child { border: 0; }
.stat-name { font-size: 11px; color: var(--muted); }
.stat-name svg { display: none; }
.stat-value { margin: 8px 0 5px; font-size: 25px; line-height: 1; font-weight: 550; font-variant-numeric: tabular-nums; letter-spacing: -.6px; }
.stat-note { font-size: 10px; line-height: 1.5; color: var(--muted); }
.panel { border: 1px solid var(--line); border-radius: 4px; margin-bottom: 20px; overflow: hidden; background: #fff; }
.panel-head { padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.panel-head small { display: block; margin-top: 5px; font-size: 11px; color: var(--muted); }
.segmented { display: inline-flex; border: 1px solid #d5dae1; border-radius: 3px; overflow: hidden; }
.segmented button { padding: 6px 10px; background: #fff; border: 0; font-size: 11px; color: var(--muted); }
.segmented button + button { border-left: 1px solid #d5dae1; }
.segmented button.active { background: #edf1f6; color: #263f62; }
.filterbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px 16px; }
.tabs { display: flex; gap: 15px; align-items: center; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 0; font-size: 11px; color: var(--muted); }
.tabs button.active { color: #285bba; border-bottom-color: #285bba; }
.search { display: flex; align-items: center; gap: 7px; border: 1px solid #d7dce3; border-radius: 3px; padding: 6px 8px; }
.search input { border: 0; outline: 0; background: none; width: 140px; font-size: 11px; color: var(--ink); }
.search svg { width: 13px; height: 13px; color: var(--muted); }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; white-space: nowrap; }
th { padding: 11px 14px; background: #f8f9fb; font-size: 10px; font-weight: 500; color: #67717e; }
td { padding: 13px 14px; border-top: 1px solid #e9ecf0; font-size: 11px; color: #59636f; }
td strong { font-size: 12px; font-weight: 500; color: #303944; }
td small { display: block; margin-top: 4px; font-size: 10px; color: var(--muted); }
tbody tr:hover { background: #fafbfd; }
.table-wrap th:last-child, .table-wrap td:last-child { position: sticky; right: 0; background: #fff; border-left: 1px solid #edf0f4; }
.table-wrap th:last-child { background: #f8f9fb; }
.document-name { display: flex; align-items: center; gap: 10px; }
.document-name strong { display: block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
.file-icon { display: flex; align-items: center; color: #8b95a2; }
.file-icon svg { width: 19px; height: 19px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: #3b7255; }
.status:before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.held, .status.scanning { color: #8a6c2c; }
.status.queued { color: #677485; }
.status.printing, .status.submitting { color: #285bba; }
.status.cancelled, .status.expired { color: #848b94; }
.status.failed, .status.uncertain, .status.revoked { color: #b33232; }
.row-actions { display: flex; gap: 3px; }
.icon-btn { display: grid; place-items: center; border: 0; background: transparent; color: #67717d; padding: 6px; border-radius: 3px; }
.icon-btn:hover { background: #edf0f4; color: #202b3b; }
.icon-btn svg { width: 15px; height: 15px; }
.panel-foot { padding: 11px 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; font-size: 10px; color: var(--muted); }
.upload-panel { border: 0; border-radius: 0; }
.dropzone { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 19px; border: 1px dashed #cdd3dc; border-radius: 4px; background: #fafbfc; cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: #6b88b5; background: #f3f6fa; }
.dropzone > svg { color: #7b8797; }
.dropzone strong { display: block; font-size: 12px; font-weight: 500; }
.dropzone p { margin: 5px 0 0; font-size: 10px; color: var(--muted); }
.mini-link { color: #285bba; }
.footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 24px; color: #868e98; font-size: 10px; }
.empty { padding: 38px 20px; text-align: center; }
.empty > svg { display: none; }
.empty strong { display: block; font-size: 12px; font-weight: 500; margin-bottom: 8px; }
.empty p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.notice { border-left: 2px solid #bcc7d8; background: #f4f6f9; border-radius: 0; padding: 9px 12px; font-size: 11px; line-height: 1.6; color: #616d7d; margin-bottom: 22px; }
.inbox-note { margin: 0 16px 18px; }
.scan-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; padding: 0 16px 16px; }
.scan-card { border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.scan-image { height: 190px; background: #f2f4f7; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.scan-image img { height: 165px; max-width: 90%; object-fit: contain; border: 1px solid #e0e4e9; }
.scan-info { padding: 12px; }
.scan-info strong { font-size: 12px; font-weight: 500; }
.scan-info p { font-size: 10px; color: var(--muted); margin: 7px 0 12px; }
.chart { height: 160px; display: flex; align-items: end; gap: 6px; padding: 18px; }
.bar { flex: 1; background: #aabddc; min-height: 3px; }
.bar:hover { background: #587eBA; }
.chart-label { display: flex; justify-content: space-between; padding: 0 18px 16px; color: var(--muted); font-size: 10px; }
.tokens-note { color: var(--muted); font-size: 11px; line-height: 1.8; max-width: 850px; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; }
dialog { width: 520px; max-width: calc(100vw - 30px); max-height: 90vh; padding: 0; border: 1px solid #d5dae1; border-radius: 5px; color: var(--ink); }
dialog::backdrop { background: #1a25394d; }
dialog:has(.setup-wizard) { width: 860px; }
dialog:has(.connect-card) { width: 500px; }
.connect-device { display: flex; gap: 15px; align-items: center; padding-bottom: 10px; }
.connect-device > svg { width: 34px; height: 34px; fill: none; stroke: #44576e; stroke-width: 1.4; flex-shrink: 0; }
.connect-device h3 { margin: 0; font-size: 16px; font-weight: 600; }
.connect-device p { margin: 5px 0 0; }
.connect-status { font-size: 12px; color: var(--muted); line-height: 1.6; margin: 20px 0 14px; }
.connect-status.has-error { color: var(--red); }
.connect-primary { width: 100%; justify-content: center; padding: 12px; }
.connect-instructions { padding: 18px 0; font-size: 12px; border-bottom: 1px solid var(--line); }
.connect-instructions p { margin: 6px 0 0; }
.connect-details { padding-top: 17px; }
.connect-details summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.modal-head { padding: 22px 24px 17px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.modal-head h2 { font-size: 19px; font-weight: 600; letter-spacing: -.3px; }
.modal-body { padding: 0 24px 23px; }
.modal-body p { color: var(--muted); font-size: 12px; line-height: 1.8; }
label.field { display: block; font-size: 11px; font-weight: 500; margin: 17px 0 7px; }
input.control, select.control { width: 100%; padding: 9px 10px; border: 1px solid #cdd4de; border-radius: 3px; background: #fff; color: var(--ink); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.modal-footer { display: flex; justify-content: end; gap: 8px; margin-top: 23px; }
.preview-wrap { background: #eff1f4; padding: 15px; max-height: 60vh; overflow: auto; text-align: center; }
.preview-wrap img { max-width: 100%; border: 1px solid #d9dfe6; }
.preview-controls { display: flex; justify-content: center; align-items: center; gap: 15px; margin: 15px; font-size: 12px; }
.token-url { padding: 12px; border: 1px solid var(--line); border-radius: 3px; background: #f5f7f9; word-break: break-all; font: 11px/1.9 ui-monospace, monospace; }
.setup-wizard { display: grid; grid-template-columns: 174px minmax(0,1fr); gap: 26px; }
.setup-nav { border-right: 1px solid var(--line); padding-right: 16px; }
.setup-group { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .7px; margin: 20px 0 8px; }
.setup-group:first-child { margin-top: 0; }
.setup-nav button { display: flex; align-items: start; gap: 9px; border: 0; width: 100%; text-align: left; background: transparent; padding: 10px 7px; border-radius: 3px; font: inherit; font-size: 12px; line-height: 1.5; color: var(--muted); cursor: pointer; }
.setup-nav button:hover { background: #f5f7f9; }
.setup-nav button[aria-current="step"] { background: #eef2f6; color: var(--ink); font-weight: 600; }
.step-number { flex-shrink: 0; display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid #cbd3dc; border-radius: 50%; font-size: 10px; }
.setup-nav button[aria-current="step"] .step-number { background: #34475e; color: white; border-color: #34475e; }
.setup-nav small { display: block; font-size: 10px; font-weight: 400; }
.setup-progress { color: var(--muted); font-size: 11px; margin-bottom: 10px; }
.setup-current { min-width: 0; }
.setup-current h3 { font-size: 18px; font-weight: 600; margin: 0 0 16px; }
.setup-current h3:focus { outline: none; }
.setup-current p.setup-hint { font-size: 11px; }
.setup-current small { color: var(--muted); font-size: 11px; }
.setup-footer { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 25px; }
.setup-image { display: block; width: 100%; border: 1px solid var(--line); border-radius: 4px; margin: 14px 0 7px; }
#setup-addresses { margin: 18px 0; }
#setup-url { font-family: ui-monospace, monospace; }
.setup-code { white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px; background: #f5f7f9; border: 1px solid var(--line); font-size: 11px; line-height: 1.7; }
@media (max-width: 640px) {
  .setup-wizard { grid-template-columns: minmax(0,1fr); gap: 20px; }
  .setup-nav { display: flex; gap: 4px; overflow-x: auto; padding: 0 0 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .setup-group, .setup-nav small { display: none; }
  .setup-nav button { flex-shrink: 0; width: auto; white-space: nowrap; padding: 8px; }
}
.check { display: flex; align-items: center; gap: 8px; margin-top: 18px; font-size: 11px; }
.error { color: var(--red); font-size: 12px; line-height: 1.7; margin-top: 15px; }
.login-page { min-height: 100vh; display: flex; flex-direction: column; max-width: 380px; margin: auto; padding: 90px 24px 40px; }
.login-story .brand { margin: 0 0 8px; }
.login-story h1, .login-story p, .login-story footer, .login-content .eyebrow { display: none; }
.login-form { margin-top: 46px; }
.login-content h2 { font-size: 24px; font-weight: 600; margin-bottom: 14px; }
.login-content p { font-size: 13px; color: var(--muted); line-height: 1.8; }
.login-content .btn { width: 100%; margin-top: 15px; padding: 11px; }
.login-content small { display: block; margin-top: 20px; color: var(--muted); font-size: 11px; line-height: 1.8; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120px); max-width: 90vw; padding: 11px 18px; border-radius: 4px; background: #293443; color: white; font-size: 12px; z-index: 1000; }
#toast.show { transform: translateX(-50%) translateY(0); }
@media (max-width: 1100px) {
  .layout { grid-template-columns: 180px minmax(0,1fr); }
  .sidebar { width: 180px; padding-left: 10px; padding-right: 10px; }
  .workspace { padding: 24px; }
  .topbar { padding: 0 24px; }
  .stat { padding: 0 14px; }
  .scan-grid { grid-template-columns: repeat(2,1fr); }
  td, th { padding-left: 11px; padding-right: 11px; }
}
@media (max-width: 760px) {
  .layout { display: block; }
  .sidebar { position: static; width: auto; padding: 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { margin-left: 0; }
  .brand-sub, .sidebar-bottom { display: none; }
  .nav { flex-direction: row; gap: 3px; overflow: auto; margin-top: 16px; }
  .nav :is(button,a) { padding: 8px; font-size: 11px; gap: 6px; }
  .nav :is(button,a) svg { width: 15px; height: 15px; }
  .nav .badge { display: none; }
  .topbar { height: 48px; padding: 0 16px; }
  .top-right .date { display: none; }
  .workspace { padding: 22px 16px; }
  .heading { align-items: start; flex-wrap: wrap; gap: 16px; }
  h1 { font-size: 24px; }
  .heading .actions { flex-wrap: wrap; }
  .stats { grid-template-columns: 1fr 1fr; gap: 18px 0; }
  .stat:nth-child(3) { padding-left: 0; }
  .stat:nth-child(2) { border-right: 0; }
  .stat-value { font-size: 23px; }
  .queue-controls { align-items: start; flex-direction: column; }
  .filterbar { flex-wrap: wrap; padding: 8px 12px; }
  .search { width: 100%; }
  .search input { width: 100%; }
  .panel-head { padding: 14px 12px; flex-wrap: wrap; }
  .panel-foot { flex-wrap: wrap; padding: 10px 12px; }
  .scan-grid { grid-template-columns: 1fr; }
  .footer { flex-wrap: wrap; line-height: 1.6; }
}
.report-details{margin:20px 0}.report-details>div{padding:12px 0;border-bottom:1px solid #e6e8eb}.report-details dt{font-size:12px;color:#606b79;margin-bottom:5px}.report-details dd{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.5}
.scan-workspace { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 20px; align-items: stretch; }
.scan-workspace .panel { margin: 0; }
.scan-pages { display: flex; flex-direction: column; }
.scan-pages-heading, .scan-review-heading { padding: 17px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.scan-pages-heading { flex-wrap: wrap; gap: 5px; }
.scan-pages-heading h2 { font-size: 13px; }
.scan-pages-heading span, .scan-review-heading span { color: var(--muted); font-size: 11px; }
.scan-review-heading strong { font-size: 12px; font-weight: 500; }
.scan-thumbnails { padding: 14px; display: grid; gap: 12px; max-height: 500px; overflow-y: auto; overflow-x: hidden; }
.scan-thumbnail { border: 1px solid var(--line); background: #f8f9fa; border-radius: 3px; padding: 10px; display: grid; gap: 8px; justify-items: center; color: var(--muted); font-size: 11px; }
.scan-thumbnail.selected { border-color: var(--green); background: #f4f7fd; color: var(--green); }
.scan-thumbnail img { width: 82px; height: 112px; object-fit: contain; background: white; border: 1px solid var(--line); }
.scan-pages-empty, .scan-draft-note { color: var(--muted); font-size: 11px; line-height: 1.7; }
.scan-pages-empty { margin: 0; }
.scan-draft-note { margin-top: auto; padding: 16px; border-top: 1px solid var(--line); }
.scan-canvas { height: clamp(220px, calc(100dvh - 470px), 480px); padding: 24px; background: #f4f5f6; display: flex; align-items: center; justify-content: center; }
.scan-full-preview { display: block; max-height: 100%; max-width: 100%; object-fit: contain; background: white; border: 1px solid #d5d9df; }
.scan-start { text-align: center; max-width: 360px; }
.scan-start-icon { display: inline-flex; padding: 18px; border: 1px solid #d9dde2; border-radius: 50%; color: var(--muted); margin-bottom: 20px; }
.scan-start-icon svg { width: 27px; height: 27px; }
.scan-start h2 { font-size: 17px; font-weight: 500; line-height: 1.5; }
.scan-start p { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 12px 0 0; }
.scan-next-step { border-top: 1px solid var(--line); padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.scan-next-step strong { font-size: 13px; font-weight: 500; }
.scan-next-step p { font-size: 11px; color: var(--muted); line-height: 1.7; margin: 6px 0 0; }
.scan-next-step .btn { flex-shrink: 0; }
.scan-page-pending { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.scan-spinner { width: 14px; height: 14px; display: inline-block; border: 2px solid #c8cfd9; border-top-color: var(--green); border-radius: 50%; animation: scan-spin 1s linear infinite; flex-shrink: 0; }
@keyframes scan-spin { to {transform: rotate(360deg);} }
@media (prefers-reduced-motion: reduce) { .scan-spinner {animation: none;} }
.scan-inline-error { padding: 0 20px 16px; font-size: 12px; color: var(--red); line-height: 1.7; }
.scan-save { margin-top: 20px; padding: 20px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.scan-name { flex: 1; max-width: 420px; }
.scan-name>div { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.scan-name input { min-width: 0; }
.scan-save-action { display: flex; align-items: center; gap: 18px; }
.scan-save-action>span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.scan-settings { display: flex; align-items: end; gap: 18px; padding: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.scan-settings>div { min-width: 145px; }
.scan-settings>div:first-child { min-width: 235px; }
.scan-quick { margin-left: auto; }
.scan-quick small { display: block; color: var(--muted); font-size: 10px; margin-top: 7px; }
.scan-source-note { color: var(--muted); font-size: 12px; line-height: 1.7; margin: -5px 0 18px; }
.scan-page-tile { position: relative; border-radius: 3px; }
.scan-page-tile[draggable=true] { cursor: grab; }
.scan-page-tile .scan-thumbnail { width: 100%; }
.scan-page-tile.dragging { opacity: .45; }
.scan-page-tile.drop-target { outline: 2px solid var(--green); outline-offset: 3px; }
.scan-remove { position: absolute; right: -6px; top: -6px; background: white; border: 1px solid #c8cfd8; border-radius: 50%; width: 29px; height: 29px; padding: 5px; display: flex; align-items: center; justify-content: center; opacity: 0; color: var(--muted); }
.scan-remove svg { width: 15px; height: 15px; }
.scan-page-tile:hover .scan-remove, .scan-page-tile:focus-within .scan-remove, .scan-page-tile:has(.scan-thumbnail.selected) .scan-remove { opacity: 1; }
.scan-remove:hover { color: var(--red); border-color: var(--red); }
.scan-undo { margin: 0 14px 14px; }
@media (hover: none), (pointer: coarse) { .scan-remove {opacity: 1;width: 34px;height: 34px;} }
@media (max-width: 640px) { .scan-quick {margin-left: 0;} .scan-settings>div, .scan-settings>div:first-child {min-width: 0; width: 100%;} .scan-page-tile {flex-shrink: 0;min-width: 120px;} }

/* Shared workspace rhythm: quiet surfaces, clear hierarchy, compact controls. */
:root { --green: #315c91; --line: #e3e7eb; }
body { background: #fbfcfd; }
.sidebar { background: #f5f7f9; overflow-y: auto; }
.brand { font-size: 22px; letter-spacing: -.6px; }
.brand-sub { margin-bottom: 24px; }
.nav { gap: 3px; }
.nav :is(button,a) { border-radius: 6px; padding: 11px 12px; }
.nav :is(button,a).active { background: #e5edf6; color: #274f7e; }
.nav-section { margin: 20px 12px 7px; color: #87919b; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.topbar { background: #fff; }
.workspace { max-width: 1420px; padding-top: 34px; }
.heading { margin-bottom: 27px; }
h1 { font-size: 27px; font-weight: 600; }
.panel { background: #fff; border-radius: 7px; }
.panel-head { min-height: 62px; }
.panel-head small { line-height: 1.7; }
.btn { border-radius: 5px; }
.btn.primary { background: #315c91; border-color: #315c91; }
.btn.primary:hover { background: #264b78; }
.btn.destructive { color: #fff; background: #a83d3d; border-color: #a83d3d; }
.delete-file { color: var(--red); }
.btn.delete-file { margin-left: 5px; }
.control { border-radius: 5px; }
.scan-settings { display: grid; grid-template-columns: minmax(180px,1fr) minmax(145px,.7fr) auto; align-items: start; padding: 19px 21px; gap: 18px; }
.scan-settings>div, .scan-settings>div:first-child { min-width: 0; max-width: none; }
.scan-settings label.field { margin: 0 0 8px; }
.scan-quick { padding-top: 21px; }
.scan-settings>div:first-child { flex: 1; max-width: 320px; }
.scan-quick .btn { width: 100%; }
.scan-canvas { background: #f1f3f5; }
.scan-thumbnails { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 10px; padding: 15px 13px; align-content: start; }
.scan-pages-empty, .scan-page-pending { grid-column: 1 / -1; }
.scan-thumbnail { padding: 8px 5px 25px; gap: 6px; border-radius: 5px; font-size: 10px; }
.scan-thumbnail img { width: 52px; height: 74px; }
.scan-drag-handle { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); color: #9aa3ad; cursor: grab; touch-action: none; display: flex; justify-content: center; width: 35px; height: 19px; }
.scan-drag-handle svg { width: 18px; height: 18px; stroke-width: 3; }
.scan-position-label { display: inline-flex; align-items: center; gap: 7px; }
.scan-position-label select { font: inherit; color: var(--ink); border: 1px solid var(--line); border-radius: 4px; background: #fff; padding: 5px 7px; }
.scan-remove { right: -5px; top: -6px; width: 25px; height: 25px; box-shadow: 0 1px 3px #20252b0c; }
.scan-next-step { padding: 20px 22px; }
.scan-save { padding: 21px; }
.usage-stats { grid-template-columns: repeat(3,minmax(0,1fr)); margin-bottom: 27px; }
.usage-stats .stat { padding-top: 19px; padding-bottom: 19px; }
.usage-panels { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.usage-notes { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 22px 0; }
.usage-notes summary { cursor: pointer; }
.usage-notes p { max-width: 850px; }
.period-select { width: auto; min-width: 155px; }
select.period-select { width: auto; }
.heading .actions { flex-wrap: wrap; justify-content: flex-end; }
.segmented { flex-shrink: 0; }
.segmented button { white-space: nowrap; }
.usage-panels>.panel { margin-bottom: 0; }
.cleanup-form { padding: 22px; display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.15fr; gap: 18px; align-items: end; }
.cleanup-form>.btn { grid-column: 1 / -1; justify-self: end; }
.input-unit { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.input-unit input { min-width: 0; }
.cleanup-review { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 5px; margin-top: 18px; }
.cleanup-review th { position: sticky; top: 0; background: #f7f9fa; }
.config-intro { padding: 22px; display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.config-intro p, .config-explainer p { font-size: 12px; color: var(--muted); line-height: 1.9; margin: 10px 0 0; }
.config-version { color: var(--muted); font-size: 11px; white-space: nowrap; }
.printer-config-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.config-properties { margin: 0; padding: 8px 22px 20px; }
.config-properties>div { border-bottom: 1px solid #f0f2f4; padding: 13px 0; }
.config-properties dt { color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.config-properties dd { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.config-explainer { padding: 22px; }
.config-explainer .btn { margin-top: 17px; }
.printer-editor { padding: 22px; display: grid; gap: 20px; }
.printer-editor label.field { margin: 0 0 8px; }
.printer-editor small { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.printer-scan-defaults { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.printer-editor .printer-default-hint { margin-top: -12px; }
.app-version { color: var(--muted); margin-left: 5px; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .printer-scan-defaults {grid-template-columns: minmax(0,1fr);} }
.printer-editor-actions { display: flex; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 18px; }
.printer-technical { padding: 18px 22px; border-top: 1px solid var(--line); font-size: 12px; }
.printer-technical summary { cursor: pointer; color: var(--muted); }
.printer-technical .config-properties { padding: 8px 0 0; }
.scan-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.scan-area-settings { padding: 20px 21px; margin-bottom: 18px; }
.scan-area-presets { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 16px; }
.scan-area-settings label.field { margin: 0 0 8px; }
.scan-area-dimensions { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-top: 20px; }
.scan-area-settings p { font-size: 11px; line-height: 1.8; color: var(--muted); margin: 16px 0 8px; }
.scan-area-summary { font-size: 11px; color: var(--green); }
.scan-area-exact { margin-top: 17px; font-size: 11px; color: var(--muted); }
.scan-area-exact summary { cursor: pointer; }
.scan-area-stage { position: relative; height: 100%; aspect-ratio: var(--scan-ratio); max-width: 100%; cursor: crosshair; touch-action: none; user-select: none; background: white; }
.scan-area-stage img { width: 100%; height: 100%; display: block; }
.scan-area-selection { position: absolute; border: 2px solid #315c91; background: #315c9120; pointer-events: none; box-shadow: 0 0 0 1px white; }
.scan-area-selection span { position: absolute; left: 0; top: 0; padding: 3px 5px; font-size: 10px; color: white; background: #315c91; white-space: nowrap; }
.scan-page-tools { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.scan-page-tools>span { margin-right: auto; font-size: 11px; color: var(--muted); }
@media (max-width: 640px) { .scan-area-presets { grid-template-columns: 1fr; } .scan-area-dimensions {grid-template-columns: repeat(2,minmax(0,1fr));} .scan-area-presets>.btn {justify-self: start;} }
.scan-card-actions .btn.delete-file { margin-left: 0; }
.scan-save { flex-wrap: wrap; }
.scan-name { min-width: 180px; }
.scan-save-action { flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.scan-save-action>span { flex-basis: 100%; text-align: right; }
.modal-footer { flex-wrap: wrap; align-items: center; }
@media (max-width: 1100px) { .scan-save { flex-direction: column; align-items: stretch; gap: 18px; } .scan-name { max-width: none; } }
@media (max-width: 1100px) { .usage-panels, .printer-config-grid {grid-template-columns: minmax(0,1fr);} .scan-thumbnails {grid-template-columns: minmax(0,1fr);} .scan-thumbnail img {width: 68px;height: 96px;} }
@media (hover: none), (pointer: coarse) { .scan-remove {width: 32px;height: 32px;} .scan-drag-handle {height: 25px;bottom: 0;} }
@media (max-width: 760px) {
 .nav-section {display: none;} .nav {margin-top: 16px;} .nav :is(button,a) {flex-shrink: 0;padding: 9px 10px;}
 .workspace {padding: 23px 16px;} .usage-stats {grid-template-columns: minmax(0,1fr);gap: 0;}
 .usage-stats .stat {padding: 15px 0;border-right: 0;border-bottom: 1px solid var(--line);}
 .cleanup-form {grid-template-columns: repeat(2,minmax(0,1fr));padding: 18px;gap: 16px;}
 .scan-settings {gap: 18px;} .scan-settings>div:first-child {max-width: none;}
}
@media (max-width: 640px) { .scan-thumbnail {width: 100px!important;} .scan-thumbnails {padding: 15px;gap: 14px;} .scan-page-tile {min-width: 100px;} .scan-thumbnail img {width: 54px;height: 78px;} }
@media (max-width: 1000px) { .scan-workspace {grid-template-columns: 145px minmax(0,1fr);gap: 14px;} .scan-next-step {align-items: start;flex-direction: column;} }
@media (max-width: 640px) {
 .scan-workspace {display: flex;flex-direction: column-reverse;}
 .scan-canvas {height: 330px;padding: 16px;}
 .scan-thumbnails {display: flex;overflow-x: auto;max-height: 190px;}
 .scan-thumbnail {flex-shrink: 0;}
 .scan-draft-note {display: none;}
 .scan-save {align-items: stretch;flex-direction: column;gap: 18px;}
 .scan-save-action {justify-content: flex-end;}
 .scan-quick {padding-top: 0;}
 .scan-settings {grid-template-columns: minmax(0,1fr);}
}

.nav a {text-decoration: none;}
