
@font-face { font-family: "SUIT"; src: url("/fonts/SUIT-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "IBM Plex Sans KR"; src: url("/fonts/IBMPlexSansKR-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans KR"; src: url("/fonts/IBMPlexSansKR-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
:root {
  color-scheme: light;
  --gray-50: #f9fafb;
  --gray-100: #f2f4f6;
  --gray-200: #e5e8eb;
  --gray-300: #d1d6db;
  --gray-400: #b0b8c1;
  --gray-500: #697789;
  --gray-600: #526174;
  --gray-700: #3c495b;
  --gray-800: #333d4b;
  --gray-900: #172337;
  --blue-500: #2563eb;
  --blue-600: #1d4ed8;
  --light-blue: #edf3ff;
  --green-700: #16803c;
  --yellow-700: #a15c00;
  --red-700: #d14343;
  --bg: #fff;
  --surface: #fff;
  --text: var(--gray-900);
  --muted: var(--gray-600);
  --border: var(--gray-200);
  --primary: var(--blue-500);
  --focus: #1b64da;
  --card-radius: 12px;
  --shadow-card: none;
  --font-heading: "IBM Plex Sans KR", sans-serif;
  --font-sans: "SUIT", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans", "Segoe UI", sans-serif;
}
* {
  box-sizing: border-box;
}
html {
  min-width: 0;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  min-width: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: .9375rem/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body:has(dialog[open]) {
  overflow: hidden;
}
button,
input,
select,
textarea {
  min-height: 44px;
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 0;
}
button:disabled {
  cursor: not-allowed;
  opacity: .5;
}
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  color: var(--blue-600);
  text-decoration: underline;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(49, 130, 246, .35);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}
body:not([data-page="collector"]) .coverage-panel {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3,
strong,
button,
th {
  color: var(--text);
  font-weight: 500;
}
h1 {
  margin: 0 0 8px;
  font-size: 1.875rem;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
  font-family: var(--font-heading);
}
h1 > span {
  color: var(--primary);
}
h2 {
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -.025em;
  font-family: var(--font-heading);
}
h3 {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  font-family: var(--font-heading);
}
p,
li {
  word-break: keep-all;
  overflow-wrap: anywhere;
}
small {
  font-size: .75rem;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
svg.icon {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
/* Navigation rail and mobile disclosure. */
.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: 216px;
  height: 100dvh;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px 12px;
  background: var(--gray-50);
  border-right: 1px solid var(--gray-200);
}
.brand {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  color: var(--gray-900);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.1;
  text-decoration: none;
  font-family: var(--font-heading);
  padding: 0 8px;
}
.brand:hover {
  color: var(--gray-900);
  text-decoration: none;
}
.brand-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1;
}
.brand-icon svg {
  display: block;
  width: 24px;
  height: 24px;
}
.brand small {
  display: block;
  margin-top: 4px;
  color: var(--gray-500);
  font-size: .6875rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.2;
  font-family: var(--font-sans);
}
.nav-section-label,
.nav-label {
  display: block;
  margin: 24px 12px 8px;
  color: var(--gray-500);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: 0;
}
.sidebar nav {
  display: grid;
  gap: 4px;
}
.nav,
.sidebar [data-go] {
  display: flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  color: var(--gray-700);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  transition: background-color .16s ease, color .16s ease;
}
.nav:hover,
.sidebar [data-go]:hover {
  background: var(--gray-50);
  color: var(--gray-900);
  text-decoration: none;
}
.nav.active,
.nav[aria-current="page"],
.sidebar [data-go].active,
.sidebar [data-go][aria-current="page"] {
  background: var(--light-blue);
  color: var(--primary);
}
.nav-icon {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  color: currentColor;
}
.nav-icon svg {
  width: 20px;
  height: 20px;
}
.nav > span:first-child:not(.nav-icon) {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  color: currentColor;
  font-size: 1.125rem;
}
.nav > span:not(:first-child):not(.nav-icon),
.nav > .nav-label-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-badge,
.nav small {
  min-height: 22px;
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-500);
  font-size: .6875rem;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
}
.nav-badge {
  background: var(--gray-100);
}
.sidebar-foot {
  margin-top: auto;
  padding: 20px 10px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--gray-200);
}
.state-seal {
  display: block;
  margin-bottom: 14px;
  color: var(--gray-300);
  font-size: 2.75rem;
  font-weight: 600;
  letter-spacing: -.08em;
  line-height: 1;
}
.sidebar-foot strong {
  display: block;
  font-size: .875rem;
}
.sidebar-foot p {
  margin: 8px 0 24px;
  color: var(--gray-600);
  font-size: .75rem;
  line-height: 1.55;
}
.small-note {
  color: var(--gray-500);
  font-size: .6875rem;
}
.workspace {
  min-width: 0;
  min-height: 100dvh;
  margin-left: 216px;
}
.top-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  color: var(--gray-600);
  font-size: .75rem;
  white-space: nowrap;
}
.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #20a464;
}
main {
  width: min(100%, 1560px);
  margin: 0 auto;
  padding: 32px 32px 56px;
  max-width: 1560px;
}
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; margin-bottom: 24px; }
.page-header h1 { margin: 0; font-size: 1.625rem; line-height: 1.3; }
.page-header .icon-btn { border-color: transparent; }
.map-panel > .panel-head { padding: 12px 16px; }
.map-panel .map-actions { margin-left: auto; }
.map-help { width: 100%; border-top: 1px solid var(--gray-200); }
.map-help summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--gray-600); }
.map-help p { padding-bottom: 12px; }
.eyebrow {
  color: var(--gray-500);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .08em;
  line-height: 1.3;
}
.button,
.section-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  padding: 10px 16px;
  overflow-wrap: anywhere;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.button:hover,
.section-link:hover {
  border-color: var(--blue-600);
  background: var(--blue-600);
  color: #fff;
  text-decoration: none;
}
.button.outline,
.section-link.outline {
  border-color: var(--gray-200);
  background: var(--surface);
  color: var(--gray-700);
}
.button.outline:hover,
.section-link.outline:hover {
  border-color: var(--gray-300);
  background: var(--gray-50);
  color: var(--gray-900);
}
.button.compact {
  min-height: 44px;
  padding: 8px 12px;
  font-size: .8125rem;
}
.button span {
  padding-left: 4px;
}
.icon-btn {
  display: inline-grid;
  width: 44px;
  height: 44px;
  min-height: 44px;
  flex: 0 0 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--surface);
  color: var(--gray-700);
  font-size: 1.25rem;
  line-height: 1;
  transition: background-color .16s ease, border-color .16s ease;
}
.icon-btn:hover {
  border-color: var(--gray-300);
  background: var(--gray-50);
}
.text-btn {
  min-height: 44px;
  padding: 8px 10px;
  background: transparent;
  color: var(--gray-600);
  font-size: .8125rem;
  font-weight: 600;
}
.text-btn:hover {
  color: var(--primary);
}
.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--light-blue);
  color: var(--blue-600);
  font-size: .6875rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}
.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(229, 232, 235, .8);
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.panel-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
}
.panel-head > div {
  min-width: 0;
}
.panel-head .eyebrow {
  display: block;
  margin-bottom: 5px;
}
.subtle {
  flex: 0 0 auto;
  color: var(--gray-500);
  font-size: .75rem;
  line-height: 1.4;
  white-space: nowrap;
}
.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
.map-layout.world-map {
  grid-template-columns: minmax(0, 1fr);
}
.map-panel {
  min-width: 0;
}
.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  margin-left: 0;
  flex: 1;
}
.map-toolbar > div {
  display: flex;
  align-items: center;
  gap: 4px;
}
.map-location {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--gray-600);
  font-size: .8125rem;
  overflow-wrap: anywhere;
}
.map-stage {
  position: relative;
  isolation: isolate;
  height: 440px;
  overflow: hidden;
  background: #f2f6fc;
}
#map {
  display: block;
  width: 100%;
  height: 100%;
}
.map-empty {
  position: absolute;
  z-index: 500;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(242, 246, 252, .86);
  text-align: center;
}
.map-empty > * {
  max-width: 460px;
}
.empty-cross,
.empty-state-icon {
  display: block;
  margin: 0 auto 12px;
  color: var(--primary);
  font-size: 2.625rem;
  font-weight: 400;
  line-height: 1;
}
svg.empty-cross,
svg.empty-state-icon {
  width: 48px;
  height: 48px;
}
.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 32px 24px;
  color: var(--gray-600);
  text-align: center;
}
.empty-state p {
  max-width: 440px;
  font-size: .875rem;
}
.map-empty h3 {
  margin-bottom: 8px;
}
.map-empty p {
  color: var(--gray-600);
  font-size: .875rem;
}
.compass {
  position: absolute;
  top: 16px;
  right: 20px;
  color: var(--gray-500);
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.7;
  pointer-events: none;
  text-align: center;
}
.map-watermark {
  position: absolute;
  z-index: 500;
  top: 16px;
  left: 20px;
  color: var(--gray-500);
  font-size: .625rem;
  font-weight: 600;
  letter-spacing: .04em;
  pointer-events: none;
}
.map-footer,
.map-caption {
  display: flex;
  flex-wrap: wrap;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  color: var(--gray-500);
  font-size: .75rem;
  line-height: 1.4;
}
#legend {
  display: flex;
  min-width: 0;
  flex-basis: 100%;
  max-height: 84px;
  overflow-y: auto;
  gap: 6px;
  flex-wrap: wrap;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gray-600);
  white-space: nowrap;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  background: var(--surface);
  font-size: .75rem;
}
.legend-item:hover,
.legend-item[aria-pressed="true"] { background: var(--blue-50, #e8f3ff); border-color: var(--primary); color: var(--primary); }
.map-actions,
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.map-status { display: flex; justify-content: space-between; gap: 12px; padding: 12px 24px 0; color: var(--gray-600); font-size: .75rem; }
.zoom-level { min-width: 46px; color: var(--gray-600); font-size: .75rem; text-align: center; font-variant-numeric: tabular-nums; }
#map-help { margin: 0; }
.map-view-empty { position: absolute; z-index: 500; inset: 0; display: grid; align-content: center; justify-items: center; gap: 12px; pointer-events: none; color: var(--gray-600); font-size: .8125rem; }
.map-view-empty p { padding: 8px 12px; background: rgba(255,255,255,.92); border-radius: 8px; }
.map-view-empty button { pointer-events: auto; }
body[data-page="map"] .map-stage { height: clamp(420px, 65vh, 760px); }
.map-panel:fullscreen { display: flex; flex-direction: column; width: 100%; height: 100%; border: 0; border-radius: 0; background: var(--surface); }
.map-panel:fullscreen .map-stage { flex: 1; height: auto; min-height: 0; }
.map-panel:fullscreen .panel-head { padding-top: 14px; padding-bottom: 14px; }
.map-panel:fullscreen #legend { max-height: 42px; }
#filter-reset { white-space: nowrap; width: 44px; min-width: 44px; flex: 0 0 44px; padding: 0; }
#search::-webkit-search-cancel-button { display: none; }
.search > .icon { flex: 0 0 auto; margin-right: 10px; color: var(--gray-500); }
.search .icon-btn { min-width: 36px; width: 36px; margin-right: -8px; }
.legend-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--primary);
}
.roster-panel,
.coverage-panel {
  margin-bottom: 24px;
}
.candidate-note {
  margin: -4px 0 14px;
  padding: 0 24px;
  color: var(--gray-600);
  font-size: .8125rem;
  line-height: 1.6;
}
.candidate-freshness {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 12px 24px;
  border-top: 1px solid var(--gray-200);
  color: var(--gray-500);
  font-size: .75rem;
}
.candidate-freshness strong { color: var(--gray-800); }
#unallied-section .rank { color: var(--primary); font-weight: 600; }
#unallied-section .panel-head { flex-wrap: wrap; }
.candidate-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.gift-panel { margin-bottom: 24px; }
.gift-panel .panel-head { flex-wrap: wrap; }
.gift-panel .gift-on { background: #e7f7ed; color: var(--green-700); }
.gift-intro,
.gift-note { margin: 0; padding: 0 24px 20px; color: var(--gray-600); font-size: .875rem; }
.gift-note { padding-top: 20px; font-size: .75rem; }
.gift-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 24px 20px; }
.gift-stats > div { display: flex; flex-direction: column; gap: 4px;     
  background: transparent;
  border: 0;
  border-left: 2px solid var(--gray-200);
  border-radius: 0;
  padding: 0 16px;
}
.gift-stats small,
.gift-code small { color: var(--gray-500); font-size: .75rem; }
.gift-stats strong { color: var(--gray-900); font-size: 1.5rem; }
.gift-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 0 24px 24px; }
.gift-actions span { color: var(--gray-600); font-size: .8125rem; }
.gift-form { display: grid; gap: 8px; margin: 0 24px 24px;    
  background: var(--gray-50);
  border: 0;
  border-radius: 8px;
  padding: 16px;
}
.gift-form label {
  font-weight: 500; }
.gift-form > div { display: flex; gap: 10px; }
.gift-form input { min-width: 0; flex: 1; padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: 10px; }
.gift-error { margin: 0 24px 20px; padding: 12px; border-radius: 10px; background: #fff0f0; color: var(--red-700); }
.gift-list-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 0 24px 12px; }
.gift-list-head h3 { margin: 0; font-size: 1rem; }
.gift-list-head a { font-size: .8125rem; }
.gift-code-list { display: grid; gap: 8px; padding: 0 24px; }
.gift-code { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px;    
  border: 0;
  border-bottom: 1px solid var(--gray-200);
  border-radius: 0;
  padding: 16px 0;
}
.gift-code > div:first-child { display: grid; gap: 3px; }
.gift-code-counts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; color: var(--gray-600); font-size: .8125rem; }
.gift-running { color: var(--blue-600); font-weight: 600; }
.gift-failed { color: var(--red-700); }
.gift-empty { color: var(--gray-500); }
.gift-roster { margin: 20px 24px 0; padding: 12px 0; border-top: 1px solid var(--gray-200); }
.gift-roster summary { cursor: pointer; color: var(--gray-700); font-weight: 600; }
.gift-roster > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 7px; max-height: 280px; overflow: auto; margin-top: 12px; color: var(--gray-600); font-size: .8125rem; }
.planner-panel { padding: 24px; margin-bottom: 16px; }
.planner-intro h2,
.planner-heading h3 { margin: 4px 0 6px;  
  font-size: 1.125rem;
}
.planner-intro p { margin: 0; color: var(--gray-600); }
.planner-kicker,
.planner-choice-tag { color: var(--blue-600); font-size: .75rem;  letter-spacing: .03em; 
  font-weight: 500;
}
.planner-load,
.planner-actions,
.planner-map-bottom,
.planner-map-top,
.planner-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.planner-load { margin-top: 20px; }
.planner-load select { min-width: 210px; max-width: 100%; padding: 0 12px; border: 1px solid var(--gray-300);  background: #fff; 
  border-radius: 8px;
}
.planner-error { margin: 16px 0 0; padding: 12px 14px; color: var(--red-700); background: #fff0f0; border-radius: 10px; }
.planner-start { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.planner-choice {
  padding: 24px; }
.planner-choice h3 { margin: 8px 0; font-size: 1.2rem; }
.planner-choice p { min-height: 3em; margin: 0 0 22px; color: var(--gray-600); }
.planner-heading { justify-content: space-between; margin-bottom: 18px; }
.planner-save-state { color: var(--gray-600); font-size: .8125rem; }
.planner-fields { display: grid; grid-template-columns: minmax(180px, 2fr) repeat(2, minmax(88px, .7fr)) minmax(160px, 1.5fr); gap: 10px; }
.planner-fields label,
.planner-target-form label { display: grid; gap: 5px; color: var(--gray-600); font-size: .8125rem; }
.planner-fields input,
.planner-fields select,
.planner-target-form input,
.planner-member-panel > input { width: 100%; min-width: 0; padding: 8px 11px; border: 1px solid var(--gray-300); border-radius: 10px; background: #fff; color: var(--gray-900); }
.planner-actions { margin-top: 16px; }
.planner-more { position: relative; }
.planner-more summary { display: flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 1px solid var(--gray-200); border-radius: 10px; color: var(--gray-700); cursor: pointer; list-style: none; }
.planner-more summary::-webkit-details-marker { display: none; }
.planner-more[open] > div { position: absolute; z-index: 5; right: 0; display: grid; gap: 4px; min-width: 220px; padding: 8px; border: 1px solid var(--gray-200); border-radius: 12px; background: #fff; box-shadow: var(--shadow-card); }
.planner-more[open] > div button { width: 100%; justify-content: flex-start; text-align: left; }
.planner-delete { padding: 8px 14px; border-radius: 10px; background: #fff; color: var(--red-700); }
.planner-delete:hover { background: #fff0f0; }
.planner-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 20px; }
.planner-stats > div { display: grid; padding: 12px; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 12px; }
.planner-stats strong { font-size: 1.2rem; }
.planner-stats small { color: var(--gray-600); }
.planner-feature-summary { margin-top: 14px; color: var(--gray-700); font-size: .8125rem; }
.planner-feature-summary summary { cursor: pointer; font-weight: 600; }
.planner-feature-summary > div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.planner-feature-summary > div span { padding: 5px 8px; border-radius: 8px; background: #fff6df; color: #7a4a00; }
.planner-freshness { margin: 16px 0 0; color: var(--gray-600); font-size: .8125rem; }
.planner-workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.planner-map-panel,
.planner-member-panel { min-width: 0; overflow: hidden; }
.planner-map-panel { overflow-x: auto; }
.planner-map-top,
.planner-map-bottom { justify-content: space-between; padding: 14px 18px; color: var(--gray-600); font-size: .8125rem; }
.planner-map-top > div { color: var(--gray-900); font-weight: 600; }
.planner-view { padding: 7px 12px; border: 1px solid var(--gray-200); border-radius: 9px; background: #fff; color: var(--gray-600); font-weight: 600; }
.planner-view.active { border-color: #3182f6; background: #eaf3ff; color: #1b64da; }
.planner-pointer { margin-left: auto; }
#planner-map { display: block; width: 100%; min-width: 1150px; aspect-ratio: 5 / 4; touch-action: manipulation; cursor: crosshair; border-block: 1px solid var(--gray-200); }
.planner-map-bottom { gap: 8px; }
.planner-map-bottom > span { margin-right: auto; }
.planner-zoom { min-width: 40px; min-height: 40px; border: 1px solid var(--gray-200); border-radius: 10px; background: #fff; font-size: 1.3rem; }
.planner-member-panel { padding: 18px; }
.planner-member-panel h3 { margin: 0 0 12px; font-size: 1rem; }
.planner-compare-help { margin: -4px 0 12px; color: var(--gray-600); font-size: .8125rem; }
.planner-member-panel > select { width: 100%; margin-top: 8px; padding: 8px 11px; border: 1px solid var(--gray-300); border-radius: 10px; background: #fff; }
.planner-selected { display: grid; gap: 4px; margin: 14px 0; padding: 14px; border: 1px solid #b4d3ff; border-radius: 12px; background: #f5f9ff; }
.planner-selected > small { color: var(--gray-600); }
.planner-target-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.planner-target-form label:nth-child(3),
.planner-target-form button { grid-column: 1 / -1; }
.planner-member-list { display: grid;  gap: 5px; max-height: 480px; overflow-y: auto; 
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
.planner-member { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: 10px; background: #fff; text-align: left; }
.planner-member:hover { background: var(--gray-50); }
.planner-member.active { background: var(--light-blue); border-color: #b4d3ff; }
.planner-member.conflict .planner-member-target { color: var(--red-700); font-weight: 600; }
.planner-member span:first-child { display: grid; min-width: 0; }
.planner-member strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planner-member small,
.planner-member-target { color: var(--gray-600); font-size: .75rem; }
.planner-member-target { flex: none; }
.planner-status-move,
.planner-status-unassigned { color: #995c00; font-weight: 600; }
.planner-status-same { color: #008568; }
.planner-status-unconfirmed,
.planner-status-conflict { color: var(--red-700); font-weight: 600; }

@media (max-width: 1000px) {
.planner-workspace { grid-template-columns: 1fr; }
.planner-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.planner-member-list { max-height: 320px; }
}
@media (max-width: 650px) {
.planner-panel,
.planner-choice { padding: 18px; }
.planner-start { grid-template-columns: 1fr; }
.planner-choice p { min-height: 0; }
.planner-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.planner-fields label:first-child,
.planner-fields label:last-child { grid-column: 1 / -1; }
.planner-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.planner-load select { width: 100%; }
.planner-actions .button { flex: 1 1 auto; }
#planner-map { min-width: 1150px; }
}
.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  flex-wrap: wrap;
}
.search {
  display: flex;
  min-width: 160px;
  min-height: 44px;
  flex: 1 1 auto;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--surface);
}
.search:focus-within {
  border-color: var(--primary);
  outline: 2px solid rgba(37, 99, 235, .2);
  outline-offset: 1px;
}
.search > span {
  margin-right: 10px;
  color: var(--gray-500);
  font-size: 1.375rem;
}
.search input:focus-visible { outline: 0; }
.search input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--gray-900);
  font-size: .875rem;
}
input::placeholder {
  color: var(--gray-500);
}
select {
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  background: var(--surface);
  color: var(--gray-800);
}
select {
  max-width: 220px;
}
select:hover {
  border-color: var(--gray-300);
}
.table-wrap {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  max-height: 720px;
  overscroll-behavior-y: contain;
}
table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  text-align: left;
}
th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 24px;
  background: var(--gray-50);
  color: var(--gray-600);
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
td {
  padding: 14px 24px;
  border-top: 1px solid var(--gray-200);
  color: var(--gray-700);
  font-size: .8125rem;
  vertical-align: middle;
}
td:first-child,
th:first-child { position: sticky; left: 0; }
td:first-child { z-index: 1; background: var(--surface); }
th:first-child { z-index: 3; }
tbody tr:hover td:first-child { background: var(--gray-50); }
td.coords { white-space: nowrap; font-variant-numeric: tabular-nums; }
tbody tr:hover {
  background: var(--gray-50);
}
.chief-btn {
  display: flex;
  min-width: 190px;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 0;
  overflow-wrap: anywhere;
  background: transparent;
  text-align: left;
}
.chief-btn > span:last-child {
  display: block;
  min-width: 0;
}
.chief-btn strong,
.chief-btn small {
  display: block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chief-btn strong {
  font-size: .875rem;
  font-weight: 500;
}
.chief-btn small,
.profile-meta {
  overflow-wrap: anywhere;
  color: var(--gray-500);
  font-size: .75rem;
  line-height: 1.4;
}
.avatar,
.detail-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 1.125rem;
  font-weight: 500;
}
.detail-avatar {
  width: 56px;
  height: 56px;
  flex-basis: 56px;
  border-radius: 12px;
  font-size: 1.5rem;
  margin-bottom: 12px;
}
.alliance-tag {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 9px;
  border-radius: 5px;
  background: var(--light-blue);
  color: var(--primary);
  font-size: .75rem;
  font-weight: 500;
  white-space: nowrap;
}
.coords,
.coverage-stats strong,
.detail-stats strong {
  font-variant-numeric: tabular-nums;
}
.coords {
  color: var(--gray-700);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
}
.star {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: transparent;
  color: var(--gray-400);
  font-size: 1.25rem;
}
.star.selected {
  color: var(--yellow-700);
}
.empty-inline {
  min-height: 130px;
  padding: 40px 24px;
  color: var(--gray-600);
  font-size: .875rem;
  text-align: center;
}
.alliance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.alliance-search { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.alliance-search .search { max-width: 420px; }
.alliance-card {
  border: 1px solid var(--gray-200);
  min-width: 0;
  padding: 24px;
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.alliance-card h2 {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
  color: var(--gray-900);
}
.alliance-card p {
  margin-bottom: 8px;
  color: var(--gray-600);
  font-size: .875rem;
}
.alliance-card small {
  color: var(--gray-500);
  font-size: .75rem;
}
footer {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  color: var(--gray-500);
  font-size: .75rem;
  line-height: 1.45;
}
footer > span:first-child {
  flex: 0 0 auto;
  color: var(--gray-700);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .02em;
}
footer > span:nth-child(2) {
  max-width: 680px;
  text-align: center;
}
dialog {
  width: min(640px, calc(100vw - 32px));
  max-width: 640px;
  max-height: 88dvh;
  margin: auto;
  padding: 28px;
  overflow: auto;
  border: 0;
  border-radius: 24px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(25, 31, 40, .22);
}
dialog::backdrop {
  background: rgba(25, 31, 40, .34);
}
.dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
dialog h2 {
  margin: 12px 0;
  overflow-wrap: anywhere;
  font-size: 1.5rem;
}
dialog h3 {
  margin-top: 24px;
}
dialog p,
dialog li {
  color: var(--gray-700);
  font-size: .875rem;
}
dialog p {
  margin: 14px 0;
}
dialog ol {
  padding-left: 22px;
}
pre {
  max-width: 100%;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  background: var(--gray-50);
  color: var(--gray-800);
  font-size: .8125rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.notice {
  padding-left: 14px;
  border-left: 3px solid var(--primary);
  color: var(--gray-700);
}
.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}
.detail-stats > div {
  min-width: 0;
  padding: 14px;
  border-radius: 10px;
  background: var(--gray-50);
}
.detail-stats small {
  display: block;
  color: var(--gray-500);
  font-size: .75rem;
}
.detail-stats strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: var(--gray-900);
  font-size: 1rem;
}
.detail-freshness {
  margin: 20px 0;
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}
.detail-freshness summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  color: var(--gray-700);
  cursor: pointer;
  font-size: .875rem;
  font-weight: 600;
}
.detail-freshness summary:focus-visible {
  outline: 3px solid rgba(49, 130, 246, .25);
  outline-offset: 4px;
}
.detail-freshness[open] summary {
  border-bottom: 1px solid var(--gray-200);
}
.detail-freshness > .detail-stats {
  margin: 16px 0;
}
.history-row {
  padding: 14px 0;
  border-top: 1px solid var(--gray-200);
  color: var(--gray-700);
  font-size: .8125rem;
}
.history-row time {
  display: block;
  margin-bottom: 5px;
  color: var(--gray-500);
  font-size: .75rem;
}
.history-row p {
  margin-top: 5px;
  white-space: pre-wrap;
}
.stale {
  color: var(--yellow-700);
}
#error {
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid #f2c7c7;
  border-radius: 10px;
  background: #fff4f4;
  color: var(--red-700);
  font-size: .875rem;
}
#toast {
  position: fixed;
  z-index: 50;
  bottom: 24px;
  left: 50%;
  max-width: min(90vw, 560px);
  padding: 12px 18px;
  transform: translateX(-50%);
  border-radius: 12px;
  background: var(--gray-900);
  color: #fff;
  box-shadow: 0 8px 30px rgba(25, 31, 40, .2);
  font-size: .875rem;
  text-align: center;
}
.skip {
  position: fixed;
  z-index: 100;
  top: -80px;
  left: 12px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
}
.skip:focus {
  top: 12px;
}
/* Coverage and operation panels share the same roomy card rhythm. */
.coverage-summary {
  padding: 0 24px 18px;
  color: var(--gray-600);
  font-size: .875rem;
}
.coverage-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0 24px 20px;
}
.coverage-stats > div {
  min-width: 0;
  padding: 14px;
  border-radius: 10px;
  background: var(--gray-50);
}
.coverage-stats small {
  display: block;
  color: var(--gray-500);
  font-size: .75rem;
  line-height: 1.35;
}
.coverage-stats strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: var(--gray-900);
  font-size: 1.125rem;
}
.coverage-freshness {
  display: flex;
  gap: 8px 20px;
  flex-wrap: wrap;
  padding: 0 24px 20px;
  color: var(--gray-500);
  font-size: .75rem;
}
.coverage-audit {
  padding: 18px 24px 22px;
  border-top: 1px solid var(--gray-200);
}
.coverage-audit summary {
  min-height: 44px;
  padding: 10px 0;
  color: var(--gray-700);
  cursor: pointer;
  font-size: .875rem;
  font-weight: 600;
}
.coverage-audit[open] summary {
  margin-bottom: 8px;
}
.coverage-check {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(0, 2fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--gray-200);
  color: var(--gray-700);
  font-size: .8125rem;
}
.coverage-check:first-child {
  border-top: 0;
}
.coverage-check small {
  color: var(--gray-500);
  font-size: .75rem;
}
.coverage-check-status {
  color: var(--yellow-700);
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.coverage-check-status.verified {
  color: var(--green-700);
}
.roster-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
  color: var(--gray-600);
  font-size: .8125rem;
}
.roster-pagination .button {
  min-width: 72px;
}
.world-id-note {
  color: var(--gray-600);
  font-size: .75rem;
}
.power-trend {
  display: block;
  width: 100%;
  height: auto;
  margin: 18px 0;
  overflow: hidden;
  border-radius: 10px;
  background: #f2f6fc;
}
.is-loading .loading-state,
.is-loading [data-loading-skeleton] {
  animation: skeleton-pulse 1.4s ease-in-out infinite;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--gray-100), var(--gray-50), var(--gray-100));
  background-size: 200% 100%;
}

@keyframes skeleton-pulse {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
strong { font-weight: 600; }
.section-link { border-color: transparent; background: transparent; color: var(--primary); }
.section-link:hover { border-color: transparent; background: var(--light-blue); color: var(--blue-600); }
.site-navigation > summary { display: none; }
.alliance-seal { display: grid; place-items: center; width: 38px; height: 38px; background: var(--gray-100); color: var(--gray-700); border-radius: 9px; font-weight: 600; }
.sidebar-foot .small-note { display: block; margin-top: 3px; }
#search-section { margin-bottom: 16px; }
#filter-reset[hidden] { display: inline-flex !important; visibility: hidden; pointer-events: none; }
.map-legend { flex-basis: 100%; width: 100%; border-top: 1px solid var(--gray-200); }
.map-legend summary { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; color: var(--gray-600); list-style: none; }
.map-legend summary::-webkit-details-marker { display: none; }
.map-legend summary::after { content: '+'; margin-left: auto; font-size: 18px; }
.map-legend[open] summary::after { content: '−'; }
#legend { max-height: 180px; padding-bottom: 4px; }
.planner-stats > div { background: transparent; border: 0; border-left: 1px solid var(--gray-200); border-radius: 0; }
.map-panel .panel-head { flex-wrap: wrap; }
.map-toolbar { font-size: .75rem; }
.gift-manual { margin: 20px 24px 0; border-top: 1px solid var(--gray-200); }
.gift-manual > summary { min-height: 44px; padding: 12px 0; cursor: pointer; color: var(--gray-700); font-size: .875rem; }
.gift-manual .gift-form { margin: 0 0 12px; }
.gift-actions .button { flex: 0 0 auto; }
.gift-actions > span { flex: 1 1 280px; }
@media (max-width: 760px) {
.gift-manual { margin-inline: 16px; }
.map-actions .button { padding-inline: 8px; }
.map-actions { margin-left: auto; }
#map-fullscreen { font-size: .75rem; }
.map-location { font-size: .75rem; }
}
@media (min-width: 1840px) {
.planner-workspace { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.planner-member-list { grid-template-columns: 1fr; max-height: 640px; }
}

@media (max-width: 1199px) {
main {
    padding: 32px 28px 56px;
  }

}

@media (max-width: 1000px) {
.map-layout,
.map-layout.world-map {
    grid-template-columns: minmax(0, 1fr);
  }
.coverage-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
.alliance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
.sidebar {
    position: sticky; top: 0; inset-inline: 0; display: flex; flex-direction: row;
    align-items: center; justify-content: space-between; width: 100%; height: 68px;
    overflow: visible; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--gray-200);
  }
.brand { margin: 0; padding: 0; font-size: 1.0625rem; }
.brand-icon { width: 32px; height: 32px; flex-basis: 32px; }
.sidebar-foot { display: none; }
.site-navigation > summary { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; color: var(--gray-700); cursor: pointer; list-style: none; }
.site-navigation > summary::-webkit-details-marker { display: none; }
.site-navigation .menu-close-icon,
.site-navigation[open] .menu-open-icon { display: none; }
.site-navigation[open] .menu-close-icon { display: block; }
.site-navigation[open] > summary { background: var(--gray-100); }
.sidebar nav { position: absolute; top: 67px; left: 0; right: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 8px; max-height: calc(100dvh - 80px); overflow-y: auto; padding: 8px 16px 20px; background: var(--surface); border-bottom: 1px solid var(--gray-200); box-shadow: 0 16px 24px rgba(23,35,55,.08); }
.nav-section-label { grid-column: 1 / -1; margin: 16px 12px 4px; }
.nav,
.sidebar [data-go] { width: 100%; min-width: 0; padding: 12px; border-radius: 8px; font-size: .875rem; }
.nav small { display: none; }
#filter-reset { min-height: 44px; }
.map-toolbar .zoom-level { display: none; }
#zoom-reset { padding-inline: 8px; min-width: 44px; }
.planner-pointer { flex-basis: 100%; margin-left: 0; }
.workspace {
    margin-left: 0;
  }
.top-actions {
    gap: 6px;
    font-size: .6875rem;
  }
.top-actions > span:not(.status-dot) {
    display: none;
  }
main {
    padding: 24px 16px 44px;
  }
h1 {
    margin-top: 7px;
    font-size: 1.625rem;
  }
.panel-head {
    padding: 20px 16px;
  }
.candidate-note { padding: 0 16px; }
.candidate-freshness { padding: 12px 16px; }
.gift-intro,
.gift-note { padding-left: 16px; padding-right: 16px; }
.gift-stats,
.gift-actions,
.gift-code-list,
.gift-list-head { padding-left: 16px; padding-right: 16px; }
.gift-form,
.gift-roster { margin-left: 16px; margin-right: 16px; }
.gift-form > div { flex-wrap: wrap; }
.gift-form input,
.gift-form button { flex: 1 1 100%; }
.map-toolbar {
    order: 3;
    flex: 1 0 100%;
    width: 100%;
    padding: 0;
    flex-wrap: wrap;
  }
.map-toolbar > div {
    margin-left: auto;
  }
.map-panel .panel-head {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }
.map-panel .panel-head .button,
.map-toolbar button,
.map-location {
    white-space: nowrap;
    flex-shrink: 0;
  }
.map-stage {
    height: 340px;
  }
body[data-page="map"] .map-stage { height: min(62dvh, 580px); min-height: 340px; }
.map-panel:fullscreen .map-stage { height: auto; min-height: 0; }
.map-actions { width: auto; }
.map-actions .button { flex: 1; }
.map-status { padding-right: 16px; padding-left: 16px; flex-wrap: wrap; gap: 4px; }
.legend-item { min-height: 42px; }
.roster-pagination { gap: 8px; }
.roster-pagination .button { min-width: 56px; padding: 8px; }
.map-footer,
.map-caption {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 16px;
  }
.filters {
    align-items: stretch;
    flex-wrap: wrap;
    padding: 0;
  }
.search {
    flex-basis: 100%;
  }
.filters select {
    max-width: none;
    flex: 1 1 80px;
  }
th,
td {
    padding-right: 16px;
    padding-left: 16px;
  }
.chief-btn { min-width: 160px; }
.chief-btn strong,
.chief-btn small {
    max-width: 136px;
  }
.alliance-grid {
    grid-template-columns: minmax(0, 1fr);
  }
.alliance-card {
    padding: 20px 16px;
  }
.detail-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
.detail-stats > div:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
.coverage-summary,
.coverage-freshness,
.coverage-audit {
    padding-right: 16px;
    padding-left: 16px;
  }
.coverage-stats {
    gap: 8px;
    padding-right: 16px;
    padding-left: 16px;
  }
.coverage-check {
    grid-template-columns: minmax(0, 1fr) auto;
  }
.coverage-check small {
    grid-column: 1 / -1;
  }
.roster-pagination {
    padding-right: 16px;
    padding-left: 16px;
  }
footer {
    flex-direction: column;
    gap: 8px;
    margin-top: 32px;
  }
footer > span:nth-child(2) {
    max-width: none;
    text-align: left;
  }
footer > span:last-child {
    display: none;
  }
dialog {
    width: calc(100% - 32px);
    max-height: 88dvh;
    padding: 24px 20px;
    border-radius: 20px;
  }
}

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

@media (max-width: 760px) {
  main { padding-top: 16px; }
  .page-header { margin-bottom: 16px; gap: 8px; }
  .page-header h1 { font-size: 1.375rem; }
  .page-header .top-actions { flex-shrink: 0; gap: 0; }
  .map-panel > .panel-head { padding: 10px 12px; }
}

/* Main navigation: top bar on desktop, compact menu on mobile. */
@media (min-width: 761px) {
  .sidebar { position: sticky; inset: auto; top: 0; width: 100%; height: auto; min-height: 80px; padding: 16px 32px; flex-direction: row; align-items: center; gap: 28px; border-right: 0; border-bottom: 1px solid var(--gray-200); background: #fff; }
  .brand { flex-shrink: 0; }
  .site-navigation { margin-left: auto; }
  .sidebar nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
  .nav-section-label, .sidebar-foot, .nav small { display: none; }
  .nav { width: auto; gap: 6px; padding: 10px; }
  .sidebar .nav-icon { display: none; }
  .workspace { margin-left: 0; }
  main { max-width: 1280px; padding-top: 40px; }
  .nav.active { border-radius: 0; background: transparent; box-shadow: inset 0 -2px var(--primary); }

}
@media (max-width: 760px) {
  .sidebar { background: #fff; }
  main { padding-inline: 20px; }
}

/* Mobile workflow: map first, secondary actions below it. */
@media (max-width: 760px) {
  input, select, textarea, .search input, .filters select { font-size: 16px; }
  main { padding-top: 16px; }
  .page-header { margin-bottom: 12px; }
  .map-panel { display: flex; flex-direction: column; }
  .map-stage { order: -1; }
  body[data-page="map"] .map-stage { height: clamp(300px, 48svh, 420px); min-height: 0; }
  .map-panel .panel-head { padding: 10px 12px; gap: 8px; }
  .map-toolbar { order: 0; }
  .map-actions { width: 100%; }
  .map-actions .button { flex: 1; }
  .map-footer .section-link, .map-help summary { min-height: 44px; }
  .map-panel:fullscreen .map-stage { height: auto; min-height: 0; }
}


/* Player history: individual observations, without backfilling current values. */
#detail { width: min(860px, calc(100vw - 32px)); max-width: 860px; }
#detail .dialog-top { position: sticky; top: -28px; z-index: 1000; padding-block: 8px; background: var(--surface); }
.player-history-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--gray-200); }
.player-history-section h3 { margin: 0 0 10px; font-size: 1.125rem; font-weight: 500; }
#detail .history-note { font-size: .8125rem; line-height: 1.7; color: var(--gray-500); }
.history-totals { font-variant-numeric: tabular-nums; }
.trend-summary { display: flex; flex-direction: column; gap: 5px; margin-top: 18px; font-variant-numeric: tabular-nums; }
.trend-summary strong { font-size: clamp(1.75rem, 4vw, 2rem); font-weight: 600; letter-spacing: -.035em; line-height: 1.25; }
.trend-summary span { font-size: .8125rem; color: var(--gray-600); }
.trend-period { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 14px; color: var(--gray-500); font-size: .75rem; }
.trend-live { border-radius: 6px; padding: 3px 7px; background: var(--gray-100); color: var(--primary); }
.detail-power-chart { width: 100%; height: 224px; display: block; margin-block: 8px 0; overflow: visible; }
.detail-power-chart text { font-family: var(--font-sans); font-size: 11px; fill: var(--gray-500); font-variant-numeric: tabular-nums; }
.chart-grid { stroke: var(--gray-200); stroke-width: 1; stroke-dasharray: 2 5; }
.chart-line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linecap: round; }
.chart-gap { stroke-dasharray: 5 5; }
.chart-dot { fill: var(--primary); stroke: var(--surface); stroke-width: 2; }
.chart-halo { fill: var(--primary); opacity: .12; }
.chart-hit { fill: transparent; cursor: pointer; }
.chart-hit:focus { outline: none; }
.chart-hit:focus-visible { stroke: var(--primary); stroke-width: 1; stroke-dasharray: 3 3; }
#detail .trend-readout { margin: 0 0 8px; padding: 10px 12px; border-radius: 8px; background: var(--gray-100); color: var(--gray-600); font-size: .75rem; font-variant-numeric: tabular-nums; }
.history-values summary { min-height: 44px; display: flex; align-items: center; color: var(--gray-600); cursor: pointer; }
.history-values table { min-width: 510px; }
.history-period { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid var(--gray-100); }
.history-period strong { font-weight: 500; overflow-wrap: anywhere; }
.history-period time { grid-column: 1 / -1; font-size: .8125rem; color: var(--gray-500); }
.history-period > span { font-size: .8125rem; color: var(--gray-600); }
.detail-history-map.leaflet-container { height: 340px; border: 1px solid var(--gray-200); border-radius: 12px; margin: 16px 0 10px; background: #eaf0f5; }
.detail-history-map .history-marker { display: grid; place-items: center; }
.history-marker span { display: block; min-width: 30px; min-height: 30px; padding: 4px; border: 2px solid white; border-radius: 16px; background: var(--primary); color: white; font: 600 12px/18px var(--font-sans); text-align: center; box-shadow: 0 1px 5px #17233740; }
#detail .movement-list { list-style: none; margin: 12px 0 0; padding: 0; }
.movement-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--gray-100); }
.movement-jump { grid-column: 1 / -1; text-align: left; background: transparent; color: var(--primary); padding: 4px 0; min-height: 44px; font-weight: 500; }
.movement-list time, .movement-list small { color: var(--gray-500); font-size: .75rem; }
@media (max-width: 760px) {
  #detail { width: 100%; max-width: none; max-height: 92dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); }
  #detail .dialog-top { top: -20px; }
  .detail-history-map.leaflet-container { height: 300px; }
  .movement-list li { grid-template-columns: minmax(0, 1fr); }
  #detail .detail-history-map .leaflet-control-zoom a { width: 44px; height: 44px; line-height: 44px; }
}

.detail-identity { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.detail-identity > div { min-width: 0; }
.detail-identity .detail-avatar { margin: 0; flex-shrink: 0; }
.detail-identity h2 { margin: 6px 0; overflow-wrap: anywhere; }
.detail-identity .profile-meta { margin: 0; overflow-wrap: anywhere; }
#detail .detail-stats { margin-top: 12px; }
#detail .detail-freshness { margin-block: 16px 0; }
#detail .detail-freshness + div > .player-history-section:first-child { margin-top: 16px; padding-top: 16px; }
