:root {
  --paper: #fdf8f1;
  --surface: rgba(255, 253, 249, 0.82);
  --ink: #271515;
  --muted: #78635c;
  --faint: #aa9288;
  --line: #ead7ce;
  --line-strong: #dcbeb4;
  --red: #aa171c;
  --red-deep: #841116;
  --rose: #d28a87;
  --taupe: #9c8177;
  --gold: #c29142;
  --green: #58715c;
  --shadow: 0 18px 50px rgba(87, 35, 23, 0.07);
  --serif: ui-serif, "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--serif);
}
button { font: inherit; }
[hidden] { display: none !important; }

.dashboard-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 48px;
}

.overview-section { padding: clamp(68px, 8vw, 108px) 0 clamp(62px, 7vw, 92px); }
.overview-copy { margin-bottom: 52px; }
.overview-copy h1 { margin: 0; color: var(--red-deep); font-size: clamp(2.2rem, 4.7vw, 4rem); font-weight: 650; letter-spacing: .03em; line-height: 1.05; }

.overview-grid { display: grid; grid-template-columns: minmax(340px, .92fr) minmax(0, 1.38fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.total-metric { display: flex; min-height: 250px; flex-direction: column; justify-content: center; padding: 38px 48px 38px 0; border-right: 1px solid var(--line); }
.total-metric span, .status-metrics span { color: var(--muted); font-size: .8rem; letter-spacing: .08em; }
.total-metric strong { margin: 16px 0 12px; color: var(--red); font-size: clamp(4.8rem, 8vw, 7.4rem); font-weight: 620; letter-spacing: -.055em; line-height: .92; font-variant-numeric: tabular-nums; }
.status-metrics { display: grid; grid-template-columns: repeat(3, 1fr); }
.status-metrics article { position: relative; display: flex; min-width: 0; flex-direction: column; justify-content: center; padding: 34px clamp(22px, 3vw, 42px); }
.status-metrics article + article::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: var(--line); }
.status-metrics strong { margin: 18px 0 12px; color: var(--ink); font-size: clamp(2.4rem, 4vw, 3.75rem); font-weight: 620; line-height: 1; font-variant-numeric: tabular-nums; }
.status-metrics article:nth-child(2) strong { color: var(--taupe); }
.status-metrics .pending-metric strong { color: var(--green); }

.country-section { padding: clamp(64px, 7vw, 92px) 0; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 36px; margin-bottom: 36px; }
.section-heading h2 { margin: 0; font-size: clamp(1.8rem, 3.6vw, 2.8rem); font-weight: 650; letter-spacing: .04em; }
.section-heading p { margin: 10px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.8; }
.country-heading { margin-bottom: 30px; }
.country-summary { text-align: right; }
.country-summary strong { display: block; color: var(--red); font-size: 2.7rem; font-weight: 620; line-height: .9; font-variant-numeric: tabular-nums; }
.country-summary span { display: block; margin-top: 10px; color: var(--faint); font-size: .72rem; }
.country-table { margin-top: 44px; }
.country-table-head, .country-row { display: grid; grid-template-columns: minmax(220px, 1fr) 160px minmax(260px, .9fr); align-items: center; column-gap: 28px; }
.country-table-head { min-height: 48px; color: var(--faint); border-bottom: 1px solid var(--line); font-size: .68rem; }
.country-table-head span:nth-child(2) { text-align: right; }
.country-table-head span:last-child { padding-left: 28px; }
.country-row { min-height: 67px; border-bottom: 1px solid rgba(234, 215, 206, .74); }
.country-row.is-collapsed { display: none; }
.country-identity { display: block; min-width: 0; }
.country-identity strong { overflow: hidden; font-size: .84rem; font-weight: 630; text-overflow: ellipsis; white-space: nowrap; }
.country-count { color: var(--ink); text-align: right; font-size: .84rem; font-variant-numeric: tabular-nums; }
.country-share { display: grid; grid-template-columns: 1fr 58px; align-items: center; gap: 16px; padding-left: 28px; }
.country-share > i { display: block; height: 6px; overflow: hidden; background: rgba(170, 23, 28, .07); }
.country-share b { display: block; width: var(--width); height: 100%; background: var(--red); }
.country-share em { color: var(--muted); font-size: .7rem; font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.country-toggle { display: block; margin: 28px auto 0; padding: 8px 0; color: var(--red-deep); background: transparent; border: 0; border-bottom: 1px solid var(--line-strong); font-size: .74rem; cursor: pointer; }
.country-toggle:hover, .country-toggle:focus-visible { border-color: var(--red); outline: none; }

.load-error { position: fixed; left: 50%; bottom: 24px; z-index: 20; display: flex; min-width: min(380px, calc(100vw - 32px)); flex-direction: column; gap: 4px; padding: 16px 18px; color: #fff; background: var(--red-deep); box-shadow: var(--shadow); transform: translateX(-50%); font-size: .8rem; }

@media (max-width: 820px) {
  .dashboard-shell { width: min(100% - 32px, 680px); }
  .overview-grid { grid-template-columns: 1fr; }
  .total-metric { min-height: 220px; padding-right: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .status-metrics article { min-height: 160px; }
  .country-table-head, .country-row { grid-template-columns: minmax(170px, 1fr) 90px minmax(170px, .8fr); column-gap: 16px; }
}

@media (max-width: 560px) {
  .dashboard-shell { width: min(100% - 24px, 480px); }
  .overview-section { padding-top: 58px; }
  .overview-copy { margin-bottom: 34px; }
  .overview-copy h1 { font-size: 2.3rem; }
  .overview-grid { border-bottom: 0; }
  .total-metric { min-height: 176px; }
  .total-metric strong { font-size: 4.45rem; }
  .status-metrics { grid-template-columns: 1fr; }
  .status-metrics article { min-height: auto; padding: 24px 0; border-bottom: 1px solid var(--line); }
  .status-metrics article + article::before { display: none; }
  .status-metrics strong { margin: 10px 0 6px; font-size: 2.45rem; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 18px; }
  .country-heading { align-items: flex-start; flex-direction: column; }
  .country-summary { display: flex; align-items: baseline; gap: 9px; text-align: left; }
  .country-summary strong { font-size: 2.2rem; }
  .country-summary span { margin-top: 0; }
  .country-table { margin-top: 36px; }
  .country-table-head { grid-template-columns: 1fr auto; }
  .country-table-head span:last-child { display: none; }
  .country-row { grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 12px 0; }
  .country-share { grid-column: 1 / -1; grid-template-columns: 1fr 52px; padding-left: 38px; }
}

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