:root {
  color-scheme: light;
  --page: #f9f9f7; --surface: #fcfcfb; --ink: #0b0b0b; --ink-2: #52514e; --muted: #898781;
  --grid: #e1e0d9; --axis: #c3c2b7; --border: rgba(11,11,11,0.10); --accent: #2a78d6;
  --bar-other: #d6d5ce; --up: #006300; --down: #b42f2f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --ink: #ffffff; --ink-2: #c3c2b7; --muted: #898781;
    --grid: #2c2c2a; --axis: #383835; --border: rgba(255,255,255,0.10); --accent: #3987e5;
    --bar-other: #3a3a37; --up: #0ca30c; --down: #e66767;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --ink: #ffffff; --ink-2: #c3c2b7; --muted: #898781;
  --grid: #2c2c2a; --axis: #383835; --border: rgba(255,255,255,0.10); --accent: #3987e5;
  --bar-other: #3a3a37; --up: #0ca30c; --down: #e66767;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", sans-serif; font-size: 15px; line-height: 1.7; }
a { color: var(--accent); }
.wrap { max-width: 980px; margin: 0 auto; padding: 16px 16px 48px; }
.crumb { font-size: 12px; color: var(--muted); }
.crumb a { color: inherit; }
header h1 { font-size: 26px; margin: 8px 0 4px; line-height: 1.35; }
.sub { color: var(--ink-2); font-size: 13px; margin: 0 0 10px; }
.toc { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 16px; }
.toc a { font-size: 13px; text-decoration: none; border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px; background: var(--surface); color: var(--ink-2); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin: 0 0 16px; }
.card h2 { font-size: 19px; margin: 0 0 8px; line-height: 1.4; }
.card h3 { font-size: 14px; margin: 22px 0 8px; }
.lead { margin: 0 0 14px; }
.note { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.tile .k { font-size: 11px; color: var(--muted); }
.tile .v { font-size: 22px; font-weight: 650; }
.tile .d { font-size: 12px; color: var(--ink-2); }
.up { color: var(--up); } .down { color: var(--down); }
@media (max-width: 640px) { .tiles { grid-template-columns: 1fr 1fr; } .tile .v { font-size: 18px; } header h1 { font-size: 22px; } }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--grid); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th { font-size: 11px; color: var(--muted); font-weight: 500; }
th:first-child, td:first-child { text-align: left; }
td:last-child { white-space: normal; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 720px) { .two { grid-template-columns: 1fr; gap: 0; } }
.hb { display: grid; grid-template-columns: 5.5em 1fr 3.8em; align-items: center; gap: 8px; font-size: 13px; margin: 3px 0; }
.hb .l { text-align: right; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb .bar { height: 12px; }
.hb .bar i { display: block; height: 100%; background: var(--bar-other); border-radius: 0 3px 3px 0; }
.hb.hl .l { color: var(--ink); font-weight: 700; }
.hb.hl .bar i { background: #0e5c2f; }
.hb .v { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.s100 { display: grid; grid-template-columns: 9em 1fr; align-items: center; gap: 8px; font-size: 13px; margin: 6px 0; }
.s100 .l { color: var(--ink-2); }
.s100 .bar { display: flex; height: 22px; gap: 2px; }
.s100 .bar i { display: block; height: 100%; }
.s100 .bar i:first-child { border-radius: 3px 0 0 3px; } .s100 .bar i:last-child { border-radius: 0 3px 3px 0; }
@media (max-width: 520px) { .s100 { grid-template-columns: 1fr; gap: 2px; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); margin: 0 0 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; }
.chip i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.chart { width: 100%; min-height: 240px; }
.chart svg { width: 100%; display: block; }
.chart text { fill: var(--ink-2); font-size: 11px; }
.chart .axis text { fill: var(--muted); font-variant-numeric: tabular-nums; }
.pref-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pref-links a { text-decoration: none; border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; color: var(--ink-2); }
.pref-links a[aria-current] { background: var(--accent); color: #fff; border-color: var(--accent); }
.pref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pref-grid a { text-decoration: none; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; color: var(--ink); display: flex; flex-direction: column; }
.pref-grid a span { font-size: 11px; color: var(--muted); }
.pref-grid a:hover { border-color: var(--accent); }
.tooltip { position: fixed; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.12); opacity: 0; z-index: 10; }
.tooltip .row { display: flex; justify-content: space-between; gap: 16px; font-variant-numeric: tabular-nums; }
footer { margin-top: 20px; font-size: 11px; color: var(--muted); line-height: 1.8; }
footer a { color: inherit; }
/* ダッシュボードと同じグラフ（インバウンド欄） */
.dash { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--grid); }
.dash .filters { margin: 0 0 12px; }
.dash .tiles { margin: 0 0 14px; }
.dash .two { margin-top: 18px; }
.dash .rank-head { margin-top: 22px; }
.dash .rank-head h3 { margin: 0; }
.tiles.tiles-1 { grid-template-columns: 1fr; }
.section-title [data-emoji]::before, h2[data-emoji]::before, h3[data-emoji]::before { content: attr(data-emoji); margin-right: .35em; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; font-weight: 400; }
.dash .section-title.big { font-size: 18px; font-weight: 700; margin: 4px 0 6px; }
.dash #trend { margin-bottom: 16px; }
