/* Без Барьеров OCR. Tokens follow design system «Без барьеров» v1.0 (02_Дизайн/tokens/tokens.css).
   Register «Спокойный» for the cabinet, «Сильный» for the login screen. Dark theme is not part of DS v1.0. */
:root {
  --ink-50: #F8F7F9; --ink-100: #F1F0F2; --ink-200: #E3E0E6; --ink-300: #CBC7D1; --ink-400: #A59EAF;
  --ink-500: #80758D; --ink-600: #635774; --ink-700: #4C3D5F; --ink-900: #210F39; --ink-950: #13002C;
  --purple-50: #F4F4F8; --purple-100: #EAE9F1; --purple-200: #D0CEE0; --purple-600: #2B2171; --purple-700: #271B65; --purple-800: #23165A;
  --cyan-50: #F0FAFB; --cyan-200: #B8E8EE; --cyan-500: #00ADC2; --sea-600: #007E92; --sea-700: #04627C;
  --success-600: #0E7A4F; --success-50: #E6F4EC; --warning-600: #A85C00; --warning-50: #FBF0E2; --error-600: #C0362C; --error-50: #FBEAE8;

  --bg-page: #FFFFFF; --bg-subtle: var(--ink-50); --bg-card: #FFFFFF; --bg-inverse: var(--ink-950);
  --text-primary: var(--ink-900); --text-secondary: var(--ink-600); --text-tertiary: var(--ink-500); --text-inverse: #FFFFFF;
  --text-link: var(--sea-600); --text-link-hover: var(--sea-700);
  --border-default: var(--ink-200); --border-strong: var(--ink-300); --border-focus: var(--purple-600);
  --action-primary: var(--purple-600); --action-primary-hover: var(--purple-700); --action-primary-active: var(--purple-800);
  --action-danger: var(--error-600); --action-disabled-bg: var(--ink-100); --action-disabled-text: var(--ink-400);
  --gradient-2: linear-gradient(90deg, #00ADC2 0%, #007E92 100%);
  --gradient-3: linear-gradient(90deg, #2B2171 0%, #13002C 100%);
  --scrim: rgba(19, 0, 44, 0.55);

  --font-display: "DIN Pro Condensed", "Roboto Condensed", system-ui, sans-serif;
  --font-text: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px; --space-12: 48px;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 22px; --radius-full: 999px;
  --shadow-sm: 0 2px 8px -4px rgba(19,0,44,.18);
  --shadow-md: 0 12px 28px -20px rgba(19,0,44,.35);
  --shadow-lg: 0 20px 44px -28px rgba(19,0,44,.40);
  --shadow-xl: 0 32px 64px -32px rgba(19,0,44,.45);
  --control-s: 40px; --control-m: 48px; --control-l: 56px; --tap-min: 44px;
  --motion-fast: 120ms cubic-bezier(.2,0,.2,1); --motion-base: 200ms cubic-bezier(.2,0,.2,1);
  --sidebar: 264px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 18px/28px var(--font-text); color: var(--text-primary); background: var(--bg-page); }
a { color: var(--text-link); text-underline-offset: 3px; }
a:hover { color: var(--text-link-hover); }
h1, h2, h3 { margin: 0 0 var(--space-3); color: var(--text-primary); }
h1 { font: 700 30px/38px var(--font-text); }
h2 { font: 700 24px/32px var(--font-text); }
h3 { font: 500 20px/28px var(--font-text); }
p { margin: 0 0 var(--space-3); }
code, .mono { font-family: var(--mono); font-size: 14px; }
pre.code { font: 14px/20px var(--mono); background: var(--bg-subtle); padding: var(--space-4); border-radius: var(--radius-md); overflow: auto; max-height: 420px; border: 1px solid var(--border-default); }
kbd { font: 14px var(--mono); border: 1px solid currentColor; border-radius: 6px; padding: 0 6px; opacity: .75; }
.ic { flex: none; vertical-align: -4px; }
.muted { color: var(--text-secondary); } .small { font-size: 14px; line-height: 20px; } .center { text-align: center; } .mt { margin-top: var(--space-6); }
.break { word-break: break-all; }
.txt-bad { color: var(--error-600); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--action-primary); color: var(--text-inverse); padding: var(--space-2) var(--space-4); z-index: 700; border-radius: var(--radius-md); }
.skip:focus { left: var(--space-2); top: var(--space-2); }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid var(--border-focus); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Layout */
.app { min-height: 100vh; background: var(--bg-subtle); }
.sidebar { display: none; }
.page { padding: var(--space-4); padding-bottom: calc(88px + env(safe-area-inset-bottom)); padding-left: max(var(--space-4), env(safe-area-inset-left)); padding-right: max(var(--space-4), env(safe-area-inset-right)); max-width: 1440px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-6); padding-top: env(safe-area-inset-top); }
.topbar-brand { display: flex; align-items: center; gap: var(--space-2); text-decoration: none; width: 100%; }
.topbar-brand img { height: 28px; width: auto; }
.topbar-brand span { font: 900 italic 18px/24px var(--font-display); letter-spacing: .04em; color: var(--action-primary); }
.page-title { margin: 0; font: 700 24px/32px var(--font-text); overflow-wrap: anywhere; }
.review-badge { display: inline-flex; gap: var(--space-2); align-items: center; text-decoration: none; color: var(--text-primary); background: var(--bg-card); border: 1px solid var(--border-default); padding: var(--space-2) var(--space-4); border-radius: var(--radius-full); font-size: 16px; min-height: var(--tap-min); }
.bottombar { position: fixed; inset: auto 0 0 0; display: flex; background: var(--bg-card); border-top: 1px solid var(--border-default); padding-bottom: env(safe-area-inset-bottom); z-index: 110; box-shadow: 0 -8px 24px -20px rgba(19,0,44,.35); }
.bottombar a, .bottombar button { flex: 1; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: 500 14px/20px var(--font-text); color: var(--text-secondary); text-decoration: none; background: none; border: 0; cursor: pointer; }
.bottombar [aria-current="page"] { color: var(--action-primary); }
.bottombar [aria-current="page"] .ic { color: var(--sea-600); }
.more-menu { position: fixed; inset: auto 0 calc(64px + env(safe-area-inset-bottom)) 0; background: var(--bg-card); border-top: 1px solid var(--border-default); padding: var(--space-3); display: grid; gap: var(--space-1); z-index: 200; box-shadow: var(--shadow-lg); border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.more-menu a, .more-menu .install-btn { display: flex; align-items: center; gap: var(--space-3); min-height: var(--control-m); padding: 0 var(--space-3); color: var(--text-primary); text-decoration: none; border-radius: var(--radius-md); background: none; border: 0; font: inherit; cursor: pointer; }
.more-menu a:hover { background: var(--bg-subtle); }
@media (min-width: 1024px) {
  .app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--border-default); padding: var(--space-6) var(--space-4); background: var(--bg-card); overflow-y: auto; }
  .sidebar nav { display: grid; gap: 2px; flex: 1; align-content: start; }
  .sidebar nav a { display: flex; align-items: center; gap: var(--space-3); min-height: var(--control-m); padding: 0 var(--space-3); border-radius: var(--radius-md); color: var(--text-primary); text-decoration: none; font-size: 16px; transition: background var(--motion-fast); }
  .sidebar nav a:hover { background: var(--bg-subtle); }
  .sidebar nav a[aria-current="page"] { background: var(--purple-50); color: var(--action-primary); font-weight: 500; box-shadow: inset 3px 0 0 var(--action-primary); }
  .sidebar nav a[aria-current="page"] .ic { color: var(--sea-600); }
  .brand { display: grid; gap: var(--space-1); text-decoration: none; margin: 0 var(--space-2) var(--space-8); }
  .brand img { width: 200px; height: auto; }
  .brand-product { font: 900 italic 20px/24px var(--font-display); letter-spacing: .04em; text-transform: uppercase; color: var(--sea-600); padding-left: 2px; }
  .nav-section { margin: var(--space-6) var(--space-3) var(--space-2); font: 500 14px/20px var(--font-text); letter-spacing: .04em; text-transform: uppercase; color: var(--text-tertiary); }
  .sidebar-foot { display: grid; gap: var(--space-2); padding: var(--space-4) var(--space-2) 0; border-top: 1px solid var(--border-default); }
  .counter { margin-left: auto; background: var(--error-600); color: var(--text-inverse); border-radius: var(--radius-full); font-size: 14px; line-height: 20px; padding: 0 8px; }
  .page { padding: var(--space-8) var(--space-8) var(--space-12); }
  .topbar-brand, .bottombar, .more-menu { display: none !important; }
  .page-title { font: 700 30px/38px var(--font-text); }
}

/* Login: register «Сильный» */
.bare { background: var(--bg-page); }
.bare-main { min-height: 100vh; display: grid; }
.auth { display: grid; min-height: 100vh; }
.auth-hero { position: relative; overflow: hidden; background: var(--gradient-3); color: var(--text-inverse); padding: var(--space-8) var(--space-6); display: grid; align-content: space-between; gap: var(--space-8); min-height: 280px; }
.auth-hero .logo { width: 200px; height: auto; position: relative; z-index: 1; }
.auth-hero h1 { font: 900 italic 48px/52px var(--font-display); letter-spacing: .02em; text-transform: uppercase; color: var(--text-inverse); margin: 0; position: relative; z-index: 1; }
.auth-hero h1 span { color: var(--cyan-500); }
.auth-hero p { color: var(--purple-200); max-width: 420px; position: relative; z-index: 1; margin: 0; }
.auth-hero .ribbon { position: absolute; right: -160px; top: 18%; width: 620px; max-width: none; pointer-events: none; opacity: .9; }
.auth-panel { display: grid; place-items: center; padding: var(--space-8) var(--space-4); }
.auth-card { width: min(440px, 100%); }
.auth-card h1 { font: 700 30px/38px var(--font-text); }
.auth-card form { margin-top: var(--space-6); }
@media (min-width: 1024px) {
  .auth { grid-template-columns: 1.1fr 1fr; }
  .auth-hero { padding: var(--space-12); }
  .auth-hero h1 { font-size: 64px; line-height: 64px; }
  .auth-hero .ribbon { width: 920px; right: -260px; top: 34%; }
}
.status-card { width: min(520px, calc(100% - 32px)); margin: auto; text-align: center; }
.error-code { font: 900 italic 64px/64px var(--font-display); color: var(--action-primary); margin: 0 0 var(--space-3); }

/* Components */
.card { background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: var(--space-4); }
@media (min-width: 600px) { .card { padding: var(--space-6); } }
.stack { display: grid; gap: var(--space-4); }
.row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: flex-end; }
.row.between { justify-content: space-between; align-items: center; margin-bottom: var(--space-4); }
.grid-2 { display: grid; gap: var(--space-6); margin-bottom: var(--space-6); }
@media (min-width: 1024px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-form { display: grid; gap: var(--space-4); }
@media (min-width: 768px) { .grid-form { grid-template-columns: repeat(2, 1fr); } .grid-form .full { grid-column: 1 / -1; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--control-m); padding: 0 var(--space-6); border-radius: var(--radius-md); border: 1.5px solid var(--action-primary); background: transparent; color: var(--action-primary); font: 500 18px/24px var(--font-text); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background var(--motion-fast), box-shadow var(--motion-fast); }
.btn:hover { background: var(--purple-50); color: var(--action-primary); }
.btn-primary { background: var(--action-primary); border-color: var(--action-primary); color: var(--text-inverse); }
.btn-primary:hover { background: var(--action-primary-hover); border-color: var(--action-primary-hover); color: var(--text-inverse); box-shadow: var(--shadow-sm); }
.btn-primary:active { background: var(--action-primary-active); }
.btn-ghost { border-color: transparent; color: var(--sea-600); padding: 0 var(--space-3); }
.btn-ghost:hover { background: var(--cyan-50); color: var(--sea-700); }
.btn-danger { background: var(--action-danger); border-color: var(--action-danger); color: var(--text-inverse); }
.btn-danger:hover { background: var(--action-danger); border-color: var(--action-danger); color: var(--text-inverse); box-shadow: var(--shadow-sm); filter: brightness(.92); }
.btn-sm { min-height: var(--control-s); padding: 0 var(--space-4); font-size: 16px; }
.btn-lg { min-height: var(--control-l); }
.btn-block { width: 100%; }
.btn-icon { min-width: var(--control-m); padding: 0; }
.btn-icon.btn-sm { min-width: var(--control-s); padding: 0; }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--action-disabled-bg); border-color: var(--action-disabled-bg); color: var(--action-disabled-text); cursor: not-allowed; box-shadow: none; }

.field { display: grid; gap: var(--space-2); font: 400 16px/24px var(--font-text); color: var(--text-secondary); min-width: 0; }
.field small { color: var(--text-tertiary); font-size: 14px; line-height: 20px; }
input, select, textarea { font: 400 18px/28px var(--font-text); color: var(--text-primary); background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 9px 14px; min-height: var(--control-m); width: 100%; max-width: 100%; transition: border-color var(--motion-fast); }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { border: 2px solid var(--border-focus); padding: 8px 13px; outline: none; }
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--action-primary); padding: 0; flex: none; }
input[type="range"] { padding: 0; min-height: 0; width: 90px; accent-color: var(--action-primary); border: 0; }
input[type="file"] { padding: 10px; font-size: 16px; }
textarea { min-height: 0; resize: vertical; }
.multiline { white-space: pre-line; }
.check { display: inline-flex; gap: var(--space-3); align-items: center; min-height: var(--tap-min); color: var(--text-primary); cursor: pointer; font-size: 16px; }
.checks { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-6); }
.otp-input { font: 500 30px/38px var(--mono); letter-spacing: .4em; text-align: center; min-height: var(--control-l); }

.alert { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); border-left: 3px solid; flex-wrap: wrap; font-size: 16px; line-height: 24px; margin-bottom: var(--space-4); }
.alert-info { background: var(--cyan-50); color: var(--sea-700); border-color: var(--sea-600); }
.alert-ok { background: var(--success-50); color: var(--success-600); border-color: var(--success-600); }
.alert-warn { background: var(--warning-50); color: var(--warning-600); border-color: var(--warning-600); }
.alert-bad { background: var(--error-50); color: var(--error-600); border-color: var(--error-600); }

.badge, .chip { display: inline-flex; align-items: center; gap: var(--space-1); padding: 2px 10px; border-radius: var(--radius-sm); font: 500 14px/20px var(--font-text); white-space: nowrap; background: var(--ink-100); color: var(--text-secondary); border: 1px solid transparent; }
.badge .ic, .chip .ic { width: 16px; height: 16px; vertical-align: 0; }
.badge-ok, .chip-ok { background: var(--success-50); color: var(--success-600); }
.badge-info { background: var(--purple-50); color: var(--action-primary); border-color: var(--purple-200); }
.badge-bad, .chip-bad { background: var(--error-50); color: var(--error-600); }
.chip-warn { background: var(--warning-50); color: var(--warning-600); }

.table { width: 100%; border-collapse: separate; border-spacing: 0; font: 400 16px/24px var(--font-text); background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden; }
.table th, .table td { text-align: left; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-default); vertical-align: top; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table thead th { font: 500 14px/20px var(--font-text); color: var(--text-secondary); background: var(--bg-subtle); }
.table th[data-sort] { cursor: pointer; }
.table tbody tr:hover { background: rgba(43, 33, 113, .04); }
.card .table { border: 0; border-radius: 0; }
@media (max-width: 767px) {
  .table-cards { border: 0; background: none; overflow: visible; }
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { border: 1px solid var(--border-default); border-radius: var(--radius-lg); margin-bottom: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--bg-card); }
  .table-cards td { border: 0 !important; padding: var(--space-1) 0; display: flex; gap: var(--space-3); justify-content: space-between; }
  .table-cards td::before { content: attr(data-label); color: var(--text-tertiary); font-size: 14px; flex: none; }
  .table-cards td:first-child { font-weight: 500; }
  .table-cards td:first-child::before { display: none; }
}
.matrix-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; border-radius: var(--radius-lg); }
.matrix th[scope="row"], .matrix thead th:first-child { position: sticky; left: 0; background: var(--bg-card); z-index: 1; min-width: 220px; }
.matrix td { text-align: center; }
.matrix-section th { background: var(--purple-50) !important; font: 500 14px/20px var(--font-text); letter-spacing: .04em; text-transform: uppercase; color: var(--action-primary); }
.fields-table input, .fields-table select, .fields-table textarea { min-width: 120px; font-size: 16px; }

.filters { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-end; margin-bottom: var(--space-6); padding: var(--space-4); background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); }
.filters .field { flex: 1 1 160px; max-width: 260px; }
.export-links { display: inline-flex; gap: var(--space-1); margin-left: auto; }
.empty { text-align: center; padding: var(--space-12) var(--space-4); color: var(--text-secondary); display: grid; gap: var(--space-4); justify-items: center; background: var(--bg-card); border: 1px dashed var(--border-strong); border-radius: var(--radius-xl); }
.empty .ribbon-mark { width: 180px; height: auto; }
.empty > .ic { width: 32px; height: 32px; color: var(--sea-600); }
.empty p { max-width: 420px; margin: 0; }
.skeleton-list { display: grid; gap: var(--space-3); }
.skeleton-list span { height: 20px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--ink-100), var(--ink-200), var(--ink-100)); background-size: 200% 100%; animation: sk 1.4s infinite; }
.skeleton-list span:nth-child(2) { width: 70%; } .skeleton-list span:nth-child(3) { width: 85%; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.modal { border: 0; border-radius: var(--radius-xl); padding: var(--space-6); background: var(--bg-card); color: var(--text-primary); width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow-xl); }
.modal::backdrop { background: var(--scrim); }
.toasts { position: fixed; right: var(--space-4); top: var(--space-4); display: grid; gap: var(--space-2); z-index: 600; }
.toast { background: var(--bg-inverse); color: var(--text-inverse); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); max-width: 380px; font-size: 16px; line-height: 24px; }
.toast-bad { background: var(--error-600); }
.stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-6); }
.stat { display: grid; gap: var(--space-1); }
.stat-n { font: 700 30px/38px var(--font-text); color: var(--action-primary); }
.stat-warn .stat-n { color: var(--warning-600); } .stat-bad .stat-n { color: var(--error-600); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-4); }
.tile { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; color: var(--text-primary); font-weight: 500; min-height: 80px; transition: box-shadow var(--motion-base), transform var(--motion-base); }
.tile .ic { color: var(--sea-600); }
.tile:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); color: var(--action-primary); }
.history { margin: 0; padding-left: var(--space-6); display: grid; gap: var(--space-1); font-size: 16px; line-height: 24px; }
.fields-dl { display: grid; grid-template-columns: minmax(140px, 40%) 1fr; gap: var(--space-3) var(--space-4); margin: 0; }
.fields-dl dt { color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; font-size: 16px; }
.fields-dl dd { margin: 0; overflow-wrap: anywhere; font-weight: 500; }
.doc-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: flex-start; }
.thumbs { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.thumbs img { border: 1px solid var(--border-default); border-radius: var(--radius-sm); height: auto; display: block; }
details.card > summary { cursor: pointer; font-weight: 500; color: var(--action-primary); min-height: var(--tap-min); display: flex; align-items: center; }

/* Tabs */
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border-default); margin-bottom: var(--space-6); overflow-x: auto; }
.tabs [role="tab"] { min-height: var(--control-m); padding: 0 var(--space-4); border: 0; background: none; font: 500 18px/24px var(--font-text); color: var(--text-secondary); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs [aria-selected="true"] { color: var(--action-primary); border-bottom-color: var(--action-primary); }

/* Upload: method hierarchy (as in «Сканирование ИПРА») */
.methods { display: grid; gap: var(--space-3); }
.method { display: grid; grid-template-columns: auto 1fr; gap: var(--space-4); align-items: center; padding: var(--space-4); border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-card); color: var(--text-primary); cursor: pointer; text-align: left; font: inherit; }
.method-ic { width: 48px; height: 48px; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--purple-50); color: var(--action-primary); }
.method b { display: block; font: 500 18px/24px var(--font-text); }
.method .small { color: var(--text-secondary); }
.method-main { background: var(--purple-600); border-color: var(--purple-600); color: var(--text-inverse); }
.method-main .method-ic { background: var(--cyan-500); color: var(--ink-950); }
.method-main .small { color: var(--purple-200); }
.method:focus-within { outline: 3px solid var(--border-focus); outline-offset: 2px; }
@media (min-width: 768px) { .methods { display: none; } }
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius-xl); padding: var(--space-12) var(--space-4); text-align: center; color: var(--text-secondary); display: grid; gap: var(--space-3); justify-items: center; cursor: pointer; background: var(--bg-subtle); transition: border-color var(--motion-fast), background var(--motion-fast); }
.dropzone > .ic { width: 32px; height: 32px; color: var(--sea-600); }
.dropzone.is-over { border-color: var(--action-primary); background: var(--purple-50); }
@media (max-width: 767px) { [data-upload-single] .dropzone { display: none; } }
.photo-strip { display: flex; gap: var(--space-2); overflow-x: auto; }
.photo-strip figure { margin: 0; position: relative; }
.photo-strip img { height: 96px; border-radius: var(--radius-sm); border: 1px solid var(--border-default); display: block; }
.photo-strip button { position: absolute; top: 4px; right: 4px; min-height: 32px; min-width: 32px; padding: 0; background: var(--bg-card); }
.progress { height: 8px; background: var(--ink-100); border-radius: var(--radius-full); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--gradient-2); transition: width var(--motion-base); }
.bulk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); max-height: 50vh; overflow-y: auto; }
.bulk-list li { display: grid; grid-template-columns: 1fr auto; gap: var(--space-1) var(--space-3); align-items: center; padding: var(--space-3) 0; border-bottom: 1px solid var(--border-default); font-size: 16px; overflow-wrap: anywhere; }
.bulk-list .progress { grid-column: 1 / -1; }
.editor-stage { position: relative; max-height: 65vh; overflow: hidden; display: grid; place-items: center; background: var(--ink-950); border-radius: var(--radius-lg); }
.editor-stage canvas { max-width: 100%; max-height: 65vh; }
.crop-frame { position: absolute; inset: 8%; border: 2px solid var(--cyan-500); border-radius: var(--radius-sm); box-shadow: 0 0 0 9999px rgba(19,0,44,.55); display: none; }
.crop-frame.is-on { display: block; }
.editor-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }

/* Review screen */
.review { display: grid; gap: var(--space-4); }
.review-tabs { margin-bottom: 0; }
.viewer { display: grid; grid-template-rows: auto 1fr auto; min-height: 60vh; background: var(--ink-100); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border-default); }
.viewer:fullscreen { background: var(--ink-950); }
.viewer-toolbar { display: flex; flex-wrap: wrap; gap: var(--space-1); align-items: center; padding: var(--space-2); background: var(--bg-card); border-bottom: 1px solid var(--border-default); }
.viewer-toolbar .btn { min-height: var(--control-s); padding: 0 var(--space-3); font-size: 16px; }
.viewer-toolbar .btn-icon { min-width: var(--control-s); padding: 0; }
.range { display: inline-flex; align-items: center; gap: var(--space-1); font-size: 16px; color: var(--text-secondary); }
.viewer-stage { position: relative; overflow: hidden; cursor: grab; touch-action: none; min-height: 50vh; }
.viewer-stage.is-dragging { cursor: grabbing; }
.viewer-stage img { position: absolute; left: 0; top: 0; transform-origin: 0 0; user-select: none; max-width: none; box-shadow: var(--shadow-md); }
.viewer-pages { display: flex; gap: var(--space-2); overflow-x: auto; padding: var(--space-2); background: var(--bg-card); border-top: 1px solid var(--border-default); }
.page-thumb { border: 2px solid transparent; background: none; padding: 2px; border-radius: var(--radius-sm); display: grid; justify-items: center; font-size: 14px; color: var(--text-secondary); cursor: pointer; min-width: var(--tap-min); }
.page-thumb[aria-current="true"] { border-color: var(--action-primary); color: var(--action-primary); }
.splitter { display: none; }
.fields-pane { min-width: 0; }
.review-fields { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: grid; gap: var(--space-3); }
.rf { border: 1px solid var(--border-default); border-left: 4px solid var(--border-default); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); background: var(--bg-card); transition: box-shadow var(--motion-fast); }
.rf-head { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-bottom: var(--space-2); }
.rf-head label { font: 500 16px/24px var(--font-text); color: var(--text-secondary); }
.rf-state { font-size: 14px; line-height: 20px; color: var(--text-tertiary); margin-left: auto; display: inline-flex; gap: var(--space-1); align-items: center; }
.rf-state .ic { width: 16px; height: 16px; }
.rf-input { font-weight: 500; }
.rf-meta { margin: var(--space-1) 0 0; color: var(--text-tertiary); display: flex; flex-wrap: wrap; gap: var(--space-3); }
.rf-actions { display: flex; gap: var(--space-4); align-items: center; margin-top: var(--space-2); flex-wrap: wrap; }
.rf-yellow { border-left-color: var(--warning-600); background: var(--warning-50); }
.rf-red { border-left-color: var(--error-600); background: var(--error-50); }
.rf-missing { border: 2px solid var(--error-600); border-left-width: 4px; }
.rf.is-confirmed { border-left-color: var(--success-600); }
.rf.is-confirmed .rf-state { color: var(--success-600); }
.rf.is-pattern-bad .rf-input { border: 2px solid var(--error-600); }
.rf.is-active { box-shadow: 0 0 0 3px var(--purple-200); }
.review-actions { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-3) 0; background: var(--bg-subtle); border-top: 1px solid var(--border-default); z-index: 100; }
@media (max-width: 767px) {
  .viewer-toolbar { flex-wrap: nowrap; overflow-x: auto; }
  .viewer-toolbar > * { flex: none; }
  .review-actions .btn-primary { flex: 1 1 100%; }
}
@media (max-width: 1023px) { .review [data-mobile-hidden] { display: none; } }
@media (min-width: 1024px) {
  .review { grid-template-columns: var(--split, 58%) 8px minmax(0, 1fr); grid-template-rows: auto; height: calc(100vh - 150px); }
  .review-tabs { display: none; }
  .viewer { min-height: 0; }
  .viewer-stage { min-height: 0; }
  .splitter { display: block; cursor: col-resize; background: var(--border-default); border-radius: var(--radius-full); margin: var(--space-12) 0; }
  .splitter:hover, .splitter:focus { background: var(--action-primary); }
  .fields-pane { overflow-y: auto; padding-right: var(--space-2); }
  .review-actions { bottom: 0; }
}
.auth-hero h1 { margin-bottom: var(--space-4); }
@media (max-width: 599px) { .auth-hero .ribbon { display: none; } }
@media (max-width: 1023px) {
  .auth { grid-template-rows: auto 1fr; align-content: start; }
  .auth-panel { place-items: start center; padding-top: var(--space-6); }
}
