:root {
  color-scheme: light;
  --bg: #eef3f8;
  --surface: #ffffff;
  --surface-soft: #f8fbfd;
  --ink: #0d1b2a;
  --muted: #64748b;
  --subtle: #8a99ab;
  --line: #d9e3ee;
  --line-strong: #bfcede;
  --brand: #0f766e;
  --brand-dark: #0b5f59;
  --navy: #173b63;
  --blue: #2563a8;
  --success: #0f7a46;
  --warning: #9a6700;
  --danger: #b42318;
  --shadow: 0 18px 44px rgba(24, 42, 66, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #f7fafc 0%, var(--bg) 42%, #edf4f8 100%);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
}

.shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.app-header,
.brand-block,
.header-actions,
.panel-heading,
.actions,
.file-row {
  display: flex;
  align-items: center;
}

.app-header {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.brand-block {
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 10px 24px rgba(13, 27, 42, 0.18);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 31px;
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: 22px;
  line-height: 1.2;
}

.brand-block p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
}

.header-actions {
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill {
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 999px;
  padding: 8px 13px;
  background: #edfdf9;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
}

.status-pill.muted {
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
}

.intro-band,
.panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.intro-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  margin-bottom: 18px;
  padding: 24px 26px;
}

.eyebrow,
.section-label {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro-band h2 {
  font-size: 28px;
}

.intro-band p {
  max-width: 760px;
  margin-top: 9px;
  color: var(--muted);
  line-height: 1.7;
}

.assurance-grid {
  display: grid;
  grid-template-columns: repeat(3, 112px);
  gap: 10px;
}

.assurance-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-soft);
}

.assurance-grid strong {
  display: block;
  font-size: 22px;
  line-height: 1;
}

.assurance-grid span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(300px, 0.9fr);
  gap: 18px;
  align-items: stretch;
}

.panel {
  padding: 22px;
  margin-bottom: 18px;
}

.panel-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-heading.compact {
  margin-bottom: 10px;
}

.small-note {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 220px;
  padding: 28px;
  border: 1.5px dashed #8fb2d1;
  border-radius: 8px;
  background: #fbfdff;
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.dropzone::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(143, 178, 209, 0.34);
  border-radius: 8px;
  pointer-events: none;
}

.dropzone.is-dragover {
  border-color: var(--brand);
  background: #effbf8;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.22), 0 14px 30px rgba(15, 118, 110, 0.12);
  transform: translateY(-1px);
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: #e8f2fb;
  color: var(--navy);
  font-weight: 900;
  letter-spacing: 0;
}

.drop-title {
  font-size: 24px;
  font-weight: 900;
}

.drop-subtitle,
.file-list {
  color: var(--muted);
}

input[type="file"] {
  max-width: 100%;
}

.file-row {
  align-items: flex-start;
  gap: 12px;
  margin: 16px 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.file-label {
  flex: 0 0 auto;
  color: var(--subtle);
  font-size: 13px;
  font-weight: 800;
}

.file-list {
  min-height: 20px;
  overflow-wrap: anywhere;
}

.file-list {
  display: grid;
  width: 100%;
  gap: 8px;
}

.empty-file {
  color: var(--muted);
}

.file-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 16px;
  align-items: center;
  border: 1px solid rgba(191, 206, 222, 0.72);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.file-name {
  color: var(--ink);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.file-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 12px;
}

.file-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--surface-soft);
}

.file-summary {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.progress-wrap {
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: #f8fbfd;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 900;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3edf6;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, var(--brand), #2563a8),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.28) 0 8px, rgba(255, 255, 255, 0) 8px 16px);
  transition: width 220ms ease;
}

.progress-wrap.is-active .progress-bar {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.26) 0 8px, rgba(255, 255, 255, 0) 8px 16px),
    linear-gradient(90deg, var(--brand), #2563a8);
  background-size: 28px 28px, auto;
  animation: progressMove 760ms linear infinite;
}

@keyframes progressMove {
  to {
    background-position: 28px 0, 0 0;
  }
}

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

button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 20px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.22);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease, background 160ms ease;
  user-select: none;
}

button.secondary {
  background: var(--navy);
  box-shadow: 0 10px 22px rgba(23, 59, 99, 0.22);
}

button.ghost {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--navy);
  box-shadow: none;
}

button:hover:not(:disabled) {
  filter: brightness(0.98);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.28);
}

button.secondary:hover:not(:disabled) {
  box-shadow: 0 14px 28px rgba(23, 59, 99, 0.28);
}

button.ghost:hover:not(:disabled) {
  box-shadow: 0 10px 22px rgba(23, 59, 99, 0.10);
}

button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.20);
}

button:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.22);
  outline-offset: 3px;
}

button:disabled {
  opacity: 0.62;
  cursor: wait;
  box-shadow: none;
}

button.is-busy::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.48);
  border-top-color: #fff;
  animation: spin 800ms linear infinite;
}

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

.status {
  min-height: 28px;
  margin-top: 18px;
  color: var(--brand-dark);
  font-weight: 900;
}

.guidance-panel {
  background: #fbfdff;
}

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

.check-list li {
  position: relative;
  padding-left: 24px;
  color: #334155;
  line-height: 1.55;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

.result-panel {
  padding-top: 24px;
}

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

.acceptance-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: 12px;
  align-items: stretch;
  margin: 12px 0 18px;
}

.acceptance-summary,
.acceptance-checks {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 15px;
}

.acceptance-summary {
  border-color: rgba(15, 118, 110, 0.32);
  background: #f1fbf8;
}

.acceptance-summary.needs-review {
  border-color: rgba(180, 35, 24, 0.26);
  background: #fff7f6;
}

.acceptance-summary strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
}

.acceptance-summary span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.acceptance-checks {
  display: grid;
  gap: 9px;
}

.acceptance-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
}

.acceptance-item b {
  color: var(--success);
  white-space: nowrap;
}

.acceptance-item.needs-review b {
  color: var(--danger);
}

.metric-card {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfdff;
}

.metric-card span {
  display: block;
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
  font-weight: 950;
}

.metric-card small {
  display: block;
  margin-top: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.metric-card.highlight {
  border-color: rgba(15, 118, 110, 0.32);
  background: #f1fbf8;
}

.metric-card.positive span {
  color: var(--success);
}

.metric-card.neutral span {
  color: var(--blue);
}

.metric-card.danger-soft span {
  color: var(--danger);
}

.metrics-note {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: #f8fbfd;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.errors {
  border-left: 4px solid var(--warning);
}

.errors h2,
.errors p {
  color: var(--warning);
}

.errors p {
  margin: 10px 0 0;
}

.hidden {
  display: none;
}

@media (max-width: 980px) {
  .intro-band,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

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

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

  .acceptance-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 660px) {
  .shell {
    width: min(100% - 24px, 1240px);
    padding-top: 20px;
  }

  .app-header,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 27px;
  }

  .intro-band h2 {
    font-size: 23px;
  }

  .assurance-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .file-card {
    grid-template-columns: 1fr;
  }

  .file-meta {
    justify-content: flex-start;
  }

  .small-note {
    white-space: normal;
  }
}
