:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17212b;
  background: #f5f4f1;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 90% 0, rgba(173, 54, 44, .08), transparent 32rem),
    #f5f4f1;
}

button, input { font: inherit; }

.container {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 56px 28px 72px;
}

.page-header { max-width: 850px; margin-bottom: 34px; }
.eyebrow, .step, .status-label {
  margin: 0 0 7px;
  color: #9e2f27;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1, h2, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(2.1rem, 6vw, 4.25rem); line-height: 1.02; letter-spacing: -.045em; }
h2 { margin: 0; font-size: clamp(1.15rem, 2vw, 1.45rem); line-height: 1.25; }
.lead { max-width: 720px; margin: 18px 0 0; color: #52606d; font-size: clamp(1rem, 2vw, 1.2rem); line-height: 1.65; }

.card, .notice, .source-file {
  margin: 20px 0;
  border: 1px solid #deddd8;
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 12px 34px rgba(30, 37, 44, .07);
}

.card { padding: 28px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.section-heading p:not(.step) { margin: 7px 0 0; color: #61707d; line-height: 1.5; }
.format-badge {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f2e8e5;
  color: #7e2923;
  font-size: .82rem;
  font-weight: 750;
}

.upload-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; margin-top: 24px; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: 8px; }
input[type="file"] {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 10px;
  border: 1px solid #aeb6bd;
  border-radius: 10px;
  background: #fff;
  color: #263440;
}
input[type="file"]::file-selector-button {
  margin-right: 12px;
  border: 0;
  border-radius: 7px;
  padding: 9px 12px;
  background: #ecefed;
  color: #263440;
  font-weight: 700;
  cursor: pointer;
}
.help-text, .replacement-note, .expiry { color: #5d6974; font-size: .9rem; line-height: 1.55; }
.help-text { margin: 8px 0 0; }
.replacement-note { margin: 20px 0 0; padding-top: 18px; border-top: 1px solid #e4e5e2; }
.actions { display: flex; }
button {
  min-height: 48px;
  border: 1px solid #8e2922;
  border-radius: 10px;
  padding: 12px 20px;
  background: #a9342b;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(169, 52, 43, .2);
}
button:hover { background: #8f2922; }
button:active { transform: translateY(1px); }
button:focus-visible, input:focus-visible, .table-wrap:focus-visible {
  outline: 3px solid #176b87;
  outline-offset: 3px;
}

.results { margin-top: 34px; }
.notice { padding: 24px 26px; border-left-width: 6px; }
.notice h2 { margin-bottom: 7px; }
.notice p:last-child { margin-bottom: 0; }
.notice-success { border-left-color: #19734c; background: #f3fbf7; }
.notice-warning { border-left-color: #b67608; background: #fff9ec; }
.notice-error { border-left-color: #b82f35; background: #fff5f5; }
.notice-info { border-left-color: #24708b; background: #f1f9fc; }

.source-file { display: flex; justify-content: space-between; gap: 16px; padding: 16px 20px; box-shadow: none; }
.source-file span { color: #63717d; }
.source-file strong { text-align: right; }

.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 16px 0 28px; }
.summary article {
  display: flex;
  min-height: 132px;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border: 1px solid #deddd8;
  border-radius: 14px;
  background: #fff;
}
.summary span { color: #52606b; line-height: 1.35; }
.summary strong { margin-top: 16px; font-size: 2.25rem; line-height: 1; }

.issue-list { border-left: 6px solid; }
.issue-list.errors { border-left-color: #b82f35; }
.issue-list.warnings { border-left-color: #b67608; }
.issue-list ul { margin: 20px 0 0; padding-left: 22px; }
.issue-list li { margin: 9px 0; line-height: 1.5; }
.truncated-note { margin: 20px 0 0; font-weight: 700; }

.download-card { display: flex; align-items: center; justify-content: space-between; gap: 28px; border-color: #b8d3c4; background: #f8fcfa; }
.download-card form { flex: 0 0 auto; }
.download-name { display: flex; flex-wrap: wrap; gap: 7px 12px; margin: 14px 0 0; }
.download-name span { color: #61707a; }
.download-name strong { word-break: break-word; }
.expiry { margin-bottom: 0; }

.preview-card { padding-bottom: 20px; }
.table-help { font-size: .82rem; }
.table-wrap { margin-top: 20px; overflow-x: auto; border: 1px solid #dfe3e5; border-radius: 12px; }
table { width: 100%; min-width: 820px; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 13px 14px; border-bottom: 1px solid #e3e7e9; text-align: left; white-space: nowrap; }
th { background: #edf0f1; color: #33414c; font-size: .78rem; letter-spacing: .035em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f7f8f8; }
.row-simple td:first-child { box-shadow: inset 4px 0 #24708b; }
.row-variable td:first-child { box-shadow: inset 4px 0 #9e2f27; }
.row-variation td:first-child { box-shadow: inset 4px 0 #b67608; }
.empty-cell { color: #8a949d; }
.legend { display: flex; flex-wrap: wrap; gap: 12px 22px; margin: 16px 0 0; padding: 0; color: #596773; font-size: .84rem; list-style: none; }
.legend li { display: flex; align-items: center; gap: 7px; }
.legend-mark { width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; }
.legend-mark.simple { color: #24708b; }
.legend-mark.variable { color: #9e2f27; }
.legend-mark.variation { color: #b67608; }

@media (max-width: 860px) {
  .container { padding: 42px 22px 60px; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upload-form { grid-template-columns: 1fr; }
  .actions button { width: 100%; }
  .download-card { align-items: stretch; flex-direction: column; }
  .download-card form, .download-card button { width: 100%; }
}

@media (max-width: 560px) {
  .container { padding: 30px 15px 48px; }
  .card, .notice { padding: 20px; border-radius: 14px; }
  .section-heading, .source-file { align-items: stretch; flex-direction: column; }
  .format-badge { align-self: flex-start; }
  .summary { grid-template-columns: 1fr; gap: 10px; }
  .summary article { min-height: 105px; }
  .source-file strong { text-align: left; }
  input[type="file"]::file-selector-button { display: block; margin: 0 0 8px; }
}

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