:root {
    color-scheme: light;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #182026;
    background: #f4f6f7;
    font-size: 16px;
    letter-spacing: 0;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; }

.topbar {
    height: 64px;
    padding: 0 max(24px, calc((100vw - 1120px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    background: #17252b;
    border-bottom: 3px solid #18a06a;
}

.topbar strong { font-size: 18px; }
.topbar span { margin-left: 12px; color: #b8c5c9; font-size: 13px; }
.topbar .health { margin: 0; color: #d6e0e2; }
.topbar .health.ok { color: #74d8ae; }
.topbar .health.error { color: #ff9a90; }

main { max-width: 1120px; margin: 0 auto; padding: 32px 24px 64px; }

.toolbar {
    display: grid;
    grid-template-columns: 220px minmax(320px, 1fr) auto auto;
    align-items: end;
    gap: 20px;
    padding-bottom: 24px;
    border-bottom: 1px solid #cbd4d7;
}

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field label, .field legend { color: #47565c; font-size: 13px; font-weight: 600; }
fieldset { margin: 0; padding: 0; border: 0; }
.platform-field legend { margin-bottom: 8px; }

input[type="month"], input[type="number"], input[type="password"], input[type="file"] {
    width: 100%;
    min-height: 42px;
    border: 1px solid #aebbc0;
    border-radius: 4px;
    padding: 9px 11px;
    background: #fff;
    color: #182026;
    font: inherit;
}

input:focus-visible, button:focus-visible, a:focus-visible {
    outline: 3px solid rgba(24, 160, 106, .24);
    outline-offset: 2px;
}

.segmented { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    cursor: pointer;
    background: #fff;
    border: 1px solid #aebbc0;
}
.segmented label:first-of-type { border-radius: 4px 0 0 4px; }
.segmented label:last-of-type { border-radius: 0 4px 4px 0; border-left: 0; }
.segmented input:checked + label { color: #fff; background: #176b4c; border-color: #176b4c; }

button, .download {
    min-height: 42px;
    border: 0;
    border-radius: 4px;
    padding: 10px 18px;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
    text-decoration: none;
}

button { color: #fff; background: #176b4c; }
button:hover { background: #105b3f; }
button:disabled { cursor: not-allowed; opacity: .55; }
button.secondary { color: #263238; background: #dfe5e7; }
button.secondary:hover { background: #d2dadd; }
button.danger { color: #a61b12; background: #f8e3e1; }
button.danger:hover { background: #f3d2cf; }

.status-band {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 2fr auto;
    gap: 28px;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid #cbd4d7;
}

.label { display: block; margin-bottom: 6px; color: #64747a; font-size: 12px; text-transform: uppercase; }
#fileStatus { font-size: 18px; }
dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 0; }
dt { color: #64747a; font-size: 12px; }
dd { margin: 5px 0 0; font-variant-numeric: tabular-nums; }
.download { display: inline-flex; align-items: center; color: #176b4c; background: #dcefe7; }
.download:hover { background: #cee6dc; }
.file-actions { display: flex; align-items: center; gap: 10px; }

.upload-section { padding-top: 30px; }
.upload-section h1 { margin: 0 0 22px; font-size: 20px; }
.form-grid { display: grid; grid-template-columns: minmax(280px, 1fr) 180px; gap: 20px; }
small { color: #6c7b80; }
.actions { min-height: 64px; display: flex; align-items: center; justify-content: flex-end; gap: 18px; border-top: 1px solid #d6dddf; margin-top: 24px; padding-top: 20px; }
#message { margin-right: auto; color: #4d5c62; }
#message.error { color: #b42318; }
#message.success { color: #176b4c; }

.progress-wrap { display: grid; grid-template-columns: 1fr 52px; gap: 14px; align-items: center; margin-top: 24px; }
progress { width: 100%; height: 10px; accent-color: #18a06a; }
#progressText { text-align: right; font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

@media (max-width: 760px) {
    .topbar { height: auto; min-height: 64px; padding: 14px 18px; }
    .topbar div span { display: block; margin: 3px 0 0; }
    main { padding: 24px 18px 48px; }
    .toolbar, .status-band, .form-grid { grid-template-columns: 1fr; }
    .toolbar { align-items: stretch; }
    .toolbar button { width: 100%; }
    .status-band { gap: 18px; }
    dl { grid-template-columns: 1fr 1fr; }
    .file-actions { align-items: stretch; flex-direction: column; }
    .download { justify-content: center; }
    .actions { align-items: stretch; flex-direction: column; }
    .actions button { width: 100%; }
}
