/* 年代・年齢グループ（age/ life/ at_that_time/）専用 */
.ag-title { font-size: 1.6rem; line-height: 1.35; margin: 12px 0 4px; }
.ag-title small { display: block; font-size: .95rem; font-weight: normal; color: var(--muted); }
.ag-catch { color: var(--muted); font-size: .92rem; margin: 0 0 12px; }
.ag-intro p { margin: 8px 0; }
.ag-count { font-size: .8rem; font-weight: normal; color: var(--muted); margin-left: .6em; }
.ag-mini-h { font-size: 1rem; border: 0; margin: 0 0 6px; padding: 0; }
.ag-note { font-size: .85rem; color: var(--muted); }
.ag-more { margin-top: 24px; }

/* 前後の年代 */
.ag-pn { display: flex; justify-content: space-between; gap: 12px; margin: 16px 0; font-size: .92rem; }
.ag-pn a { display: block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); text-decoration: none; }
.ag-pn a span { display: block; font-size: .75rem; color: var(--muted); }
.ag-pn .ag-next { text-align: right; }

/* 10年ごとの人数の帯 */
.ag-century { margin: 20px 0; }
.ag-strip { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.ag-strip li > a, .ag-strip li > span { display: block; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); font-size: .8rem; line-height: 1.4; text-decoration: none; }
.ag-strip b { display: block; font-size: .95rem; }
.ag-strip li.is-current > span { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.ag-strip li.is-zero a { color: var(--muted); }
.ag-cent h3 { margin: 20px 0 6px; }
.ag-cent.is-empty .ag-strip { opacity: .75; }

/* 生没年表（横棒） */
.ag-tl { margin: 12px 0 24px; }
.ag-tl-cap { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.ag-axis, .ag-row { display: grid; grid-template-columns: minmax(11em, 38%) 1fr; gap: 0 12px; align-items: center; }
.ag-axis { position: sticky; top: 0; background: var(--bg); z-index: 1; border-bottom: 1px solid var(--line); height: 1.6em; font-size: .72rem; color: var(--muted); }
.ag-axis-track { position: relative; height: 100%; }
.ag-axis-track span { position: absolute; top: .2em; transform: translateX(-50%); white-space: nowrap; }
.ag-axis-track span:first-child { transform: none; }
.ag-axis-track span:last-child { transform: translateX(-100%); }
.ag-rows { list-style: none; margin: 0; padding: 0; }
.ag-row { border-bottom: 1px solid var(--line); padding: 3px 0; }
.ag-who { line-height: 1.45; min-width: 0; }
.ag-who a { font-size: .95rem; }
.ag-meta { display: block; font-size: .75rem; color: var(--muted); }
.ag-flag { display: inline-block; font-size: .68rem; border: 1px solid var(--line); border-radius: 3px; padding: 0 3px; line-height: 1.3; }
.ag-track {
  position: relative; height: 14px;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: var(--ag-grid) 100%;
}
.ag-bar { position: absolute; top: 2px; bottom: 2px; background: var(--accent); border-radius: 2px; opacity: .85; }
@media (max-width: 560px) {
  .ag-axis, .ag-row { grid-template-columns: 1fr; }
  .ag-axis-pad { display: none; }
  .ag-axis-track span.minor { display: none; }
  .ag-track { margin-top: 2px; }
}

/* 一覧・案内 */
.ag-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }
.ag-list li span { display: block; font-size: .8rem; color: var(--muted); }
.ag-guide, .ag-box { border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 12px 16px; margin: 24px 0; }
.ag-guide h2 { margin-top: 0; font-size: 1.05rem; }
.ag-guide ul, .ag-links, .ag-related ul { padding-left: 1.2em; }
.ag-gnav { margin: 12px 0; font-size: .92rem; }
.ag-gnav p { margin: 4px 0; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.ag-gnav-p { font-weight: 700; min-width: 3em; }
.ag-gnav b { color: var(--fg); }

/* 寿命データ */
.ag-form { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: .92rem; }
.ag-form select, .ag-form input, .ag-form button { font: inherit; padding: 3px 6px; max-width: 100%; }
.ag-cond { color: var(--muted); font-size: .9rem; }
.ag-kpi { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 8px 0 16px; }
.ag-kpi dt { font-size: .8rem; color: var(--muted); }
.ag-kpi dd { margin: 0; }
.ag-kpi b { font-size: 1.8rem; }
.ag-kpi small { color: var(--muted); margin-left: .4em; }
.ag-hist { margin: 16px 0; overflow-x: auto; }
.ag-hist figcaption { font-size: .8rem; color: var(--muted); }
.ag-hist ol { list-style: none; margin: 4px 0 0; padding: 0; display: flex; align-items: flex-end; gap: 2px; height: 180px; padding-top: 16px; min-width: 420px; border-bottom: 1px solid var(--line); }
.ag-hist li { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; }
.ag-hist-bar { width: 100%; background: var(--accent); opacity: .85; border-radius: 2px 2px 0 0; min-height: 0; }
.ag-hist-v { font-size: .6rem; color: var(--muted); line-height: 1.2; margin-bottom: 1px; }
.ag-hist-k { position: absolute; bottom: -1.4em; font-size: .65rem; color: var(--muted); }
.ag-hist { padding-bottom: 1.6em; }
.ag-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 24px; }
.ag-rank { padding-left: 1.4em; }
.ag-rank span { display: block; font-size: .8rem; color: var(--muted); }
.ag-table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 8px 0 16px; }
.ag-table th, .ag-table td { border-bottom: 1px solid var(--line); padding: 5px 6px; text-align: left; vertical-align: top; }
.ag-table th { font-size: .8rem; color: var(--muted); font-weight: normal; }
.ag-table td small { display: block; font-size: .75rem; color: var(--muted); }
.ag-table .num { text-align: right; white-space: nowrap; }

/* そのとき何歳？ */
.att-events { padding-left: 1.2em; }
.att-events span { display: block; font-size: .8rem; color: var(--muted); }
.att-note { display: block; font-size: .72rem; color: var(--accent); }
