/* ===== BLUESEEDS Database Dashboard ===== */
:root {
  --primary: #1e5fa8;
  --primary-dark: #0d3a6e;
  --primary-light: #3a7fc8;
  --accent: #4ec3d9;
  --accent-light: #a3e0eb;
  --warm: #f5a05c;
  --warning: #e57373;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #1f2a3d;
  --text-2: #51607a;
  --text-3: #8a96aa;
  --border: #e3e8f0;
  --border-strong: #c8d2e0;
  --shadow-sm: 0 1px 2px rgba(20,40,80,.04), 0 2px 6px rgba(20,40,80,.04);
  --shadow-md: 0 4px 14px rgba(20,40,80,.06), 0 2px 6px rgba(20,40,80,.04);
  --shadow-lg: 0 10px 32px rgba(20,40,80,.10);
  --radius: 14px;
  --radius-sm: 8px;
  --sidebar-w: 268px;
  --font-jp: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", sans-serif;
  --font-num: "Inter", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-jp);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-feature-settings: "palt";
}
a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* ===== Sidebar ===== */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(180deg, #0d3a6e 0%, #1e5fa8 100%);
  color: #fff;
  padding: 20px 20px 24px;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.sidebar-header { padding-bottom: 24px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 44px; height: 44px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--font-num);
  font-weight: 900; font-size: 16px;
  letter-spacing: 0.5px;
}
.brand-text strong { display: block; font-size: 14px; letter-spacing: .04em; font-weight: 700; line-height: 1.2; }
.brand-text small { display: block; font-size: 10px; letter-spacing: .12em; color: var(--accent-light); font-weight: 500; margin-bottom: 1px; }
.sidebar-tagline {
  margin: 16px 0 0;
  font-size: 12px;
  color: rgba(255,255,255,.7);
  line-height: 1.6;
}

.nav { flex: 1; }
.nav-group { margin-bottom: 18px; }
.nav-title {
  margin: 0 0 6px 10px;
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255,255,255,.5);
  font-weight: 600;
  text-transform: uppercase;
  font-family: var(--font-num);
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  color: rgba(255,255,255,.85);
  font-size: 13.5px;
  font-weight: 400;
  border-radius: 8px;
  margin-bottom: 2px;
  transition: all .15s;
  cursor: pointer;
}
.nav-link:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
  text-decoration: none;
}
.nav-link.active {
  background: rgba(255,255,255,.16);
  color: #fff;
  font-weight: 500;
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-icon {
  display: inline-block;
  width: 16px;
  text-align: center;
  color: var(--accent-light);
  font-size: 11px;
}
.nav-link.active .nav-icon { color: var(--accent); }

.sidebar-footer {
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: 11px;
  color: rgba(255,255,255,.55);
}
.sidebar-footer p { margin: 4px 0; }
.sidebar-footer a { color: var(--accent-light); }

/* ===== Mobile menu ===== */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 16px; right: 16px;
  z-index: 200;
  width: 44px; height: 44px;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  box-shadow: var(--shadow-md);
}
.mobile-menu-btn span {
  display: block;
  width: 22px; height: 2px;
  background: #fff;
  transition: all .2s;
}
.mobile-menu-btn.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-btn.is-open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Main ===== */
.main {
  margin-left: var(--sidebar-w);
  padding: 36px 44px 48px;
  min-height: 100vh;
}

.content { display: none; animation: fadeIn .25s ease-out; }
.content.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  gap: 20px;
  flex-wrap: wrap;
}
.eyebrow {
  display: inline-block;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 8px;
}
h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
}
.lede {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-2);
  max-width: 680px;
  line-height: 1.75;
}
.badge {
  display: inline-block;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-2);
  font-family: var(--font-num);
  letter-spacing: 1px;
}

/* ===== KPI Cards ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.kpi-card--primary {
  background: linear-gradient(135deg, #1e5fa8 0%, #0d3a6e 100%);
  color: #fff;
  border-color: transparent;
}
.kpi-card--primary .kpi-label,
.kpi-card--primary .kpi-sub { color: rgba(255,255,255,.78); }
.kpi-card--primary .kpi-value { color: #fff; }
.kpi-card--alert {
  background: linear-gradient(135deg, #c44 0%, #8b3045 100%);
  color: #fff;
  border-color: transparent;
}
.kpi-card--alert .kpi-label,
.kpi-card--alert .kpi-sub { color: rgba(255,255,255,.85); }
.kpi-card--alert .kpi-value { color: #fff; }
.kpi-card--accent {
  background: linear-gradient(135deg, #4ec3d9 0%, #2a8fa8 100%);
  color: #fff;
  border-color: transparent;
}
.kpi-card--accent .kpi-label,
.kpi-card--accent .kpi-sub { color: rgba(255,255,255,.85); }
.kpi-card--accent .kpi-value { color: #fff; }

.kpi-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 8px;
  letter-spacing: .5px;
}
.kpi-value {
  display: block;
  font-family: var(--font-num);
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -.02em;
}
.kpi-value small { font-size: 14px; font-weight: 600; margin-left: 4px; opacity: .8; }
.kpi-sub {
  display: block;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.5;
}
.kpi-delta {
  display: inline-block;
  margin-top: 10px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  font-family: var(--font-num);
}
.delta-up { background: rgba(229,115,115,.12); color: #c8513b; }
.delta-down { background: rgba(78,195,140,.14); color: #2e8c5c; }
.kpi-card--primary .delta-up { background: rgba(255,255,255,.18); color: #ffe5d3; }
.kpi-card--primary .delta-down { background: rgba(255,255,255,.18); color: #c5f0d8; }
.kpi-card--accent .delta-up { background: rgba(255,255,255,.2); color: #fff; }
.kpi-card--accent .delta-down { background: rgba(255,255,255,.2); color: #fff; }

.kpi-card--small .kpi-value { font-size: 24px; }

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.card h3 {
  margin: 0 0 18px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h3::before {
  content: '';
  display: inline-block;
  width: 4px; height: 16px;
  background: var(--primary);
  border-radius: 2px;
}
.card-note {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.6;
}
.card-cta { margin: 16px 0 0; }
.card--alert {
  background: linear-gradient(135deg, #fff8ef 0%, #fef0e0 100%);
  border-color: #f5d6a8;
}
.card--alert h3::before { background: var(--warm); }
.card--map { padding: 0; overflow: hidden; }

/* ===== Grid layouts ===== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

/* ===== Charts ===== */
.chart-wrap {
  position: relative;
  height: 280px;
  width: 100%;
}
.chart-wrap--md { height: 320px; }
.chart-wrap--lg { height: 400px; }
.chart-wrap--xl { height: 620px; }

/* ===== Prefecture controls ===== */
.pref-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 8px 0;
}
.pref-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 500;
}
.pref-controls select {
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
}
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* External nav link (voices page) */
.nav-link--external small { opacity: .6; font-size: .85em; margin-left: 2px; }

/* Type badges */
.badge-type {
  display: inline-block;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-free    { background: #e3f4f7; color: #2c8aa0; }
.badge-alt     { background: #fdf0e2; color: #b35c1f; }
.badge-tayouka { background: #f1ebf8; color: #6b4cb0; }
.badge-online  { background: #e6f3ea; color: #3a8454; }

/* School list filters */
.count-badge {
  display: inline-block;
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
  margin-left: 8px;
}
.school-filters {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sf-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sf-row > label {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 600;
  letter-spacing: 0.04em;
  min-width: 70px;
}
.sf-search {
  flex: 1;
  min-width: 180px;
  font-size: 13px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  background: #fff;
}
#schoolPrefSelect, #schoolSort {
  font-size: 13px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  background: #fff;
  min-width: 140px;
}
@media (max-width: 720px) {
  .sf-row { flex-direction: column; align-items: flex-start; }
  .sf-row > label { min-width: 0; }
  .sf-search { width: 100%; }
}

/* Tayouka map specific */
#tayoukaMap {
  width: 100%;
  height: 540px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
#schoolMap {
  width: 100%;
  height: 1080px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* ===== Mini cards / Step cards ===== */
.mini-card {
  padding: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  position: relative;
}
.mini-card h4 {
  margin: 0 0 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.mini-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.7;
}
.mini-number {
  position: absolute;
  top: 12px; right: 14px;
  font-family: var(--font-num);
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  opacity: .55;
}

.step-card {
  padding: 14px 16px;
  border-left: 3px solid var(--primary-light);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 10px;
}
.step-card h4 {
  margin: 0 0 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary-dark);
}
.step-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.7;
}

/* ===== Lists ===== */
.bullet-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.85;
}
.bullet-list li { margin-bottom: 4px; }
.bullet-list li::marker { color: var(--accent); }
.bullet-list strong { color: var(--text); font-weight: 600; }

.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.link-list li:last-child { border-bottom: none; }
.link-list a::before {
  content: '→ ';
  color: var(--accent);
  font-weight: 700;
}

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.data-table thead th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--text-2);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border-strong);
  font-size: 11.5px;
  letter-spacing: .5px;
}
.data-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table tbody tr:hover { background: var(--surface-2); }

/* ===== Quote ===== */
.quote-block {
  margin-top: 16px;
  padding: 14px 18px;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  font-size: 12.5px;
  color: var(--text-2);
  font-style: italic;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.quote-block cite {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: 11px;
  color: var(--text-3);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-family: var(--font-jp);
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  line-height: 1;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30,95,168,.3);
}
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.btn-block { width: 100%; }

/* ===== Map ===== */
.map-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  transition: all .15s;
}
.filter-pill:hover { border-color: var(--primary-light); }
.filter-pill input { margin: 0; cursor: pointer; }
.filter-pill .dot {
  width: 10px; height: 10px; border-radius: 50%;
}
.dot-free { background: #4ec3d9; }
.dot-alt { background: #f5a05c; }
.dot-tayouka { background: #b88be0; }
.dot-online { background: #6cc28d; }

#schoolMap {
  height: 480px;
  width: 100%;
  border-radius: var(--radius);
}
.leaflet-popup-content {
  font-family: var(--font-jp);
  font-size: 12.5px;
  line-height: 1.6;
}
.leaflet-popup-content strong { color: var(--primary-dark); }

/* ===== Forms ===== */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: flex; flex-direction: column; }
.form-row--2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-row label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="url"],
.form-row input[type="number"],
.form-row select,
.form-row textarea {
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: var(--font-jp);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,95,168,.12);
}
.form-row textarea { resize: vertical; font-family: var(--font-jp); }
.req {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  color: #c8513b;
  background: rgba(229,115,115,.12);
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  letter-spacing: 1px;
}
.radio-group { display: flex; gap: 14px; flex-wrap: wrap; padding-top: 4px; }
.radio, .check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-2);
  cursor: pointer;
}
.radio input, .check input { margin: 0; cursor: pointer; }
.form-note {
  font-size: 12px;
  margin: 0;
  min-height: 1em;
}
.form-note.success { color: #2e8c5c; }
.form-note.error { color: #c8513b; }

.info-block {
  margin-top: 24px;
  padding: 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-2);
}
.info-block h4 {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text);
}
.info-block p { margin: 4px 0; }

/* ===== News ===== */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.news-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  transition: all .15s;
}
.news-item:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}
.news-date {
  font-family: var(--font-num);
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
  padding-top: 2px;
}
.news-body { flex: 1; }
.news-body h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
}
.news-body h4 a { color: var(--text); }
.news-body h4 a:hover { color: var(--primary); }
.news-body p {
  margin: 0;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
}
.news-source {
  display: inline-block;
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--text-3);
}

/* ===== Footer ===== */
.page-footer {
  margin-top: 48px;
  padding: 24px 0 0;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-3);
  text-align: center;
}
.page-footer p { margin: 4px 0; }
.page-footer .small { font-size: 10.5px; }

/* ===== Pathway list (career section) ===== */
.pathway-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pathway-item {
  border-left: 3px solid var(--primary);
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: 0 6px 6px 0;
}
.pathway-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}
.pathway-head strong { font-size: 13px; color: var(--text); }
.pathway-pct { font-size: 11.5px; color: var(--primary); font-weight: 600; }
.pathway-item p { margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.7; }

/* ===== Timeline section ===== */
.timeline-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.timeline-controls .filter-pill { font-size: 12px; padding: 6px 12px; }
.dot-tl-gov { background: #1e5fa8; }
.dot-tl-law { background: #c44; }
.dot-tl-school { background: #f5a05c; }
.dot-tl-support { background: #3a8454; }
.dot-tl-data { background: #6b4cb0; }

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 75px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.tl-item {
  position: relative;
  padding-left: 100px;
  padding-bottom: 22px;
  min-height: 60px;
}
.tl-marker {
  position: absolute;
  left: 68px;
  top: 14px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--border);
  background: var(--primary);
  z-index: 1;
}
.tl-item--gov .tl-marker { background: #1e5fa8; }
.tl-item--law .tl-marker { background: #c44; }
.tl-item--school .tl-marker { background: #f5a05c; }
.tl-item--support .tl-marker { background: #3a8454; }
.tl-item--data .tl-marker { background: #6b4cb0; }
.tl-critical .tl-marker { box-shadow: 0 0 0 3px #1e5fa8, 0 0 0 6px rgba(30,95,168,.2); width: 18px; height: 18px; left: 67px; }
.tl-high .tl-marker { box-shadow: 0 0 0 3px var(--border); }

.tl-content {
  background: var(--surface-2);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
}
.tl-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.tl-year {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}
.tl-date { font-size: 11px; color: var(--text-3); }
.tl-cat {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #fff;
  color: #51607a;
  border: 1px solid var(--border);
  font-weight: 500;
}
.tl-cat--gov     { background: #e8f1fb; color: #1e5fa8; border-color: #c4d8ee; }
.tl-cat--law     { background: #fbe9e9; color: #c44;    border-color: #f0c8c8; }
.tl-cat--school  { background: #fdf0e2; color: #b35c1f; border-color: #f0d8b8; }
.tl-cat--support { background: #e6f3ea; color: #3a8454; border-color: #c4dfca; }
.tl-cat--data    { background: #f1ebf8; color: #6b4cb0; border-color: #d4c2eb; }

.tl-content h4 { margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--text); }
.tl-content p  { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.7; }

/* Timeline absolute year column — aligned vertically with marker */
.timeline .tl-item::before {
  content: attr(data-year);
  position: absolute;
  left: 0;
  top: 12px;
  width: 56px;
  text-align: right;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.02em;
}

/* ===== Municipality cards ===== */
.muni-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.muni-card {
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s, transform .12s;
}
.muni-card:hover { box-shadow: 0 6px 18px rgba(30,40,80,.08); transform: translateY(-2px); border-color: var(--primary); }
.muni-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.muni-card-head strong { font-size: 15px; color: var(--text); }
.muni-pref { font-size: 11px; color: var(--text-3); }
.muni-card-lead { font-size: 12.5px; color: var(--text-2); line-height: 1.6; margin: 6px 0 12px; }
.muni-card-foot { display: flex; align-items: center; gap: 8px; }
.muni-status { font-size: 10.5px; padding: 2px 9px; border-radius: 10px; font-weight: 600; letter-spacing: 0.04em; }
.muni-status--live { background: #e6f3ea; color: #3a8454; }
.muni-status--generating { background: #fdf0e2; color: #b35c1f; }
.muni-status--paid { background: #f1ebf8; color: #6b4cb0; }
.muni-status--available { background: #eef3f8; color: #51607a; }

/* ===== Voices summary (aggregated thematic) ===== */
.voices-summary {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 18px 0;
}
.voice-summary-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 22px 26px;
  box-shadow: 0 2px 8px rgba(30, 40, 80, 0.04);
}
.voice-summary-card header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f3f8;
}
.voice-summary-card .vs-num {
  font-family: 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.04em;
  min-width: 50px;
}
.voice-summary-card header > div {
  flex: 1;
}
.voice-summary-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
  line-height: 1.4;
}
.voice-summary-card .vs-lead {
  font-size: 13px;
  color: var(--text-2);
  margin: 0;
  font-style: italic;
}
.voice-summary-card .vs-count {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  background: #eef3f8;
  padding: 4px 9px;
  border-radius: 10px;
  align-self: flex-start;
}
.voice-summary-card .vs-points {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px 18px;
}
.voice-summary-card .vs-points li {
  position: relative;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-2);
}
.voice-summary-card .vs-points li::before {
  content: '◆';
  position: absolute;
  left: 0;
  top: 1px;
  color: var(--accent);
  font-size: 9px;
}
.voice-summary-card .vs-summary {
  font-size: 14px;
  line-height: 1.85;
  color: var(--text);
  margin: 0;
  padding: 14px 18px;
  background: #f8faff;
  border-left: 3px solid var(--primary);
  border-radius: 0 6px 6px 0;
}
@media (max-width: 720px) {
  .voice-summary-card { padding: 18px 18px; }
  .voice-summary-card header { flex-wrap: wrap; }
  .voice-summary-card .vs-num { font-size: 22px; min-width: 0; }
  .voice-summary-card .vs-points { grid-template-columns: 1fr; }
}

/* ===== Voices section (in-SPA) - legacy individual cards (unused now but kept for layout) ===== */
.voice-disclaimer { background: #fdf6e8; border-left: 4px solid #e89c43; }
.voice-disclaimer strong {
  display: block;
  color: #b35c1f;
  font-size: 12.5px;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.voice-disclaimer p { margin: 0; font-size: 13.5px; line-height: 1.75; color: #51607a; }

.voice-stats { margin-top: 14px; }

.voice-filters { padding: 14px 18px; }
.voice-filters .vf-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px dashed #eef1f6;
}
.voice-filters .vf-row:last-child { border-bottom: 0; }
.vf-label {
  font-size: 12px;
  font-weight: 600;
  color: #51607a;
  letter-spacing: 0.04em;
  min-width: 110px;
  padding-top: 6px;
}
.vf-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}
.vf-pill {
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.vf-pill:hover { border-color: var(--primary); color: var(--primary); }
.vf-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.voices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.voice-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 22px 22px 18px;
  position: relative;
  display: flex;
  flex-direction: column;
}
.voice-card::before {
  content: '"';
  position: absolute;
  top: 4px;
  left: 16px;
  font-size: 56px;
  color: #d8e3f0;
  font-family: Georgia, serif;
  line-height: 1;
}
.voice-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  padding-left: 30px;
  position: relative;
  z-index: 1;
}
.voice-cat {
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.voice-cat.cat-transition { background: #b35c1f; }
.voice-cat.cat-change     { background: #3a8454; }
.voice-cat.cat-cost       { background: #c44; }
.voice-cat.cat-family     { background: #6b4cb0; }
.voice-cat.cat-learning   { background: #1e5fa8; }
.voice-cat.cat-community  { background: #2c8aa0; }
.voice-cat.cat-local      { background: #6c8a3a; }
.voice-cat.cat-future     { background: #b07a1f; }
.voice-cat.cat-regret     { background: #71426e; }
.voice-cat.cat-advice     { background: #14629c; }

.voice-tag {
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: 10px;
  background: #eef3f8;
  color: #51607a;
}
.voice-tag.school-free    { background: #e3f4f7; color: #2c8aa0; }
.voice-tag.school-alt     { background: #fdf0e2; color: #b35c1f; }
.voice-tag.school-tayouka { background: #f1ebf8; color: #6b4cb0; }
.voice-tag.school-online  { background: #e6f3ea; color: #3a8454; }

.voice-theme {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 10px;
  padding-left: 4px;
}
.voice-body {
  font-size: 14px;
  line-height: 1.85;
  color: #2c3a52;
  margin: 0 0 14px;
  flex: 1;
  white-space: pre-line;
}
.voice-source {
  font-size: 11px;
  color: var(--text-3);
  border-top: 1px dashed #eef1f6;
  padding-top: 10px;
  margin-top: auto;
}
.voices-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease-out;
    width: 280px;
  }
  .sidebar.is-open { transform: translateX(0); }
  .mobile-menu-btn { display: flex; }
  .main { margin-left: 0; padding: 70px 18px 36px; }
  h1 { font-size: 22px; }
  .lede { font-size: 13.5px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .voices-grid { grid-template-columns: 1fr; }
  .vf-row { flex-direction: column; gap: 8px; }
  .vf-label { min-width: 0; padding-top: 0; }
  .form-row--2col { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .kpi-value { font-size: 26px; }
  .chart-wrap { height: 240px; }
  .chart-wrap--lg { height: 320px; }
  #schoolMap { height: 360px; }
  #tayoukaMap { height: 360px; }
  .card { padding: 18px; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .map-controls { flex-direction: column; align-items: stretch; }
  .filter-pill { justify-content: center; }
}

/* ===== サイトトップ 運営者向けメッセージ（薄いアコーディオン） ===== */
.op-msg {
  background: #fff;
  border-radius: 8px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(15,30,50,.04);
  border-left: 3px solid var(--accent);
  overflow: hidden;
  transition: all .2s;
}
.op-msg__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  font-size: 12.5px;
  color: var(--text-2, #51607a);
  font-weight: 600;
  line-height: 1.4;
  min-height: 36px;
}
.op-msg__bar:hover { background: #f8faff; }
.op-msg__title { display: inline-flex; align-items: center; gap: 6px; }
.op-msg__icon { font-size: 13px; }
.op-msg__chevron {
  font-size: 12px;
  color: var(--text-3, #8a96aa);
  transition: transform .2s;
  margin-left: 8px;
}
.op-msg[data-state="closed"] .op-msg__chevron { transform: rotate(-90deg); }
.op-msg[data-state="closed"] .op-msg__body { display: none; }

.op-msg__body {
  position: relative;
  padding: 6px 18px 16px;
  border-top: 1px dashed #e8eef5;
}
.op-msg__close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: #f0f3f7;
  color: var(--text-3, #8a96aa);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.op-msg__close:hover { background: #e3e8ef; color: var(--text, #1f2a3d); }
.op-msg__close::after {
  content: '次回も閉じたまま';
  position: absolute;
  right: 30px; top: 50%; transform: translateY(-50%);
  background: rgba(15,30,50,.85);
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
.op-msg__close:hover::after { opacity: 1; }
.op-msg__lede {
  margin: 8px 0 12px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2, #51607a);
  padding-right: 36px;
}
.op-msg__lede strong { color: var(--primary-dark, #0d3a6e); }
.op-msg__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  font-size: 12px;
}
.op-msg__cols h4 {
  font-size: 11px;
  color: var(--primary, #1e5fa8);
  margin: 0 0 4px;
  letter-spacing: .04em;
  font-weight: 700;
}
.op-msg__cols ul {
  margin: 0;
  padding-left: 16px;
  line-height: 1.8;
  color: var(--text-2, #51607a);
}
.op-msg__cols li { margin-bottom: 2px; }
.op-msg__cols a { color: var(--primary, #1e5fa8); font-weight: 600; }

@media (max-width: 700px) {
  .op-msg__cols { grid-template-columns: 1fr; gap: 12px; }
  .op-msg__title { font-size: 12px; }
  .op-msg__lede { padding-right: 30px; font-size: 12px; }
}

/* ===== 情報追加申請ボタン + モーダル ===== */
.btn-suggest {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; font-size: 12.5px; font-weight: 600;
  background: #fff; color: var(--primary);
  border: 1px solid var(--primary); border-radius: 999px;
  cursor: pointer; transition: all .15s;
  font-family: inherit;
}
.btn-suggest:hover { background: var(--primary); color: #fff; }
.btn-suggest::before { content: '＋'; font-weight: 700; }

.suggest-bar {
  display: flex; justify-content: flex-end; align-items: center;
  margin: 10px 0 0; padding-top: 10px;
  border-top: 1px dashed #d8e1ec;
  gap: 10px;
}
.suggest-bar--top {
  margin: 0 0 18px;
  padding: 10px 0 0;
  border-top: 0;
  border-bottom: 1px dashed #d8e1ec;
  padding-bottom: 10px;
}
.suggest-bar small { color: #8a96aa; font-size: 11.5px; }

.suggest-overlay {
  position: fixed; inset: 0; background: rgba(15, 30, 50, .55);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; padding: 20px;
  animation: suggest-fade .15s ease-out;
}
@keyframes suggest-fade { from { opacity: 0 } to { opacity: 1 } }

.suggest-panel {
  background: #fff; border-radius: 12px; max-width: 580px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  padding: 24px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.suggest-title { margin: 0 0 6px; font-size: 18px; color: var(--primary-dark); }
.suggest-help { margin: 0 0 16px; font-size: 12.5px; color: #51607a; line-height: 1.6; }

.suggest-form { display: flex; flex-direction: column; gap: 4px; }
.suggest-label { display: block; margin: 10px 0 4px; font-size: 12px; font-weight: 600; color: #51607a; }
.suggest-input,
.suggest-textarea {
  width: 100%; padding: 9px 12px; font-size: 14px;
  border: 1px solid #d2dbe6; border-radius: 6px;
  background: #fff; color: #2c3e50;
  font-family: inherit; box-sizing: border-box;
}
.suggest-textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.suggest-input:focus,
.suggest-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,95,168,.15); }

.suggest-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .suggest-row { grid-template-columns: 1fr; } }

.suggest-status { margin: 12px 0 0; font-size: 13px; line-height: 1.6; }
.suggest-status--ok  { color: #2e7d4e; background: #e8f5ec; padding: 8px 12px; border-radius: 6px; }
.suggest-status--err { color: #c44; background: #fceef0; padding: 8px 12px; border-radius: 6px; }

.suggest-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.suggest-btn {
  padding: 9px 18px; font-size: 13.5px; font-weight: 600;
  border-radius: 6px; cursor: pointer; border: 1px solid transparent;
  font-family: inherit; transition: all .15s;
}
.suggest-btn--cancel { background: #f0f3f7; color: #51607a; border-color: #d2dbe6; }
.suggest-btn--cancel:hover { background: #e3e8ef; }
.suggest-btn--primary { background: var(--primary); color: #fff; }
.suggest-btn--primary:hover { background: var(--primary-dark); }
.suggest-btn:disabled { opacity: .55; cursor: wait; }
