:root {
    color-scheme: light;
    --bg: #f3f6fa;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --ink: #182230;
    --muted: #687386;
    --line: #dce3ed;
    --blue: #225ee8;
    --blue-dark: #1848b6;
    --blue-soft: #eaf0ff;
    --green: #147d64;
    --green-soft: #e7f7f1;
    --amber: #9a6100;
    --amber-soft: #fff3d8;
    --red: #b42318;
    --surface-translucent: rgba(255, 255, 255, 0.96);
    --surface-muted-translucent: rgba(255, 255, 255, 0.82);
    --panel-tint: #f9fbff;
    --success-surface: #f8fdfa;
    --success-surface-strong: #f5fcf9;
    --warning-surface: #fffbf2;
    --error-surface: #fff8f7;
    --error-soft: #fff0ee;
    --error-table: #fff4f2;
    --focus-ring: rgba(34, 94, 232, 0.10);
    --accent-shadow: rgba(34, 94, 232, 0.24);
    --body-glow: rgba(34, 94, 232, 0.10);
    --status-dot: #1dad84;
    --status-ring: rgba(29, 173, 132, 0.13);
    --workspace-line: rgba(213, 222, 235, 0.90);
    --accent-line: #cbd8f3;
    --field-line: #c5d2e8;
    --drop-line: #b8c6da;
    --detail-line: rgba(190, 204, 230, 0.80);
    --success-line: #bfe6d8;
    --warning-line: #f0d28d;
    --error-line: #efc4bf;
    --shadow: 0 24px 70px rgba(27, 42, 74, 0.10);
    --ack-green: #16c47a;
    --ack-green-soft: rgba(22, 196, 122, 0.18);
    --ack-green-shadow: rgba(22, 196, 122, 0.38);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #141517;
    --surface: #202225;
    --surface-soft: #292c30;
    --ink: #f3f4f6;
    --muted: #a8adb6;
    --line: #3a3e44;
    --blue: #e5484d;
    --blue-dark: #c9363b;
    --blue-soft: rgba(229, 72, 77, 0.14);
    --green: #59c9a5;
    --green-soft: rgba(63, 185, 143, 0.14);
    --amber: #f0b45a;
    --amber-soft: rgba(224, 154, 45, 0.15);
    --red: #ff6b6b;
    --surface-translucent: rgba(32, 34, 37, 0.96);
    --surface-muted-translucent: rgba(39, 41, 45, 0.90);
    --panel-tint: #242629;
    --success-surface: rgba(55, 120, 95, 0.13);
    --success-surface-strong: rgba(55, 120, 95, 0.16);
    --warning-surface: rgba(150, 98, 25, 0.16);
    --error-surface: rgba(170, 55, 55, 0.15);
    --error-soft: rgba(229, 72, 77, 0.15);
    --error-table: rgba(229, 72, 77, 0.11);
    --focus-ring: rgba(229, 72, 77, 0.20);
    --accent-shadow: rgba(229, 72, 77, 0.24);
    --body-glow: rgba(229, 72, 77, 0.10);
    --status-dot: #59c9a5;
    --status-ring: rgba(89, 201, 165, 0.16);
    --workspace-line: #3a3e44;
    --accent-line: rgba(229, 72, 77, 0.38);
    --field-line: #50545b;
    --drop-line: #555960;
    --detail-line: rgba(229, 72, 77, 0.24);
    --success-line: rgba(89, 201, 165, 0.42);
    --warning-line: rgba(240, 180, 90, 0.42);
    --error-line: rgba(255, 107, 107, 0.45);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

:root[data-theme="dark-pro"] {
    color-scheme: dark;
    --bg: #141517;
    --surface: #202225;
    --surface-soft: #292c30;
    --ink: #f3f4f6;
    --muted: #a8adb6;
    --line: #3a3e44;
    --blue: #0095b6;
    --blue-dark: #007a96;
    --blue-soft: rgba(0, 149, 182, 0.16);
    --green: #59c9a5;
    --green-soft: rgba(63, 185, 143, 0.14);
    --amber: #f0b45a;
    --amber-soft: rgba(224, 154, 45, 0.15);
    --red: #ff6b6b;
    --surface-translucent: rgba(32, 34, 37, 0.96);
    --surface-muted-translucent: rgba(39, 41, 45, 0.90);
    --panel-tint: #242629;
    --success-surface: rgba(55, 120, 95, 0.13);
    --success-surface-strong: rgba(55, 120, 95, 0.16);
    --warning-surface: rgba(150, 98, 25, 0.16);
    --error-surface: rgba(170, 55, 55, 0.15);
    --error-soft: rgba(255, 107, 107, 0.15);
    --error-table: rgba(255, 107, 107, 0.11);
    --focus-ring: rgba(0, 149, 182, 0.22);
    --accent-shadow: rgba(0, 149, 182, 0.28);
    --body-glow: rgba(0, 149, 182, 0.12);
    --status-dot: #59c9a5;
    --status-ring: rgba(89, 201, 165, 0.16);
    --workspace-line: #3a3e44;
    --accent-line: rgba(0, 149, 182, 0.40);
    --field-line: #50545b;
    --drop-line: #555960;
    --detail-line: rgba(0, 149, 182, 0.26);
    --success-line: rgba(89, 201, 165, 0.42);
    --warning-line: rgba(240, 180, 90, 0.42);
    --error-line: rgba(255, 107, 107, 0.45);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-width: 320px;
    background:
        radial-gradient(circle at top left, var(--body-glow), transparent 34rem),
        var(--bg);
    color: var(--ink);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    transition: background-color 180ms ease, color 180ms ease;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.page-shell {
    position: relative;
    z-index: 1;
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 54px 0 80px;
}

body.has-side-wallpapers {
    position: relative;
    min-height: 100vh;
}

.side-wallpapers {
    position: absolute;
    z-index: 0;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.side-wallpaper {
    position: absolute;
    top: 0;
    bottom: 0;
    width: max(
        0px,
        calc((100% - min(1120px, calc(100% - 32px))) / 2 - 0.5cm)
    );
    background-repeat: repeat-y;
    background-position: top center;
    background-size: 100% auto;
}

.side-wallpaper-left {
    left: 0;
    background-image: url("/static/side-wallpaper-arkhipova-left.jpg");
}

.side-wallpaper-right {
    right: 0;
    background-image: url("/static/side-wallpaper-arkhipova-right.jpg");
}

@media (max-width: 1280px) {
    body.has-side-wallpapers .side-wallpapers {
        display: none;
    }
}

.hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 28px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

.brand-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 14px;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(42px, 7vw, 72px);
    line-height: 0.95;
    letter-spacing: -0.055em;
}

h1 span {
    color: var(--blue);
}

.reference-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.reference-chip,
.reference-refresh {
    display: inline-grid;
    place-items: center;
    box-sizing: border-box;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-translucent);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1;
    user-select: none;
}

.reference-chip.ready {
    border-color: var(--success-line);
    background: var(--green-soft);
    color: var(--green);
    box-shadow: inset 0 0 0 1px var(--success-line);
}

.reference-chip.warning {
    border-color: var(--warning-line);
    background: var(--warning-surface);
    color: var(--amber);
}

.reference-chip.error,
.reference-chip.missing {
    border-color: var(--error-line);
    background: var(--error-surface);
    color: var(--red);
}

.reference-refresh {
    cursor: pointer;
    color: var(--ink);
    font-size: 14px;
    transition: border-color 150ms ease, color 150ms ease;
}

.reference-refresh:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.reference-refresh:disabled {
    cursor: default;
    opacity: 0.55;
}

.app-version {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.release-badge-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.release-badge {
    margin: 0;
    padding: 3px 9px;
    border: 1px solid var(--warning-line);
    border-radius: 999px;
    background: var(--amber-soft);
    color: var(--amber);
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.release-badge:hover,
.release-badge:focus-visible {
    border-color: var(--amber);
    color: var(--ink);
}

.release-fireworks {
    position: absolute;
    left: calc(100% + 6px);
    top: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 6;
}

.release-spark {
    position: absolute;
    left: 0;
    top: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    opacity: 0;
    transform: translate(-50%, -50%);
}

.release-spark:nth-child(3n) {
    width: 3px;
    height: 11px;
    border-radius: 2px;
}

.release-fireworks.is-firing .release-spark {
    animation: release-spark 720ms ease-out forwards;
}

.release-fireworks.is-firing .release-spark:nth-child(n+9) {
    animation-delay: 700ms;
}

.release-spark:nth-child(1),
.release-spark:nth-child(9) {
    --angle: 8deg;
    --dist: 34px;
    background: #ffd24a;
}

.release-spark:nth-child(2),
.release-spark:nth-child(10) {
    --angle: 52deg;
    --dist: 42px;
    background: #ff6b6b;
}

.release-spark:nth-child(3),
.release-spark:nth-child(11) {
    --angle: 98deg;
    --dist: 30px;
    background: var(--blue);
}

.release-spark:nth-child(4),
.release-spark:nth-child(12) {
    --angle: 148deg;
    --dist: 38px;
    background: #59c9a5;
}

.release-spark:nth-child(5),
.release-spark:nth-child(13) {
    --angle: 188deg;
    --dist: 28px;
    background: #ff9f1c;
}

.release-spark:nth-child(6),
.release-spark:nth-child(14) {
    --angle: 236deg;
    --dist: 40px;
    background: #c77dff;
}

.release-spark:nth-child(7),
.release-spark:nth-child(15) {
    --angle: 292deg;
    --dist: 36px;
    background: #ffd24a;
}

.release-spark:nth-child(8),
.release-spark:nth-child(16) {
    --angle: 332deg;
    --dist: 44px;
    background: #ff6b6b;
}

@keyframes release-spark {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(var(--angle)) translateY(0) scale(1);
    }
    70% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(var(--dist) * -1)) scale(0.35);
    }
}

.check-scope {
    position: fixed;
    z-index: 24;
    top: 14px;
    left: 0;
    width: 175px;
    max-height: calc(100vh - 28px);
    overflow: hidden;
    border: 1px solid var(--line);
    border-left: none;
    border-radius: 0 16px 16px 0;
    background: var(--surface);
    box-shadow: var(--shadow);
    color: var(--ink);
    transition:
        width 280ms cubic-bezier(0.16, 0.84, 0.28, 1),
        background-color 180ms ease,
        color 180ms ease,
        border-color 180ms ease;
}

.check-scope[open] {
    width: min(26rem, calc(100vw - 16px));
    overflow: auto;
}

.check-scope summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 18px 12px 16px;
    cursor: pointer;
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
    list-style: none;
}

.check-scope[open] summary {
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px 10px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.check-scope summary::-webkit-details-marker {
    display: none;
}

.check-scope-handle {
    flex: 0 0 auto;
    width: 30px;
    height: 9px;
    border: 2px solid var(--line);
    border-radius: 4px;
    background: var(--surface-soft);
    box-shadow: 0 2px 0 color-mix(in srgb, var(--ink) 12%, transparent);
}

.check-scope[open] .check-scope-handle {
    width: 9px;
    height: 30px;
    margin-top: 4px;
}

.check-scope-body {
    padding: 12px 16px 16px;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.55;
    background: var(--panel-tint);
}

.check-scope-body h3 {
    margin: 16px 0 8px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
}

.check-scope-body h3:first-of-type {
    margin-top: 4px;
}

.check-scope-body p,
.check-scope-body ol {
    margin: 0 0 10px;
    padding-left: 0;
}

.check-scope-body ol {
    padding-left: 1.3em;
}

.check-scope-body li + li {
    margin-top: 6px;
}

.check-scope-alert {
    color: var(--red);
    font-weight: 800;
}

.hero-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
    flex: 0 0 auto;
}

.manual-downloads {
    display: grid;
    grid-template-columns: repeat(2, minmax(118px, 132px));
    gap: 14px;
}

.manual-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: 148px;
    padding: 12px 10px 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-translucent);
    text-align: center;
}

.manual-card-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    color: var(--blue);
}

.manual-card-icon svg {
    width: 44px;
    height: 44px;
}

.manual-card-icon svg [data-page] {
    fill: var(--surface);
}

.manual-card-icon.is-custom {
    width: 88px;
    height: 88px;
}

.manual-card-icon.is-custom img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.manual-card-caption {
    margin: 8px 0 0;
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 0.01em;
}

.manual-card-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--blue);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: filter 150ms ease, transform 150ms ease;
}

.manual-card-download:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

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

.theme-toggle {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 8px;
    padding: 11px 15px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-translucent);
    color: var(--ink);
    font-size: 13px;
    font-weight: 750;
    transition: border-color 150ms ease, color 150ms ease, background-color 180ms ease;
}

.theme-toggle:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.theme-icon {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    font-size: 18px;
    line-height: 1;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--status-dot);
    box-shadow: 0 0 0 4px var(--status-ring);
}

.workspace-card {
    padding: clamp(22px, 4vw, 42px);
    border: 1px solid var(--workspace-line);
    border-radius: 28px;
    background: var(--surface-translucent);
    box-shadow: var(--shadow);
}

.fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.fields-grid.single-field {
    grid-template-columns: 1fr;
}

.fields-grid label {
    display: grid;
    gap: 8px;
}

.fields-grid label span {
    font-size: 13px;
    font-weight: 800;
}

.fields-grid input {
    width: 100%;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    color: var(--ink);
    background: var(--surface-soft);
}

.fields-grid input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.vor-input-panel {
    margin-bottom: 24px;
    padding: 20px;
    border: 1px solid var(--accent-line);
    border-radius: 18px;
    background: linear-gradient(135deg, var(--blue-soft), var(--panel-tint));
}

.vor-input-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.vor-input-heading h2 {
    margin-bottom: 0;
    font-size: 20px;
}

.vor-input-heading > p {
    max-width: 520px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.vor-input-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.vor-input-grid label {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--detail-line);
    border-radius: 12px;
    background: var(--surface-muted-translucent);
}

.vor-input-grid label span {
    font-size: 12px;
    font-weight: 800;
}

.vor-input-grid input {
    min-width: 0;
    width: 100%;
    min-height: 44px;
    padding: 11px 12px;
    border: 1px solid var(--field-line);
    border-radius: 10px;
    outline: none;
    background: var(--surface);
    color: var(--ink);
    font-size: 16px;
    font-weight: 750;
}

.vor-input-grid input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.vor-manual-warning {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid var(--warning-line);
    border-radius: 14px;
    background: var(--warning-surface);
}

.vor-manual-warning p {
    margin: 0;
    color: var(--amber);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.vor-manual-warning .secondary-button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.vor-manual-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.vor-manual-form-error {
    margin: 12px 0 0;
    color: var(--red);
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 720px) {
    .vor-manual-warning {
        flex-direction: column;
    }

    .vor-manual-warning .secondary-button {
        width: 100%;
    }
}


.drop-zone {
    display: grid;
    place-items: center;
    min-height: 300px;
    padding: 36px;
    border: 2px dashed var(--drop-line);
    border-radius: 22px;
    outline: none;
    background: var(--surface-soft);
    text-align: center;
    transition: 160ms ease;
}

.drop-zone:hover,
.drop-zone:focus,
.drop-zone.is-dragging {
    border-color: var(--blue);
    background: var(--blue-soft);
    transform: translateY(-1px);
}

.upload-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin-bottom: 18px;
    border-radius: 18px;
    background: var(--blue);
    color: white;
    font-size: 32px;
    font-weight: 300;
    box-shadow: 0 12px 26px var(--accent-shadow);
}

.upload-icon.is-custom {
    width: 96px;
    height: 96px;
    padding: 0;
    overflow: hidden;
    background: #1a0a08;
}

.upload-icon.is-custom img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.drop-zone h2 {
    margin-bottom: 8px;
    font-size: 24px;
}

.drop-zone p {
    margin-bottom: 20px;
    color: var(--muted);
}

.secondary-button,
.primary-button {
    border: 0;
    border-radius: 12px;
    font-weight: 800;
    transition: 150ms ease;
}

.secondary-button {
    padding: 11px 18px;
    background: var(--surface);
    color: var(--blue);
    box-shadow: 0 0 0 1px var(--line);
}

.primary-button {
    padding: 14px 22px;
    background: var(--blue);
    color: white;
    box-shadow: 0 10px 24px var(--accent-shadow);
}

.primary-button:hover:not(:disabled) {
    background: var(--blue-dark);
    transform: translateY(-1px);
}

.report-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 0 28px;
    padding: 24px;
    border: 1px solid var(--success-line);
    border-radius: 18px;
    background: var(--success-surface);
}

.report-section.warning {
    border-color: var(--warning-line);
    background: var(--warning-surface);
}

.report-section h2 {
    margin-bottom: 6px;
    font-size: 22px;
}

.report-section p:last-child {
    margin: 0;
    color: var(--muted);
}

.report-download {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.gis-table-section {
    margin: 0 0 28px;
    padding: 22px 24px 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
}

.gis-table-warning {
    margin: 0 0 16px;
    color: var(--red);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.gis-table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.gis-table-toggle {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gis-table-toggle-button {
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.gis-table-toggle-button[aria-pressed="true"] {
    border-color: var(--blue);
    background: var(--blue-soft);
    color: var(--blue);
}

.gis-table-message {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.gis-table-wrapper {
    position: relative;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.gis-mark-summary {
    margin-top: 16px;
    padding: 14px 16px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
}

.gis-mark-summary h3 {
    margin: 0;
    font-size: 15px;
}

.gis-mark-summary-caption,
.gis-mark-summary-total {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.gis-mark-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px 24px;
    margin-top: 12px;
}

.gis-mark-summary h4 {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.gis-mark-summary ul {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gis-mark-summary li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}

.gis-mark-summary li span:last-child {
    font-weight: 800;
}

.gis-table-wrapper.is-collapsed::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 52px;
    pointer-events: none;
    background: linear-gradient(transparent, var(--surface));
}

.gis-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.gis-table th,
.gis-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.gis-table th {
    background: var(--surface-soft);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

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

.gis-table-uncontrolled {
    margin: 14px 0 0;
    padding: 12px 14px;
    border: 1px solid var(--warning-line);
    border-radius: 14px;
    background: var(--warning-surface);
}

.gis-table-uncontrolled-warning {
    margin: 0;
    color: var(--amber);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.gis-table-uncontrolled-note {
    margin: 8px 0 0;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}

.gis-table-foreign {
    margin: 14px 0 0;
    padding: 12px 14px;
    border: 1px solid var(--error-line);
    border-radius: 14px;
    background: var(--error-surface);
}

.gis-table-foreign-error {
    margin: 0;
    color: var(--red);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.gis-table-foreign-note {
    margin: 8px 0 0;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}

.gis-table tbody tr.is-foreign td,
.gis-table tbody tr.is-repeat td {
    background: var(--error-table);
}

.gis-table-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.gis-table-preview-note {
    margin: 0;
    flex: 1 1 220px;
    color: var(--muted);
    font-size: 13px;
}

.gis-table-expand,
.gis-table-download {
    flex: 0 0 auto;
}

.support-heights-section h2 {
    margin: 0 0 10px;
    font-size: 22px;
}

.support-heights-note {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.support-heights-missing {
    color: var(--red);
    font-weight: 700;
}

.controllers-sync-pick {
    width: 44px;
    text-align: center;
}

.controllers-sync-codes {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-all;
}

.controllers-sync-differs {
    color: var(--red);
    font-weight: 700;
}

.controllers-sync-kind {
    margin: 0;
    font-weight: 700;
}

.controllers-sync-kind.is-removed {
    color: var(--red);
}

.controllers-sync-kind.is-existing_rk {
    color: var(--amber);
}

.controllers-sync-fields,
.controllers-sync-removed {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.controllers-sync-actions {
    margin: 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.controllers-sync-actions label {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    color: var(--ink);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
}

.controllers-sync-actions input {
    margin: 3px 0 0;
    flex: 0 0 auto;
}

.controllers-sync-keep-rfid {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.controllers-marks-remarks {
    margin-top: 16px;
    padding: 15px;
    border: 1px solid var(--warning-line);
    background: var(--warning-surface);
    border-radius: 14px;
}

.controllers-marks-remarks h3 {
    margin: 0 0 8px;
    font-size: 16px;
}

.controllers-marks-remarks ul {
    margin: 0;
    padding-left: 1.2em;
}

.controllers-marks-remarks li {
    margin: 6px 0;
    font-size: 14px;
    line-height: 1.45;
}

.controllers-marks-remarks .check-hint {
    margin-top: 9px;
    padding: 8px 11px;
    border: 1px dashed color-mix(in srgb, currentColor 30%, var(--line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.controllers-marks-remarks .check-hint-body p {
    margin: 0;
    color: var(--ink);
    font-size: 12.5px;
    line-height: 1.5;
}

.support-heights-dialog {
    width: min(40rem, calc(100% - 32px));
}

.support-heights-editor-wrap {
    overflow: auto;
    max-height: min(22rem, calc(100vh - 22rem));
    margin: 0 0 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.support-heights-editor {
    margin: 0;
}

.support-heights-editor th:last-child,
.support-heights-editor td:last-child {
    width: 8.5rem;
}

.support-heights-height-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid var(--field-line);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
}

.support-heights-height-input:focus {
    outline: 2px solid var(--focus-ring);
    border-color: var(--blue);
}

.support-heights-height-input::placeholder {
    color: var(--muted);
    font-weight: 500;
}

.scroll-top-button {
    position: fixed;
    z-index: 30;
    left: max(16px, calc((100vw - 1120px) / 2 - 122px));
    bottom: 28px;
    display: grid;
    place-items: center;
    width: 100px;
    height: 100px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--surface-translucent);
    color: var(--blue);
    box-shadow: var(--shadow);
    font-size: 50px;
    font-weight: 850;
    backdrop-filter: blur(12px);
    transition:
        transform 150ms ease,
        border-color 150ms ease,
        background-color 180ms ease,
        color 180ms ease;
}

.scroll-top-button:hover {
    border-color: var(--blue);
    background: var(--blue);
    color: white;
    transform: translateY(-2px);
}

.scroll-top-button:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

.garage-reward {
    position: fixed;
    z-index: 25;
    top: 14px;
    right: 14px;
    width: 175px;
    height: 316px;
    pointer-events: none;
}

.garage-frame {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border: 5px solid #4c5561;
    border-bottom-width: 7px;
    border-radius: 8px 8px 5px 5px;
    background: #101318;
    box-shadow:
        inset 0 10px 0 #2f3640,
        0 10px 28px rgba(16, 22, 34, 0.28);
}

.garage-frame::before {
    content: "";
    position: absolute;
    z-index: 3;
    top: 0;
    right: 0;
    left: 0;
    height: 10px;
    background: linear-gradient(#6a7380, #3e4652);
}

.garage-stage,
.garage-door {
    position: absolute;
    inset: 0;
}

.garage-stage {
    top: 10px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 70%, #2a3344 0%, #101318 72%);
}

.garage-fallback {
    position: absolute;
    inset: 0;
}

.garage-confetti {
    position: absolute;
    top: -12px;
    width: 8px;
    height: 14px;
    border-radius: 2px;
    animation: garage-confetti-fall 1.4s linear infinite;
    animation-play-state: paused;
}

.garage-confetti:nth-child(1) { left: 12%; background: #ff5a5f; animation-delay: 0s; }
.garage-confetti:nth-child(2) { left: 28%; background: #ffd166; animation-delay: 0.2s; }
.garage-confetti:nth-child(3) { left: 44%; background: #06d6a0; animation-delay: 0.45s; }
.garage-confetti:nth-child(4) { left: 58%; background: #4cc9f0; animation-delay: 0.1s; }
.garage-confetti:nth-child(5) { left: 72%; background: #f72585; animation-delay: 0.35s; }
.garage-confetti:nth-child(6) { left: 86%; background: #ffe66d; animation-delay: 0.55s; }

.garage-stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #16c47a;
    color: #fff;
    font-size: 34px;
    font-weight: 850;
    transform: translate(-50%, -50%);
    animation: garage-stamp-pop 0.9s ease infinite alternate;
    animation-play-state: paused;
}

.garage-gif {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.garage-door {
    z-index: 2;
    background:
        repeating-linear-gradient(
            to bottom,
            #9aa3b0 0 15px,
            #7d8694 15px 17px,
            #b7c0cc 17px 18px
        );
    box-shadow: inset 0 -8px 16px rgba(20, 24, 32, 0.28);
    transform: translateY(0);
    transition: transform 900ms cubic-bezier(0.16, 0.84, 0.28, 1);
}

.garage-handle {
    position: absolute;
    left: 50%;
    bottom: 24%;
    width: 30px;
    height: 9px;
    border: 2px solid #2b313b;
    border-radius: 4px;
    background: linear-gradient(#e7edf4, #aeb6c2);
    transform: translateX(-50%);
    box-shadow: 0 2px 0 rgba(20, 24, 32, 0.35);
}

.garage-reward.is-open .garage-door {
    transform: translateY(-108%);
}

.garage-reward.is-open .garage-confetti,
.garage-reward.is-open .garage-stamp {
    animation-play-state: running;
}

@keyframes garage-confetti-fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(150px) rotate(220deg); opacity: 0.15; }
}

@keyframes garage-stamp-pop {
    from { transform: translate(-50%, -50%) scale(0.92); }
    to { transform: translate(-50%, -46%) scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
    .garage-door,
    .garage-confetti,
    .garage-stamp {
        animation: none;
        transition: none;
    }

    .garage-reward.is-open .garage-door {
        transform: translateY(-108%);
    }

    .release-fireworks.is-firing .release-spark {
        animation: none;
        opacity: 0;
    }

    .release-badge-wrap:has(.is-firing) .release-badge {
        outline: 2px solid var(--amber);
        outline-offset: 2px;
    }
}

.file-toolbar,
.action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.action-row {
    align-items: flex-end;
    min-height: 52px;
    margin-top: 22px;
}

.file-toolbar {
    margin-top: 28px;
}

.file-toolbar h2 {
    margin-bottom: 4px;
    font-size: 18px;
}

.file-toolbar p,
.progress-text {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 13px;
}

.check-progress {
    display: grid;
    gap: 12px;
    flex: 1;
    min-width: min(100%, 420px);
    padding: 14px 16px;
    border: 1px solid var(--accent-line);
    border-radius: 16px;
    background: var(--blue-soft);
}

.check-progress[hidden] {
    display: none;
}

.check-progress.is-complete {
    border-color: var(--success-line);
    background: var(--green-soft);
}

.check-progress.is-error {
    border-color: var(--error-line);
    background: var(--error-soft);
}

.check-progress-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.check-spinner {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border: 2.5px solid var(--accent-line);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: check-spin 0.75s linear infinite;
}

.check-progress.is-complete .check-spinner,
.check-progress.is-error .check-spinner {
    display: none;
}

.check-progress-copy {
    min-width: 0;
}

.progress-text {
    color: var(--ink);
    font-size: 14px;
    font-weight: 750;
}

.progress-detail {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.check-progress-track {
    overflow: hidden;
    height: 6px;
    border-radius: 999px;
    background: var(--surface);
}

.check-progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: var(--blue);
    transition: width 0.45s ease;
}

.check-progress.is-complete .check-progress-bar {
    background: var(--green);
}

.check-progress.is-error .check-progress-bar {
    background: var(--red);
}

.check-progress-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.check-progress-steps li {
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.3;
}

.check-progress-steps li.is-active {
    border-color: var(--blue);
    color: var(--blue);
    box-shadow: 0 0 0 2px var(--focus-ring);
}

.check-progress-steps li.is-done {
    border-color: var(--success-line);
    background: var(--success-surface);
    color: var(--green);
}

.check-progress.is-error .check-progress-steps li.is-active {
    border-color: var(--error-line);
    color: var(--red);
    box-shadow: none;
}

.workspace-card.is-checking .drop-zone,
.workspace-card.is-checking .file-item .remove-file {
    pointer-events: none;
    opacity: 0.55;
}

@keyframes check-spin {
    to {
        transform: rotate(360deg);
    }
}

.text-button {
    border: 0;
    background: transparent;
    color: var(--blue);
    font-weight: 750;
}

.file-list {
    display: grid;
    gap: 9px;
    margin-top: 16px;
}

.file-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
}

.file-type {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 11px;
    font-weight: 900;
}

.file-name {
    overflow: hidden;
    margin-bottom: 3px;
    font-size: 14px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.remove-file {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: 20px;
}

.remove-file:hover {
    background: var(--error-soft);
    color: var(--red);
}

.results-section {
    margin-top: 44px;
}

.section-heading h2 {
    margin-bottom: 8px;
    font-size: 32px;
    letter-spacing: -0.03em;
}

.section-heading > p:last-child {
    color: var(--muted);
}

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

.result-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: var(--surface);
}

.result-card.success {
    border-color: var(--success-line);
}

.result-card.warning {
    border-color: var(--warning-line);
}

.result-kicker {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.result-card h3 {
    margin: 0 0 7px;
    font-size: 18px;
}

.result-card p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.result-filename {
    overflow-wrap: anywhere;
    color: var(--ink) !important;
    font-weight: 700;
}

.request-summary {
    margin-top: 22px;
    padding: clamp(22px, 4vw, 34px);
    border: 1px solid var(--accent-line);
    border-radius: 22px;
    background: linear-gradient(135deg, var(--blue-soft), var(--surface-translucent));
}

.request-summary-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.request-summary-heading h2 {
    margin-bottom: 0;
    font-size: 30px;
    letter-spacing: -0.03em;
}

.composition-badge {
    padding: 9px 12px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green);
    font-size: 12px;
    font-weight: 800;
}

.composition-badge.warning {
    background: var(--amber-soft);
    color: var(--amber);
}

.request-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 24px 0 0;
}

.request-facts > div {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--detail-line);
    border-radius: 14px;
    background: var(--surface-muted-translucent);
}

.request-facts .wide-fact {
    grid-column: 1 / -1;
}

.request-facts dt {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.request-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 16px;
    font-weight: 800;
}

.support-details {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--detail-line);
}

.support-details summary {
    cursor: pointer;
    color: var(--blue);
    font-size: 13px;
    font-weight: 800;
}

.support-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 14px;
}

.support-list span {
    padding: 6px 9px;
    border: 1px solid var(--detail-line);
    border-radius: 8px;
    background: var(--surface);
    font-family: "Cascadia Code", Consolas, monospace;
    font-size: 12px;
}

.verification-section {
    margin-top: 22px;
    padding: clamp(22px, 4vw, 34px);
    border: 1px solid var(--accent-line);
    border-radius: 22px;
    background: var(--surface);
}

.verification-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.verification-heading h2 {
    margin-bottom: 8px;
    font-size: 30px;
    letter-spacing: -0.03em;
}

.verification-heading > div > p:last-child {
    margin-bottom: 0;
    color: var(--muted);
}

.verification-badge {
    flex: 0 0 auto;
    padding: 9px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.verification-badge.success {
    background: var(--green-soft);
    color: var(--green);
}

.verification-badge.warning {
    background: var(--amber-soft);
    color: var(--amber);
}

.verification-badge.error {
    background: var(--error-soft);
    color: var(--red);
}

.verification-counts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 24px 0;
}

.verification-counts > div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
}

.verification-counts dt {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.verification-counts dd {
    margin: 0;
    font-size: 24px;
    font-weight: 850;
}

.verification-checks {
    display: grid;
    gap: 10px;
}

.verification-filter-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: -6px 0 18px;
}

.verification-filter-button[aria-pressed="true"] {
    background: var(--blue);
    color: white;
    box-shadow: 0 0 0 1px var(--blue);
}

.verification-filter-empty {
    margin: 0;
    padding: 18px;
    border: 1px solid var(--success-line);
    border-radius: 14px;
    background: var(--success-surface);
    color: var(--green);
    font-weight: 750;
    text-align: center;
}

.verification-check-group {
    margin: 16px 0 2px;
    color: var(--blue);
    font-size: 13px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.verification-check-group:first-child {
    margin-top: 0;
}

.verification-check {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 13px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.verification-check.has-ack {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
}

.verification-check.is-acknowledged {
    box-shadow: inset -5px 0 0 var(--ack-green);
}

.verification-check.success {
    border-color: var(--success-line);
    background: var(--success-surface);
}

.verification-check.warning {
    border-color: var(--warning-line);
    background: var(--warning-surface);
}

.verification-check.error {
    border-color: var(--error-line);
    background: var(--error-surface);
}

.check-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--green-soft);
    color: var(--green);
    font-weight: 900;
}

.verification-check.warning .check-icon {
    background: var(--amber-soft);
    color: var(--amber);
}

.verification-check.error .check-icon {
    background: var(--error-soft);
    color: var(--red);
}

.verification-check h3 {
    margin: 1px 0 4px;
    font-size: 15px;
}

.verification-check p,
.verification-check li {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.verification-check details {
    margin-top: 8px;
}

.verification-check summary {
    cursor: pointer;
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
}

.notice-inventory-list {
    overflow-wrap: anywhere;
}

.verification-check ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.issue-ack {
    display: grid;
    place-items: start;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.issue-ack-box {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 2px solid color-mix(in srgb, var(--ink) 18%, var(--line));
    border-radius: 8px;
    background: var(--surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.issue-ack:hover .issue-ack-box,
.issue-ack:focus-visible .issue-ack-box {
    border-color: var(--ack-green);
    box-shadow: 0 0 0 4px var(--ack-green-soft);
}

.issue-ack:focus-visible {
    outline: none;
}

.issue-ack[aria-pressed="true"] .issue-ack-box {
    border-color: var(--ack-green);
    background: var(--ack-green);
    box-shadow: 0 10px 18px var(--ack-green-shadow);
}

.issue-ack-mark {
    width: 18px;
    height: 18px;
    overflow: visible;
    fill: none;
    stroke: white;
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
    transform: scale(0.45);
    transform-origin: center;
}

.issue-ack[aria-pressed="true"] .issue-ack-mark {
    opacity: 1;
    transform: scale(1);
}

.issue-ack-mark path {
    stroke-dasharray: 28;
    stroke-dashoffset: 28;
}

.issue-ack[aria-pressed="true"] .issue-ack-mark path {
    stroke-dashoffset: 0;
}

.issue-ack.is-popping[aria-pressed="true"] .issue-ack-box {
    animation: issue-ack-box-pop 420ms cubic-bezier(0.2, 1.4, 0.35, 1);
}

.issue-ack.is-popping[aria-pressed="true"] .issue-ack-mark {
    animation: issue-ack-mark-pop 420ms cubic-bezier(0.2, 1.4, 0.35, 1);
}

.issue-ack.is-popping[aria-pressed="true"] .issue-ack-mark path {
    animation: issue-ack-draw 380ms ease-out forwards;
}

@keyframes issue-ack-box-pop {
    0% { transform: scale(0.82); }
    55% { transform: scale(1.16); }
    100% { transform: scale(1); }
}

@keyframes issue-ack-mark-pop {
    0% { opacity: 0; transform: scale(0.2) rotate(-18deg); }
    60% { opacity: 1; transform: scale(1.22) rotate(6deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes issue-ack-draw {
    from { stroke-dashoffset: 28; }
    to { stroke-dashoffset: 0; }
}

.check-sources {
    margin-top: 9px;
    padding: 9px 11px;
    border-left: 3px solid currentColor;
    border-radius: 6px;
    background: color-mix(in srgb, currentColor 6%, transparent);
    color: var(--muted);
    font-size: 12px;
}

.check-sources strong {
    display: block;
    color: var(--ink);
}

.check-sources-hint {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.check-sources .check-source-list {
    display: grid;
    gap: 6px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.check-sources .check-source-item {
    display: grid;
    gap: 4px;
    padding: 7px 8px;
    border: 1px solid color-mix(in srgb, currentColor 16%, var(--line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.check-sources .check-source-heading {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.check-sources .check-source-role {
    flex: 0 0 auto;
    padding: 1px 7px;
    border: 1px solid color-mix(in srgb, var(--blue) 45%, var(--line));
    border-radius: 6px;
    background: var(--blue-soft);
    color: var(--ink);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.check-sources .check-source-file {
    overflow: hidden;
    color: var(--ink);
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.check-sources .check-source-place {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.check-sources .check-source-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--blue) 12%, var(--surface));
    color: var(--ink);
    font-size: 11px;
    font-weight: 700;
}

.check-sources .check-source-chip.is-paragraph {
    background: color-mix(in srgb, var(--muted) 16%, var(--surface));
}

.check-sources .check-source-note {
    line-height: 1.45;
}

.check-sources-more {
    margin-top: 8px;
}

.check-sources-more .check-source-list {
    margin-top: 8px;
}

/* Пояснение «почему это ошибка и что сделать». */
.verification-check .check-hint {
    margin-top: 9px;
    padding: 8px 11px;
    border: 1px dashed color-mix(in srgb, currentColor 30%, var(--line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.verification-check .check-hint summary {
    color: var(--ink);
}

.check-hint-body {
    display: grid;
    gap: 6px;
    margin-top: 7px;
}

.verification-check .check-hint-body p {
    margin: 0;
    color: var(--ink);
    font-size: 12.5px;
    line-height: 1.5;
}

.check-hint-body strong {
    color: var(--muted);
    font-weight: 800;
}

.vor-source-cell {
    white-space: pre-line;
    font-weight: 650;
    line-height: 1.45;
}

.vor-input-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin: 24px 0;
}

.vor-input-summary > div {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
}

.vor-input-summary dt {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.vor-input-summary dd {
    margin: 0;
    font-size: 19px;
    font-weight: 850;
}

.vor-final-table {
    margin: 0 0 24px;
    padding: 16px 18px 18px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface-soft);
}

.vor-final-table-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.vor-final-table-heading h3 {
    margin: 0 0 6px;
    font-size: 16px;
}

.vor-final-table-heading p {
    max-width: 820px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.vor-final-table .vor-table-wrapper {
    margin-top: 14px;
}

.vor-final-copy-table {
    min-width: 1480px;
}

.vor-final-copy-table th {
    text-transform: none;
    letter-spacing: 0;
    white-space: normal;
    line-height: 1.35;
}

.vor-final-copy-table td:nth-child(n+3):nth-child(-n+10) {
    font-size: 16px;
    font-weight: 850;
}

.vor-final-table-status {
    margin: 10px 0 0;
    color: var(--blue);
    font-size: 13px;
    font-weight: 750;
}

.vor-final-table-status.is-error {
    color: var(--red);
}

.vor-verification-sections {
    display: grid;
    gap: 12px;
}

.vor-section-card {
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 15px;
}

.vor-section-card.success {
    border-color: var(--success-line);
    background: var(--success-surface);
}

.vor-section-card.error {
    border-color: var(--error-line);
    background: var(--error-surface);
}

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

.vor-section-heading h3 {
    margin: 0;
    font-size: 16px;
}

.vor-section-heading span {
    flex: 0 0 auto;
    padding: 6px 9px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green);
    font-size: 12px;
    font-weight: 800;
}

.vor-section-card.error .vor-section-heading span {
    background: var(--error-soft);
    color: var(--red);
}

.vor-section-card details {
    margin-top: 12px;
}

.vor-section-card summary {
    cursor: pointer;
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
}

.vor-table-wrapper {
    overflow-x: auto;
    margin-top: 12px;
}

.vor-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    background: var(--surface);
    font-size: 12px;
}

.vor-table th,
.vor-table td {
    padding: 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.vor-table th {
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.vor-table tr.error td {
    background: var(--error-table);
    color: var(--red);
    font-weight: 700;
}

.vor-table tr.is-acknowledged td {
    box-shadow: inset -4px 0 0 var(--ack-green);
}

.vor-table th.issue-ack-cell,
.vor-table td.issue-ack-cell {
    width: 44px;
    padding: 8px 10px 8px 4px;
    text-align: center;
    vertical-align: middle;
}

.vor-table td.issue-ack-cell .issue-ack {
    place-items: center;
    margin: 0 auto;
}

@media (max-width: 980px) {
    .vor-input-grid,
    .vor-input-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .page-shell {
        width: min(100% - 20px, 1120px);
        padding-top: 30px;
    }

    .report-section {
        align-items: stretch;
        flex-direction: column;
    }

    .hero,
    .file-toolbar,
    .action-row {
        align-items: stretch;
        flex-direction: column;
    }

    .hero {
        gap: 20px;
    }

    .hero-side,
    .hero-actions {
        align-self: stretch;
        align-items: stretch;
    }

    .hero-side {
        align-items: stretch;
    }

    .manual-downloads {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

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

    .fields-grid,
    .result-grid,
    .request-facts,
    .verification-counts,
    .vor-input-grid,
    .vor-input-summary {
        grid-template-columns: 1fr;
    }

    .request-summary-heading,
    .verification-heading {
        align-items: stretch;
        grid-template-columns: auto 1fr;
    }

    .request-summary-heading {
        display: flex;
        flex-direction: column;
    }

    .verification-heading {
        flex-direction: column;
    }

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

    .vor-input-heading,
    .vor-final-table-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .request-facts .wide-fact {
        grid-column: auto;
    }

    .drop-zone {
        min-height: 260px;
        padding: 28px 18px;
    }

    .primary-button {
        width: 100%;
    }

    .scroll-top-button {
        left: 12px;
        bottom: 16px;
        width: 92px;
        height: 92px;
        border-radius: 24px;
        font-size: 44px;
    }

    .garage-reward {
        top: 8px;
        right: 8px;
        width: 140px;
        height: 253px;
    }

    .check-scope {
        top: 8px;
        width: 140px;
    }

    .check-scope[open] {
        width: min(26rem, calc(100vw - 12px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-top-button {
        transition: none;
    }

    .check-scope {
        transition: none;
    }

    .check-spinner {
        animation: none;
        border-top-color: var(--blue);
        opacity: 0.85;
    }

    .check-progress-bar {
        transition: none;
    }

    .issue-ack-box,
    .issue-ack-mark,
    .issue-ack-mark path {
        transition: none;
        animation: none !important;
    }

    .issue-ack[aria-pressed="true"] .issue-ack-mark path {
        stroke-dashoffset: 0;
    }
}

/* Вход, панель пользователя, журнал и администрирование */

.auth-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
}

.auth-shell {
    width: min(460px, calc(100% - 32px));
    padding: 40px 0;
}

.auth-card {
    display: grid;
    gap: 22px;
    padding: clamp(24px, 5vw, 40px);
    border: 1px solid var(--workspace-line);
    border-radius: 26px;
    background: var(--surface-translucent);
    box-shadow: var(--shadow);
}

.auth-brand h1 {
    margin: 0 0 8px;
    font-size: 30px;
    letter-spacing: -0.02em;
}

.auth-brand h1 span {
    color: var(--blue);
}

.auth-brand .eyebrow {
    margin: 0;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-form h2 {
    margin: 0;
    font-size: 19px;
}

.auth-form label {
    display: grid;
    gap: 7px;
}

.auth-form label span {
    font-size: 13px;
    font-weight: 800;
}

.auth-form input {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid var(--field-line);
    border-radius: 12px;
    outline: none;
    background: var(--surface);
    color: var(--ink);
    font-size: 16px;
}

.auth-form input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.auth-submit {
    margin-top: 4px;
    width: 100%;
}

.auth-hint {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.auth-message {
    margin: 0;
    padding: 13px 15px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
}

.auth-message.is-error {
    border: 1px solid var(--error-line);
    background: var(--error-surface);
    color: var(--red);
}

.auth-message.is-info {
    border: 1px solid var(--success-line);
    background: var(--success-surface);
    color: var(--green);
}

.auth-footer {
    display: flex;
    justify-content: center;
    padding-top: 4px;
    border-top: 1px solid var(--line);
}

.user-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
}

.user-bar > :not([hidden]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    text-decoration: none;
}

.user-bar > [hidden] {
    display: none;
}

.user-name {
    font-size: 13px;
    font-weight: 800;
}

.gis-lookup-section {
    margin-top: 28px;
}

.gis-lookup-section .auth-message {
    margin-top: 16px;
}

.gis-lookup-result {
    margin-top: 22px;
}

.history-section {
    margin-top: 28px;
}

.history-search {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.history-search-label {
    display: grid;
    gap: 6px;
    flex: 1 1 220px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.history-search-label input {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--field-line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
}

.history-search-label input:focus {
    outline: 3px solid var(--focus-ring);
    border-color: var(--blue);
}

.history-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.history-item {
    display: grid;
    gap: 8px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.history-item.success {
    border-left-color: var(--green);
}

.history-item.warning {
    border-left-color: var(--amber);
}

.history-item.error {
    border-left-color: var(--red);
}

.history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.history-head h3 {
    margin: 0;
    font-size: 16px;
}

.history-meta {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.history-item .text-button {
    justify-self: start;
    padding: 0;
    text-align: left;
    text-decoration: none;
}

.history-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.history-pagination[hidden] {
    display: none;
}

.history-page-label {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
    text-align: center;
}

.status-pill {
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.status-pill.success {
    background: var(--green-soft);
    color: var(--green);
}

.status-pill.warning {
    background: var(--amber-soft);
    color: var(--amber);
}

.status-pill.error {
    background: var(--error-soft);
    color: var(--red);
}

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

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

.metric-card {
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
}

.metric-label {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.metric-value {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.metric-detail {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.admin-tab {
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    transition: 150ms ease;
}

.admin-tab[aria-selected="true"] {
    border-color: transparent;
    background: var(--blue);
    color: white;
    box-shadow: 0 8px 20px var(--accent-shadow);
}

.admin-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 14px;
    margin-bottom: 22px;
}

.admin-form label {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.admin-form label span {
    font-size: 12px;
    font-weight: 800;
}

.admin-form input,
.admin-form select,
.admin-filters select,
.admin-filters input {
    min-width: 0;
    width: 100%;
    min-height: 44px;
    padding: 11px 12px;
    border: 1px solid var(--field-line);
    border-radius: 10px;
    outline: none;
    background: var(--surface);
    color: var(--ink);
    font-size: 15px;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-filters select:focus,
.admin-filters input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.admin-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.controller-record-query {
    flex: 1 1 280px;
    min-width: min(100%, 280px);
}

.controller-record-input {
    width: 100%;
    min-width: 140px;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--field-line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
}

.admin-filters select,
.admin-filters input {
    width: auto;
    min-width: 170px;
}

.credentials-notice {
    margin-bottom: 24px;
    padding: 16px 18px;
    border: 1px solid var(--warning-line);
    border-radius: 14px;
    background: var(--warning-surface);
}

.credentials-notice p {
    margin: 0 0 6px;
    font-size: 14px;
}

.credentials-text {
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 15px;
    font-weight: 700;
    user-select: all;
}

.admin-table-wrapper {
    overflow-x: auto;
    margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

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

.admin-table th {
    background: var(--surface-soft);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

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

.admin-table select,
.inline-input {
    min-height: 36px;
    min-width: 120px;
    padding: 7px 9px;
    border: 1px solid var(--field-line);
    border-radius: 8px;
    outline: none;
    background: var(--surface);
    color: var(--ink);
    font-size: 13px;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
}

.row-actions .text-button {
    padding: 0;
    font-size: 13px;
    white-space: nowrap;
}

.logs-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.log-entry {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.log-entry.warning {
    border-left-color: var(--amber);
    background: var(--warning-surface);
}

.log-entry.error,
.log-entry.critical {
    border-left-color: var(--red);
    background: var(--error-surface);
}

.log-meta {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.log-text {
    margin: 6px 0 0;
    font-size: 14px;
}

.log-extra {
    margin: 8px 0 0;
    overflow-x: auto;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--surface-soft);
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 12px;
}

.reference-admin-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.reference-admin-card {
    display: grid;
    gap: 8px;
    align-content: start;
    padding: 18px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
}

.reference-admin-card.ready {
    border-left-color: var(--green);
}

.reference-admin-card.warning {
    border-left-color: var(--amber);
}

.reference-admin-card.error,
.reference-admin-card.missing {
    border-left-color: var(--red);
}

.reference-admin-card h3 {
    margin: 0;
    font-size: 15px;
}

.reference-admin-card h4 {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.reference-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}

.reference-upload-label {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    cursor: pointer;
}

.reference-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.reference-admin-backups {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.reference-admin-backup {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
}

.reference-admin-backup p {
    margin: 0;
}

.reference-admin-backup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Страница MnogoMoney: расчёт по КС */

.summary-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 24px 0;
}

.summary-metrics > div {
    min-width: 0;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
}

.summary-metrics dt {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.summary-metrics dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 25px;
    font-weight: 850;
    letter-spacing: -0.02em;
}

.summary-metrics dd span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0;
}

.vor-table th.numeric-cell,
.vor-table td.numeric-cell {
    text-align: right;
    white-space: nowrap;
}

.vor-table td.inventory-cell {
    font-family: "Cascadia Code", Consolas, monospace;
    font-weight: 700;
    white-space: nowrap;
}

.admin-database-panel {
    margin-bottom: 22px;
}

.perechen-step {
    margin-top: 32px;
}

#uploadWorkspace .drop-zone {
    min-height: 180px;
    margin-top: 16px;
}

.admin-database-hint {
    margin: 8px 0 0;
    max-width: 48rem;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.admin-database-hint strong {
    color: var(--ink);
    font-family: "Cascadia Code", Consolas, monospace;
    font-weight: 750;
}

.admin-database-panel .auth-message {
    margin-top: 16px;
}

.contractor-database-list {
    display: grid;
    gap: 10px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.contractor-database-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
}

.contractor-database-item h3 {
    margin: 0;
    font-size: 16px;
}

.contractor-database-item .secondary-button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.contractor-database-status {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 1000px) {
    .admin-metrics,
    .admin-form,
    .reference-admin-list,
    .summary-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .admin-metrics,
    .admin-form,
    .reference-admin-list,
    .summary-metrics {
        grid-template-columns: 1fr;
    }

    .admin-filters select,
    .admin-filters input {
        width: 100%;
    }

    .user-bar {
        justify-content: flex-start;
    }

    .contractor-database-item {
        align-items: stretch;
        flex-direction: column;
    }

    .history-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}

.support-dialog {
    width: min(32rem, calc(100% - 32px));
    padding: 24px 24px 20px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow);
}

.support-dialog::backdrop {
    background: rgba(18, 24, 38, 0.46);
}

.support-dialog h2 {
    margin: 0 0 10px;
    font-size: 22px;
    letter-spacing: -0.03em;
}

.support-dialog p {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.support-field {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 750;
}

.support-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--field-line);
    border-radius: 14px;
    background: var(--surface-soft);
    color: var(--ink);
    font-weight: 500;
    resize: vertical;
    min-height: 8.5rem;
}

.support-field textarea:focus {
    outline: 2px solid var(--focus-ring);
    border-color: var(--blue);
}

.support-dialog .auth-message {
    margin: 0 0 14px;
}

.support-dialog-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.support-inbox-button {
    position: fixed;
    z-index: 40;
    right: 20px;
    bottom: 28px;
    display: grid;
    place-items: center;
    width: 100px;
    height: 100px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--surface-translucent);
    color: var(--blue);
    box-shadow: var(--shadow);
    cursor: pointer;
    backdrop-filter: blur(12px);
}

.support-inbox-button svg {
    width: 68px;
    height: 68px;
}

.support-inbox-button:hover {
    border-color: var(--blue);
    background: var(--blue);
    color: white;
    transform: translateY(-2px);
}

.support-inbox-button:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

.support-inbox-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #e5484d;
    color: white;
    font-size: 11px;
    font-weight: 800;
    line-height: 22px;
    text-align: center;
}

.support-inbox-panel {
    position: fixed;
    z-index: 45;
    top: 16px;
    right: 20px;
    bottom: 140px;
    display: flex;
    flex-direction: column;
    width: min(26rem, calc(100vw - 32px));
    max-height: none;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow);
}

.support-inbox-compose {
    overflow: auto;
}

.support-inbox-compose h2 {
    display: none;
}

.support-inbox-compose p {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.support-back-button {
    justify-self: start;
    margin: 0 0 8px;
}

.support-inbox-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 8px;
}

.support-inbox-head h2 {
    margin: 0;
    font-size: 18px;
}

.support-inbox-tabs {
    display: flex;
    gap: 8px;
    padding: 0 16px 10px;
}

.support-inbox-tab {
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--ink);
    font-weight: 700;
    cursor: pointer;
}

.support-inbox-tab[aria-selected="true"] {
    border-color: var(--blue);
    background: var(--blue);
    color: white;
}

.support-inbox-pane {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    padding: 0 16px 16px;
}

.support-inbox-meta,
.support-inbox-empty {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.support-chat-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    min-height: 12rem;
    max-height: 18rem;
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
}

.support-chat-row {
    max-width: 92%;
    padding: 8px 10px;
    border-radius: 14px;
    background: var(--surface);
}

.support-chat-row.is-admin {
    align-self: flex-start;
}

.support-chat-row.is-user {
    align-self: flex-end;
    background: color-mix(in srgb, var(--blue) 14%, var(--surface));
}

.support-chat-who {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.support-chat-body {
    margin: 0;
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.45;
}

.support-chat-form {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.support-chat-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--field-line);
    border-radius: 14px;
    background: var(--surface-soft);
    color: var(--ink);
    resize: vertical;
}

.support-history-list {
    display: grid;
    gap: 8px;
    max-height: 24rem;
    overflow: auto;
}

.support-history-item {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.support-history-item.is-active,
.support-history-item:hover {
    border-color: var(--blue);
}

.support-history-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
}

.support-history-preview,
.support-history-meta {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.support-history-unread {
    min-width: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #e5484d;
    color: white;
    font-size: 11px;
    line-height: 20px;
    text-align: center;
}

.support-admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.support-admin-layout .admin-table-wrapper {
    min-width: 0;
}

.support-admin-layout .admin-table {
    min-width: 920px;
}

.support-admin-chat {
    position: static;
    display: flex;
    flex-direction: column;
    min-height: 16rem;
    margin: 2px 0 4px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
}

.admin-table tbody tr.is-open-ticket td {
    background: color-mix(in srgb, var(--blue) 12%, var(--surface));
    border-bottom-color: transparent;
}

.support-admin-chat-row td {
    padding: 0 12px 16px;
    background: var(--surface-soft);
    vertical-align: top;
}

.support-admin-chat[hidden] {
    display: none !important;
}

.support-admin-chat-head h3 {
    margin: 0 0 6px;
    font-size: 16px;
}

.support-admin-chat-head p {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 1000px) {
    .support-admin-layout {
        grid-template-columns: 1fr;
    }

    .support-admin-chat {
        position: static;
    }
}

@media (max-width: 760px) {
    .support-inbox-button,
    .support-inbox-panel {
        right: 12px;
    }

    .support-inbox-button {
        bottom: 16px;
        width: 92px;
        height: 92px;
        border-radius: 24px;
    }

    .support-inbox-button svg {
        width: 60px;
        height: 60px;
    }

    .support-inbox-panel {
        top: 12px;
        bottom: 120px;
    }
}
