:root {
  color-scheme: light;
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #182e37;
  background: #f3f6f7;
  --teal: #155c5b;
  --dark: #102e39;
  --muted: #526872;
  --line: #d7e2e5;
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.65; }
[hidden] { display: none !important; }
a { color: var(--teal); text-underline-offset: .25em; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid #227e79; outline-offset: 4px; }
.wrap { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.skip-link { position: absolute; left: 1rem; top: .5rem; z-index: 2; transform: translateY(-160%); padding: .5rem; background: white; }
.skip-link:focus { transform: none; }
.site-header { background: #fff; }
.header-inner, .footer-inner, .section-heading, .map-card header, .map-card footer, .dialog-head {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.header-inner { min-height: 76px; }
.brand, nav, .owner { display: flex; align-items: center; gap: .75rem; }
.brand { text-decoration: none; color: var(--dark); font-weight: 750; letter-spacing: .04em; }
.brand img { object-fit: contain; }
nav { gap: clamp(.65rem, 2vw, 1.5rem); font-size: .92rem; }
nav a { text-decoration: none; }
.button {
  display: inline-block; border: 1px solid transparent; border-radius: .5rem;
  background: var(--teal); color: white; text-decoration: none; font-weight: 650;
  padding: .65rem 1rem;
}
.button:hover { background: #104c4a; }
.hero { background: var(--dark); color: #fff; padding: 54px 0 62px; }
.hero .label { margin: 0 0 .9rem; color: #c7e2df; font-size: .9rem; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
.hero h1 { font-size: clamp(2.45rem, 6vw, 4.3rem); letter-spacing: -.045em; }
.hero p:last-child { margin: .9rem 0 0; color: #deeced; }
.centers { padding-block: 38px; }
.section-heading { margin-bottom: 1.25rem; flex-wrap: wrap; }
.section-heading p { margin: 0; color: var(--muted); font-size: .85rem; }
.status-dot { width: .65rem; height: .65rem; display: inline-block; background: #778a96; border-radius: 50%; vertical-align: baseline; margin-inline: .35rem; flex: none; }
.status-dot.active { background: #14866a; box-shadow: 0 0 0 3px #d6eee4; }
.map-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.map-card { border: 1px solid var(--line); border-radius: .8rem; background: white; overflow: hidden; display: flex; flex-direction: column; }
.map-card header, .map-card footer { padding: .9rem 1.15rem; }
.map-card h3 span { color: var(--muted); font-size: .72em; font-weight: 650; margin-left: .3em; letter-spacing: .07em; }
.map-card header > span { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.map-frame { position: relative; background: #eaf1f4; }
.map-frame img { width: 100%; height: auto; aspect-ratio: 600 / 422; display: block; }
.china-city-frame { background: white; }
.china-city-canvas { position: relative; width: 78%; margin-inline: auto; }
.china-city-canvas img, .china-city-dialog .map-frame img { aspect-ratio: 220 / 200; }
.china-city-dialog { width: min(520px, calc(100% - 20px)); }
.china-city-dialog .map-frame { background: white; }
.map-expand { position: absolute; bottom: .55rem; right: .55rem; font-size: .85rem; }
.map-dialog { width: min(1220px, calc(100% - 20px)); max-height: calc(100dvh - 20px); padding: clamp(.65rem, 2vw, 1.25rem); }
.map-dialog h2 { font-size: clamp(1.15rem, 3vw, 1.5rem); }
.map-actions { display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.large-map-viewport { margin-top: .75rem; overflow: auto; max-height: 72dvh; border: 1px solid var(--line); }
.large-map-viewport .zoomed { width: max(200%, 1100px); }
.map-markers { position: absolute; inset: 0; pointer-events: none; }
.map-marker { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; width: 1.85rem; height: 1.85rem; border-radius: 50%; border: 2px solid white; background: #647b8d; box-shadow: 0 0 0 2px #4e68754d; }
.map-marker.active { background: #07775b; box-shadow: 0 0 0 5px #1e967d45; }
.map-city-label {
  position: absolute; left: calc(100% + .35rem); top: 50%; transform: translateY(-50%);
  white-space: nowrap; font-size: .875rem; font-weight: 700; line-height: 1.3;
  color: var(--dark); background: white; border: 1px solid var(--line); border-radius: .3rem;
  padding: .16rem .35rem;
}
.china-city-canvas .map-marker, .china-city-dialog .map-marker { width: 1.25rem; height: 1.25rem; }
.site-list { padding: .6rem 1.15rem; min-height: 3rem; }
.site-list p { margin: .2rem 0; color: var(--muted); font-size: .93rem; }
.center-row { background: #f4f7f8; color: var(--dark); border: 1px solid var(--line); border-radius: .45rem; width: 100%; text-align: left; padding: .55rem; margin: .25rem 0; display: flex; align-items: center; gap: .4rem; }
.center-row:hover { background: #eaf3f3; }
.map-card footer { border-top: 1px solid var(--line); font-size: .75rem; margin-top: auto; color: var(--muted); flex-wrap: wrap; }
.map-note { color: var(--muted); font-size: .87rem; margin: .8rem 0 0; }
.overview { padding: 22px 0 42px; border-top: 1px solid var(--line); }
.overview p { margin: .85rem 0 .5rem; color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .83rem; background: white; }
.footer-inner { padding-block: 24px; flex-wrap: wrap; }
.owner { gap: .55rem; }
dialog { border: 1px solid var(--line); border-radius: .75rem; padding: 1.35rem; width: min(480px, calc(100% - 32px)); color: inherit; box-shadow: 0 12px 60px #102e3940; }
dialog::backdrop { background: #102e3980; }
.icon-button, .plain-button { border: 1px solid var(--line); border-radius: .4rem; padding: .4rem .85rem; color: var(--teal); background: white; }
.icon-button { font-size: 1.3rem; padding: 0 .55rem; }
.report-page { padding-block: 44px; }
.report-card { max-width: 625px; padding: clamp(1.25rem, 4vw, 2rem); background: white; border: 1px solid var(--line); border-radius: .85rem; margin: auto; }
.report-card h1 { font-size: clamp(1.85rem, 4vw, 2.65rem); }
.report-card form { display: grid; gap: .9rem; margin: 1.05rem 0; }
.report-card label { display: grid; gap: .28rem; font-weight: 650; }
.report-card input, .report-card select { width: 100%; border: 1px solid #9ab0b9; border-radius: .35rem; color: inherit; background: white; min-height: 42px; padding: .45rem .65rem; }
.report-card form button { justify-self: start; }
.report-card details { padding-block: .8rem; border-block: 1px solid var(--line); }
.report-card summary { cursor: pointer; color: var(--teal); }
#message:empty { display: none; }
#message { padding: .65rem .75rem; background: #eff5f4; border-left: 3px solid var(--teal); }
@media (max-width: 620px) {
  .wrap { width: calc(100% - 32px); }
  .map-grid { grid-template-columns: 1fr; }
  .header-inner { min-height: 64px; gap: .5rem; }
  .header-inner nav > a[href="#about"] { display: none; }
  .hero { padding-block: 41px 48px; }
  .brand { gap: .3rem; font-size: .9rem; }
  .brand img { width: 34px; }
  nav .button { padding: .42rem .65rem; }
}

.manage-card { max-width: 960px; }
.management-centers { list-style: none; padding: 0; margin: .8rem 0 1.6rem; }
.management-centers li {
  border: 1px solid var(--line); border-radius: .5rem; padding: .7rem .9rem;
  margin-bottom: .55rem; display: flex; gap: .75rem; justify-content: space-between;
  align-items: center; flex-wrap: wrap;
}
.management-centers p { margin: .18rem 0 0; color: var(--muted); font-size: .89rem; }
.management-table { overflow-x: auto; }
.management-table table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.management-table th, .management-table td {
  text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--line);
}
.management-table th { background: #f2f6f7; }
.report-card a.plain-button { text-decoration: none; display: inline-block; }

.case-note { padding: .65rem .85rem; background: #f4f7f8; color: var(--muted); }
.case-list, .case-tools { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem; }
.case-detail-heading { margin-top: 1rem; }
.case-tools label { flex: 1 1 10rem; }
.case-event { margin-top: .85rem; padding: .85rem; border: 1px solid var(--line); border-radius: .5rem; }
.case-event p { margin: .35rem 0; overflow-wrap: anywhere; }
.case-preserve { white-space: pre-line; }
.case-history { margin-top: 1rem; }
#event-fields, #case-identification { display: grid; gap: .8rem; }
#case-form textarea { width: 100%; padding: .45rem .65rem; border: 1px solid #9ab0b9; border-radius: .35rem; color: inherit; font: inherit; }
.case-totals p { margin: 0 0 .85rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: .4rem; }

.roster-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; margin: .85rem 0 1.25rem; }
.roster-panel { min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: .55rem; scroll-margin: .9rem; }
.roster-panel .section-heading { margin-bottom: .45rem; flex-wrap: wrap; }
.roster-panel .button { font-size: .88rem; }
.roster-list { display: grid; gap: .45rem; margin-top: .75rem; }
.roster-person {
  width: 100%; display: grid; gap: .15rem; text-align: left; color: var(--dark);
  border: 1px solid var(--line); border-radius: .4rem; padding: .5rem .65rem; background: #f4f7f8;
}
.roster-person:hover { background: #eaf3f3; }
.roster-person span { font-size: .86rem; color: var(--muted); }
@media (max-width: 650px) {.roster-grid { grid-template-columns: 1fr; }}

.case-timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(9rem, 1fr));
  gap: .45rem;
  overflow-x: auto;
  padding: .25rem .25rem .65rem;
  margin: .4rem -.25rem 1rem;
}
.timeline-step {
  display: flex; align-items: center; gap: .45rem; text-align: left; white-space: nowrap;
  background: #f5f8f8; color: var(--dark); border: 1px solid var(--line); padding: .55rem .5rem; border-radius: .45rem;
}
.timeline-step strong, .timeline-step small { display: block; }
.timeline-step strong { font-size: .88rem; }
.timeline-step small { color: var(--muted); }
.timeline-step[aria-current="step"] { background: #e8f4ef; border-color: var(--teal); }
.timeline-number {
  display: grid; place-items: center; width: 1.55rem; height: 1.55rem; flex: none;
  border-radius: 50%; background: white; font-weight: 700; font-size: .8rem;
}
.timeline-step[aria-current="step"] .timeline-number { background: var(--teal); color: white; }
.case-tasks { list-style: none; margin: .65rem 0; padding: 0; }
.case-tasks li {
  display: flex; justify-content: space-between; align-items: center; gap: .6rem;
  border-bottom: 1px solid var(--line); padding: .5rem 0;
}
.case-tasks span { display: block; font-size: .86rem; color: var(--muted); }
.case-tasks button { flex: none; }
.phase-actions { margin-block: .85rem; }
.case-session { padding: .75rem; margin-top: 1rem; border: 1px solid var(--line); border-radius: .6rem; background: #f8fbfb; }
.case-session .section-heading { flex-wrap: wrap; margin: 0; }
.case-session h4 { margin: 0; }
.case-session .case-event { background: white; }

.procedure-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .75rem; }
.procedure-section { margin-block: .9rem; }
.procedure-section h4 { margin: .4rem 0; }
.procedure-table { margin-block: .55rem; }
.procedure-table th { white-space: normal; min-width: 7.5rem; }
.procedure-table td { min-width: 7rem; }
.procedure-table textarea { min-width: 9rem; }

.case-timeline { grid-template-columns: repeat(6, minmax(8rem, 1fr)); }
.case-safety-queue { border-top: 1px solid var(--line); padding-top: 1rem; }
.safety-queue-item { display: block; width: 100%; text-align: left; margin: .5rem 0; }
#eligibility-tables th:first-child { min-width: 13rem; }
#eligibility-tables td:first-child { white-space: normal; }
