:root {
    color-scheme: light;
    --ink-950: #0b1220;
    --ink-900: #111c2f;
    --ink-800: #1b2a41;
    --ink-700: #33445e;
    --ink-600: #52617a;
    --ink-500: #718096;
    --ink-300: #c9d2df;
    --ink-200: #dfe5ed;
    --ink-100: #edf1f6;
    --ink-50: #f6f8fb;
    --surface: #ffffff;
    --accent: #18b89b;
    --accent-strong: #0e967e;
    --accent-soft: #e7f8f4;
    --blue: #4f73f6;
    --blue-soft: #eef2ff;
    --warning: #e99a26;
    --warning-soft: #fff6e8;
    --danger: #dc5a68;
    --danger-soft: #fff0f2;
    --success: #1da77f;
    --success-soft: #e9f8f2;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 18px 45px rgba(15, 23, 42, 0.08);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --ink-950: #f5f8fc;
    --ink-900: #e8edf5;
    --ink-800: #d5deea;
    --ink-700: #b8c4d4;
    --ink-600: #96a5b8;
    --ink-500: #7f8fa4;
    --ink-300: #405068;
    --ink-200: #303f54;
    --ink-100: #233044;
    --ink-50: #151f2e;
    --surface: #101927;
    --accent: #31c9ac;
    --accent-strong: #65dfc7;
    --accent-soft: #173b38;
    --blue: #7d9bff;
    --blue-soft: #202e4b;
    --warning: #f1b755;
    --warning-soft: #3c301d;
    --danger: #f08391;
    --danger-soft: #3e252d;
    --success: #43c99e;
    --success-soft: #193b33;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 20px 52px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--ink-50);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink-900);
    background:
        radial-gradient(circle at 8% 0%, rgba(79, 115, 246, 0.07), transparent 24rem),
        radial-gradient(circle at 92% 8%, rgba(24, 184, 155, 0.08), transparent 25rem),
        var(--ink-50);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(11, 18, 32, 0.94);
    box-shadow: 0 8px 30px rgba(11, 18, 32, 0.12);
    backdrop-filter: blur(18px);
}

.app-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1240px, calc(100% - 40px));
    min-height: 72px;
    margin: 0 auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.brand:hover {
    color: #fff;
}

.brand__mark {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(145deg, #22c5a5, #3d72ed);
    box-shadow: 0 8px 24px rgba(24, 184, 155, 0.24);
}

.brand__mark svg {
    width: 21px;
    height: 21px;
}

.brand__copy {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand__title {
    font-size: 15px;
    font-weight: 720;
    letter-spacing: -0.01em;
}

.brand__subtitle {
    margin-top: 4px;
    color: #93a4bc;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.account-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle {
    display: inline-grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 11px;
    color: #b5c1d2;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.theme-toggle:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    background: rgba(255, 255, 255, 0.11);
    transform: translateY(-1px);
}

.theme-toggle:focus-visible {
    outline: 3px solid rgba(49, 201, 172, 0.28);
    outline-offset: 2px;
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.theme-toggle__sun,
html[data-theme="dark"] .theme-toggle__moon {
    display: none;
}

html[data-theme="dark"] .theme-toggle__sun {
    display: block;
}

.theme-toggle--floating {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 20;
}

.account-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px 7px 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: #dfe7f2;
    background: rgba(255, 255, 255, 0.06);
    font-size: 13px;
    font-weight: 600;
}

.account-pill__avatar {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border-radius: 50%;
    color: var(--ink-950);
    background: #9fe8d8;
    font-size: 12px;
    font-weight: 800;
}

.logout-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 11px;
    border-radius: 10px;
    color: #9eacc0;
    text-decoration: none;
    transition: 160ms ease;
}

.logout-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.logout-link svg {
    width: 17px;
    height: 17px;
}

.app-main {
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
    padding: 42px 0 64px;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 28px;
}

.page-heading__copy {
    max-width: 680px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.eyebrow::before {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 5px rgba(24, 184, 155, 0.12);
    content: "";
}

.page-title {
    margin: 0;
    color: var(--ink-950);
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 760;
    letter-spacing: -0.045em;
    line-height: 1.08;
}

.page-description {
    max-width: 620px;
    margin: 12px 0 0;
    color: var(--ink-600);
    font-size: 16px;
}

.stepper {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 6px;
    border: 1px solid var(--ink-200);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow-sm);
}

.stepper__item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    border-radius: 9px;
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.stepper__item.is-active {
    color: var(--ink-950);
    background: var(--accent-soft);
}

.stepper__number {
    display: grid;
    width: 21px;
    height: 21px;
    place-items: center;
    border: 1px solid var(--ink-200);
    border-radius: 7px;
    background: var(--surface);
    font-size: 10px;
}

.stepper__item.is-active .stepper__number {
    border-color: var(--accent);
    color: #fff;
    background: var(--accent);
}

.stepper__item.is-complete {
    color: var(--accent-strong);
}

.stepper__item.is-complete .stepper__number {
    border-color: #bfe8de;
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.surface-card {
    overflow: hidden;
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-md);
}

.surface-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 26px 28px 22px;
    border-bottom: 1px solid var(--ink-100);
}

.surface-card__title {
    margin: 0;
    color: var(--ink-950);
    font-size: 19px;
    font-weight: 740;
    letter-spacing: -0.025em;
}

.surface-card__description {
    margin: 6px 0 0;
    color: var(--ink-500);
    font-size: 13px;
}

.surface-card__body {
    padding: 28px;
}

.section-block + .section-block {
    margin-top: 30px;
    padding-top: 28px;
    border-top: 1px solid var(--ink-100);
}

.section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.section-label__number {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 9px;
    color: var(--blue);
    background: var(--blue-soft);
    font-size: 11px;
    font-weight: 800;
}

.section-label__text {
    color: var(--ink-800);
    font-size: 14px;
    font-weight: 760;
}

.form-label {
    margin-bottom: 7px;
    color: var(--ink-700);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.01em;
}

.form-label.required::after {
    margin-left: 3px;
    color: var(--danger);
    content: "*";
}

.form-control,
.form-select {
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
    color: var(--ink-900);
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
    font-size: 14px;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.form-control:hover,
.form-select:hover {
    border-color: var(--ink-300);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(24, 184, 155, 0.12);
}

.form-control::placeholder {
    color: #98a4b5;
}

.form-control[type="file"] {
    min-height: 52px;
    padding: 5px;
    color: var(--ink-500);
    background: var(--ink-50);
}

.form-control[type="file"]::file-selector-button {
    height: 40px;
    margin-right: 12px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: var(--ink-800);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 150ms ease;
}

.form-control[type="file"]::file-selector-button:hover {
    background: var(--ink-950);
}

.form-text {
    margin-top: 7px;
    color: var(--ink-500);
    font-size: 12px;
}

.form-text code {
    padding: 2px 5px;
    border: 1px solid #d8e0ee;
    border-radius: 5px;
    color: #3f5bb7;
    background: #f3f6ff;
    font-size: 11px;
}

.field-errors,
.errorlist {
    margin: 7px 0 0;
    padding: 0;
    color: var(--danger);
    font-size: 12px;
    list-style: none;
}

.input-group-text {
    border-color: var(--ink-200);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    color: var(--ink-600);
    background: var(--ink-50);
    font-weight: 700;
}

.normalization-panel {
    padding: 20px;
    border: 1px solid #ccebe3;
    border-radius: var(--radius-md);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(231, 248, 244, 0.84)),
        var(--accent-soft);
}

.normalization-panel__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 17px;
}

.normalization-panel__icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    place-items: center;
    border-radius: 10px;
    color: var(--accent-strong);
    background: #d7f2eb;
}

.normalization-panel__icon svg {
    width: 18px;
    height: 18px;
}

.normalization-panel__title {
    margin: 0;
    color: #135f52;
    font-size: 14px;
    font-weight: 780;
}

.normalization-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 9px;
    color: #246e61;
    background: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.normalization-hint::before {
    flex-shrink: 0;
    color: var(--accent-strong);
    content: "→";
    font-weight: 900;
}

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

.setting-toggle {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    min-height: 66px;
    padding: 14px;
    border: 1px solid var(--ink-200);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.setting-toggle:hover {
    border-color: #b9c5d5;
    background: var(--ink-50);
    transform: translateY(-1px);
}

.setting-toggle .form-check-input {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin: 1px 0 0;
    border-color: #b8c3d2;
    box-shadow: none;
}

.setting-toggle .form-check-input:checked {
    border-color: var(--accent);
    background-color: var(--accent);
}

.setting-toggle__copy {
    display: flex;
    flex-direction: column;
}

.setting-toggle__title {
    color: var(--ink-800);
    font-size: 13px;
    font-weight: 720;
}

.setting-toggle__description {
    margin-top: 3px;
    color: var(--ink-500);
    font-size: 11px;
    line-height: 1.35;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--ink-100);
}

.form-actions__note {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-500);
    font-size: 11px;
}

.form-actions__note svg {
    width: 16px;
    height: 16px;
    color: var(--accent-strong);
}

.btn {
    min-height: 44px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 720;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding-right: 20px;
    padding-left: 20px;
    border-color: var(--accent);
    color: #fff;
    background: var(--accent);
    box-shadow: 0 10px 24px rgba(24, 184, 155, 0.2);
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: var(--accent-strong);
    background: var(--accent-strong);
    box-shadow: 0 13px 28px rgba(14, 150, 126, 0.25);
    transform: translateY(-1px);
}

.btn-primary svg {
    width: 17px;
    height: 17px;
}

.btn-outline-secondary {
    border-color: var(--ink-200);
    color: var(--ink-700);
    background: #fff;
}

.btn-outline-secondary:hover {
    border-color: var(--ink-300);
    color: var(--ink-950);
    background: var(--ink-50);
}

.side-panel {
    position: sticky;
    top: 98px;
    padding: 24px;
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.76);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
}

.side-panel__label {
    margin-bottom: 18px;
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.flow-list {
    display: grid;
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.flow-list__item {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 11px;
}

.flow-list__number {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid var(--ink-200);
    border-radius: 9px;
    color: var(--blue);
    background: #fff;
    font-size: 10px;
    font-weight: 800;
}

.flow-list__title {
    display: block;
    color: var(--ink-800);
    font-size: 13px;
    font-weight: 720;
}

.flow-list__description {
    display: block;
    margin-top: 3px;
    color: var(--ink-500);
    font-size: 11px;
    line-height: 1.45;
}

.privacy-note {
    display: flex;
    gap: 10px;
    margin-top: 22px;
    padding: 14px;
    border-radius: 12px;
    color: #3b5376;
    background: var(--blue-soft);
    font-size: 11px;
    line-height: 1.5;
}

.privacy-note svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--blue);
}

.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 8px 11px;
    border: 1px solid var(--ink-200);
    border-radius: 10px;
    color: var(--ink-700);
    background: #fff;
    box-shadow: var(--shadow-sm);
    font-size: 12px;
    font-weight: 700;
}

.file-chip svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--blue);
}

.file-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mapping-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px 16px;
}

.mapping-field {
    min-width: 0;
}

.required-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 8px;
    color: #3f5bb7;
    background: var(--blue-soft);
    font-size: 11px;
    font-weight: 750;
}

.required-badge::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--blue);
    content: "";
}

.preview-card {
    margin-top: 24px;
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.preview-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 19px 22px;
    border-bottom: 1px solid var(--ink-100);
}

.preview-card__title {
    margin: 0;
    color: var(--ink-900);
    font-size: 15px;
    font-weight: 740;
}

.preview-card__meta {
    color: var(--ink-500);
    font-size: 11px;
}

.preview-table {
    max-height: 460px;
    overflow: auto;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.preview-table table {
    min-width: 820px;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.preview-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--ink-200);
    color: var(--ink-600);
    background: #f7f9fc;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
}

.preview-table tbody td {
    max-width: 230px;
    padding: 11px 14px;
    overflow: hidden;
    border: 0;
    border-bottom: 1px solid var(--ink-100);
    color: var(--ink-700);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-table tbody tr:nth-child(even) td {
    background: #fafbfd;
}

.preview-table tbody tr:hover td {
    background: var(--accent-soft);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ink-600);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.back-link:hover {
    color: var(--ink-950);
}

.back-link svg {
    width: 16px;
    height: 16px;
}

.result-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
    gap: 24px;
    align-items: start;
}

.result-hero {
    overflow: hidden;
    border: 1px solid #bee9da;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-md);
}

.result-hero__top {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 30px;
    background:
        radial-gradient(circle at 90% 10%, rgba(24, 184, 155, 0.16), transparent 17rem),
        linear-gradient(135deg, #f5fffc, #fff);
}

.result-hero__icon {
    display: grid;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    place-items: center;
    border-radius: 15px;
    color: #fff;
    background: var(--success);
    box-shadow: 0 12px 26px rgba(29, 167, 127, 0.24);
}

.result-hero__icon svg {
    width: 25px;
    height: 25px;
}

.result-hero__eyebrow {
    color: var(--success);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.result-hero__title {
    margin: 5px 0 0;
    color: var(--ink-950);
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 770;
    letter-spacing: -0.04em;
}

.result-hero__text {
    margin: 8px 0 0;
    color: var(--ink-600);
    font-size: 13px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    border-top: 1px solid var(--ink-100);
    border-bottom: 1px solid var(--ink-100);
    background: var(--ink-100);
}

.stat-tile {
    padding: 24px 26px;
    background: #fff;
}

.stat-tile__label {
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 700;
}

.stat-tile__value {
    display: block;
    margin-top: 5px;
    color: var(--ink-950);
    font-size: 30px;
    font-weight: 780;
    letter-spacing: -0.04em;
    line-height: 1;
}

.stat-tile--success .stat-tile__value {
    color: var(--success);
}

.stat-tile--warning .stat-tile__value {
    color: var(--warning);
}

.stat-tile--blue .stat-tile__value {
    color: var(--blue);
}

.result-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 26px 30px 30px;
}

.result-actions .btn-primary {
    min-height: 50px;
}

.archive-panel {
    padding: 24px;
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-sm);
}

.archive-panel__title {
    margin: 0 0 16px;
    color: var(--ink-900);
    font-size: 14px;
    font-weight: 760;
}

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

.archive-list__item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px;
    border: 1px solid var(--ink-100);
    border-radius: 10px;
    background: #fff;
}

.archive-list__icon {
    display: grid;
    width: 31px;
    height: 31px;
    flex-shrink: 0;
    place-items: center;
    border-radius: 8px;
    color: var(--blue);
    background: var(--blue-soft);
}

.archive-list__icon svg {
    width: 15px;
    height: 15px;
}

.archive-list__name {
    display: block;
    color: var(--ink-800);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    font-weight: 700;
}

.archive-list__description {
    display: block;
    margin-top: 2px;
    color: var(--ink-500);
    font-size: 10px;
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 82% 14%, rgba(24, 184, 155, 0.13), transparent 24rem),
        var(--ink-950);
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(440px, 0.72fr);
    width: min(1080px, 100%);
    min-height: 650px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 36px 100px rgba(0, 0, 0, 0.32);
}

.login-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 48px;
    color: #fff;
    background:
        radial-gradient(circle at 82% 18%, rgba(53, 213, 183, 0.19), transparent 17rem),
        linear-gradient(150deg, #101c31, #0b1220);
}

.login-aside::after {
    position: absolute;
    right: -90px;
    bottom: -130px;
    width: 360px;
    height: 360px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 50%;
    box-shadow: 0 0 0 60px rgba(255, 255, 255, 0.025), 0 0 0 120px rgba(255, 255, 255, 0.015);
    content: "";
}

.login-aside__content {
    position: relative;
    z-index: 1;
    max-width: 430px;
    margin: auto 0;
}

.login-aside__eyebrow {
    color: #73d9c5;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.login-aside__title {
    margin: 13px 0 0;
    font-size: clamp(34px, 4vw, 50px);
    font-weight: 760;
    letter-spacing: -0.05em;
    line-height: 1.05;
}

.login-aside__text {
    max-width: 390px;
    margin: 18px 0 0;
    color: #a8b5c7;
    font-size: 14px;
}

.login-aside__status {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #a8b5c7;
    font-size: 11px;
}

.login-aside__status::before {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4cdbbd;
    box-shadow: 0 0 0 5px rgba(76, 219, 189, 0.12);
    content: "";
}

.login-main {
    display: grid;
    place-items: center;
    padding: 50px;
    background: #fff;
}

.login-card {
    width: min(360px, 100%);
}

.login-card__title {
    margin: 0;
    color: var(--ink-950);
    font-size: 29px;
    font-weight: 770;
    letter-spacing: -0.04em;
}

.login-card__text {
    margin: 8px 0 28px;
    color: var(--ink-500);
    font-size: 13px;
}

.login-card .btn-primary {
    width: 100%;
    min-height: 48px;
    margin-top: 8px;
}

.login-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 20px;
    color: var(--ink-500);
    font-size: 11px;
}

.login-note svg {
    width: 14px;
    height: 14px;
}

html[data-theme="dark"] body {
    background:
        radial-gradient(circle at 8% 0%, rgba(91, 126, 255, 0.11), transparent 25rem),
        radial-gradient(circle at 92% 8%, rgba(49, 201, 172, 0.1), transparent 26rem),
        #151f2e;
}

html[data-theme="dark"] .stepper,
html[data-theme="dark"] .surface-card,
html[data-theme="dark"] .setting-toggle,
html[data-theme="dark"] .side-panel,
html[data-theme="dark"] .file-chip,
html[data-theme="dark"] .preview-card,
html[data-theme="dark"] .result-hero,
html[data-theme="dark"] .stat-tile,
html[data-theme="dark"] .archive-panel,
html[data-theme="dark"] .archive-list__item {
    background: rgba(16, 25, 39, 0.96);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text {
    border-color: var(--ink-200);
    color: var(--ink-900);
    background-color: #121d2c;
}

html[data-theme="dark"] .form-control::placeholder {
    color: #718096;
}

html[data-theme="dark"] .form-control[type="file"] {
    color: var(--ink-600);
    background: #121d2c;
}

html[data-theme="dark"] .form-control[type="file"]::file-selector-button {
    color: #eef4fb;
    background: #2c3b50;
}

html[data-theme="dark"] .form-control[type="file"]::file-selector-button:hover {
    background: #3a4b63;
}

html[data-theme="dark"] .form-text code {
    border-color: #35465d;
    color: #9db2ff;
    background: #1b2942;
}

html[data-theme="dark"] .normalization-panel {
    border-color: #27544d;
    background: linear-gradient(135deg, rgba(21, 39, 48, 0.92), rgba(20, 54, 50, 0.9));
}

html[data-theme="dark"] .normalization-panel__icon {
    color: #7ce5d0;
    background: #214b44;
}

html[data-theme="dark"] .normalization-panel__title {
    color: #94ead9;
}

html[data-theme="dark"] .normalization-hint {
    color: #9bd8cb;
    background: rgba(8, 17, 27, 0.36);
}

html[data-theme="dark"] .setting-toggle:hover {
    border-color: #52647d;
    background: #182537;
}

html[data-theme="dark"] .btn-outline-secondary {
    border-color: var(--ink-200);
    color: var(--ink-700);
    background: #121d2c;
}

html[data-theme="dark"] .btn-outline-secondary:hover {
    border-color: var(--ink-300);
    color: var(--ink-950);
    background: #1a2739;
}

html[data-theme="dark"] .flow-list__number {
    background: #162234;
}

html[data-theme="dark"] .privacy-note {
    color: #a8b9da;
}

html[data-theme="dark"] .preview-table thead th {
    background: #172335;
}

html[data-theme="dark"] .preview-table tbody tr:nth-child(even) td {
    background: #121c2a;
}

html[data-theme="dark"] .preview-table tbody tr:hover td {
    background: #173530;
}

html[data-theme="dark"] .result-hero__top {
    background:
        radial-gradient(circle at 90% 10%, rgba(49, 201, 172, 0.14), transparent 17rem),
        linear-gradient(135deg, #13272a, #101927);
}

html[data-theme="dark"] .login-page {
    background:
        radial-gradient(circle at 82% 14%, rgba(49, 201, 172, 0.13), transparent 24rem),
        #090f1b;
}

html[data-theme="dark"] .login-shell,
html[data-theme="dark"] .login-main {
    background: #101927;
}

html[data-theme="dark"] .alert-success {
    border-color: #2c6658;
    color: #9be5d2;
}

html[data-theme="dark"] .alert-danger,
html[data-theme="dark"] .alert-error {
    border-color: #6a3944;
    color: #f3a2ad;
}

html[data-theme="dark"] .alert-warning {
    border-color: #6a5129;
    color: #f0c878;
}

.alert {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 13px 16px;
    border-radius: 12px;
    border-width: 1px;
    box-shadow: var(--shadow-sm);
    font-size: 13px;
}

.alert-success {
    border-color: #bee9da;
    color: #12654f;
    background: var(--success-soft);
}

.alert-danger,
.alert-error {
    border-color: #f1c9d0;
    color: #9d3442;
    background: var(--danger-soft);
}

.alert-warning {
    border-color: #f1d6a8;
    color: #8c5a13;
    background: var(--warning-soft);
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(11, 18, 32, 0.68);
    backdrop-filter: blur(10px);
}

.loading-overlay.active {
    display: flex;
}

.loading-dialog {
    width: min(420px, 100%);
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    color: #fff;
    background: var(--ink-900);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.loading-dialog .spinner-border {
    width: 40px;
    height: 40px;
    color: #57ddc2;
}

.loading-dialog__title {
    margin: 18px 0 5px;
    font-size: 17px;
    font-weight: 740;
}

.loading-dialog__text {
    margin: 0;
    color: #9eacc0;
    font-size: 12px;
}

@media (max-width: 991.98px) {
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 20px;
    }

    .side-panel {
        position: static;
    }

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

    .result-layout {
        grid-template-columns: 1fr;
    }

    .login-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .login-aside {
        min-height: 280px;
    }
}

@media (max-width: 767.98px) {
    .app-header__inner,
    .app-main {
        width: min(100% - 28px, 1240px);
    }

    .app-header__inner {
        min-height: 64px;
    }

    .brand__subtitle,
    .account-pill span:not(.account-pill__avatar) {
        display: none;
    }

    .account-pill {
        padding-right: 8px;
    }

    .logout-link span {
        display: none;
    }

    .app-main {
        padding-top: 28px;
    }

    .page-title {
        font-size: 32px;
    }

    .page-description {
        font-size: 14px;
    }

    .stepper {
        width: 100%;
        overflow-x: auto;
    }

    .surface-card__header,
    .surface-card__body {
        padding-right: 20px;
        padding-left: 20px;
    }

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

    .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
    }

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

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

    .result-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .result-actions .btn {
        width: 100%;
    }

    .login-page {
        padding: 14px;
    }

    .login-aside {
        display: none;
    }

    .login-main {
        min-height: calc(100vh - 28px);
        padding: 34px 24px;
    }
}

@media (max-width: 479.98px) {
    .mapping-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* Premium aurora refresh */
:root {
    --accent: #0fc7a5;
    --accent-strong: #07977f;
    --accent-soft: #e2fbf5;
    --blue: #536dfe;
    --blue-soft: #edf0ff;
    --violet: #7657ff;
    --cyan: #13bfe3;
    --aurora: linear-gradient(120deg, #7657ff 0%, #536dfe 38%, #13bfe3 68%, #0fc7a5 100%);
    --shadow-sm: 0 1px 2px rgba(19, 29, 52, 0.04), 0 10px 28px rgba(50, 65, 112, 0.07);
    --shadow-md: 0 28px 70px rgba(34, 47, 83, 0.12), 0 4px 14px rgba(83, 109, 254, 0.05);
}

html[data-theme="dark"] {
    --accent: #39dfbd;
    --accent-strong: #7ae8d3;
    --accent-soft: #163d39;
    --blue: #8ca2ff;
    --blue-soft: #232f50;
    --violet: #a48cff;
    --cyan: #48d2ee;
    --aurora: linear-gradient(120deg, #a48cff 0%, #7894ff 38%, #48d2ee 68%, #39dfbd 100%);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.22), 0 14px 34px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 30px 75px rgba(0, 0, 0, 0.34), 0 4px 18px rgba(70, 107, 255, 0.08);
}

body {
    position: relative;
    isolation: isolate;
    background:
        radial-gradient(circle at 8% -4%, rgba(118, 87, 255, 0.13), transparent 29rem),
        radial-gradient(circle at 92% 2%, rgba(19, 191, 227, 0.11), transparent 27rem),
        radial-gradient(circle at 78% 78%, rgba(15, 199, 165, 0.07), transparent 30rem),
        var(--ink-50);
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(83, 109, 254, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(83, 109, 254, 0.025) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, black, transparent 68%);
    content: "";
}

html[data-theme="dark"] body {
    background:
        radial-gradient(circle at 8% -4%, rgba(118, 87, 255, 0.18), transparent 30rem),
        radial-gradient(circle at 92% 2%, rgba(19, 191, 227, 0.12), transparent 28rem),
        radial-gradient(circle at 75% 82%, rgba(15, 199, 165, 0.08), transparent 31rem),
        #111a28;
}

.app-header {
    min-height: 76px;
    border-bottom-color: rgba(255, 255, 255, 0.11);
    background:
        linear-gradient(90deg, rgba(118, 87, 255, 0.09), transparent 32%, rgba(15, 199, 165, 0.06)),
        rgba(9, 15, 28, 0.93);
    box-shadow: 0 14px 44px rgba(6, 12, 24, 0.2);
}

.app-header::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: var(--aurora);
    opacity: 0.72;
    content: "";
}

.app-header__inner {
    min-height: 76px;
}

.brand__mark {
    width: 44px;
    height: 44px;
    border-color: rgba(255, 255, 255, 0.24);
    border-radius: 15px;
    background: var(--aurora);
    box-shadow: 0 10px 30px rgba(83, 109, 254, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.brand__title {
    font-size: 16px;
    font-weight: 780;
}

.brand__subtitle {
    color: #9eacc0;
    letter-spacing: 0.12em;
}

.workspace-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid rgba(76, 219, 189, 0.16);
    border-radius: 999px;
    color: #9edbcc;
    background: rgba(15, 199, 165, 0.07);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.04em;
}

.workspace-status__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4cdbbd;
    box-shadow: 0 0 0 4px rgba(76, 219, 189, 0.11), 0 0 12px rgba(76, 219, 189, 0.62);
}

.theme-toggle,
.account-pill,
.logout-link {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.075);
    backdrop-filter: blur(12px);
}

.account-pill__avatar {
    color: #09111e;
    background: linear-gradient(135deg, #b9aaff, #71ead3);
}

.app-main {
    padding-top: 52px;
}

.eyebrow {
    padding: 6px 10px;
    border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-soft) 78%, transparent);
    box-shadow: 0 7px 18px color-mix(in srgb, var(--accent) 8%, transparent);
}

.eyebrow::before {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent), 0 0 14px color-mix(in srgb, var(--accent) 50%, transparent);
}

.page-title {
    max-width: 780px;
    background: linear-gradient(110deg, var(--ink-950) 0%, var(--ink-800) 45%, var(--violet) 115%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    font-size: clamp(34px, 4.6vw, 52px);
    font-weight: 800;
    letter-spacing: -0.055em;
}

html[data-theme="dark"] .page-title {
    background: linear-gradient(110deg, #ffffff 0%, #dce5ff 48%, #91e9dc 120%);
    background-clip: text;
    -webkit-background-clip: text;
}

.page-description {
    font-size: 15px;
    line-height: 1.7;
}

.stepper {
    border-color: color-mix(in srgb, var(--blue) 18%, var(--ink-200));
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(18px);
}

.stepper__item.is-active {
    background: linear-gradient(135deg, var(--blue-soft), var(--accent-soft));
}

.stepper__item.is-active .stepper__number {
    border: 0;
    background: var(--aurora);
    box-shadow: 0 7px 16px color-mix(in srgb, var(--blue) 28%, transparent);
}

.surface-card,
.preview-card,
.result-hero,
.archive-panel,
.side-panel {
    border-color: color-mix(in srgb, var(--blue) 14%, var(--ink-200));
    box-shadow: var(--shadow-md);
}

.surface-card,
.result-hero {
    position: relative;
}

.surface-card::before,
.result-hero::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 2;
    height: 3px;
    background: var(--aurora);
    content: "";
}

.surface-card__header {
    background:
        radial-gradient(circle at 88% 0%, color-mix(in srgb, var(--violet) 9%, transparent), transparent 16rem),
        color-mix(in srgb, var(--surface) 92%, transparent);
}

.section-label__number {
    color: #ffffff;
    background: linear-gradient(140deg, var(--violet), var(--blue));
    box-shadow: 0 8px 18px color-mix(in srgb, var(--blue) 23%, transparent);
}

.normalization-panel {
    border-color: color-mix(in srgb, var(--accent) 30%, var(--ink-200));
    background:
        radial-gradient(circle at 92% 0%, color-mix(in srgb, var(--cyan) 14%, transparent), transparent 14rem),
        linear-gradient(135deg, color-mix(in srgb, var(--surface) 82%, var(--accent-soft)), var(--accent-soft));
    box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 55%, transparent);
}

.setting-toggle {
    box-shadow: 0 8px 22px rgba(35, 51, 89, 0.045);
}

.setting-toggle:hover {
    border-color: color-mix(in srgb, var(--blue) 36%, var(--ink-200));
    box-shadow: 0 14px 28px rgba(35, 51, 89, 0.085);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 14%, transparent), 0 8px 22px color-mix(in srgb, var(--blue) 8%, transparent);
}

.btn-primary {
    position: relative;
    overflow: hidden;
    border: 0;
    background: var(--aurora);
    box-shadow: 0 13px 30px color-mix(in srgb, var(--blue) 25%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.btn-primary::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.22) 50%, transparent 75%);
    transform: translateX(-130%);
    transition: transform 480ms ease;
    content: "";
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: transparent;
    background: var(--aurora);
    box-shadow: 0 17px 38px color-mix(in srgb, var(--blue) 31%, transparent);
}

.btn-primary:hover::after {
    transform: translateX(130%);
}

.side-panel {
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--violet) 11%, transparent), transparent 17rem),
        color-mix(in srgb, var(--surface) 84%, transparent);
}

.privacy-note {
    border: 1px solid color-mix(in srgb, var(--blue) 16%, transparent);
    background: linear-gradient(135deg, var(--blue-soft), color-mix(in srgb, var(--accent-soft) 65%, var(--blue-soft)));
}

.result-hero__icon {
    background: var(--aurora);
    box-shadow: 0 14px 32px color-mix(in srgb, var(--blue) 28%, transparent);
}

.login-shell {
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 42px 120px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(118, 87, 255, 0.08);
}

.login-aside {
    background:
        radial-gradient(circle at 82% 18%, rgba(83, 109, 254, 0.28), transparent 18rem),
        radial-gradient(circle at 15% 82%, rgba(15, 199, 165, 0.15), transparent 19rem),
        linear-gradient(150deg, #131d36, #080e1b);
}

.login-aside__eyebrow {
    color: #8debd8;
}

.login-aside__title {
    background: linear-gradient(110deg, #ffffff, #cfdbff 55%, #8fe9d8);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

@media (max-width: 991.98px) {
    .workspace-status {
        display: none;
    }
}
