:root {
    --brand-950: #0a2e3d;
    --brand-900: #103f53;
    --brand-800: #164f67;
    --brand-700: #1d617d;
    --brand-600: #287895;
    --brand-100: #dcecf1;
    --brand-50: #eff7f9;
    --ink-950: #172429;
    --ink-800: #293b42;
    --ink-600: #586c74;
    --ink-500: #75858b;
    --line: #dfe7e9;
    --surface: #ffffff;
    --canvas: #f4f7f7;
    --success: #16805c;
    --success-bg: #e8f7f1;
    --warning: #a86a15;
    --warning-bg: #fff5df;
    --danger: #b64245;
    --danger-bg: #fff0f0;
    --shadow-sm: 0 1px 2px rgba(20, 48, 58, .05), 0 4px 14px rgba(20, 48, 58, .05);
    --shadow-md: 0 14px 40px rgba(19, 54, 68, .12);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --sidebar-width: 264px;
    --font: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--ink-950); font-family: var(--font); background: var(--canvas); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
svg { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; }
[hidden] { display: none !important; }
::selection { color: white; background: var(--brand-700); }

.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar-width); display: flex; flex-direction: column; color: white; background: linear-gradient(178deg, var(--brand-950), #0c3546 64%, #102f3b); overflow: hidden; }
.sidebar::before { content: ""; position: absolute; width: 270px; height: 270px; right: -160px; top: 90px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 42px rgba(255,255,255,.025), 0 0 0 86px rgba(255,255,255,.02); pointer-events: none; }
.sidebar-brand { position: relative; display: flex; align-items: center; gap: 12px; min-height: 94px; padding: 20px 26px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-brand img { width: 132px; height: auto; }
.sidebar-brand span { align-self: flex-end; margin: 0 0 17px -2px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.35); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.sidebar-nav { position: relative; display: flex; flex-direction: column; gap: 5px; flex: 1; padding: 22px 16px; }
.nav-caption { margin: 18px 12px 7px; color: rgba(255,255,255,.46); font-size: .68rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.nav-caption:first-child { margin-top: 0; }
.nav-link { display: flex; align-items: center; gap: 13px; min-height: 46px; padding: 10px 13px; color: rgba(255,255,255,.73); border: 1px solid transparent; border-radius: 12px; font-size: .93rem; font-weight: 600; transition: .18s ease; }
.nav-link svg { width: 19px; height: 19px; }
.nav-link:hover { color: white; background: rgba(255,255,255,.075); transform: translateX(2px); }
.nav-link.active { color: white; background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.1); box-shadow: inset 3px 0 var(--brand-600); }
.sidebar-foot { position: relative; display: flex; align-items: center; gap: 8px; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.1); }
.user-summary { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.user-avatar { display: grid; place-items: center; width: 40px; height: 40px; color: white; background: linear-gradient(145deg, var(--brand-600), var(--brand-800)); border: 1px solid rgba(255,255,255,.28); border-radius: 12px; font-size: .75rem; font-weight: 800; }
.user-avatar.compact { width: 36px; height: 36px; border-color: var(--brand-100); }
.user-copy { display: flex; flex-direction: column; min-width: 0; }
.user-copy strong { overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.user-copy small { margin-top: 2px; color: rgba(255,255,255,.55); font-size: .7rem; }
.app-content { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; min-height: 76px; padding: 12px clamp(20px, 3vw, 42px); background: rgba(255,255,255,.88); border-bottom: 1px solid rgba(213,224,227,.82); backdrop-filter: blur(16px); }
.topbar-title { display: flex; flex-direction: column; gap: 2px; }
.topbar-title strong { color: var(--ink-950); font-size: 1.08rem; }
.eyebrow { display: block; color: var(--brand-700); font-size: .69rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.secure-indicator { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; color: var(--success); background: var(--success-bg); border-radius: 999px; font-size: .75rem; font-weight: 700; }
.page-content { width: min(1460px, 100%); margin-inline: auto; padding: clamp(22px, 3vw, 42px); }
.sidebar-scrim { display: none; }
.mobile-only { display: none !important; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.page-heading h1 { margin: 5px 0 6px; font-size: clamp(1.65rem, 3vw, 2.25rem); line-height: 1.1; letter-spacing: -.035em; }
.page-heading p { margin: 0; color: var(--ink-600); }
.heading-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 10px 16px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-size: .88rem; font-weight: 750; line-height: 1; transition: transform .17s ease, box-shadow .17s ease, background .17s ease, border-color .17s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:focus-visible, .icon-button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(40,120,149,.22); outline-offset: 2px; }
.button:disabled { cursor: not-allowed; opacity: .58; }
.button-primary { color: white; background: linear-gradient(135deg, var(--brand-700), var(--brand-900)); box-shadow: 0 8px 18px rgba(22,79,103,.19); }
.button-primary:hover:not(:disabled) { box-shadow: 0 12px 26px rgba(22,79,103,.25); }
.button-secondary { color: var(--brand-800); background: white; border-color: #cddcE0; }
.button-secondary:hover:not(:disabled) { background: var(--brand-50); border-color: #b9cfd6; }
.button-ghost { color: var(--ink-600); background: transparent; }
.button-danger { color: var(--danger); background: var(--danger-bg); border-color: #f3cdcf; }
.button-success { color: white; background: var(--success); }
.button-sm { min-height: 36px; padding: 8px 12px; font-size: .8rem; }
.button-lg { min-height: 50px; padding: 14px 19px; font-size: .94rem; }
.button-block { width: 100%; }
.icon-button { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; color: var(--ink-600); background: white; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; transition: .17s ease; }
.icon-button:hover { color: var(--brand-700); border-color: #c4d6db; background: var(--brand-50); }
.icon-button-light { color: rgba(255,255,255,.7); background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.12); }
.icon-button-light:hover { color: white; background: rgba(255,255,255,.12); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.card-header h2, .card-header h3 { margin: 0; font-size: 1rem; }
.card-body { padding: 22px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 24px; }
.stat-card { position: relative; min-height: 136px; padding: 20px; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; width: 92px; height: 92px; right: -30px; bottom: -40px; border-radius: 50%; background: currentColor; opacity: .045; }
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; }
.stat-label { color: var(--ink-600); font-size: .78rem; font-weight: 700; }
.stat-icon { display: grid; place-items: center; width: 38px; height: 38px; color: var(--brand-700); background: var(--brand-50); border-radius: 11px; }
.stat-value { display: block; margin-top: 17px; font-size: 2rem; line-height: 1; letter-spacing: -.04em; }
.stat-note { display: block; margin-top: 8px; color: var(--ink-500); font-size: .72rem; }
.stat-card.success .stat-icon { color: var(--success); background: var(--success-bg); }
.stat-card.warning .stat-icon { color: var(--warning); background: var(--warning-bg); }
.stat-card.neutral .stat-icon { color: var(--ink-600); background: #edf1f2; }

.toolbar { display: flex; align-items: center; gap: 12px; padding: 16px 18px; }
.search-field { position: relative; display: flex; align-items: center; flex: 1; min-width: 200px; }
.search-field > svg { position: absolute; left: 13px; color: var(--ink-500); pointer-events: none; }
.search-field input { width: 100%; padding-left: 40px; }
.filter-select { width: min(230px, 100%); }
.toggle-control { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-600); font-size: .78rem; font-weight: 650; white-space: nowrap; }
.toggle-control input { width: 17px; height: 17px; min-height: 0; accent-color: var(--brand-700); }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 12px 18px; color: var(--ink-500); background: #f8fafa; border-block: 1px solid var(--line); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 16px 18px; border-bottom: 1px solid #ebf0f1; font-size: .86rem; vertical-align: middle; }
.data-table tbody tr { cursor: pointer; transition: background .15s ease; }
.data-table tbody tr:hover { background: #f7fafb; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.row-actions .icon-button { width: 35px; height: 35px; }
.role-pill { display: inline-flex; align-items: center; gap: 7px; color: var(--brand-800); font-size: .78rem; font-weight: 750; }
.text-button { padding: 0; color: var(--brand-700); background: transparent; border: 0; cursor: pointer; font-weight: 750; }
.cell-main { display: flex; flex-direction: column; gap: 3px; }
.cell-main strong { color: var(--ink-800); font-size: .88rem; }
.cell-main small { color: var(--ink-500); font-size: .73rem; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 5px 9px; border-radius: 999px; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.status-badge svg { width: 14px; height: 14px; }
.status-waiting { color: var(--warning); background: var(--warning-bg); }
.status-success { color: var(--success); background: var(--success-bg); }
.status-danger { color: var(--danger); background: var(--danger-bg); }
.status-neutral { color: var(--ink-600); background: #edf1f2; }
.mobile-list { display: none; }
.empty-state { display: grid; place-items: center; min-height: 300px; padding: 36px; color: var(--ink-600); text-align: center; }
.empty-state span { display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 12px; color: var(--brand-700); background: var(--brand-50); border-radius: 18px; }
.empty-state h3 { margin: 0 0 6px; color: var(--ink-800); }
.empty-state p { max-width: 400px; margin: 0 0 18px; }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; color: var(--ink-800); font-size: .79rem; font-weight: 750; }
.field > span:first-child { display: flex; justify-content: space-between; }
.field small { color: var(--ink-500); font-weight: 500; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--ink-950); background: #fff; border: 1px solid #cfdcdf; border-radius: 10px; transition: border .15s ease, box-shadow .15s ease; }
textarea { min-height: 104px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #9aa8ad; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-600); box-shadow: 0 0 0 3px rgba(40,120,149,.11); outline: 0; }
input:disabled, select:disabled { color: var(--ink-500); background: #f1f4f5; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
.compact-grid { grid-template-columns: minmax(120px, 220px) minmax(160px, 240px); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 22px; border-top: 1px solid var(--line); }
.input-with-icon { position: relative; display: flex; align-items: center; }
.input-with-icon > svg { position: absolute; left: 13px; z-index: 1; color: var(--ink-500); }
.input-with-icon input { padding-left: 42px; padding-right: 42px; }
.input-action { position: absolute; right: 5px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; color: var(--ink-500); background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.check-row { display: flex; align-items: flex-start; gap: 10px; color: var(--ink-600); font-size: .82rem; cursor: pointer; }
.check-row input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--brand-700); }
.form-alert { padding: 11px 13px; color: var(--danger); background: var(--danger-bg); border: 1px solid #f0ced0; border-radius: 10px; font-size: .8rem; }
.hint-box, .password-hint { display: flex; align-items: flex-start; gap: 10px; padding: 12px; color: var(--brand-800); background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 11px; font-size: .78rem; line-height: 1.45; }
.form-section { padding: 24px; }
.form-section + .form-section { border-top: 1px solid var(--line); }
.section-title { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.section-title > span { display: grid; place-items: center; width: 38px; height: 38px; color: var(--brand-700); background: var(--brand-50); border-radius: 11px; }
.section-title h2 { margin: 0 0 4px; font-size: 1rem; }
.section-title p { margin: 0; color: var(--ink-500); font-size: .78rem; }
.dropzone { display: grid; place-items: center; min-height: 190px; padding: 26px; text-align: center; background: #fafcfc; border: 1.5px dashed #b9cdd3; border-radius: 15px; cursor: pointer; transition: .18s ease; }
.dropzone:hover, .dropzone.dragging { background: var(--brand-50); border-color: var(--brand-600); }
.dropzone > span { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 12px; color: var(--brand-700); background: white; border: 1px solid var(--brand-100); border-radius: 15px; box-shadow: var(--shadow-sm); }
.dropzone strong { font-size: .9rem; }
.dropzone p { margin: 5px 0; color: var(--ink-500); font-size: .76rem; }
.dropzone small { color: var(--ink-500); font-size: .69rem; }
.file-chip { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px; background: var(--success-bg); border: 1px solid #cce9dd; border-radius: 11px; }
.file-chip > span:first-child { display: grid; place-items: center; width: 38px; height: 38px; color: var(--success); background: white; border-radius: 9px; }
.file-chip-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-chip-copy strong { overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.file-chip-copy small { margin-top: 3px; color: var(--ink-500); }

.combobox { position: relative; }
.combobox input { padding-right: 42px; }
.combobox-spinner { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-500); }
.combobox-results { position: absolute; z-index: 20; top: calc(100% + 7px); left: 0; right: 0; max-height: 290px; padding: 6px; overflow-y: auto; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md); }
.combo-option { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px; background: transparent; border: 0; border-radius: 9px; cursor: pointer; text-align: left; }
.combo-option:hover, .combo-option[aria-selected="true"] { background: var(--brand-50); }
.combo-option > span:first-child { display: grid; place-items: center; width: 36px; height: 36px; color: var(--brand-700); background: var(--brand-100); border-radius: 9px; }
.combo-copy { display: flex; flex-direction: column; min-width: 0; }
.combo-copy strong { overflow: hidden; color: var(--ink-800); font-size: .79rem; text-overflow: ellipsis; white-space: nowrap; }
.combo-copy small { margin-top: 2px; color: var(--ink-500); font-size: .7rem; }
.selected-client { display: flex; align-items: center; gap: 12px; padding: 13px; background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 11px; }
.selected-client .combo-copy { flex: 1; }

.details-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .75fr); gap: 20px; }
.detail-main-stack, .detail-side-stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.back-eyebrow { display: inline-flex; align-items: center; gap: 6px; }
.back-eyebrow:hover { color: var(--brand-900); }
.success-color { color: var(--success); }
.inline-note { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 0; color: var(--ink-500); font-size: .75rem; }
.empty-combo { padding: 18px 12px; color: var(--ink-600); text-align: center; font-size: .78rem; }
.empty-combo small { display: block; margin-top: 4px; color: var(--ink-500); }
.spin-icon { animation: spin .75s linear infinite; }
.info-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.info-item { display: flex; flex-direction: column; gap: 6px; }
.info-item small { color: var(--ink-500); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.info-item strong { font-size: .91rem; }
.link-box { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 8px 8px 8px 13px; background: #f7fafb; border: 1px solid var(--line); border-radius: 11px; }
.link-box code { min-width: 0; flex: 1; overflow: hidden; color: var(--brand-800); font: 600 .72rem/1.3 var(--font); text-overflow: ellipsis; white-space: nowrap; }
.timeline { position: relative; display: flex; flex-direction: column; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding-bottom: 22px; }
.timeline-item:not(:last-child)::before { content: ""; position: absolute; top: 32px; bottom: 0; left: 16px; width: 1px; background: var(--line); }
.timeline-icon { z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; color: var(--brand-700); background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 50%; }
.timeline-copy strong { display: block; margin: 2px 0 4px; font-size: .82rem; }
.timeline-copy small { color: var(--ink-500); font-size: .72rem; }
.action-stack { display: flex; flex-direction: column; gap: 9px; }

.modal { position: fixed; z-index: 90; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(10,31,39,.48); backdrop-filter: blur(5px); }
.modal-panel { width: min(620px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: white; border-radius: 20px; box-shadow: 0 24px 70px rgba(8,31,41,.3); animation: modal-in .2s ease-out; }
.compact-modal { width: min(460px, 100%); }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 1.08rem; }
.modal-body { padding: 22px; }
.modal-footer { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }

.skeleton { position: relative; overflow: hidden; color: transparent !important; background: #e9eff0 !important; border-radius: 7px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .65s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast-region { position: fixed; z-index: 120; top: 20px; right: 20px; display: flex; flex-direction: column; gap: 9px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; color: var(--ink-800); background: white; border: 1px solid var(--line); border-left: 4px solid var(--success); border-radius: 12px; box-shadow: var(--shadow-md); opacity: 0; transform: translateY(-8px); transition: .2s ease; pointer-events: auto; }
.toast.visible { opacity: 1; transform: none; }
.toast > span { flex: 1; font-size: .8rem; line-height: 1.4; }
.toast button { display: grid; place-items: center; padding: 0; color: var(--ink-500); background: transparent; border: 0; cursor: pointer; }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }

.auth-page { display: grid; grid-template-columns: minmax(400px, .92fr) minmax(520px, 1.08fr); min-height: 100vh; }
.auth-brand-panel { position: relative; display: flex; align-items: center; min-height: 100vh; padding: 7vw; color: white; background: linear-gradient(145deg, var(--brand-950), var(--brand-800)); overflow: hidden; }
.auth-brand-panel::after { content: ""; position: absolute; inset: 0; opacity: .16; background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px); background-size: 52px 52px; mask-image: linear-gradient(to bottom right, black, transparent 72%); }
.auth-brand-content { position: relative; z-index: 2; width: min(560px, 100%); }
.auth-logo { width: 210px; margin-bottom: 68px; }
.auth-product-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; font-size: .72rem; font-weight: 800; }
.auth-brand-content h1 { margin: 22px 0 18px; font-size: clamp(2.55rem, 4.5vw, 4.6rem); line-height: .98; letter-spacing: -.055em; }
.auth-brand-content > p { max-width: 500px; margin: 0; color: rgba(255,255,255,.69); font-size: 1rem; line-height: 1.65; }
.auth-trust-list { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 42px; }
.auth-trust-list span { display: inline-flex; align-items: center; gap: 7px; color: rgba(255,255,255,.78); font-size: .75rem; font-weight: 650; }
.brand-orb { position: absolute; z-index: 1; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; }
.brand-orb-one { width: 460px; height: 460px; right: -250px; top: -160px; box-shadow: 0 0 0 70px rgba(255,255,255,.02), 0 0 0 140px rgba(255,255,255,.018); }
.brand-orb-two { width: 280px; height: 280px; left: -190px; bottom: -90px; }
.auth-form-panel { display: grid; place-items: center; min-height: 100vh; padding: 44px; background: #f8fafa; }
.auth-card { width: min(430px, 100%); padding: 36px; background: white; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 22px 60px rgba(18,55,68,.1); }
.auth-card h1, .auth-card h2 { margin: 8px 0 8px; font-size: clamp(1.65rem, 3vw, 2.05rem); letter-spacing: -.035em; }
.auth-card .muted { margin: 0 0 26px; }
.auth-card .field { margin-top: 17px; }
.auth-card .check-row { margin: 18px 0; }
.auth-card .form-alert { margin-bottom: 12px; }
.muted { color: var(--ink-600); line-height: 1.5; }
.auth-help { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 18px 0 0; color: var(--ink-500); font-size: .72rem; }
.mobile-auth-logo { display: none; }
.simple-auth-page, .feedback-page { display: grid; place-items: center; min-height: 100vh; padding: 28px; background: radial-gradient(circle at 10% 10%, var(--brand-100), transparent 32%), #f6f9f9; }
.form-logo { width: 150px; margin-bottom: 28px; }
.step-icon, .feedback-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 17px; color: var(--brand-700); background: var(--brand-50); border-radius: 14px; }
.step-icon svg, .feedback-icon svg { width: 24px; height: 24px; }
.feedback-card { width: min(520px, 100%); padding: 44px; text-align: center; background: white; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-md); }
.feedback-icon { margin-inline: auto; }
.feedback-icon.warning { color: var(--warning); background: var(--warning-bg); }
.feedback-icon.danger { color: var(--danger); background: var(--danger-bg); }
.feedback-card h1 { margin: 8px 0 10px; font-size: 1.8rem; letter-spacing: -.03em; }
.feedback-card p { margin: 0 auto 24px; color: var(--ink-600); line-height: 1.6; }

/* Fluxo público de assinatura */
.public-body { background: #f3f7f7; }
.signing-header { position: relative; z-index: 20; display: flex; align-items: center; justify-content: space-between; min-height: 78px; padding: 12px clamp(18px, 5vw, 74px); background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.signing-logo img { display: block; width: 156px; }
.signing-secure { display: inline-flex; align-items: center; gap: 7px; color: var(--success); font-size: .75rem; font-weight: 750; }
.wizard-app { width: min(1380px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 52px; }
.wizard-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.wizard-heading h1 { margin: 5px 0 5px; font-size: clamp(1.7rem, 3.5vw, 2.55rem); line-height: 1.08; letter-spacing: -.04em; }
.wizard-heading p { margin: 0; color: var(--ink-600); }
.wizard-expiration { display: flex; align-items: center; gap: 11px; padding: 12px 15px; color: var(--ink-800); background: white; border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-sm); }
.wizard-expiration > svg { color: var(--brand-700); }
.wizard-expiration span { display: flex; flex-direction: column; gap: 2px; }
.wizard-expiration small { color: var(--ink-500); font-size: .66rem; }
.wizard-expiration strong { font-size: .78rem; }
.wizard-progress { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 920px; margin: 0 auto 28px; }
.progress-line { position: absolute; z-index: 0; top: 18px; left: calc(12.5% - 4px); right: calc(12.5% - 4px); height: 2px; background: #d7e2e4; overflow: hidden; }
.progress-line span { display: block; width: 0; height: 100%; background: var(--brand-700); transition: width .35s ease; }
.progress-step { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: center; gap: 10px; color: var(--ink-500); }
.progress-step > span { display: grid; place-items: center; width: 36px; height: 36px; color: var(--ink-500); background: #edf2f3; border: 2px solid #d6e1e3; border-radius: 50%; font-size: .74rem; font-weight: 850; transition: .22s ease; }
.progress-step > div { display: flex; flex-direction: column; gap: 2px; padding-top: 2px; }
.progress-step strong { color: inherit; font-size: .76rem; }
.progress-step small { font-size: .65rem; }
.progress-step.active { color: var(--brand-800); }
.progress-step.active > span { color: white; background: var(--brand-700); border-color: var(--brand-700); box-shadow: 0 0 0 5px var(--brand-100); }
.progress-step.complete > span { color: white; background: var(--success); border-color: var(--success); }
.progress-step.complete > span svg { width: 15px; }
.wizard-card { min-height: 540px; background: white; border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 18px 55px rgba(19,54,68,.09); overflow: hidden; }
.wizard-step { padding: clamp(25px, 4.5vw, 58px); opacity: 0; transform: translateX(14px); transition: opacity .25s ease, transform .25s ease; }
.wizard-step.active { opacity: 1; transform: none; }
.wizard-step-heading { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 28px; }
.wizard-step-heading .step-number { color: var(--brand-600); font-size: 1.15rem; font-weight: 850; letter-spacing: -.03em; }
.wizard-step-heading h2 { margin: 3px 0 5px; font-size: clamp(1.35rem, 3vw, 1.95rem); letter-spacing: -.035em; }
.wizard-step-heading p { margin: 0; color: var(--ink-600); }
.terms-box { max-height: 330px; overflow-y: auto; background: #f9fbfb; border: 1px solid var(--line); border-radius: 16px; scrollbar-color: #afc5cc transparent; }
.terms-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: rgba(249,251,251,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.terms-head > span { display: grid; place-items: center; width: 38px; height: 38px; color: var(--brand-700); background: white; border: 1px solid var(--brand-100); border-radius: 11px; }
.terms-head > div { display: flex; flex-direction: column; gap: 2px; }
.terms-head strong { font-size: .82rem; }
.terms-head small { color: var(--ink-500); font-size: .68rem; }
.terms-copy { padding: 20px; color: #53676f; font-size: .8rem; line-height: 1.72; white-space: pre-line; }
.consent-check { display: flex; align-items: flex-start; gap: 13px; margin-top: 17px; padding: 16px; background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 13px; cursor: pointer; }
.consent-check input { width: 20px; height: 20px; min-height: 0; margin: 1px 0 0; accent-color: var(--brand-700); }
.consent-check > span { display: flex; flex-direction: column; gap: 3px; }
.consent-check strong { font-size: .82rem; }
.consent-check small { color: var(--ink-600); font-size: .72rem; }
.location-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 15px; margin-top: 14px; padding: 17px; border: 1px solid var(--line); border-radius: 14px; transition: .2s ease; }
.location-card.authorized { background: var(--success-bg); border-color: #bfe3d5; }
.location-icon { display: grid; place-items: center; width: 44px; height: 44px; color: var(--brand-700); background: var(--brand-50); border-radius: 13px; }
.location-card.authorized .location-icon { color: var(--success); background: white; }
.location-copy strong { font-size: .85rem; }
.location-copy p { margin: 4px 0 7px; color: var(--ink-600); font-size: .72rem; }
.location-copy > span { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-500); font-size: .69rem; font-weight: 700; }
.location-copy > span.success { color: var(--success); }
.location-copy > span.error { color: var(--danger); }
.signer-form { max-width: 880px; }
.privacy-note { display: inline-flex; align-items: center; gap: 9px; margin-top: 24px; padding: 10px 13px; color: var(--success); background: var(--success-bg); border-radius: 10px; font-size: .72rem; font-weight: 650; }
.wizard-actions { position: sticky; z-index: 18; bottom: 16px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; margin-top: 18px; padding: 14px 16px; background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 14px 40px rgba(19,54,68,.13); backdrop-filter: blur(14px); }
.wizard-actions #wizard-back { justify-self: start; }
.wizard-actions #wizard-next { justify-self: end; }
.wizard-safe-note { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-500); font-size: .7rem; font-weight: 650; }
.wizard-safe-note svg { color: var(--success); }

.signature-step { padding-inline: clamp(20px, 3vw, 42px); }
.signature-workspace { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 20px; align-items: start; }
.signature-maker { position: sticky; top: 92px; padding: 16px; background: #f8fafa; border: 1px solid var(--line); border-radius: 16px; }
.segmented-control { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: #e9eff0; border-radius: 10px; }
.segmented-control button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 37px; padding: 7px; color: var(--ink-600); background: transparent; border: 0; border-radius: 8px; cursor: pointer; font-size: .7rem; font-weight: 750; }
.segmented-control button.active { color: var(--brand-800); background: white; box-shadow: var(--shadow-sm); }
.signature-canvas-wrap { position: relative; margin: 13px 0 6px; background: white; border: 1px dashed #acc1c7; border-radius: 11px; overflow: hidden; }
.signature-canvas-wrap canvas { display: block; width: 100%; height: 130px; touch-action: none; cursor: crosshair; }
.signature-canvas-wrap > span { position: absolute; right: 9px; bottom: 7px; color: #a0afb4; font-size: .6rem; pointer-events: none; }
.mini-dropzone { display: grid; place-items: center; min-height: 154px; margin: 13px 0; padding: 18px; text-align: center; background: white; border: 1px dashed #acc1c7; border-radius: 11px; cursor: pointer; }
.mini-dropzone > span { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 8px; color: var(--brand-700); background: var(--brand-50); border-radius: 11px; }
.mini-dropzone strong { max-width: 100%; overflow: hidden; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.mini-dropzone small { margin-top: 4px; color: var(--ink-500); font-size: .62rem; }
.mini-dropzone.has-file { background: var(--success-bg); border-color: #a8d7c6; }
.signature-maker > .button-block { margin-top: 12px; }
.maker-hint { display: flex; align-items: center; gap: 6px; margin: 11px 0 0; color: var(--ink-500); font-size: .64rem; line-height: 1.4; }
.document-editor { min-width: 0; overflow: hidden; background: #e8edef; border: 1px solid #d7e0e2; border-radius: 16px; }
.document-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; padding: 10px 13px; background: white; border-bottom: 1px solid var(--line); }
.document-toolbar > div:first-child { display: flex; align-items: center; gap: 9px; min-width: 0; }
.document-toolbar > div:first-child > svg { color: var(--brand-700); }
.document-toolbar > div:first-child > span { display: flex; flex-direction: column; min-width: 0; }
.document-toolbar strong { overflow: hidden; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.document-toolbar small { color: var(--ink-500); font-size: .62rem; }
.page-controls { display: flex; align-items: center; gap: 7px; }
.page-controls .icon-button { width: 32px; height: 32px; }
.page-controls > span { color: var(--ink-600); font-size: .68rem; }
.document-stage { min-height: 620px; padding: 20px; overflow: auto; text-align: center; }
.document-loading { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 500px; color: var(--ink-600); font-size: .75rem; }
.document-page { position: relative; display: inline-block; line-height: 0; background: white; box-shadow: 0 10px 30px rgba(28,48,55,.16); }
.document-page canvas, .document-page > img { display: block; max-width: none; }
.signature-overlay { position: absolute; z-index: 3; min-width: 110px; min-height: 42px; padding: 3px; line-height: 0; background: rgba(255,255,255,.82); border: 2px solid var(--brand-600); border-radius: 5px; box-shadow: 0 5px 16px rgba(22,79,103,.2); cursor: grab; touch-action: none; user-select: none; }
.signature-overlay:active { cursor: grabbing; }
.signature-overlay > img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.resize-handle { position: absolute; right: -10px; bottom: -10px; display: grid; place-items: center; width: 24px; height: 24px; color: white; background: var(--brand-700); border: 2px solid white; border-radius: 50%; cursor: nwse-resize; }
.resize-handle svg { width: 12px; height: 12px; }
.document-tip { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 0; padding: 10px; color: var(--ink-600); background: white; border-top: 1px solid var(--line); font-size: .67rem; }

.selfie-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 22px; align-items: start; }
.camera-card { padding: 16px; background: #f8fafa; border: 1px solid var(--line); border-radius: 18px; }
.camera-viewport { position: relative; display: grid; place-items: center; min-height: 430px; overflow: hidden; background: linear-gradient(145deg, #dce7e9, #eef3f4); border-radius: 14px; }
.camera-placeholder { max-width: 360px; padding: 30px; text-align: center; }
.camera-placeholder > span { display: grid; place-items: center; width: 70px; height: 70px; margin: 0 auto 15px; color: var(--brand-700); background: white; border-radius: 50%; box-shadow: var(--shadow-sm); }
.camera-placeholder > span svg { width: 32px; height: 32px; }
.camera-placeholder strong { font-size: 1rem; }
.camera-placeholder p { margin: 7px 0 0; color: var(--ink-600); font-size: .75rem; line-height: 1.5; }
.camera-viewport video, .camera-viewport > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera-viewport video { transform: scaleX(-1); }
.face-guide { position: absolute; z-index: 2; width: min(58%, 300px); aspect-ratio: .77; border: 2px solid rgba(255,255,255,.88); border-radius: 48%; box-shadow: 0 0 0 999px rgba(6,29,38,.17), inset 0 0 30px rgba(255,255,255,.1); pointer-events: none; }
.camera-actions { display: flex; align-items: center; justify-content: center; gap: 9px; flex-wrap: wrap; padding-top: 14px; }
.review-card { padding: 24px; background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); }
.review-icon { display: grid; place-items: center; width: 46px; height: 46px; color: var(--success); background: var(--success-bg); border-radius: 13px; }
.review-card h3 { margin: 15px 0 18px; font-size: 1.05rem; }
.review-list { display: flex; flex-direction: column; }
.review-list > span { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.review-list small { color: var(--ink-500); font-size: .63rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.review-list strong { overflow-wrap: anywhere; font-size: .79rem; }
.review-card > p { display: flex; align-items: flex-start; gap: 7px; margin: 17px 0 0; color: var(--ink-500); font-size: .67rem; line-height: 1.5; }
.wizard-complete { padding: clamp(50px, 8vw, 90px) 24px; text-align: center; animation: complete-in .45s ease-out; }
@keyframes complete-in { from { opacity: 0; transform: translateY(14px); } }
.success-burst { position: relative; display: grid; place-items: center; width: 92px; height: 92px; margin: 0 auto 26px; }
.success-burst::before, .success-burst::after { content: ""; position: absolute; inset: 0; background: var(--success-bg); border-radius: 50%; animation: pulse-ring 2s ease-out infinite; }
.success-burst::after { animation-delay: .8s; }
@keyframes pulse-ring { 0% { opacity: .9; transform: scale(.65); } 70%,100% { opacity: 0; transform: scale(1.45); } }
.success-burst span { position: relative; z-index: 2; display: grid; place-items: center; width: 70px; height: 70px; color: white; background: var(--success); border-radius: 50%; box-shadow: 0 12px 30px rgba(22,128,92,.25); }
.success-burst svg { width: 34px; height: 34px; stroke-width: 2.5; }
.wizard-complete h2 { margin: 8px 0 9px; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.045em; }
.wizard-complete > p { max-width: 590px; margin: 0 auto; color: var(--ink-600); line-height: 1.6; }
.verification-code { width: fit-content; margin: 26px auto 18px; padding: 14px 20px; color: var(--brand-900); background: var(--brand-50); border: 1px dashed var(--brand-600); border-radius: 12px; font-size: clamp(1.15rem, 3vw, 1.55rem); font-weight: 850; letter-spacing: .08em; }
.completion-trust { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 30px; color: var(--ink-500); font-size: .68rem; font-weight: 650; }
.completion-trust span { display: inline-flex; align-items: center; gap: 6px; }
.signing-state-page { display: grid; place-items: center; min-height: calc(100vh - 78px); padding: 30px; background: radial-gradient(circle at 50% 0%, var(--brand-100), transparent 38%); }
.signing-state-card { width: min(570px, 100%); padding: clamp(30px, 6vw, 56px); text-align: center; background: white; border: 1px solid var(--line); border-radius: 25px; box-shadow: var(--shadow-md); }
.state-icon { display: grid; place-items: center; width: 66px; height: 66px; margin: 0 auto 21px; border-radius: 19px; }
.state-icon svg { width: 30px; height: 30px; }
.state-icon.success { color: var(--success); background: var(--success-bg); }
.state-icon.warning { color: var(--warning); background: var(--warning-bg); }
.state-icon.danger { color: var(--danger); background: var(--danger-bg); }
.signing-state-card h1 { margin: 8px 0 10px; font-size: clamp(1.6rem, 4vw, 2.25rem); letter-spacing: -.04em; }
.signing-state-card > p { margin: 0 auto 24px; color: var(--ink-600); line-height: 1.65; }
.signing-state-card > img { width: 125px; margin-top: 25px; opacity: .65; }
.state-client { display: flex; flex-direction: column; gap: 4px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.state-client small { color: var(--ink-500); font-size: .67rem; text-transform: uppercase; }
.state-client strong { font-size: .85rem; }
.verification-page { width: min(960px, calc(100% - 32px)); margin: 0 auto; padding: clamp(45px, 8vw, 90px) 0; }
.verification-intro { max-width: 680px; margin: 0 auto; text-align: center; }
.verification-intro h1 { margin: 8px 0 10px; font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -.05em; }
.verification-intro > p { margin: 0 auto; color: var(--ink-600); line-height: 1.65; }
.verification-search { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-top: 26px; padding: 7px; background: white; border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow-md); }
.verification-search > svg { position: absolute; z-index: 1; top: 50%; left: 20px; color: var(--ink-500); transform: translateY(-50%); }
.verification-search input { height: 48px; padding-left: 46px; border: 0; box-shadow: none; font-weight: 750; letter-spacing: .04em; }
.verification-result { margin-top: 36px; padding: clamp(24px, 5vw, 40px); background: white; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-sm); }
.verification-result.valid { border-top: 4px solid var(--success); }
.verification-result.invalid { max-width: 620px; margin-inline: auto; border-top: 4px solid var(--danger); }
.verification-status { display: flex; align-items: center; gap: 14px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.verification-status > span { display: grid; place-items: center; width: 50px; height: 50px; color: var(--success); background: var(--success-bg); border-radius: 14px; }
.invalid .verification-status > span { color: var(--danger); background: var(--danger-bg); }
.verification-status > div { display: flex; flex-direction: column; gap: 3px; }
.verification-status small { color: var(--success); font-size: .68rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.invalid .verification-status small { color: var(--danger); }
.verification-status strong { font-size: 1.2rem; }
.verification-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; padding: 28px 0; }
.verification-details > span { display: flex; flex-direction: column; gap: 5px; }
.verification-details small, .hash-box small { color: var(--ink-500); font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.verification-details strong { overflow-wrap: anywhere; font-size: .82rem; }
.hash-box { display: flex; align-items: center; gap: 12px; padding: 14px; background: #f7fafa; border: 1px solid var(--line); border-radius: 12px; }
.hash-box > span { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.hash-box code { overflow-wrap: anywhere; color: var(--brand-800); font-size: .68rem; }
.verification-note { display: flex; align-items: flex-start; gap: 8px; margin: 18px 0 0; color: var(--ink-500); font-size: .7rem; line-height: 1.5; }
.verification-note svg { color: var(--success); }
.verification-result.invalid > p { margin: 22px 0 0; color: var(--ink-600); line-height: 1.6; }

@media (max-width: 1080px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .details-grid { grid-template-columns: 1fr; }
    .auth-page { grid-template-columns: minmax(360px, .8fr) minmax(460px, 1.2fr); }
    .auth-brand-panel { padding: 54px; }
    .auth-brand-content h1 { font-size: 3.1rem; }
    .signature-workspace { grid-template-columns: 260px minmax(0, 1fr); }
    .document-stage { min-height: 540px; }
}

@media (max-width: 820px) {
    .app-shell { display: block; }
    .sidebar { width: min(300px, 86vw); transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-md); }
    .sidebar-open .sidebar { transform: none; }
    .sidebar-scrim { position: fixed; z-index: 35; inset: 0; display: block; background: rgba(6,29,38,.45); opacity: 0; visibility: hidden; transition: .2s ease; }
    .sidebar-open .sidebar-scrim { opacity: 1; visibility: visible; }
    .app-content { grid-column: auto; }
    .mobile-only { display: inline-grid !important; }
    .topbar { min-height: 68px; padding: 10px 16px; gap: 12px; }
    .topbar-title .eyebrow, .secure-indicator { display: none; }
    .topbar-title strong { font-size: .98rem; }
    .page-content { padding: 22px 16px 34px; }
    .auth-page { display: block; background: linear-gradient(160deg, var(--brand-950) 0 30%, #f6f9f9 30% 100%); }
    .auth-brand-panel { display: none; }
    .auth-form-panel { min-height: 100vh; padding: 26px 18px; background: transparent; }
    .auth-card { padding: 28px 24px; }
    .mobile-auth-logo { display: block; margin-bottom: 30px; }
    .mobile-auth-logo img { width: 145px; }
    .wizard-app { width: min(100% - 28px, 760px); padding-top: 24px; }
    .wizard-heading { align-items: flex-start; flex-direction: column; }
    .wizard-expiration { width: 100%; }
    .progress-step { justify-content: center; }
    .progress-step > div { display: none; }
    .progress-line { left: 12.5%; right: 12.5%; }
    .signature-workspace { grid-template-columns: 1fr; }
    .signature-maker { position: static; }
    .signature-canvas-wrap canvas { height: 170px; }
    .selfie-layout { grid-template-columns: 1fr; }
    .review-card { order: -1; }
    .review-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
}

@media (max-width: 640px) {
    .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
    .page-heading .heading-actions, .page-heading .button { width: 100%; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat-card { min-height: 126px; padding: 15px; }
    .stat-value { font-size: 1.7rem; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .filter-select { width: 100%; }
    .desktop-table { display: none; }
    .mobile-list { display: flex; flex-direction: column; }
    .mobile-list-item { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
    .mobile-list-item:last-child { border-bottom: 0; }
    .mobile-list-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
    .mobile-list-meta { display: flex; justify-content: space-between; color: var(--ink-500); font-size: .72rem; }
    .form-grid, .info-list { grid-template-columns: 1fr; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .button { width: 100%; }
    .form-section { padding: 19px 16px; }
    .card-header, .card-body { padding-inline: 16px; }
    .modal { align-items: end; padding: 0; }
    .modal-panel { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; }
    .modal-footer .button { flex: 1; }
    .toast-region { top: 12px; right: 16px; }
    .feedback-card { padding: 32px 22px; }
    .simple-auth-page { padding: 18px; }
    .simple-auth-page .auth-card { padding: 28px 22px; }
    .signing-header { min-height: 66px; padding: 10px 16px; }
    .signing-logo img { width: 126px; }
    .signing-secure span { display: none; }
    .wizard-app { width: 100%; padding: 18px 0 0; }
    .wizard-heading { padding-inline: 16px; }
    .wizard-heading h1 { font-size: 1.55rem; }
    .wizard-progress { margin-inline: 15px; }
    .wizard-card { min-height: 520px; border-inline: 0; border-radius: 20px 20px 0 0; }
    .wizard-step { padding: 25px 16px 36px; }
    .wizard-step-heading { gap: 10px; }
    .wizard-step-heading .step-number { display: none; }
    .location-card { grid-template-columns: auto 1fr; }
    .location-card .button { grid-column: 1 / -1; width: 100%; }
    .wizard-actions { position: sticky; bottom: 0; grid-template-columns: auto 1fr; margin: 0; padding: 12px 13px calc(12px + env(safe-area-inset-bottom)); border-inline: 0; border-bottom: 0; border-radius: 0; }
    .wizard-safe-note { display: none; }
    .wizard-actions #wizard-next { width: 100%; }
    .signature-step { padding-inline: 12px; }
    .document-stage { min-height: 460px; padding: 12px; }
    .document-loading { min-height: 410px; }
    .document-toolbar strong { max-width: 145px; }
    .camera-viewport { min-height: 360px; }
    .camera-actions { align-items: stretch; flex-direction: column; }
    .camera-actions .button { width: 100%; }
    .review-list { grid-template-columns: 1fr; }
    .completion-trust { align-items: center; flex-direction: column; gap: 10px; }
    .signing-state-page { min-height: calc(100vh - 66px); padding: 18px; }
    .verification-page { padding-top: 40px; }
    .verification-search { grid-template-columns: 1fr; padding: 8px; }
    .verification-search > svg { top: 31px; }
    .verification-search .button { width: 100%; }
    .verification-details { grid-template-columns: 1fr 1fr; gap: 18px; }
}
