
:root {
  --canvas: #eef8ff;
  --canvas-2: #f8fcff;
  --surface: rgba(255,255,255,.94);
  --ink: #10203b;
  --muted: #697b96;
  --line: #dceaf5;
  --blue: #2f8bd8;
  --deep-blue: #1768ae;
  --sky: #53b7de;
  --orange: #ff7b3f;
  --mint: #31aa78;
  --violet: #875fd6;
  --soft-blue: #eaf5ff;
  --soft-orange: #fff1e9;
  --soft-mint: #e9f8f1;
  --soft-violet: #f1ecfb;
  --shadow: 0 18px 48px rgba(48, 91, 130, .11);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { background: var(--canvas); }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 5%, rgba(88, 184, 225, .14), transparent 28%),
    linear-gradient(145deg, var(--canvas-2) 0%, var(--canvas) 62%, #e7f5ff 100%);
  font-family: Inter, "Noto Sans JP", "Yu Gothic UI", "Hiragino Kaku Gothic ProN",
               "Segoe UI", system-ui, sans-serif;
  line-height: 1.6;
}

button, select { font: inherit; }
button { cursor: pointer; }

.page-shell {
  width: min(1600px, calc(100% - 64px));
  margin: 0 auto;
}

.site-header {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  text-decoration: none;
}

.brand strong {
  font-size: 15px;
  letter-spacing: .14em;
}

.brand strong span { color: var(--blue); }

.brand small {
  color: #8290a6;
  letter-spacing: .15em;
  font-size: 12px;
}

.header-nav {
  display: inline-flex;
  padding: 3px;
  border: 1px solid #dce7f0;
  border-radius: 12px;
  background: rgba(255,255,255,.75);
  box-shadow: 0 6px 20px rgba(48,91,130,.06);
}

.lang-pill {
  border: 0;
  background: transparent;
  padding: 8px 18px;
  border-radius: 9px;
  color: #34435b;
  font-size: 12px;
}

.lang-pill.active {
  background: var(--blue);
  color: white;
  box-shadow: 0 4px 12px rgba(47,139,216,.28);
}

.hero {
  display: grid;
  grid-template-columns: 1.45fr .65fr;
  gap: 36px;
  min-height: 205px;
  align-items: center;
  padding: 26px 0 34px;
}

.section-kicker {
  margin: 0 0 12px;
  color: #71849f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 18px;
  max-width: 890px;
  font-size: clamp(38px, 4.2vw, 64px);
  line-height: 1.11;
  letter-spacing: -.035em;
}

.hero-lede {
  margin-bottom: 0;
  color: #627590;
  font-size: 15px;
}

.aoi-message {
  min-height: 145px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 18px 24px;
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(234,246,255,.88), rgba(255,255,255,.9));
  box-shadow: var(--shadow);
}

.aoi-copy p {
  margin: 0;
  color: #3e79b2;
  font-size: 14px;
  font-weight: 650;
}

.aoi-copy strong {
  display: block;
  margin-top: 14px;
  color: var(--deep-blue);
  font-size: 15px;
}

.aoi-mascot-slot {
  width: 135px;
  height: 125px;
  display: grid;
  place-items: center;
}

.aoi-mascot-slot.has-artwork .aoi-placeholder { display: none; }

.aoi-placeholder {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 2px solid #a8d9f4;
  border-radius: 48% 48% 44% 44%;
  background: #fff;
  color: var(--blue);
  box-shadow: 0 10px 22px rgba(47,139,216,.14);
}

.aoi-placeholder .heart {
  line-height: 1;
  font-size: 28px;
}

.aoi-placeholder span {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .12em;
}

.card {
  border: 1px solid rgba(217,232,243,.92);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.data-alert {
  padding: 13px 16px;
  margin-bottom: 18px;
  border: 1px solid #ffd4cc;
  border-radius: 12px;
  background: #fff2f0;
  color: #99483d;
  font-size: 13px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.kpi-card {
  position: relative;
  min-height: 118px;
  padding: 18px 18px 15px 72px;
  overflow: hidden;
}

.kpi-icon {
  position: absolute;
  top: 19px;
  left: 19px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 19px;
}

.kpi-label {
  color: #64758e;
  font-size: 12px;
  font-weight: 700;
}

.kpi-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 6px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 850;
  letter-spacing: -.025em;
}

.delta-chip {
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}

.kpi-meta {
  margin-top: 5px;
  color: #8895a8;
  font-size: 10px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1.07fr 1fr;
  gap: 20px;
}

.chart-card, .map-card { padding: 22px; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.title-line {
  display: flex;
  align-items: center;
  gap: 9px;
}

.card h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -.02em;
}

.badge {
  color: #536a84;
  font-size: 11px;
  font-weight: 700;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  color: #657690;
  font-size: 11px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot-line {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.chart-controls label {
  display: grid;
  gap: 4px;
  color: #7a899f;
  font-size: 10px;
}

select {
  border: 1px solid #dae6ef;
  border-radius: 10px;
  padding: 8px 11px;
  background: #fff;
  color: #283950;
}

.chart-wrap {
  position: relative;
  height: 355px;
}

.chart-note {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  margin-top: 11px;
  border-radius: 8px;
  background: #ebf6ff;
  color: #54728f;
  font-size: 10px;
}

.info-icon {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border: 1px solid #68afe2;
  border-radius: 50%;
  color: #3a92d3;
  font-weight: 850;
}

.subtle {
  margin: 5px 0 0;
  color: #71819a;
  font-size: 11px;
}

.coverage-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #36986f;
  font-size: 11px;
  font-weight: 750;
}

.coverage-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
}

.map-stage {
  position: relative;
  height: 410px;
  overflow: hidden;
  border: 1px solid #dbeaf5;
  border-radius: 15px;
  background:
    radial-gradient(circle at 70% 30%, rgba(103,197,231,.20), transparent 35%),
    linear-gradient(145deg, #e9f7ff, #dceffb);
}

.japan-map {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 10px;
}

.japan-map svg {
  width: 100%;
  height: 100%;
  max-height: 405px;
}

.japan-map .prefecture {
  fill: #f9f7eb !important;
  stroke: #7da3bd !important;
  stroke-width: 1.4px !important;
  cursor: pointer;
  transition: fill .15s ease, filter .15s ease, transform .15s ease;
}

.japan-map .prefecture:hover {
  fill: #d8f1ff !important;
  filter: drop-shadow(0 2px 3px rgba(45,105,145,.2));
}

.japan-map .prefecture[data-status="available"] {
  fill: #dff6ea !important;
  stroke: #49a77d !important;
}

.japan-map .prefecture[data-status="preparing"] {
  fill: #fff7dd !important;
  stroke: #d7aa4e !important;
}

.japan-map .prefecture.selected {
  fill: #bce9ff !important;
  stroke: #2488c9 !important;
  stroke-width: 2.2px !important;
}

.prefecture-panel {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 205px;
  padding: 15px;
  border: 1px solid #d8e5ef;
  border-radius: 14px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 13px 30px rgba(36,84,122,.14);
}

.prefecture-panel h3 {
  margin: 3px 0 8px;
  font-size: 17px;
}

.prefecture-panel p {
  margin-bottom: 9px;
  color: #75839a;
  font-size: 10px;
}

.panel-status {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 7px;
  background: #f0f3f7;
  color: #748399;
  font-size: 9px;
  font-weight: 750;
}

.panel-metric {
  margin: 8px 0;
  font-size: 11px;
}

.primary-button, .secondary-button {
  width: 100%;
  border: 0;
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 750;
}

.primary-button {
  background: var(--blue);
  color: white;
}

.primary-button:disabled {
  background: #dbe4ec;
  color: #8a98a9;
  cursor: default;
}

.secondary-button {
  margin-top: 12px;
  border: 1px solid #8fc4e8;
  background: #f6fbff;
  color: #287cba;
}

.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 11px;
  color: #6f7f96;
  font-size: 9px;
}

.status-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot.available { background: var(--mint); }
.dot.preparing { background: #e0ae3c; }
.dot.planned { background: #88a4bd; }
.dot.untouched { background: #c8d0db; }

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.info-card { padding: 21px; }

.info-card-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.info-card-title h3 {
  margin: 0;
  font-size: 18px;
}

.info-card > p {
  margin: 12px 0 0;
  color: #5e7089;
  font-size: 11px;
}

.icon-chip {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  font-weight: 850;
}

.icon-chip.blue { background: #e7f3ff; color: var(--blue); }
.icon-chip.sky { background: #e6f7fc; color: #329cc9; }

.concept-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  text-align: center;
}

.concept-flow > div {
  display: grid;
  gap: 2px;
}

.concept-flow > div > span { font-size: 20px; }
.concept-flow b { font-size: 10px; }
.concept-flow small { color: #8190a5; font-size: 9px; }

.provenance-body {
  min-height: 93px;
  display: grid;
  gap: 5px;
  margin-top: 13px;
  color: #63748b;
  font-size: 10px;
}

.provenance-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
}

.provenance-row strong { color: #344a64; }
.provenance-row code { overflow-wrap: anywhere; }

.site-footer {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 1.3fr;
  gap: 30px;
  align-items: center;
  margin-top: 22px;
  padding: 21px 14px 28px;
  border-top: 1px solid #d8e8f3;
  color: #62738c;
  font-size: 10px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.footer-brand strong {
  color: var(--deep-blue);
  font-size: 13px;
}

.footer-brand p { margin: 3px 0 0; }

.mini-aoi {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #b7dbef;
  border-radius: 50%;
  background: white;
  color: var(--blue);
  font-size: 18px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  color: #287bb7;
  font-weight: 650;
}

.footer-legal {
  display: grid;
  justify-items: end;
  text-align: right;
}

.footer-legal strong { color: #354961; }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .workspace-grid { grid-template-columns: 1fr; }
  .map-stage { height: 520px; }
}

@media (max-width: 820px) {
  .page-shell { width: min(100% - 28px, 1600px); }
  .hero { grid-template-columns: 1fr; }
  .aoi-message { max-width: 520px; }
  .kpi-grid, .info-grid { grid-template-columns: 1fr 1fr; }
  .site-footer { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; flex-wrap: wrap; }
  .footer-legal { justify-items: start; text-align: left; }
}

@media (max-width: 560px) {
  .brand small { display: none; }
  .lang-pill { padding-inline: 9px; }
  .kpi-grid, .info-grid { grid-template-columns: 1fr; }
  .prefecture-panel {
    position: static;
    width: auto;
    margin: 8px;
  }
  .map-stage { height: auto; }
  .japan-map { min-height: 430px; }
}


/* v1.8 readability and time-range controls */
body { font-size: 16px; }
.hero-lede { font-size: 16px; }
.kpi-label { font-size: 13px; }
.kpi-meta { font-size: 11px; }
.legend { font-size: 12px; }
.chart-controls { display:flex; gap:10px; align-items:end; flex-wrap:wrap; }
.chart-controls label { font-size:11px; }
.chart-controls select { min-width:104px; font-size:12px; }
.card h2 { font-size:22px; }
.subtle { font-size:12px; }
.chart-note { font-size:11px; }
.info-card > p { font-size:12px; }
.provenance-body { font-size:11px; }
.site-footer { font-size:11px; }

.range-summary {
  margin: 8px 0 0;
  color: #74859c;
  font-size: 11px;
}


/* v1.9 accessibility controls */
html {
  font-size: calc(16px * var(--font-scale, 1));
}

body {
  font-size: 1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.font-controls {
  display: inline-flex;
  padding: 3px;
  border: 1px solid #dce7f0;
  border-radius: 12px;
  background: rgba(255,255,255,.75);
  box-shadow: 0 6px 20px rgba(48,91,130,.06);
}

.font-button {
  min-width: 36px;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 9px;
  color: #34435b;
  font-weight: 750;
}

.font-button:hover,
.font-button.active {
  background: #e8f4ff;
  color: #1768ae;
}

@media (max-width: 720px) {
  .site-header {
    height: auto;
    padding: 12px 0;
    align-items: flex-start;
    gap: 12px;
  }
  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}


/* v1.10 real accessibility font scaling.
   Most of the visual system was authored with px values, so changing the root
   font size alone did not affect the page. These rules explicitly multiply
   user-facing typography while preserving layout geometry. */
:root { --font-scale: 1; }

body { font-size: calc(16px * var(--font-scale)); }

.brand strong { font-size: calc(15px * var(--font-scale)); }
.brand small { font-size: calc(11px * var(--font-scale)); }
.lang-pill { font-size: calc(12px * var(--font-scale)); }
.font-button { font-size: calc(16px * var(--font-scale)); }

.section-kicker { font-size: calc(12px * var(--font-scale)); }
h1 { font-size: clamp(calc(38px * var(--font-scale)), calc(4.2vw * var(--font-scale)), calc(64px * var(--font-scale))); }
.hero-lede { font-size: calc(15px * var(--font-scale)); }
.aoi-copy p { font-size: calc(14px * var(--font-scale)); }
.aoi-copy strong { font-size: calc(15px * var(--font-scale)); }

.kpi-label { font-size: calc(12px * var(--font-scale)); }
.kpi-value { font-size: calc(28px * var(--font-scale)); }
.delta-chip { font-size: calc(11px * var(--font-scale)); }
.kpi-meta { font-size: calc(10px * var(--font-scale)); }

.card h2 { font-size: calc(20px * var(--font-scale)); }
.badge { font-size: calc(11px * var(--font-scale)); }
.legend { font-size: calc(11px * var(--font-scale)); }
.chart-controls label { font-size: calc(10px * var(--font-scale)); }
select { font-size: calc(12px * var(--font-scale)); }
.range-summary { font-size: calc(11px * var(--font-scale)); }
.chart-note { font-size: calc(10px * var(--font-scale)); }
.subtle { font-size: calc(11px * var(--font-scale)); }
.coverage-pill { font-size: calc(11px * var(--font-scale)); }

.prefecture-panel h3 { font-size: calc(17px * var(--font-scale)); }
.prefecture-panel p { font-size: calc(10px * var(--font-scale)); }
.panel-status { font-size: calc(9px * var(--font-scale)); }
.panel-metric { font-size: calc(11px * var(--font-scale)); }
.primary-button, .secondary-button { font-size: calc(11px * var(--font-scale)); }
.status-legend { font-size: calc(9px * var(--font-scale)); }

.info-card-title h3 { font-size: calc(18px * var(--font-scale)); }
.info-card > p { font-size: calc(11px * var(--font-scale)); }
.concept-flow b { font-size: calc(10px * var(--font-scale)); }
.concept-flow small { font-size: calc(9px * var(--font-scale)); }
.provenance-body { font-size: calc(10px * var(--font-scale)); }

.site-footer { font-size: calc(10px * var(--font-scale)); }
.footer-brand strong { font-size: calc(13px * var(--font-scale)); }


/* v1.11 map + KPI + accessibility refinements */

.scope-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid #cfe1ee;
  border-radius: 10px;
  background: #f7fbff;
  color: #49637e;
  font-size: calc(11px * var(--font-scale));
  font-weight: 750;
}
.scope-button.active {
  border-color: #6ab2e3;
  background: #e8f5ff;
  color: #247fbd;
}

.leaflet-stage {
  height: 410px;
}
.leaflet-map {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
}
.leaflet-container {
  font-family: Inter, "Noto Sans JP", "Yu Gothic UI", "Segoe UI", system-ui, sans-serif;
  background: #dff2ff;
}
.leaflet-control-attribution {
  font-size: 9px !important;
}

.pref-marker {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 2px 7px rgba(30,73,105,.28);
  background: #91a4bb;
}
.pref-marker.hokkaido { background: #e0ae3c; }
.pref-marker.selected { background: #2f8bd8; transform: scale(1.18); }

.scope-details {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  padding: 9px 0;
  border-top: 1px solid #e5edf4;
  border-bottom: 1px solid #e5edf4;
}
.scope-details > div {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 7px;
}
.scope-details span {
  color: #8390a3;
  font-size: calc(9px * var(--font-scale));
}
.scope-details strong {
  color: #334963;
  font-size: calc(9.5px * var(--font-scale));
  overflow-wrap: anywhere;
}

/* KPI badges are intentionally more visible than v1.10. */
.delta-chip {
  padding: 4px 10px;
  border-radius: 9px;
  font-size: calc(13px * var(--font-scale)) !important;
  line-height: 1.2;
}

/* Main hero should remain visually stable when accessibility text scaling is used. */
h1 {
  font-size: clamp(38px, 4.2vw, 64px) !important;
}

/* Small functional text receives a stronger accessibility multiplier. */
.kpi-meta,
.chart-note,
.subtle,
.provenance-body,
.status-legend,
.scope-details span,
.scope-details strong {
  font-size: calc(11px * var(--font-scale)) !important;
}

@media(max-width: 1180px) {
  .leaflet-stage { height: 500px; }
}
