:root {
    color-scheme: light;
    --bg: #f7f5f4;
    --surface: #fefefd;
    --surface-soft: #f7f5f4;
    --surface-raised: #ffffff;
    --text: #292929;
    --text-strong: #000000;
    --muted: #71655e;
    --line: #e6e0dc;
    --line-strong: #b3aca9;
    --accent: #71655e;
    --accent-strong: #5d534d;
    --accent-soft: #eee9e6;
    --accent-warm: #cf9878;
    --accent-warm-soft: #f4e3d9;
    --danger: #b42318;
    --danger-soft: #fae7e2;
    --warning: #9a5b22;
    --warning-soft: #f7ecd9;
    --success: #199c68;
    --success-soft: #e8f2ed;
    --nav-bg: #fefefd;
    --nav-text: #292929;
    --nav-muted: #9d9c9c;
    --nav-active: #000000;
    --nav-line: #e6e0dc;
    --shadow: 0 14px 32px rgba(113, 101, 94, 0.11);
    --shadow-strong: 0 20px 46px rgba(113, 101, 94, 0.16);
    --button-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 18%, transparent);
    --primary-bg: var(--accent);
    --primary-hover: var(--accent-strong);
    --primary-border: transparent;
    --primary-text: #ffffff;
    --focus: 0 0 0 3px rgba(113, 101, 94, 0.22);
    --tour-dim: rgba(41, 36, 31, 0.2);
    --tour-dim-strong: rgba(41, 36, 31, 0.26);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #141515;
    --surface: #1d1f1f;
    --surface-soft: #181a1a;
    --surface-raised: #232626;
    --text: #eef1f0;
    --text-strong: #fefefd;
    --muted: #b7c1bf;
    --line: #3b4240;
    --line-strong: #56605d;
    --accent: #d49a78;
    --accent-strong: #e4b091;
    --accent-soft: #302824;
    --accent-warm: #67d18d;
    --accent-warm-soft: #173527;
    --danger: #ff8768;
    --danger-soft: #3a1f1b;
    --warning: #e6b66f;
    --warning-soft: #332a18;
    --success: #67d18d;
    --success-soft: #163829;
    --nav-bg: #111313;
    --nav-text: #f5f7f6;
    --nav-muted: #a8b2b0;
    --nav-active: #ffffff;
    --nav-line: rgba(255, 255, 255, 0.1);
    --shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
    --shadow-strong: 0 24px 56px rgba(0, 0, 0, 0.4);
    --button-shadow: none;
    --primary-bg: color-mix(in srgb, var(--accent) 48%, var(--surface-raised));
    --primary-hover: color-mix(in srgb, var(--accent) 62%, var(--surface-raised));
    --primary-border: color-mix(in srgb, var(--accent) 42%, var(--line));
    --primary-text: #ffffff;
    --focus: 0 0 0 3px rgba(212, 154, 120, 0.32);
    --tour-dim: rgba(0, 0, 0, 0.2);
    --tour-dim-strong: rgba(0, 0, 0, 0.26);
}

:root[data-theme="dark-black"] {
    color-scheme: dark;
    --bg: #080a0a;
    --surface: #101313;
    --surface-soft: #0c0f0f;
    --surface-raised: #151919;
    --text: #edf2f1;
    --text-strong: #ffffff;
    --muted: #9da9a6;
    --line: #26302d;
    --line-strong: #3a4742;
    --accent: #62d6ad;
    --accent-strong: #95e8ca;
    --accent-soft: #102821;
    --accent-warm: #7ee3bd;
    --accent-warm-soft: #102a22;
    --danger: #ff8067;
    --danger-soft: #331a17;
    --warning: #e7bd71;
    --warning-soft: #2e2616;
    --success: #6dda9b;
    --success-soft: #112b20;
    --nav-bg: #070909;
    --nav-text: #f2f6f5;
    --nav-muted: #8f9b98;
    --nav-active: #ffffff;
    --nav-line: rgba(255, 255, 255, 0.11);
    --shadow: 0 18px 46px rgba(0, 0, 0, 0.38);
    --shadow-strong: 0 24px 58px rgba(0, 0, 0, 0.48);
    --button-shadow: none;
    --primary-bg: color-mix(in srgb, var(--accent) 48%, var(--surface-raised));
    --primary-hover: color-mix(in srgb, var(--accent) 62%, var(--surface-raised));
    --primary-border: color-mix(in srgb, var(--accent) 42%, var(--line));
    --primary-text: #ffffff;
    --focus: 0 0 0 3px rgba(98, 214, 173, 0.26);
    --tour-dim: rgba(0, 0, 0, 0.2);
    --tour-dim-strong: rgba(0, 0, 0, 0.26);
}

:root[data-theme="dark-pure"] {
    color-scheme: dark;
    --bg: #050607;
    --surface: #0c0d0f;
    --surface-soft: #08090a;
    --surface-raised: #131518;
    --text: #eef0f2;
    --text-strong: #ffffff;
    --muted: #a8afb6;
    --line: #24272b;
    --line-strong: #3b4148;
    --accent: #9fb7d8;
    --accent-strong: #c3d4eb;
    --accent-soft: #111923;
    --accent-warm: #6ed6ad;
    --accent-warm-soft: #0e241b;
    --danger: #ff7d67;
    --danger-soft: #2c1715;
    --warning: #e4bd75;
    --warning-soft: #292113;
    --success: #68d79a;
    --success-soft: #0f281d;
    --nav-bg: #040505;
    --nav-text: #f1f4f5;
    --nav-muted: #929aa0;
    --nav-active: #ffffff;
    --nav-line: rgba(255, 255, 255, 0.1);
    --shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
    --shadow-strong: 0 24px 60px rgba(0, 0, 0, 0.58);
    --button-shadow: none;
    --primary-bg: color-mix(in srgb, var(--accent) 42%, var(--surface-raised));
    --primary-hover: color-mix(in srgb, var(--accent) 55%, var(--surface-raised));
    --primary-border: color-mix(in srgb, var(--accent) 38%, var(--line));
    --primary-text: #f8fbff;
    --focus: 0 0 0 3px rgba(159, 183, 216, 0.28);
    --tour-dim: rgba(0, 0, 0, 0.2);
    --tour-dim-strong: rgba(0, 0, 0, 0.26);
}

:root[data-theme="dark-forest"] {
    color-scheme: dark;
    --bg: #101716;
    --surface: #18211f;
    --surface-soft: #131c1a;
    --surface-raised: #1d2925;
    --text: #edf4f1;
    --text-strong: #ffffff;
    --muted: #b8c8c2;
    --line: #31453e;
    --line-strong: #4d675e;
    --accent: #77d2a4;
    --accent-strong: #a5e7c4;
    --accent-soft: #173b2a;
    --accent-warm: #eab080;
    --accent-warm-soft: #34271f;
    --danger: #ff886c;
    --danger-soft: #3a211d;
    --warning: #e4bc70;
    --warning-soft: #332c18;
    --success: #77d2a4;
    --success-soft: #143827;
    --nav-bg: #0e1413;
    --nav-text: #f3f8f6;
    --nav-muted: #a8bab4;
    --nav-active: #ffffff;
    --nav-line: rgba(255, 255, 255, 0.1);
    --shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
    --shadow-strong: 0 24px 56px rgba(0, 0, 0, 0.42);
    --button-shadow: none;
    --primary-bg: color-mix(in srgb, var(--accent) 48%, var(--surface-raised));
    --primary-hover: color-mix(in srgb, var(--accent) 62%, var(--surface-raised));
    --primary-border: color-mix(in srgb, var(--accent) 42%, var(--line));
    --primary-text: #ffffff;
    --focus: 0 0 0 3px rgba(119, 210, 164, 0.28);
    --tour-dim: rgba(0, 0, 0, 0.2);
    --tour-dim-strong: rgba(0, 0, 0, 0.26);
}

:root[data-theme="dark-ink"] {
    color-scheme: dark;
    --bg: #11151b;
    --surface: #191f27;
    --surface-soft: #151a21;
    --surface-raised: #202832;
    --text: #eef3f8;
    --text-strong: #ffffff;
    --muted: #b8c2cc;
    --line: #34404d;
    --line-strong: #536373;
    --accent: #8fb9ff;
    --accent-strong: #bdd6ff;
    --accent-soft: #1c2c46;
    --accent-warm: #e2a178;
    --accent-warm-soft: #34261f;
    --danger: #ff846d;
    --danger-soft: #3a211d;
    --warning: #e5bc72;
    --warning-soft: #332b19;
    --success: #70d89b;
    --success-soft: #153829;
    --nav-bg: #0e1217;
    --nav-text: #f3f7fb;
    --nav-muted: #aab6c1;
    --nav-active: #ffffff;
    --nav-line: rgba(255, 255, 255, 0.1);
    --shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
    --shadow-strong: 0 24px 56px rgba(0, 0, 0, 0.44);
    --button-shadow: none;
    --primary-bg: color-mix(in srgb, var(--accent) 48%, var(--surface-raised));
    --primary-hover: color-mix(in srgb, var(--accent) 62%, var(--surface-raised));
    --primary-border: color-mix(in srgb, var(--accent) 42%, var(--line));
    --primary-text: #ffffff;
    --focus: 0 0 0 3px rgba(143, 185, 255, 0.28);
    --tour-dim: rgba(0, 0, 0, 0.2);
    --tour-dim-strong: rgba(0, 0, 0, 0.26);
}

:root[data-theme="dark-plum"] {
    color-scheme: dark;
    --bg: #171317;
    --surface: #211a20;
    --surface-soft: #1b161a;
    --surface-raised: #281f26;
    --text: #f4edf1;
    --text-strong: #ffffff;
    --muted: #c9bbc4;
    --line: #463541;
    --line-strong: #66515f;
    --accent: #e1a0b4;
    --accent-strong: #efc0ce;
    --accent-soft: #3a2230;
    --accent-warm: #eab27c;
    --accent-warm-soft: #38271d;
    --danger: #ff846d;
    --danger-soft: #3a211d;
    --warning: #e5b96c;
    --warning-soft: #342b18;
    --success: #72d890;
    --success-soft: #153828;
    --nav-bg: #120f12;
    --nav-text: #f8f2f6;
    --nav-muted: #b8aab3;
    --nav-active: #ffffff;
    --nav-line: rgba(255, 255, 255, 0.1);
    --shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
    --shadow-strong: 0 24px 56px rgba(0, 0, 0, 0.44);
    --button-shadow: none;
    --primary-bg: color-mix(in srgb, var(--accent) 48%, var(--surface-raised));
    --primary-hover: color-mix(in srgb, var(--accent) 62%, var(--surface-raised));
    --primary-border: color-mix(in srgb, var(--accent) 42%, var(--line));
    --primary-text: #ffffff;
    --focus: 0 0 0 3px rgba(225, 160, 180, 0.28);
    --tour-dim: rgba(0, 0, 0, 0.2);
    --tour-dim-strong: rgba(0, 0, 0, 0.26);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-strong);
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: var(--focus);
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    width: 76px;
    height: 100vh;
    padding: 18px 14px;
    overflow: visible;
    background: var(--nav-bg);
    color: var(--nav-text);
    border-right: 1px solid var(--nav-line);
    transition: none;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-height: 52px;
    padding: 8px 0 18px;
    color: var(--nav-active);
    white-space: nowrap;
}

.brand:hover {
    color: var(--nav-active);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--accent);
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 34%, transparent);
}

:root:not([data-theme="light"]) .brand-mark {
    box-shadow: none;
}

.brand strong,
.brand small {
    display: block;
}

.brand-copy,
.nav-label,
.theme-toggle [data-theme-label],
.onboarding-label,
.logout-label {
    width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: none;
}

.brand strong {
    font-size: 16px;
    letter-spacing: 0;
}

.brand small {
    margin-top: 1px;
    color: var(--nav-muted);
    font-size: 12px;
}

.sidebar-nav {
    display: grid;
    gap: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--nav-line);
}

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-height: 42px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid transparent;
    color: var(--nav-text);
}

.sidebar-button {
    width: 100%;
    box-shadow: none;
    font: inherit;
    cursor: pointer;
}

.report-trigger {
    min-height: 40px;
    background: transparent;
    border-color: var(--nav-line);
    color: var(--nav-muted);
}

.report-trigger:hover {
    background: color-mix(in srgb, var(--accent) 10%, var(--nav-bg));
    border-color: color-mix(in srgb, var(--accent) 26%, var(--nav-line));
    color: var(--nav-text);
}

.report-trigger:hover .sidebar-icon {
    color: var(--accent-warm);
}

.sidebar-link:hover,
.sidebar-link.active {
    background: color-mix(in srgb, var(--accent) 14%, var(--nav-bg));
    border-color: color-mix(in srgb, var(--accent) 32%, var(--nav-line));
    color: var(--nav-active);
}

.sidebar-alert-link {
    border-color: color-mix(in srgb, var(--accent-warm) 48%, var(--nav-line));
    color: var(--accent-warm);
}

.sidebar-alert-link:hover {
    background: color-mix(in srgb, var(--accent-warm) 16%, var(--nav-bg));
}

.nav-dot {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--nav-muted);
}

.sidebar-link.active .nav-dot {
    background: var(--accent-warm);
}

.sidebar-icon {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.78;
}

.sidebar-link.active .sidebar-icon,
.sidebar-link:hover .sidebar-icon {
    opacity: 1;
    color: var(--accent-warm);
}

.sidebar-footer {
    display: grid;
    gap: 10px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--nav-line);
}

.mobile-bottom-nav {
    display: none;
}

.theme-picker {
    position: relative;
    width: 100%;
    min-width: 0;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 100%;
    min-height: 40px;
    padding: 0;
    border: 1px solid var(--nav-line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--nav-bg) 86%, var(--accent-soft));
    color: var(--nav-text);
    cursor: pointer;
}

.theme-toggle:hover {
    background: color-mix(in srgb, var(--accent) 18%, rgba(255, 255, 255, 0.06));
}

.theme-menu {
    position: fixed;
    top: auto;
    left: 86px;
    z-index: 120;
    display: grid;
    gap: 4px;
    width: min(236px, calc(100vw - 24px));
    max-height: min(360px, calc(100vh - 24px));
    overflow: auto;
    overscroll-behavior: contain;
    padding: 7px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.theme-menu[hidden] {
    display: none !important;
}

.theme-option {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    box-shadow: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.theme-option:hover,
.theme-option.active {
    border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
    color: var(--text-strong);
}

.theme-option.active::after {
    content: "";
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    margin-left: auto;
    border-radius: 50%;
    background: var(--accent-warm);
}

.theme-swatch {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: linear-gradient(135deg, var(--swatch-bg) 0 58%, var(--swatch-accent) 58% 100%);
}

.onboarding-trigger {
    justify-content: center;
    gap: 0;
    min-height: 40px;
    padding: 0;
    background: transparent;
    border-color: var(--nav-line);
    box-shadow: none;
    color: var(--nav-muted);
}

.onboarding-trigger:hover {
    background: color-mix(in srgb, var(--accent) 14%, var(--nav-bg));
    border-color: color-mix(in srgb, var(--accent) 30%, var(--nav-line));
    color: var(--accent-warm);
}

.theme-toggle-mark {
    position: relative;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border: 1px solid color-mix(in srgb, var(--nav-text) 28%, var(--nav-line));
    border-radius: 50%;
    background: var(--nav-bg);
}

.theme-color {
    position: absolute;
    width: 9px;
    height: 9px;
    border: 1px solid var(--nav-bg);
    border-radius: 50%;
}

.theme-color-primary {
    top: 4px;
    left: 4px;
    z-index: 1;
    background: var(--accent);
}

.theme-color-warm {
    top: 4px;
    right: 4px;
    z-index: 2;
    background: var(--accent-warm);
}

.theme-color-success {
    left: 50%;
    bottom: 3px;
    z-index: 3;
    background: var(--success);
    transform: translateX(-50%);
}

.logout-form {
    margin: 0;
}

.inline-form {
    display: inline-flex;
    align-items: stretch;
    margin: 0;
}

.inline-form > button,
.inline-form > .button {
    align-self: stretch;
}

.workspace {
    min-width: 0;
    margin-left: 76px;
}

.workspace-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 62px;
    padding: 0 28px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 color-mix(in srgb, var(--surface-raised) 60%, transparent);
    backdrop-filter: blur(12px);
}

.workspace-topbar strong,
.workspace-eyebrow {
    display: block;
}

.workspace-topbar strong {
    color: var(--text-strong);
    font-size: 15px;
}

.workspace-eyebrow {
    color: var(--muted);
    font-size: 12px;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 13px;
}

.page {
    width: min(1360px, calc(100% - 48px));
    margin: 24px auto 44px;
}

.auth-page {
    display: grid;
    align-content: center;
    min-height: 100vh;
    width: min(420px, calc(100% - 32px));
    margin: 0 auto;
}

.page-header {
    margin-bottom: 18px;
}

.page-header h1,
.section-header h2,
.panel h2,
.form-section h2 {
    color: var(--text-strong);
}

.page-header h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.15;
}

.page-header p {
    margin: 7px 0 0;
}

.page-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin-bottom: 8px;
    padding: 0 9px;
    border: 1px solid color-mix(in srgb, var(--accent-warm) 42%, var(--line));
    border-radius: 999px;
    background: var(--accent-warm-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
}

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.muted,
.stat-label,
.stat-note {
    color: var(--muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.document-stats-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-command {
    display: grid;
    grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
    gap: 16px;
    align-items: stretch;
    margin-bottom: 16px;
}

.dashboard-command-copy {
    display: grid;
    align-content: center;
    min-height: 136px;
    padding: 18px 0;
}

.dashboard-command-copy h1 {
    margin: 0;
    color: var(--text-strong);
    font-size: 32px;
    line-height: 1.12;
}

.dashboard-command-copy p {
    margin: 8px 0 0;
    max-width: 560px;
}

.dashboard-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.dashboard-action {
    display: grid;
    align-content: center;
    gap: 6px;
    min-height: 136px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}

.dashboard-action:hover {
    border-color: var(--accent-warm);
    color: var(--text);
}

.dashboard-action.primary {
    border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
    background: linear-gradient(135deg, var(--primary-bg), var(--primary-hover));
    color: var(--primary-text);
}

.dashboard-action.primary small {
    color: rgba(255, 255, 255, 0.78);
}

.dashboard-action span {
    color: inherit;
    font-size: 16px;
    font-weight: 900;
}

.dashboard-action small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.dashboard-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
    gap: 14px;
    align-items: start;
}

.dashboard-side-stack {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.dashboard-action-list {
    max-height: 620px;
    overflow: auto;
}

.compact-list {
    display: grid;
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}

.compact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 12px 14px;
    background: var(--surface-raised);
    color: var(--text);
}

.compact-row:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.compact-row > span:first-child {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.compact-row strong,
.compact-row small {
    overflow-wrap: anywhere;
}

.compact-row strong {
    color: var(--text-strong);
}

.compact-row small {
    color: var(--muted);
    font-size: 12px;
}

.stat-card,
.panel,
.auth-panel,
.table-wrap,
.details-grid,
.form-section,
.insight-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.form-panel {
    width: min(100%, 640px);
}

.prep-flow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.prep-flow > div {
    display: grid;
    gap: 5px;
    min-height: 86px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-raised);
}

.prep-flow strong {
    color: var(--text-strong);
    font-size: 14px;
}

.prep-flow span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.prep-form .form-section {
    margin-bottom: 14px;
}

.wide-form.prep-form {
    max-width: none;
}

.panel,
.table-wrap,
.client-overview,
.client-side,
.dashboard-grid > *,
.dashboard-workspace > *,
.dashboard-side-stack > *,
.dashboard-stats > *,
.work-grid > *,
.stats-grid > *,
.details-grid > *,
.form-section {
    min-width: 0;
    max-width: 100%;
}

.stat-card {
    display: grid;
    align-content: center;
    gap: 8px;
    min-height: 96px;
    padding: 16px 18px;
    background: var(--surface-raised);
    color: var(--text);
}

.stat-card:hover {
    border-color: var(--accent-warm);
    color: var(--text);
    transform: translateY(-1px);
}

.stat-card.priority {
    background: linear-gradient(135deg, var(--accent-soft), var(--accent-warm-soft), var(--surface-raised));
}

.stat-value {
    color: var(--text-strong);
    font-size: 34px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.stat-label {
    font-weight: 700;
}

.stat-note {
    font-size: 12px;
}

.compact-stats {
    grid-template-columns: repeat(auto-fit, minmax(220px, 280px));
}

.compact-stats .stat-card {
    min-height: 92px;
}

.panel,
.auth-panel {
    padding: 18px;
}

.auth-panel {
    width: 100%;
    border-top: 4px solid var(--accent-warm);
}

.auth-panel h1 {
    margin: 0 0 18px;
}

.login-form {
    display: grid;
    gap: 14px;
}

.login-form .form-field {
    display: grid;
    gap: 6px;
}

.login-form .form-field label {
    margin: 0;
}

.login-form .login-button {
    margin-top: 2px;
}

.attention-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    border-color: color-mix(in srgb, var(--warning) 35%, var(--line));
    background: var(--warning-soft);
    box-shadow: none;
}

.attention-panel p {
    margin: 6px 0 0;
}

.readiness-panel {
    display: grid;
    gap: 12px;
    max-width: 900px;
    margin-bottom: 18px;
}

.readiness-panel.ready {
    border-color: color-mix(in srgb, var(--success) 32%, var(--line));
}

.readiness-panel.blocked {
    border-color: color-mix(in srgb, var(--danger) 28%, var(--line));
}

.readiness-group {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.readiness-group strong {
    display: block;
    margin-bottom: 8px;
}

.readiness-group ul {
    margin: 0;
    padding-left: 18px;
}

.readiness-group li + li {
    margin-top: 5px;
}

.readiness-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.confirmation-intake-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    border-color: color-mix(in srgb, var(--warning) 34%, var(--line));
    background: var(--warning-soft);
    box-shadow: none;
}

.confirmation-intake-panel p {
    margin: 6px 0 0;
}

.confirmation-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 14px;
    align-items: start;
}

.confirmation-main {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.confirmation-entities {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.confirmation-entity {
    display: grid;
    gap: 14px;
    align-content: start;
    min-height: 100%;
}

.confirmation-entity-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.confirmation-label {
    color: var(--accent-warm);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.confirmation-entity h2,
.confirmation-submit-panel h2 {
    margin: 0;
    color: var(--text-strong);
    font-size: 20px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.confirmation-lot-title {
    display: -webkit-box;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
}

.confirmation-data-list {
    display: grid;
    gap: 0;
    overflow: hidden;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}

.confirmation-data-list div {
    display: grid;
    grid-template-columns: minmax(96px, 0.35fr) minmax(0, 1fr);
    gap: 12px;
    padding: 10px 12px;
    background: var(--surface-raised);
}

.confirmation-data-list dt,
.confirmation-submit-summary span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.3;
    text-transform: uppercase;
}

.confirmation-data-list dd {
    min-width: 0;
    margin: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.confirmation-status {
    display: grid;
    gap: 12px;
}

.confirmation-status.ready {
    border-color: color-mix(in srgb, var(--success) 32%, var(--line));
}

.confirmation-status.blocked {
    border-color: color-mix(in srgb, var(--danger) 28%, var(--line));
}

.confirmation-check-group {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-raised);
}

.confirmation-check-group.danger {
    border-color: color-mix(in srgb, var(--danger) 30%, var(--line));
    background: var(--danger-soft);
}

.confirmation-check-group.warning {
    border-color: color-mix(in srgb, var(--warning) 34%, var(--line));
    background: var(--warning-soft);
}

.confirmation-check-group strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text-strong);
}

.confirmation-check-group ul {
    margin: 0;
    padding-left: 18px;
}

.confirmation-check-group li + li {
    margin-top: 5px;
}

.confirmation-submit-panel {
    position: sticky;
    top: 18px;
    display: grid;
    gap: 14px;
}

.confirmation-submit-panel button,
.confirmation-submit-panel .button {
    min-height: 38px;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
}

.confirmation-submit-panel .combo-trigger {
    overflow: hidden;
    min-height: 38px;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.generation-options-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.generation-options-grid .field,
.generation-options-grid .switch-field {
    min-width: 0;
}

.generation-options-grid .switch-field {
    align-self: end;
    padding: 8px 0 0;
}

.confirmation-submit-panel .errorlist,
.confirmation-form-errors .errorlist {
    margin: 0;
}

.confirmation-submit-summary {
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}

.confirmation-submit-summary div {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    background: var(--surface-raised);
}

.confirmation-submit-summary strong {
    color: var(--text-strong);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.batch-warning-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.batch-warning-list div {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border: 1px solid color-mix(in srgb, var(--warning) 32%, var(--line));
    border-radius: 8px;
    background: var(--surface);
}

.batch-warning-list span {
    color: var(--muted);
    font-size: 12px;
}

.toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.filter-panel {
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.filter-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.filter-panel-title {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.filter-panel-title strong {
    color: var(--text-strong);
    font-size: 13px;
    line-height: 1.25;
}

.filter-panel-title span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.3;
}

.filter-toggle {
    min-height: 32px;
    padding: 0 10px;
    border-color: var(--line-strong);
    background: var(--surface-soft);
    color: var(--text);
    font-size: 12px;
    white-space: nowrap;
}

.filter-panel.collapsed .filter-grid {
    display: none;
}

.filter-panel.collapsed .filter-summary {
    margin-top: 0;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 10px;
    align-items: end;
}

.filter-grid > .field:has(input[type="search"]) {
    grid-column: span 2;
}

.filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
    grid-column: span 2;
}

.filter-actions button,
.filter-actions .button {
    width: auto;
    white-space: nowrap;
}

.filter-summary {
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.bulk-panel {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.bulk-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.bulk-panel-head strong,
.bulk-panel-head span {
    display: block;
}

.bulk-grid {
    display: grid;
    grid-template-columns: minmax(190px, 1.15fr) repeat(5, minmax(150px, 1fr)) minmax(118px, auto);
    gap: 10px;
    align-items: end;
}

.bulk-actions {
    display: flex;
    align-items: end;
}

.bulk-actions button {
    width: 100%;
}

.bulk-selected-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.live-search-status {
    min-height: 18px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 18px;
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    backdrop-filter: blur(8px);
}

.report-backdrop {
    position: fixed;
    inset: 0;
    z-index: 170;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(3px);
}

.report-backdrop[hidden] {
    display: none !important;
}

.report-dialog {
    display: grid;
    gap: 0;
    width: min(560px, 100%);
    max-height: min(760px, calc(100vh - 28px));
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}

.report-head,
.report-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
}

.report-head {
    border-bottom: 1px solid var(--line);
}

.report-head h2 {
    margin: 4px 0 0;
    font-size: 22px;
}

.report-body {
    display: grid;
    gap: 12px;
    padding: 16px 18px;
}

.report-actions {
    border-top: 1px solid var(--line);
}

.report-context {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.report-screenshot-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.report-screenshot-actions .button {
    min-height: 32px;
}

.report-status {
    min-height: 18px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.report-status.error {
    color: var(--danger);
}

.report-status.success {
    color: var(--success);
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-raised);
    color: var(--muted);
    box-shadow: none;
}

.icon-button:hover {
    border-color: var(--accent-warm);
    background: var(--surface-soft);
    color: var(--text-strong);
}

.confirm-backdrop[hidden] {
    display: none !important;
}

.confirm-dialog {
    width: min(440px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}

.confirm-dialog header,
.confirm-dialog footer {
    padding: 14px 16px;
    background: var(--surface-soft);
}

.confirm-dialog h2 {
    margin: 0;
    font-size: 17px;
}

.confirm-body {
    padding: 16px;
}

.confirm-body p {
    margin: 0;
    color: var(--text);
    line-height: 1.45;
}

.confirm-dialog footer {
    justify-content: flex-end;
}

.live-search-results {
    transition: opacity 0.12s ease;
}

.live-search-results.loading {
    opacity: 0.62;
}

input,
select,
textarea {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    padding: 9px 11px;
    background: var(--surface-raised);
    color: var(--text);
}

input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
    padding: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

input[type="file"] {
    display: block;
    min-height: 38px;
    padding: 3px 10px;
    line-height: 30px;
}

input[type="file"]::file-selector-button {
    height: 30px;
    margin: 0 9px 0 0;
    padding: 0 11px;
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    background: color-mix(in srgb, var(--surface-raised) 78%, var(--accent-soft));
    color: var(--text-strong);
    font-weight: 800;
    cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
    border-color: var(--accent-warm);
    background: var(--surface-soft);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-warm);
}

textarea {
    min-height: 96px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--primary-border);
    border-radius: 6px;
    background: var(--primary-bg);
    color: var(--primary-text);
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--button-shadow);
}

button:hover,
.button:hover {
    background: var(--primary-hover);
    color: var(--primary-text);
}

button:disabled,
.button:disabled {
    opacity: 0.52;
    cursor: not-allowed;
    box-shadow: none;
}

.secondary {
    background: var(--surface-raised);
    border-color: var(--line-strong);
    color: var(--text);
}

.secondary:hover {
    background: var(--surface-soft);
    border-color: var(--accent-warm);
    color: var(--text-strong);
}

.ghost {
    background: color-mix(in srgb, var(--nav-bg) 90%, var(--surface-raised));
    border-color: var(--nav-line);
    color: var(--nav-text);
}

.ghost:hover {
    background: color-mix(in srgb, var(--accent) 14%, var(--nav-bg));
    color: var(--nav-active);
}

.logout-button {
    justify-content: center;
    gap: 0;
    min-height: 40px;
    padding: 0;
    background: transparent;
    border-color: var(--nav-line);
    box-shadow: none;
    color: var(--nav-muted);
}

.logout-button:hover {
    background: color-mix(in srgb, var(--danger) 10%, var(--nav-bg));
    border-color: color-mix(in srgb, var(--danger) 28%, var(--nav-line));
    color: var(--danger);
}

.login-button {
    min-height: 44px;
    box-shadow: none;
}

.login-button:hover {
    transform: translateY(-1px);
}

.auth-links {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 700;
}

.auth-links a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding-inline: 4px;
    color: var(--accent-warm);
}

.pending-invites {
    margin-bottom: 14px;
}

.invite-link {
    display: block;
    max-width: min(640px, 100%);
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.invite-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.invite-cancel-form {
    margin: 0;
}

.invite-cancel-form .table-action {
    width: auto;
}

.danger {
    background: var(--danger);
    color: #ffffff;
}

.danger:hover {
    background: color-mix(in srgb, var(--danger) 82%, #000000);
}

.full-width {
    width: 100%;
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.actions-row > .button,
.actions-row > button,
.actions-row > .inline-form > button,
.actions-row > .inline-form > .button {
    min-height: 38px;
}

.actions-row.tight {
    align-items: center;
    gap: 6px;
}

.clients-page-header {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) auto;
    align-items: start;
}

.clients-page-header > .actions-row {
    flex-wrap: nowrap;
    justify-content: flex-end;
}

@media (min-width: 1281px), (min-width: 961px) and (max-height: 899px) {
    td.actions-cell,
    .mobile-card-table td[data-label=""]:not([colspan]),
    .employee-table td[data-label=""]:not([colspan]) {
        width: 1%;
        white-space: nowrap;
    }

    td.actions-cell .actions-row.tight,
    .mobile-card-table td[data-label=""]:not([colspan]) .actions-row.tight,
    .employee-table td[data-label=""]:not([colspan]) .actions-row.tight {
        flex-wrap: nowrap;
        justify-content: flex-end;
    }
}

.section-header {
    margin: 26px 0 12px;
}

.section-header.compact {
    margin: 0 0 14px;
}

.section-header h2 {
    margin: 0;
    font-size: 18px;
}

.page:has(.dashboard-page) {
    width: min(1560px, calc(100% - 48px));
}

.dashboard-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.dashboard-header h1 {
    margin: 3px 0 6px;
    color: var(--text-strong);
    font-size: 30px;
    line-height: 1.15;
}

.dashboard-header p {
    max-width: 720px;
    margin: 0;
}

.dashboard-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.dashboard-header-actions .button {
    min-height: 36px;
    white-space: nowrap;
}

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.dashboard-metrics:has(.dashboard-metric:nth-child(4):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-metric {
    display: grid;
    grid-template-columns: minmax(104px, 0.36fr) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 84px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}

.dashboard-metric:hover {
    border-color: var(--accent-warm);
    color: var(--text);
    transform: translateY(-1px);
}

.dashboard-metric.priority {
    border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
    background: linear-gradient(135deg, var(--accent-soft), var(--accent-warm-soft), var(--surface));
}

.dashboard-metric-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    width: 100%;
    min-width: 0;
    min-height: 42px;
    max-width: 100%;
    color: var(--text-strong);
    font-size: 28px;
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: 0;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-metric strong,
.dashboard-metric small {
    display: block;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: normal;
}

.dashboard-metric strong {
    color: var(--text-strong);
    font-size: 14px;
}

.dashboard-metric small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.dashboard-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
    gap: 14px;
    align-items: start;
}

.dashboard-board > *,
.dashboard-right-column > *,
.dashboard-queue-row > *,
.dashboard-metric > * {
    min-width: 0;
}

.dashboard-card {
    padding: 16px;
}

.dashboard-card-header {
    gap: 12px;
    margin-bottom: 12px;
}

.dashboard-card-header h2 {
    font-size: 17px;
}

.dashboard-card-header .muted {
    display: block;
    margin-top: 3px;
    font-size: 12px;
}

.dashboard-queue-list {
    display: grid;
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}

.dashboard-queue-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    min-height: 66px;
    padding: 12px 14px;
    background: var(--surface-raised);
}

.dashboard-queue-row:hover {
    background: var(--surface-soft);
}

.dashboard-queue-main {
    display: grid;
    gap: 3px;
}

.dashboard-queue-main strong {
    color: var(--text-strong);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.dashboard-queue-main span {
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.dashboard-right-column {
    display: grid;
    gap: 14px;
}

.quick-action-list {
    display: grid;
    gap: 8px;
}

.dashboard-quick-card .quick-action-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quick-action-list a {
    display: grid;
    gap: 3px;
    min-height: 62px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-raised);
    color: var(--text);
}

.quick-action-list a:hover {
    border-color: var(--accent-warm);
    background: var(--surface-soft);
    color: var(--text);
}

.quick-action-list a:first-child {
    border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
    background: color-mix(in srgb, var(--accent-soft) 58%, var(--surface));
}

.quick-action-list strong {
    color: var(--text-strong);
    font-size: 13px;
}

.quick-action-list span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.dashboard-compact-list .compact-row {
    min-height: 54px;
    padding: 10px 12px;
}

.dashboard-compact-list .status-badge {
    flex: 0 0 auto;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 14px;
    margin-top: 14px;
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.employee-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.employee-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(560px, 1fr));
    gap: 12px;
}

.employee-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.employee-card.is-disabled {
    background: color-mix(in srgb, var(--surface) 82%, var(--surface-soft));
}

.employee-card-head {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
}

.employee-avatar {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #ffffff;
    font-size: 16px;
    font-weight: 900;
    text-transform: uppercase;
}

.employee-identity {
    min-width: 0;
}

.employee-identity h2 {
    margin: 0;
    font-size: 17px;
    line-height: 1.25;
}

.employee-identity h2 a {
    color: var(--text-strong);
}

.employee-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 10px;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.employee-meta-line span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.employee-state-stack {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    max-width: 330px;
}

.employee-card-body {
    display: grid;
    gap: 10px;
}

.employee-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.employee-metrics div {
    display: grid;
    gap: 3px;
    min-height: 48px;
    padding: 8px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.employee-metrics strong {
    color: var(--text-strong);
    font-size: 18px;
    line-height: 1;
}

.employee-metrics span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
}

.employee-activity {
    display: grid;
    align-content: start;
    gap: 5px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-soft) 62%, transparent);
}

.employee-activity > strong {
    color: var(--text-strong);
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.employee-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.client-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.34fr);
    gap: 14px;
    align-items: start;
}

.client-side {
    display: grid;
    gap: 14px;
}

.data-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.data-jump {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: 0 0 12px;
    padding-bottom: 2px;
}

.data-jump a {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
}

.data-jump a:hover {
    border-color: var(--accent-warm);
    color: var(--text-strong);
}

.data-section {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-raised);
}

.data-section.complete {
    border-color: color-mix(in srgb, var(--success) 30%, var(--line));
}

.data-section.optional {
    border-color: var(--line);
}

.data-section.incomplete {
    border-color: color-mix(in srgb, var(--warning) 32%, var(--line));
}

.data-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
}

.data-section-head strong {
    color: var(--text-strong);
}

.data-section-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.check-list {
    display: grid;
}

.check-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 9px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}

.check-item:last-child {
    border-bottom: 0;
}

.check-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--success-soft);
    color: var(--success);
    font-size: 12px;
    font-weight: 900;
}

.check-item.missing .check-mark {
    background: var(--warning-soft);
    color: var(--warning);
}

.check-item.optional-empty .check-mark {
    background: var(--surface-soft);
    color: var(--muted);
}

.check-item small,
.check-item strong {
    display: block;
    overflow-wrap: anywhere;
}

.check-item small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.required-chip {
    display: inline-flex;
    align-items: center;
    min-height: 16px;
    margin-left: 6px;
    padding: 0 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.check-item strong {
    margin-top: 2px;
    color: var(--text-strong);
    font-size: 13px;
}

.work-panel {
    min-width: 0;
}

.action-list {
    display: grid;
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}

.action-list.flat {
    gap: 8px;
    border: 0;
    background: transparent;
}

.action-item,
.empty-state {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 58px;
    padding: 12px 14px;
    background: var(--surface-raised);
}

.action-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    justify-content: stretch;
    gap: 4px;
    min-height: 64px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
}

.action-link strong,
.action-link .muted {
    min-width: 0;
    overflow-wrap: normal;
    word-break: normal;
}

.action-link:hover {
    border-color: var(--accent-warm);
    color: var(--text);
}

.action-item > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.action-item > .actions-row.tight {
    flex-wrap: nowrap;
    justify-content: flex-end;
    min-width: max-content;
}

.action-item > .actions-row.tight .inline-form,
.action-item > .actions-row.tight .table-action,
.action-item > .actions-row.tight .status-badge {
    flex: 0 0 auto;
}

.action-item strong,
.action-item .muted {
    overflow-wrap: anywhere;
}

.action-link strong,
.action-link .muted {
    overflow-wrap: break-word;
    word-break: normal;
}

.empty-state {
    display: flex;
    justify-content: flex-start;
    color: var(--muted);
}

.table-empty-cell {
    padding: 0;
}

.table-empty-state {
    display: grid;
    justify-items: start;
    gap: 6px;
    max-width: 620px;
    padding: 24px;
}

.table-empty-state strong {
    color: var(--text-strong);
    font-size: 16px;
}

.table-empty-state span {
    color: var(--muted);
}

.table-empty-state .button {
    margin-top: 6px;
}

.workflow-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.workflow-step {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 68px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}

.workflow-step:hover {
    border-color: var(--accent);
    color: var(--text);
}

.workflow-step.done {
    border-color: color-mix(in srgb, var(--success) 35%, var(--line));
    background: var(--success-soft);
}

.workflow-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--muted);
    font-weight: 800;
}

.workflow-step.done .workflow-mark {
    background: var(--success);
    color: #ffffff;
}

.workflow-step span:last-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.workflow-step strong,
.workflow-step small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workflow-step small {
    color: var(--muted);
}

.danger-zone {
    padding-top: 10px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 11px 13px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

thead th:first-child {
    border-top-left-radius: 8px;
}

thead th:last-child {
    border-top-right-radius: 8px;
}

.select-column {
    width: 44px;
    text-align: center;
}

.select-column input[type="checkbox"] {
    display: block;
    width: 24px;
    height: 24px;
    min-height: 24px;
    margin: 0 auto;
}

.operation-editor-row[hidden] {
    display: none;
}

.operation-editor-row td {
    padding: 0;
    background: var(--surface-soft);
}

.operation-editor-row:hover td {
    background: var(--surface-soft);
}

.inline-operation-form {
    display: grid;
    gap: 12px;
    margin: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.inline-operation-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.inline-operation-head strong,
.inline-operation-head span {
    display: block;
}

.inline-operation-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
}

.inline-comment-field {
    grid-column: 1 / -1;
}

.inline-review-field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    min-height: 68px;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text);
    cursor: pointer;
}

.inline-review-field input {
    margin-top: 2px;
}

.inline-review-field strong,
.inline-review-field small {
    display: block;
}

.inline-review-field small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.source-purpose {
    display: grid;
    gap: 4px;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.source-purpose strong {
    color: var(--muted);
    font-size: 12px;
}

.source-purpose span {
    overflow-wrap: anywhere;
}

.table-subline {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.table-action,
.link-button.table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 8px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    box-shadow: none;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.table-action:hover,
.link-button.table-action:hover {
    border-color: var(--accent-warm);
    background: var(--surface-soft);
    color: var(--text-strong);
}

.link-button.table-action {
    width: auto;
}

.danger-action {
    border-color: color-mix(in srgb, var(--danger) 36%, var(--line));
    color: var(--danger);
}

.danger-action:hover {
    border-color: var(--danger);
    background: var(--danger-soft);
    color: var(--danger);
}

button.danger-button,
.button.danger-button {
    border-color: color-mix(in srgb, var(--danger) 46%, var(--line));
    background: var(--danger-soft);
    color: var(--danger);
    box-shadow: none;
}

button.danger-button:hover,
.button.danger-button:hover {
    border-color: var(--danger);
    background: color-mix(in srgb, var(--danger-soft) 78%, var(--danger));
    color: var(--danger);
}

.processing-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 20px;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: blur(5px);
}

.processing-backdrop[hidden] {
    display: none;
}

.processing-dialog {
    display: grid;
    gap: 12px;
    width: min(420px, 100%);
    padding: 20px;
    border: 0;
    border-radius: 8px;
    background: var(--surface);
    box-shadow:
        0 0 0 1px var(--line-strong),
        var(--shadow-strong);
}

.processing-dialog strong {
    color: var(--text-strong);
    font-size: 16px;
}

.processing-dialog p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.processing-progress {
    position: relative;
    overflow: hidden;
    height: 6px;
    border-radius: 999px;
    background: var(--surface-soft);
}

.processing-progress span {
    position: absolute;
    inset: 0 auto 0 0;
    width: 42%;
    border-radius: inherit;
    background: var(--accent);
    animation: processing-slide 1.1s ease-in-out infinite;
}

.processing-backdrop.is-error .processing-progress {
    display: none;
}

.processing-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

.processing-actions[hidden] {
    display: none;
}

.ocr-queue-progress {
    display: grid;
    gap: 14px;
    max-width: 760px;
}

.ocr-queue-progress progress {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    background: var(--surface-soft);
    accent-color: var(--accent);
}

.ocr-queue-progress progress::-webkit-progress-bar {
    border-radius: inherit;
    background: var(--surface-soft);
}

.ocr-queue-progress progress::-webkit-progress-value {
    border-radius: inherit;
    background: var(--accent);
    transition: width 240ms ease;
}

.ocr-queue-progress progress::-moz-progress-bar {
    border-radius: inherit;
    background: var(--accent);
}

.ocr-progress-detail {
    margin: -4px 0 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

@keyframes processing-slide {
    0% {
        transform: translateX(-105%);
    }
    100% {
        transform: translateX(245%);
    }
}

html.onboarding-open,
html.onboarding-open body {
    overflow: hidden;
}

.onboarding-backdrop {
    position: fixed;
    inset: 0;
    z-index: 130;
    background: transparent;
    transition: background-color 0.2s ease;
}

.onboarding-backdrop.no-target {
    background: var(--tour-dim);
}

.onboarding-backdrop[hidden] {
    display: none !important;
}

.onboarding-blur {
    position: fixed;
    inset: 0;
    z-index: 130;
    pointer-events: none;
}

.onboarding-blur span {
    position: fixed;
    background: color-mix(in srgb, var(--tour-dim) 74%, transparent);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    transition:
        left 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
        top 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
        width 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
        height 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
        opacity 0.18s ease;
}

.onboarding-spotlight {
    position: fixed;
    z-index: 131;
    border: 2px solid var(--accent-warm);
    border-radius: 10px;
    box-shadow:
        0 0 0 9999px var(--tour-dim-strong),
        0 12px 28px rgba(0, 0, 0, 0.16);
    pointer-events: none;
    transition:
        left 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
        top 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
        width 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
        height 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
        opacity 0.18s ease;
}

.onboarding-spotlight::after {
    content: "";
    position: absolute;
    inset: -6px;
    border: 1px solid color-mix(in srgb, var(--accent-warm) 56%, transparent);
    border-radius: 14px;
    opacity: 0.72;
}

.onboarding-spotlight[hidden] {
    display: none;
}

.onboarding-card {
    position: fixed;
    z-index: 132;
    display: grid;
    gap: 12px;
    width: min(380px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    padding: 18px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.28);
    transition:
        left 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
        top 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
        right 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
        bottom 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
        opacity 0.18s ease;
    will-change: left, top, opacity, transform;
}

.onboarding-card.is-transitioning {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
    pointer-events: none;
}

.onboarding-card.centered.is-transitioning {
    transform: translate(-50%, calc(-50% + 6px)) scale(0.985);
}

.onboarding-card.is-entering {
    animation: onboarding-card-in 0.2s ease-out;
}

.onboarding-card.centered {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.onboarding-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    min-height: 30px;
    padding: 0;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    color: var(--muted);
    font-size: 20px;
    line-height: 1;
}

.onboarding-close:hover {
    background: var(--surface-soft);
    color: var(--text-strong);
}

.onboarding-kicker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-right: 28px;
    color: var(--accent-warm);
    font-size: 12px;
    font-weight: 900;
}

.onboarding-kicker span:first-child {
    text-transform: uppercase;
}

.onboarding-card h2 {
    margin: 0;
    color: var(--text-strong);
    font-size: 20px;
    line-height: 1.2;
}

.onboarding-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.onboarding-points {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 9px 12px 9px 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
}

.onboarding-points[hidden] {
    display: none !important;
}

.onboarding-points li[hidden] {
    display: none !important;
}

.onboarding-points li::marker {
    color: var(--accent-warm);
    font-size: 0.78em;
}

.onboarding-points li {
    color: var(--text);
    font-size: 12.5px;
    line-height: 1.34;
}

.onboarding-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.onboarding-dots span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--line-strong);
}

.onboarding-dots span.active {
    width: 18px;
    background: var(--accent-warm);
}

.onboarding-step-action {
    justify-self: start;
}

.onboarding-step-action[hidden] {
    display: none !important;
}

.onboarding-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 4px;
}

.onboarding-actions > span {
    display: inline-flex;
    gap: 8px;
}

@keyframes onboarding-card-in {
    0% {
        opacity: 0;
        transform: translateY(6px) scale(0.985);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.onboarding-card.centered.is-entering {
    animation-name: onboarding-card-centered-in;
}

@keyframes onboarding-card-centered-in {
    0% {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 6px)) scale(0.985);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}

.pagination-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.button.disabled,
.button.disabled:hover {
    background: var(--surface-soft);
    border-color: var(--line);
    color: var(--muted);
    opacity: 0.62;
    cursor: not-allowed;
    box-shadow: none;
}

tbody tr:hover td {
    background: var(--surface-soft);
}

tbody tr:last-child td {
    border-bottom: 0;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0;
    overflow: hidden;
    background: var(--surface);
}

.generation-details-grid {
    grid-template-columns: minmax(120px, 0.7fr) minmax(190px, 1fr) minmax(240px, 1.2fr) minmax(140px, 0.8fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr);
}

.details-grid > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 78px;
    padding: 15px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.details-grid strong {
    color: var(--text-strong);
    overflow-wrap: anywhere;
}

.lot-title-cell,
.details-lot-title {
    display: -webkit-box;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    overflow-wrap: anywhere;
}

.lot-title-cell {
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.details-lot-title {
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.lot-title-cell.is-expandable,
.details-lot-title.is-expandable {
    cursor: pointer;
}

.lot-title-cell.expanded,
.details-lot-title.expanded {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
}

.text-expand-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    margin-top: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent-warm);
    box-shadow: none;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.text-expand-toggle:hover {
    color: var(--text-strong);
    text-decoration: underline;
}

.lot-title-cell strong,
.details-lot-title strong {
    font-weight: 900;
}

.activity-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin: 0 0 18px;
}

.activity-summary-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.activity-summary-card strong {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--surface-raised);
    color: var(--accent);
    font-size: 15px;
}

.activity-summary-card span {
    min-width: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.form {
    max-width: 560px;
}

.wide-form {
    max-width: 900px;
}

.form-section {
    margin-bottom: 14px;
    padding: 16px;
}

.form-section h2 {
    margin: 0 0 14px;
    font-size: 17px;
}

.form-subsection {
    display: grid;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.form-subsection:first-of-type {
    padding-top: 0;
    border-top: 0;
}

.form-subsection + .form-subsection {
    margin-top: 16px;
}

.form-subsection h3 {
    margin: 0;
    color: var(--text-strong);
    font-size: 14px;
    line-height: 1.3;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 14px;
}

.form-grid-span-2 {
    grid-column: 1 / -1;
}

.field {
    min-width: 0;
}

.form-section > .field {
    margin-bottom: 14px;
}

.form-section > .field:last-child {
    margin-bottom: 0;
}

.field textarea,
.field input,
.field select {
    margin-top: 0;
}

.native-select-hidden {
    display: none;
}

.combo-select {
    position: relative;
    margin-top: 0;
}

.combo-trigger {
    width: 100%;
    gap: 10px;
    justify-content: space-between;
    min-width: 0;
    overflow: hidden;
    border-color: var(--line);
    background: var(--surface);
    color: var(--text);
    box-shadow: none;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.combo-trigger::after {
    content: "";
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    margin-left: auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
}

.combo-select.open .combo-trigger {
    border-color: var(--accent-warm);
}

.combo-menu {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface-raised);
    box-shadow: var(--shadow);
}

.combo-search {
    width: calc(100% - 20px);
    min-height: 36px;
    margin: 10px;
    font-size: 13px;
}

.combo-options {
    max-height: 260px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 8px 10px;
}

.combo-group {
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-raised) 92%, var(--surface-soft));
}

.combo-group.primary {
    border-color: color-mix(in srgb, var(--accent-warm) 48%, var(--line));
    background: color-mix(in srgb, var(--accent-warm) 8%, var(--surface-raised));
}

.combo-group.recent {
    border-color: color-mix(in srgb, var(--accent) 54%, var(--line));
    background: color-mix(in srgb, var(--accent) 9%, var(--surface-raised));
}

.combo-group.all {
    background: transparent;
}

.combo-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-soft) 70%, transparent);
    color: var(--text-strong);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.2;
}

.combo-group-title span {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: none;
}

.combo-group-options {
    display: grid;
    gap: 2px;
    padding: 4px;
}

.combo-option {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 36px;
    justify-content: flex-start;
    margin: 0;
    padding: 7px 9px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    box-shadow: none;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
}

.combo-option:hover {
    border-color: var(--line);
    background: var(--surface-soft);
    color: var(--text-strong);
}

.combo-option.auto,
.combo-option.recent {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.combo-option.auto {
    border-color: color-mix(in srgb, var(--accent-warm) 32%, transparent);
    background: color-mix(in srgb, var(--accent-warm) 14%, transparent);
    color: var(--text-strong);
}

.combo-option.recent {
    border-color: color-mix(in srgb, var(--accent) 24%, transparent);
    color: var(--text-strong);
}

.combo-empty {
    padding: 12px 9px;
    color: var(--muted);
    font-size: 13px;
}

.password-control {
    position: relative;
    display: block;
}

.password-control input {
    width: 100%;
    margin-top: 0;
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-color: transparent;
    background: transparent;
    color: var(--muted);
    box-shadow: none;
    transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
    border-color: var(--line);
    background: var(--surface-soft);
    color: var(--text-strong);
}

.password-toggle-icon {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.password-toggle-icon-hide,
.password-toggle.is-visible .password-toggle-icon-show {
    display: none;
}

.password-toggle.is-visible .password-toggle-icon-hide {
    display: block;
}

.field:has(textarea),
.checkbox-field {
    grid-column: 1 / -1;
}

.switch-field {
    padding: 10px 0 2px;
}

.switch-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--text);
    cursor: pointer;
}

.switch-row input[type="checkbox"] {
    position: relative;
    flex: 0 0 42px;
    width: 42px;
    min-height: 24px;
    margin: 0;
    border-color: var(--line-strong);
    border-radius: 999px;
    appearance: none;
    background: var(--surface-raised);
    transition: background 0.12s ease, border-color 0.12s ease;
}

.switch-row input[type="checkbox"]::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--muted);
    transition: transform 0.12s ease, background 0.12s ease;
}

.switch-row input[type="checkbox"]:checked {
    border-color: color-mix(in srgb, var(--success) 58%, var(--line));
    background: var(--success-soft);
}

.switch-row input[type="checkbox"]:checked::after {
    background: var(--success);
    transform: translateX(18px);
}

.switch-row span {
    display: grid;
    gap: 2px;
}

.switch-row small {
    color: var(--muted);
    font-size: 12px;
}

.checkbox-field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px 10px;
}

.checkbox-field label {
    margin: 0;
}

.checkbox-field input[type="checkbox"] {
    grid-row: 1;
    width: 18px;
    min-height: 18px;
    margin: 0;
}

.help {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}

.form p {
    margin: 0 0 14px;
}

.inline-editor {
    margin-top: 12px;
}

.inline-editor summary {
    width: max-content;
    list-style: none;
    cursor: pointer;
}

.inline-editor summary::-webkit-details-marker {
    display: none;
}

.inline-edit-form {
    max-width: none;
    margin-top: 12px;
}

.inline-edit-form textarea {
    margin-top: 6px;
}

.form label,
.field label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-weight: 800;
}

.errorlist {
    margin: 0 0 8px;
    padding-left: 18px;
    color: var(--danger);
}

.error-text {
    color: var(--danger);
}

.field-error {
    display: block;
    margin-top: 5px;
    color: var(--danger);
    font-size: 12px;
    font-weight: 800;
}

.error-page {
    display: grid;
    justify-items: start;
    width: min(680px, 100%);
    margin: clamp(40px, 10vh, 110px) auto;
    padding: clamp(24px, 5vw, 48px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.error-page h1 {
    margin: 12px 0 8px;
}

.error-page > p {
    max-width: 560px;
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.error-code {
    color: color-mix(in srgb, var(--accent-warm) 34%, var(--muted));
    font-size: clamp(52px, 9vw, 88px);
    font-weight: 800;
    line-height: 0.9;
}

.error-reference {
    display: grid;
    gap: 3px;
    width: 100%;
    margin-top: 22px;
    padding: 14px 16px;
    border-left: 3px solid var(--accent-warm);
    background: var(--surface-soft);
}

.error-reference span,
.error-reference small {
    color: var(--muted);
}

.error-reference strong {
    font-size: 20px;
}

.error-page .actions-row {
    margin-top: 24px;
}

.invite-explainer {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.invite-explainer > div {
    display: grid;
    gap: 5px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
}

.invite-explainer span,
.invite-email-lock span,
.invite-email-lock small {
    color: var(--muted);
}

.invite-form-section {
    max-width: 680px;
}

.invite-method-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.invite-method-fieldset legend {
    margin-bottom: 9px;
    color: var(--text-strong);
    font-weight: 800;
}

.invite-method-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.form label.invite-method-option {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 18px;
    gap: 12px;
    min-height: 112px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    cursor: pointer;
}

.invite-method-option:hover {
    border-color: var(--line-strong);
    background: var(--surface-soft);
}

.invite-method-option:has(input:checked) {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent-soft) 62%, var(--surface));
}

.invite-method-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 1px;
    opacity: 0;
    pointer-events: none;
}

.invite-method-content {
    display: grid;
    align-content: start;
    gap: 6px;
}

.invite-method-content strong {
    color: var(--text-strong);
}

.invite-method-content small {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.invite-method-mark {
    display: block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface);
}

.invite-method-option:has(input:checked) .invite-method-mark {
    border: 5px solid var(--accent);
}

.invite-method-option:focus-within {
    outline: 2px solid color-mix(in srgb, var(--accent) 52%, transparent);
    outline-offset: 2px;
}

.invite-email-field {
    margin-top: 16px;
}

.invite-email-field[hidden] {
    display: none;
}

.invitation-result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
    gap: 14px;
    align-items: start;
}

.invitation-state,
.invitation-actions-panel {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.invitation-state h2,
.invitation-actions-panel h2 {
    margin: 12px 0 6px;
}

.invitation-state > p,
.invitation-actions-panel > p {
    margin: 0;
    color: var(--muted);
}

.invite-copy-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: center;
    margin-top: 22px;
    padding: 14px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: var(--surface-soft);
}

.invite-copy-box > span {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.invite-copy-input {
    min-width: 0;
    width: 100%;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface);
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 12px;
    text-overflow: ellipsis;
}

.invite-copy-input:focus {
    border-color: var(--accent-warm);
}

.invite-delivery-state {
    display: grid;
    gap: 4px;
    margin-top: 14px;
    padding: 12px 14px;
    border-left: 3px solid var(--accent-warm);
    background: var(--surface-soft);
}

.invite-delivery-state span,
.invite-expiry {
    color: var(--muted);
    font-size: 13px;
}

.invite-expiry {
    margin-top: 12px !important;
}

.invitation-actions-panel {
    display: grid;
    gap: 10px;
}

.invitation-actions-panel h2 {
    margin-top: 0;
}

.invitation-actions-panel form {
    margin: 0;
}

.invite-email-lock {
    display: grid;
    gap: 3px;
    margin: 18px 0;
    padding: 12px 14px;
    border-left: 3px solid var(--accent-warm);
    background: var(--surface-soft);
}

.auth-name-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 10px;
}

.auth-name-grid .form-field {
    align-content: start;
}

.auth-name-grid input {
    min-height: 40px;
    height: 40px;
}

@media (max-width: 720px) {
    .invite-explainer,
    .invitation-result,
    .auth-name-grid,
    .invite-method-grid {
        grid-template-columns: 1fr;
    }

    .invite-method-option {
        min-height: 0;
    }

    .invite-copy-box {
        grid-template-columns: 1fr;
    }

    .invite-copy-box button {
        width: 100%;
    }
}

.is-invalid {
    border-color: var(--danger) !important;
}

.batch-review-panel {
    display: grid;
    gap: 12px;
}

.batch-file-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 8px;
}

.batch-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 86%, var(--background));
    color: var(--text);
    text-decoration: none;
}

.batch-file-item:hover,
.batch-file-item.active {
    border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.batch-file-item span:first-child {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.batch-file-item strong,
.batch-file-item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.batch-file-item small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.batch-file-item .status-badge {
    flex: 0 0 auto;
}

.ocr-review-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.1fr);
    gap: 14px;
    align-items: start;
}

.lot-candidates-panel {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
}

.lot-candidate-search {
    width: 100%;
}

.attention-inline {
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--warning) 38%, var(--line));
    border-radius: 8px;
    background: var(--warning-soft);
    color: var(--warning);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.45;
}

.conflict-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.conflict-item {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 90%, var(--background));
    font-size: 13px;
}

.conflict-item span {
    color: var(--muted);
    line-height: 1.45;
}

.lot-candidate-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
    max-height: 360px;
    overflow: auto;
    padding-right: 4px;
}

.lot-candidate {
    display: grid;
    gap: 7px;
    min-height: 118px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 86%, var(--background));
    color: var(--text);
    text-decoration: none;
}

.lot-candidate:hover,
.lot-candidate.is-selected {
    border-color: var(--accent-warm);
    background: color-mix(in srgb, var(--accent-warm) 8%, var(--surface));
    color: var(--text);
}

.lot-candidate-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.lot-candidate strong {
    color: var(--text-strong);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.lot-candidate-empty {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.ocr-source {
    position: sticky;
    top: 82px;
}

.ocr-raw-text {
    margin-top: 14px;
}

.ocr-raw-text summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 800;
}

.ocr-raw-text pre,
.source-text {
    max-height: 460px;
    overflow: auto;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
    color: var(--text);
    white-space: pre-wrap;
}

.source-text.empty {
    min-height: 180px;
    color: var(--muted);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.status-pending,
.status-processing,
.status-active {
    background: var(--warning-soft);
    color: var(--warning);
}

.status-succeeded,
.status-reviewed,
.status-inactive {
    background: var(--success-soft);
    color: var(--success);
}

.status-archived {
    background: var(--surface-soft);
    color: var(--muted);
}

.status-failed {
    background: var(--danger-soft);
    color: var(--danger);
}

.access-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
}

.access-status.enabled {
    border-color: color-mix(in srgb, var(--success) 35%, var(--line));
    color: var(--success);
}

.access-status.disabled {
    border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
    color: var(--danger);
}

.presence-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 26px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    max-width: 100%;
    white-space: nowrap;
}

.presence-badge.online {
    border-color: color-mix(in srgb, var(--success) 42%, var(--line));
    background: var(--success-soft);
    color: var(--success);
}

.presence-badge.muted-presence {
    color: var(--muted);
}

.presence-dot {
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.presence-badge.online .presence-dot {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 14%, transparent);
}

.access-action {
    min-height: 32px;
    padding: 0 12px;
    border-radius: 6px;
    box-shadow: none;
    font-size: 13px;
}

.access-action.enable {
    background: var(--success-soft);
    border-color: color-mix(in srgb, var(--success) 45%, var(--line));
    color: var(--success);
}

.access-action.enable:hover {
    background: var(--success);
    color: #ffffff;
}

.access-action.disable {
    background: var(--danger-soft);
    border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
    color: var(--danger);
}

.access-action.disable:hover {
    background: var(--danger);
    color: #ffffff;
}

.status-dot {
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.messages {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.message {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.link-button {
    display: inline;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-weight: 800;
    line-height: inherit;
}

.link-button:hover {
    background: transparent;
    color: var(--accent-strong);
}

.record-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.record-title h1 {
    overflow-wrap: anywhere;
}

.record-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .employee-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .employee-board {
        grid-template-columns: minmax(0, 1fr);
    }

    .generation-details-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid,
    .dashboard-command,
    .dashboard-workspace,
    .dashboard-header,
    .dashboard-board,
    .client-overview,
    .confirmation-layout,
    .prep-flow,
    .ocr-review-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        align-items: start;
    }

    .dashboard-header-actions {
        justify-content: flex-start;
    }

    .dashboard-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-metrics:has(.dashboard-metric:nth-child(4):last-child) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bulk-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .inline-operation-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-command-copy {
        min-height: 0;
    }

    .ocr-source {
        position: static;
    }
}

@media (max-width: 960px), (max-width: 1280px) and (min-height: 900px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: fixed;
        width: auto;
        height: auto;
        right: 0;
        bottom: auto;
        z-index: 30;
        padding: 10px 12px;
        overflow: visible;
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.05);
    }

    .sidebar:hover,
    .sidebar:focus-within {
        width: auto;
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.05);
    }

    .brand {
        justify-content: flex-start;
        gap: 12px;
        min-height: 42px;
        padding: 0 2px 8px;
    }

    .sidebar:hover .brand,
    .sidebar:focus-within .brand {
        padding: 0 2px 8px;
    }

    .brand-copy,
    .theme-toggle [data-theme-label],
    .onboarding-label,
    .logout-label {
        width: auto;
        opacity: 1;
    }

    .brand-mark {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
    }

    .brand strong {
        font-size: 15px;
    }

    .brand small {
        font-size: 11px;
    }

    .sidebar-nav {
        display: none;
    }

    .sidebar-footer {
        grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
        gap: 8px;
        margin-top: 0;
        padding-top: 8px;
    }

    .sidebar-footer > *,
    .sidebar-footer .inline-form,
    .sidebar-footer .sidebar-link,
    .theme-picker,
    .theme-toggle,
    .onboarding-trigger,
    .logout-button {
        min-width: 0;
    }

    .theme-toggle,
    .sidebar:hover .theme-toggle,
    .sidebar:focus-within .theme-toggle,
    .onboarding-trigger,
    .sidebar:hover .onboarding-trigger,
    .sidebar:focus-within .onboarding-trigger,
    .logout-button,
    .sidebar:hover .logout-button,
    .sidebar:focus-within .logout-button {
        justify-content: center;
        gap: 10px;
        padding: 0 10px;
    }

    .theme-menu {
        right: auto;
        bottom: auto;
        width: min(260px, calc(100vw - 24px));
        transform: none;
    }

    .workspace-topbar {
        display: none;
    }

    .workspace {
        margin-left: 0;
        padding-top: 116px;
    }

    .mobile-bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 40;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
        gap: 6px;
        padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--nav-line);
        background: color-mix(in srgb, var(--surface) 94%, transparent);
        box-shadow: 0 -12px 26px rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(12px);
    }

    .mobile-nav-link {
        display: grid;
        align-content: center;
        justify-items: center;
        gap: 4px;
        min-width: 0;
        min-height: 44px;
        padding: 5px 4px;
        border: 1px solid transparent;
        border-radius: 8px;
        color: var(--muted);
        font-size: 11px;
        font-weight: 800;
        overflow: hidden;
    }

    .mobile-nav-link span {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-nav-link.active {
        border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
        background: color-mix(in srgb, var(--accent) 11%, var(--surface));
        color: var(--text-strong);
    }

    .mobile-nav-icon {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
        opacity: 0.78;
    }

    .mobile-nav-link.active .mobile-nav-icon {
        opacity: 1;
    }

    .page {
        width: min(820px, calc(100% - 24px));
        margin-top: 14px;
        padding-bottom: 84px;
    }

    .page-header > div,
    .dashboard-header > div,
    .section-header > div {
        min-width: 0;
    }

    .page-header p,
    .dashboard-header p,
    .section-header .muted {
        overflow-wrap: anywhere;
    }

    .clients-page-header {
        grid-template-columns: 1fr;
    }

    .clients-page-header > .actions-row {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .onboarding-card,
    .onboarding-card.centered {
        right: 12px;
        bottom: calc(78px + env(safe-area-inset-bottom));
        left: 12px !important;
        top: auto !important;
        width: auto;
        max-height: calc(100vh - 112px);
        overflow: auto;
        transform: none;
    }

    .onboarding-card.is-transitioning,
    .onboarding-card.centered.is-transitioning {
        transform: translateY(6px) scale(0.985);
    }

    .onboarding-card.centered.is-entering {
        animation-name: onboarding-card-in;
    }

    .onboarding-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .onboarding-actions > span {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .onboarding-actions button {
        width: 100%;
    }

    .row,
    .toolbar,
    .filter-grid {
        align-items: stretch;
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .filter-grid > .field:has(input[type="search"]) {
        grid-column: auto;
    }

    .filter-actions {
        grid-column: auto;
    }

    .filter-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .filter-actions button,
    .filter-actions .button {
        width: 100%;
    }

    .bulk-panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .bulk-grid {
        grid-template-columns: 1fr;
    }

    .bulk-actions button {
        width: 100%;
    }

    .inline-operation-head {
        flex-direction: column;
    }

    .inline-operation-grid {
        grid-template-columns: 1fr;
    }

    .inline-operation-form {
        margin: 0;
        border: 0;
        box-shadow: none;
    }

    .dashboard-command,
    .dashboard-actions,
    .dashboard-workspace,
    .dashboard-header,
    .dashboard-board,
    .work-grid,
    .client-overview,
    .workflow-strip {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        gap: 10px;
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .dashboard-header h1 {
        font-size: 27px;
    }

    .dashboard-header p {
        font-size: 13px;
    }

    .dashboard-header-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .dashboard-header-actions .button {
        width: 100%;
    }

    .dashboard-command {
        gap: 10px;
        margin-bottom: 12px;
    }

    .dashboard-command-copy {
        min-height: 0;
        padding: 0;
    }

    .dashboard-command-copy h1 {
        font-size: 28px;
    }

    .dashboard-actions {
        gap: 8px;
    }

    .dashboard-action {
        min-height: 0;
        padding: 12px 13px;
    }

    .dashboard-action span {
        font-size: 14px;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 12px;
    }

    .employee-card {
        gap: 12px;
        padding: 12px;
    }

    .employee-card-head,
    .employee-card-body {
        grid-template-columns: 1fr;
    }

    .employee-card-head {
        gap: 10px;
    }

    .employee-avatar {
        width: 40px;
        height: 40px;
    }

    .employee-state-stack {
        justify-items: start;
    }

    .employee-card-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(98px, 1fr));
        justify-content: stretch;
    }

    .employee-card-actions .table-action,
    .employee-card-actions .access-action,
    .employee-card-actions .inline-form {
        width: 100%;
    }

    .employee-card-actions .table-action,
    .employee-card-actions .access-action {
        justify-content: center;
        min-height: 32px;
    }

    .dashboard-metrics {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        overflow: visible;
        margin-right: 0;
        margin-bottom: 12px;
        margin-left: 0;
        padding: 0;
        scroll-snap-type: none;
    }

    .dashboard-metric {
        grid-template-columns: minmax(58px, 0.36fr) minmax(0, 1fr);
        min-height: 84px;
        padding: 11px;
        scroll-snap-align: unset;
    }

    .dashboard-metric-value {
        min-width: 68px;
        font-size: 26px;
    }

    .dashboard-metric strong {
        font-size: 13px;
        line-height: 1.25;
    }

    .dashboard-metric small {
        font-size: 11px;
    }

    @media (max-width: 380px) {
        .dashboard-metrics {
            grid-template-columns: 1fr;
        }
    }

    .dashboard-card {
        padding: 12px;
    }

    .dashboard-quick-card .quick-action-list {
        grid-template-columns: 1fr;
    }

    .dashboard-card-header {
        align-items: stretch;
    }

    .dashboard-queue-row {
        grid-template-columns: 1fr;
        gap: 8px;
        align-items: stretch;
        min-height: 0;
        padding: 11px 12px;
    }

    .dashboard-queue-row .table-action {
        width: 100%;
    }

    .dashboard-stats .stat-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .dashboard-action-list {
        max-height: none;
        overflow: visible;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .generation-details-grid {
        grid-template-columns: 1fr;
    }

    .confirmation-entities {
        grid-template-columns: 1fr;
    }

    .confirmation-submit-panel {
        position: static;
    }

    .generation-options-grid {
        grid-template-columns: 1fr;
    }

    .generation-options-grid .switch-field {
        padding-top: 0;
    }

    .confirmation-intake-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .confirmation-intake-panel .button {
        width: 100%;
    }

    .stat-card {
        min-height: 92px;
        padding: 12px;
    }

    .stat-value {
        font-size: 28px;
    }

    .stat-note {
        font-size: 11px;
    }

    .data-section-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .data-jump {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        overflow: visible;
        margin: 0 0 12px;
        padding: 0;
    }

    .data-jump a {
        justify-content: center;
        min-width: 0;
        min-height: 32px;
        padding: 6px 8px;
        text-align: center;
        white-space: normal;
        line-height: 1.2;
    }

    .data-section-head {
        padding: 10px 12px;
    }

    .check-item {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 8px;
        padding: 8px 10px;
    }

    .check-mark {
        width: 18px;
        height: 18px;
    }

    .action-item,
    .attention-panel {
        display: flex;
        align-items: flex-start;
        flex-direction: column;
    }

    .action-item > .actions-row.tight {
        flex-wrap: wrap;
        justify-content: flex-start;
        min-width: 0;
        width: 100%;
    }

    .work-panel .action-item .muted > a {
        display: inline-flex;
        align-items: center;
        min-height: 32px;
    }

    .employee-identity h2 a,
    .help a {
        display: inline-flex;
        align-items: center;
        min-height: 32px;
    }

    .action-link {
        width: 100%;
        min-height: 0;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .mobile-card-table,
    .employee-table {
        border: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
        scroll-margin-top: 118px;
    }

    .mobile-card-table table,
    .mobile-card-table tbody,
    .mobile-card-table tr,
    .mobile-card-table td,
    .employee-table table,
    .employee-table tbody,
    .employee-table tr,
    .employee-table td {
        display: block;
        width: 100%;
    }

    .mobile-card-table table,
    .employee-table table {
        border-collapse: separate;
        border-spacing: 0;
    }

    .mobile-card-table thead,
    .employee-table thead {
        display: none;
    }

    .mobile-card-table tbody,
    .employee-table tbody {
        display: grid;
        gap: 14px;
    }

    .mobile-card-table tr,
    .employee-table tr {
        display: grid;
        gap: 8px;
        overflow: visible;
        padding: 12px;
        border: 1px solid var(--line-strong);
        border-radius: 10px;
        background: color-mix(in srgb, var(--surface-raised) 92%, var(--surface-soft));
        box-shadow: var(--shadow);
    }

    .mobile-card-table td,
    .employee-table td {
        display: block;
        min-width: 0;
        padding: 0;
        background: transparent;
        border-bottom: 0;
    }

    .mobile-card-table td > strong,
    .mobile-card-table td .table-subline,
    .employee-table td > strong,
    .employee-table td .table-subline {
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .mobile-card-table td + td,
    .employee-table td + td {
        padding-top: 8px;
        border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
    }

    .mobile-card-table td:first-child:not([colspan])::before,
    .employee-table td:first-child:not([colspan])::before {
        display: block;
        margin-bottom: 4px;
    }

    .mobile-card-table td::before,
    .employee-table td::before {
        content: attr(data-label);
        color: var(--muted);
        display: block;
        margin-bottom: 4px;
        font-size: 11px;
        font-weight: 800;
        line-height: 1.4;
        text-transform: uppercase;
    }

    .mobile-card-table td:last-child,
    .employee-table td:last-child {
        border-bottom: 0;
    }

    .mobile-card-table td:not([data-label]),
    .mobile-card-table td[data-label=""],
    .employee-table td:not([data-label]),
    .employee-table td[data-label=""] {
        display: block;
        width: 100%;
        padding-top: 10px;
        background: transparent;
    }

    .mobile-card-table td:not([data-label])::before,
    .mobile-card-table td[data-label=""]::before,
    .employee-table td:not([data-label])::before,
    .employee-table td[data-label=""]::before {
        display: none;
    }

    .mobile-card-table td > a:not(.table-action),
    .employee-table td > a:not(.table-action) {
        display: inline-flex;
        align-items: center;
        min-width: 32px;
        min-height: 32px;
        font-weight: 800;
        overflow-wrap: anywhere;
    }

    .mobile-card-table .status-badge,
    .employee-table .status-badge {
        width: auto;
        max-width: 100%;
    }

    .mobile-card-table .actions-row.tight,
    .employee-table .actions-row.tight {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(98px, 1fr));
        justify-content: stretch;
        width: 100%;
        gap: 6px;
    }

    .mobile-card-table .actions-row.tight .table-action,
    .mobile-card-table .actions-row.tight .button,
    .employee-table .actions-row.tight .table-action,
    .employee-table .actions-row.tight .button {
        justify-content: center;
        width: 100%;
        min-height: 32px;
    }

    .pagination {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .pagination .button,
    .pagination-status {
        width: 100%;
    }

    .invite-actions {
        justify-content: flex-start;
    }

    .invite-actions .table-action {
        width: 100%;
    }

    .invite-cancel-form {
        width: 100%;
    }
}

@media (max-width: 960px) and (max-height: 560px) {
    .sidebar {
        right: 0;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
        align-items: center;
        gap: 10px;
        padding: 8px 12px;
    }

    .brand {
        min-height: 38px;
        padding: 0;
    }

    .sidebar-footer {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding-top: 0;
        border-top: 0;
    }

    .theme-toggle,
    .onboarding-trigger,
    .logout-button {
        min-height: 38px;
    }

    .page {
        margin-top: 10px;
        padding-bottom: 72px;
    }

    .workspace {
        padding-top: 60px;
    }

    .mobile-card-table,
    .employee-table {
        scroll-margin-top: 62px;
    }

    .mobile-bottom-nav {
        gap: 5px;
        padding: 6px 7px calc(6px + env(safe-area-inset-bottom));
    }

    .mobile-nav-link {
        min-height: 38px;
        gap: 2px;
        padding: 4px;
        font-size: 10px;
    }

    .mobile-nav-icon {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 640px) {
    input,
    select,
    textarea {
        font-size: 16px;
    }

    .theme-toggle [data-theme-label],
    .onboarding-label,
    .logout-label {
        display: none;
    }

    .theme-toggle,
    .sidebar:hover .theme-toggle,
    .sidebar:focus-within .theme-toggle,
    .onboarding-trigger,
    .sidebar:hover .onboarding-trigger,
    .sidebar:focus-within .onboarding-trigger,
    .logout-button,
    .sidebar:hover .logout-button,
    .sidebar:focus-within .logout-button {
        gap: 0;
        padding: 0;
    }

    .sidebar {
        padding: 9px 12px 8px;
    }

    .sidebar-footer {
        gap: 6px;
    }

    .theme-toggle,
    .sidebar:hover .theme-toggle,
    .sidebar:focus-within .theme-toggle,
    .onboarding-trigger,
    .sidebar:hover .onboarding-trigger,
    .sidebar:focus-within .onboarding-trigger,
    .logout-button,
    .sidebar:hover .logout-button,
    .sidebar:focus-within .logout-button {
        gap: 6px;
        min-height: 38px;
        padding: 0 6px;
        font-size: 12px;
    }

    .theme-toggle-mark {
        flex-basis: 22px;
        width: 22px;
        height: 22px;
    }

    .theme-menu {
        width: min(236px, calc(100vw - 24px));
    }

    .page-header > .actions-row {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .page-header > .actions-row .button,
    .page-header > .actions-row button,
    .page-header > .actions-row form {
        width: 100%;
    }

    .stats-grid,
    .document-stats-grid,
    .dashboard-metrics {
        grid-template-columns: 1fr;
    }

    .confirmation-data-list div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .filter-actions {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (forced-colors: active) {
    button:focus-visible,
    a:focus-visible,
    input:focus-visible,
    select:focus-visible,
    textarea:focus-visible {
        outline-color: Highlight;
        box-shadow: none;
    }
}

.section-heading,
.package-review-summary,
.package-review-settings,
.sticky-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.section-heading h2,
.section-heading p {
    margin: 0;
}

.section-heading > div {
    display: grid;
    gap: 5px;
}

.field-span-full {
    grid-column: 1 / -1;
}

.package-upload-primary input[type="file"] {
    min-height: 48px;
}

.prep-separate-upload {
    padding: 0;
    overflow: visible;
}

.prep-separate-upload > summary {
    display: flex;
    align-items: center;
    min-height: 62px;
    padding: 14px 16px;
    color: var(--text-strong);
    cursor: pointer;
    list-style-position: inside;
}

.prep-separate-upload > summary span {
    display: inline-grid;
    gap: 3px;
    margin-left: 7px;
}

.prep-separate-upload > summary small {
    color: var(--muted);
    font-weight: 400;
}

.prep-separate-content {
    display: grid;
    gap: 20px;
    padding: 0 16px 16px;
    border-top: 1px solid var(--line);
}

.prep-separate-content > section {
    padding-top: 16px;
}

.prep-separate-content h2 {
    margin: 0 0 12px;
    font-size: 17px;
}

.package-review-summary,
.package-review-settings,
.package-identity-warning {
    margin-bottom: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.package-review-summary > div:first-child,
.package-review-hint {
    display: grid;
    gap: 4px;
}

.package-review-summary span,
.package-review-hint span {
    color: var(--muted);
    font-size: 13px;
}

.package-review-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.package-review-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--line-strong);
}

.legend-dot.client {
    background: var(--accent);
}

.legend-dot.lot {
    background: var(--success);
}

.package-review-settings .field {
    width: min(100%, 520px);
}

.package-review-hint {
    max-width: 520px;
}

.package-identity-warning {
    display: grid;
    gap: 8px;
    border-color: var(--warning);
    background: var(--warning-soft);
}

.package-identity-warning p {
    margin: 0;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 5px;
    font-weight: 700;
}

.check-row input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.package-page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}

.package-page-card {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    min-height: 174px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.package-page-preview {
    position: relative;
    min-height: 174px;
    overflow: hidden;
    border-right: 1px solid var(--line);
    background: var(--surface-soft);
}

.package-page-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: top center;
    background: #ffffff;
}

.package-page-preview span {
    position: absolute;
    right: 6px;
    bottom: 6px;
    padding: 3px 6px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface);
    color: var(--text-strong);
    font-size: 11px;
    font-weight: 800;
}

.package-page-controls {
    display: grid;
    align-content: start;
    gap: 7px;
    min-width: 0;
    padding: 12px;
}

.package-page-controls label {
    font-size: 12px;
}

.package-page-controls select {
    width: 100%;
}

.package-page-controls p {
    display: -webkit-box;
    margin: 2px 0 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.package-page-card[data-page-kind="lot_source"] {
    border-color: color-mix(in srgb, var(--success) 55%, var(--line));
}

.package-page-card[data-page-kind="passport_main"],
.package-page-card[data-page-kind="passport_registration"],
.package-page-card[data-page-kind="snils"],
.package-page-card[data-page-kind="inn"],
.package-page-card[data-page-kind="bank_details"],
.package-page-card[data-page-kind="payment_order"],
.package-page-card[data-page-kind="application"],
.package-page-card[data-page-kind="agency_agreement"],
.package-page-card[data-page-kind="other"] {
    border-color: color-mix(in srgb, var(--accent-warm) 52%, var(--line));
}

.package-page-card[data-page-kind="exclude"] {
    opacity: 0.7;
}

.sticky-form-actions {
    position: sticky;
    z-index: 8;
    bottom: 10px;
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-raised) 94%, transparent);
    box-shadow: var(--shadow-strong);
    backdrop-filter: blur(10px);
}

.sticky-form-actions > div:first-child {
    display: grid;
    gap: 2px;
}

.sticky-form-actions > div:first-child span {
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 760px) {
    .section-heading,
    .package-review-summary,
    .package-review-settings,
    .sticky-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .section-heading .status-badge {
        align-self: flex-start;
    }

    .package-review-legend {
        gap: 8px 12px;
    }

    .package-review-settings .field,
    .package-review-hint {
        width: 100%;
        max-width: none;
    }

    .package-page-grid {
        grid-template-columns: 1fr;
    }

    .package-page-card {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .sticky-form-actions .actions-row,
    .sticky-form-actions .actions-row > * {
        width: 100%;
    }
}
