:root {
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: #243349;
    background: #f1f5f9;
    font-size: 15px;
    color-scheme: light;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
}
main {
    max-width: 1280px;
    margin: auto;
    padding: 36px 28px;
}
header,
.section-head,
.toolbar,
.source,
.versions,
.scan-status {
    display: flex;
    align-items: center;
    gap: 16px;
}
header {
    justify-content: space-between;
    margin-bottom: 26px;
}
h1 {
    margin: 7px 0;
    font-size: 29px;
    color: #162438;
    letter-spacing: -0.7px;
}
h1 small {
    display: inline-block;
    font-size: 12px;
    vertical-align: middle;
    background: #e0eaff;
    color: #2852a0;
    border-radius: 7px;
    padding: 5px 9px;
    letter-spacing: 0;
}
header p {
    margin: 0;
    color: #66768d;
}
.eyebrow {
    font-size: 11px;
    letter-spacing: 2px;
    font-weight: 700;
    color: #4b6ca3;
}
.card {
    background: white;
    border: 1px solid #dde5ef;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px #18385405;
}
h2 {
    font-size: 18px;
    margin: 0 0 20px;
}
.section-head {
    justify-content: space-between;
}
.step {
    display: inline-grid;
    place-items: center;
    background: #eaf0ff;
    color: #3861b2;
    border-radius: 8px;
    width: 28px;
    height: 28px;
    font-size: 14px;
    margin-right: 7px;
}
label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #45556d;
    font-size: 13px;
    font-weight: 600;
}
input,
select,
button {
    font: inherit;
}
input:not([type='checkbox']),
select {
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 10px 12px;
    min-width: 0;
    width: 100%;
    background: #fff;
    color: #23354c;
}
input:focus,
select:focus {
    outline: 2px solid #9fb9f3;
    outline-offset: 1px;
}
.grow {
    flex: 1;
}
.source {
    align-items: flex-end;
}
.source select {
    min-width: 180px;
}
.check {
    flex-direction: row;
    align-items: center;
    font-weight: 400;
    font-size: 14px;
    gap: 8px;
}
input[type='checkbox'] {
    width: 16px;
    height: 16px;
    accent-color: #315fc4;
    flex-shrink: 0;
}
button,
.download {
    border: 1px solid transparent;
    background: #315fc4;
    color: white;
    border-radius: 7px;
    padding: 10px 17px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
button:hover,
.download:hover {
    background: #234b9f;
}
button:disabled {
    opacity: 0.45;
    cursor: default;
}
button.secondary {
    background: #fff;
    border-color: #cbd5e1;
    color: #345077;
}
button.subtle {
    background: transparent;
    color: #52657f;
    padding: 8px 11px;
}
button.subtle:hover,
button.secondary:hover {
    background: #edf2fc;
}
.toolbar {
    margin-top: 20px;
    flex-wrap: wrap;
}
.hint,
footer {
    color: #7a889c;
    font-size: 12px;
    line-height: 1.65;
}
.hint {
    margin: 12px 0 0;
}
.scan-status {
    justify-content: space-between;
    font-size: 13px;
    margin-top: 23px;
    color: #52637b;
}
progress {
    display: block;
    width: 100%;
    height: 9px;
    border: none;
    border-radius: 8px;
    margin-top: 12px;
    overflow: hidden;
    accent-color: #3b6ddd;
}
progress::-webkit-progress-bar {
    background: #edf1f8;
}
progress::-webkit-progress-value {
    background: #416fce;
    transition: width 0.15s;
}
table {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
}
th {
    text-align: left;
    background: #f7f9fc;
    color: #667891;
    font-size: 11px;
    letter-spacing: 0.4px;
    white-space: nowrap;
}
th,
td {
    padding: 12px;
    border-bottom: 1px solid #edf1f6;
}
td:nth-child(2) {
    font-family: Consolas, monospace;
    overflow-wrap: anywhere;
}
td:nth-child(3),
td:nth-child(4) {
    white-space: nowrap;
}
.table-wrap {
    max-height: 360px;
    overflow: auto;
    border: 1px solid #e8edf5;
    border-radius: 8px;
}
thead {
    position: sticky;
    top: 0;
}
th:first-child {
    width: 36px;
}
.empty {
    text-align: center;
    height: 110px;
    color: #8a96a8;
}
.invalid {
    color: #ae4d2b;
    background: #fffaf5;
}
.versions {
    align-items: flex-end;
    flex-wrap: wrap;
}
.versions label:not(.grow) {
    width: 145px;
}
.export-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 22px;
}
.error {
    background: #fff1f1;
    color: #a42e39;
    border-radius: 8px;
    padding: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}
.error:empty {
    display: none;
}
.warnings {
    white-space: pre-wrap;
    background: #fff8df;
    color: #8f631a;
    padding: 12px;
    border-radius: 8px;
    font:
        13px/1.6 'Segoe UI',
        sans-serif;
}
#result {
    background: #f0f8f5;
    border: 1px solid #c9e6d8;
    border-radius: 9px;
    padding: 14px;
    margin-top: 20px;
    color: #235c47;
}
#result p {
    margin: 0 0 12px;
    font-size: 13px;
}
.download {
    font-size: 13px;
    margin: 0 8px 4px 0;
    background: #2b7056;
}
footer {
    margin: 24px 4px;
}
dialog {
    border: 1px solid #d4deec;
    border-radius: 14px;
    padding: 24px;
    width: min(640px, 95vw);
    color: #263954;
    box-shadow: 0 25px 80px #16243844;
}
dialog::backdrop {
    background: #182b4c66;
}
dialog h2 {
    margin: 0;
}
.mono {
    font:
        13px/1.6 Consolas,
        monospace;
    overflow-wrap: anywhere;
    color: #73839a;
}
#folders {
    max-height: 300px;
    overflow: auto;
    min-height: 70px;
}
.folder {
    display: block;
    background: #f6f8fc;
    color: #365177;
    border: 1px solid #e4eaf4;
    text-align: left;
    width: 100%;
    margin-bottom: 6px;
}
.folder:hover {
    background: #e7eefb;
}
.login {
    max-width: 520px;
    margin: 50px auto;
}
.login form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.login p {
    line-height: 1.6;
    color: #63758c;
}
code {
    font-size: 13px;
}
[hidden] {
    display: none !important;
}
@media (max-width: 800px) {
    main {
        padding: 22px 14px;
    }
    h1 {
        font-size: 23px;
    }
    .card {
        padding: 18px;
    }
    .source {
        flex-wrap: wrap;
    }
    .source .grow {
        flex-basis: 60%;
    }
    .scan-status {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }
    .versions label.grow {
        flex-basis: 100%;
    }
    header {
        align-items: flex-start;
    }
    .section-head {
        gap: 8px;
        flex-wrap: wrap;
    }
}

.config-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}
.config-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
    padding: 12px 18px;
    border: 1px solid #315fc4;
    border-radius: 10px;
    background: linear-gradient(135deg, #416fda, #315fc4);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    box-shadow: 0 4px 10px #315fc426;
    transition:
        background 0.15s,
        box-shadow 0.15s,
        transform 0.15s;
}
.config-button:hover {
    background: #234b9f;
    box-shadow: 0 6px 14px #315fc43b;
    transform: translateY(-1px);
}
.config-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px #315fc426;
}
.config-button:focus-visible {
    outline: 3px solid #9fb9f3;
    outline-offset: 3px;
}
.config-button-icon {
    font-size: 20px;
    line-height: 1;
}
@media (prefers-reduced-motion: reduce) {
    .config-button {
        transition: none;
    }
    .config-button:hover,
    .config-button:active {
        transform: none;
    }
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}
.status-ready {
    color: #166534;
    background: #dcfce7;
    border-color: #86d5a2;
}
.status-error {
    color: #a12b36;
    background: #feecef;
    border-color: #f0b4bc;
}
.status-detail {
    display: block;
    margin-top: 7px;
    line-height: 1.55;
    color: #994733;
}
.status-pending {
    color: #854d0e;
    background: #fef9c3;
    border-color: #e5cd75;
}
.version-mode {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid #dce5f4;
    border-radius: 9px;
    background: #f7faff;
}
.version-mode .hint {
    margin-top: 7px;
}
input[readonly] {
    background: #edf2fa;
    color: #365381;
}
.version-summary {
    display: grid;
    gap: 9px;
    margin-top: 14px;
    font-size: 13px;
    color: #52637b;
}
.version-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}
.version-value {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}
.version-value svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.version-value-current {
    color: #315a96;
    background: #eaf1fc;
    border-color: #c5d7f0;
}
.version-value-next {
    color: #166534;
    background: #dcfce7;
    border-color: #86d5a2;
}
.version-summary .hint {
    margin: 0;
}
.tooltip-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}
.versions .tooltip-field {
    width: 145px;
}
.versions .field-heading > label {
    width: auto;
}
.field-heading {
    display: flex;
    align-items: center;
    gap: 7px;
    position: relative;
}
.help-tooltip {
    display: inline-flex;
}
.help-tooltip .help-trigger {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 1px solid #bdcfe9;
    border-radius: 50%;
    background: #e9f0fc;
    color: #365f9b;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    flex-shrink: 0;
}
.help-tooltip .help-trigger:hover {
    background: #dbe8fa;
}
.help-trigger:focus-visible {
    outline: 2px solid #638ed4;
    outline-offset: 3px;
}
.help-bubble {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    left: 0;
    width: 320px;
    max-width: calc(100vw - 64px);
    padding: 12px 14px;
    border: 1px solid #3a5274;
    border-radius: 9px;
    background: #233852;
    color: #f4f7fc;
    box-shadow: 0 8px 24px #182d4a33;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.65;
    text-align: left;
    overflow-wrap: anywhere;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}
.help-tooltip:hover .help-bubble,
.help-tooltip:focus-within .help-bubble {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}
.versions .tooltip-field:nth-child(2) .help-bubble {
    left: auto;
    right: 0;
}
.help-bubble::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 9px;
}
.versions .tooltip-field-minimum {
    width: 175px;
}
.help-bubble .help-keyword {
    color: #fde68a;
    background: #fde68a1f;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 700;
}
.versions .tooltip-field-web {
    width: auto;
    min-width: 240px;
}
.tooltip-field-web .help-bubble {
    left: auto;
    right: 0;
    width: 390px;
}
.upload-panel {
    margin-top: 22px;
    padding: 20px;
    border: 1px solid #dce5f4;
    border-radius: 10px;
    background: #f8fbff;
}
.upload-panel h3 {
    margin: 0;
    font-size: 16px;
    color: #284c82;
}
.upload-panel .section-head .hint {
    margin: 0;
}
.upload-panel .toolbar {
    margin-top: 15px;
}
.upload-overwrite {
    margin-top: 16px;
}
.upload-progress-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 13px;
    margin-top: 20px;
    color: #45556d;
}
.upload-progress-heading > span {
    overflow-wrap: anywhere;
}
.upload-progress-heading > strong {
    flex-shrink: 0;
    color: #315fc4;
}
.upload-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin-top: 15px;
    font-size: 13px;
    color: #52637b;
}
.upload-metrics strong {
    color: #243349;
}
.upload-results {
    max-height: 170px;
    overflow: auto;
    padding-left: 20px;
    font-size: 12px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}
.upload-ok {
    color: #166534;
}
.upload-error {
    color: #a12b36;
}
@media (max-width: 800px) {
    .versions .tooltip-field-web {
        flex-basis: 100%;
        min-width: 0;
    }
    .upload-panel {
        padding: 15px;
    }
    .tooltip-field-web .help-bubble {
        right: auto;
        left: 0;
    }
}
.upload-error-report {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #e4cfb2;
}
.upload-error-report h4 {
    margin: 0;
    color: #9a4a12;
}
.upload-error-report .table-wrap {
    margin-top: 12px;
}
.upload-error-report th:first-child {
    width: 35%;
}
.upload-error-report td:first-child {
    font-family: Consolas, monospace;
    overflow-wrap: anywhere;
}
.upload-error-report td:nth-child(2) {
    font-family: inherit;
    white-space: normal;
    line-height: 1.6;
}
.upload-error-report th:last-child {
    width: 130px;
}
#upload-error-dialog p {
    line-height: 1.6;
}
#upload-error-dialog .check {
    line-height: 1.6;
}
