
  :root {
    color-scheme: light;
    --surface-1: #ffffff;
    --page-plane: #ffffff;
    --text-primary: #0b0b0b;
    --text-secondary: #52514e;
    --text-muted: #898781;
    --gridline: #e8e8e5;
    --baseline: #c3c2b7;
    --border: rgba(11,11,11,0.10);
    --accent: #3b7de8;
  }
  * { box-sizing: border-box; }
  body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--page-plane);
    color: var(--text-primary);
  }
  .wrap { max-width: 760px; margin: 0 auto; padding: 32px 20px 60px; }
  h1 { font-size: 24px; font-weight: 700; margin: 0 0 6px; }
  h2 { font-size: 17px; font-weight: 700; margin: 24px 0 10px; }
  .breadcrumb { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
  .breadcrumb a { color: var(--accent); text-decoration: none; }
  .top-link { font-size: 13px; margin-bottom: 10px; }
  .top-link a { color: var(--accent); text-decoration: none; }
  .top-link a:hover { text-decoration: underline; }
  .stats { font-size: 15px; line-height: 1.8; color: var(--text-primary); margin: 16px 0 24px; }
  .stats strong { color: var(--accent); }
  .chart-wrap { width: 100%; margin: 20px 0 28px; }
  .trend-svg .grid-line { stroke: var(--gridline); stroke-width: 1; }
  .trend-svg .axis-label { fill: var(--text-muted); font-size: 10px; font-family: inherit; }
  .trend-svg .trend-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
  .trend-svg .trend-area { fill: var(--accent); opacity: 0.1; stroke: none; }
  .trend-svg .trend-dot { fill: var(--accent); stroke: var(--surface-1); stroke-width: 2; }
  .trend-svg .crosshair { stroke: var(--text-muted); stroke-width: 1; }
  .links { font-size: 14px; margin-top: 20px; }
  .links a { color: var(--accent); text-decoration: none; margin-right: 16px; }
  .links a:hover { text-decoration: underline; }
  .note { font-size: 12px; color: var(--text-muted); margin-top: 24px; border-top: 1px solid var(--gridline); padding-top: 12px; }
  .tooltip {
    position: fixed; pointer-events: none; background: var(--text-primary); color: var(--page-plane);
    font-size: 12px; padding: 6px 9px; border-radius: 6px; opacity: 0;
    transform: translate(-50%, -100%); transition: opacity .1s ease; z-index: 10; white-space: nowrap;
  }
  .tooltip.visible { opacity: 1; }
  .row {
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    margin-bottom: 8px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  }
  .rank {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
    font-variant-numeric: tabular-nums;
  }
  .rank.top3 { font-size: 20px; }
  .row-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
  .row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
  .title-link {
    font-size: 14px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .title-link:hover { text-decoration: underline; }
  .value {
    font-size: 13px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .bar-track { height: 12px; border-radius: 6px; background: var(--gridline); overflow: hidden; }
  .bar-fill { height: 100%; border-radius: 6px; background: var(--accent); }
  
  .tw-period-row { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
  .tw-period-btn { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-1); color: var(--text-secondary); font-size: 12px; cursor: pointer; }
  .tw-period-btn:hover { background: var(--gridline); }
  .tw-period-btn.active { background: var(--accent); border-color: var(--accent); color: #ffffff; font-weight: 600; }
  .tw-date-row { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; font-size: 12px; color: var(--text-secondary); flex-wrap: wrap; }
  .tw-date-row button { padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-1); color: var(--text-secondary); font-size: 12px; cursor: pointer; }
  .tw-date-row button:hover { background: var(--gridline); }
  .tw-date-segment { position: relative; padding: 5px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-1); color: var(--text-primary); font-size: 12px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; }
  .tw-date-segment:hover { background: var(--gridline); }
  .tw-seg-caret { margin-left: 3px; font-size: 9px; color: var(--text-muted); }
  .tw-segment-dropdown { position: absolute; top: 100%; left: 0; margin-top: 4px; max-height: 200px; overflow-y: auto; background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.18); z-index: 50; min-width: 68px; }
  .tw-segment-option { padding: 5px 10px; font-size: 12px; color: var(--text-primary); cursor: pointer; white-space: nowrap; }
  .tw-segment-option:hover { background: var(--gridline); }
  .tw-segment-option.selected { background: var(--accent); color: #ffffff; }
  .tw-date-hint { color: var(--accent); font-weight: 600; }
  .tw-stat-line { font-size: 14px; color: var(--text-primary); margin: 4px 0 12px; }
  .tw-stat-line strong { color: var(--accent); }

  
  .kana-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 24px; }
  .kana-nav a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--surface-1); border: 1px solid var(--border);
    color: var(--accent); text-decoration: none; font-size: 13px; font-weight: 600;
  }
  .kana-nav a:hover { background: var(--accent); color: #fff; }
  .kana-nav a.active { background: var(--accent); color: #fff; }
  .row-heading {
    font-size: 15px; font-weight: 700; color: var(--text-secondary);
    margin: 28px 0 8px; padding-top: 12px; border-top: 1px solid var(--gridline);
  }
  .row-heading:first-of-type { border-top: none; padding-top: 0; }
  .row-toc { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
  .row-toc a {
    display: flex; justify-content: space-between; padding: 10px 14px;
    border: 1px solid var(--border); border-radius: 8px; background: var(--surface-1);
    color: var(--text-primary); text-decoration: none; font-weight: 600;
  }
  .row-toc a:hover { background: var(--gridline); }
  .row-toc span { color: var(--text-secondary); font-weight: 400; font-size: 13px; }

  
  .back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-1);
    color: var(--accent);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 100;
  }
  .back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
  .back-to-top:hover { background: var(--accent); color: #ffffff; }

