/* FMM Japan edition (J1). Values follow DESIGN.jp.md and DESIGN.core.md */
:root {
  --bg: #fff;
  --surface: #f6f6f3;
  --ink: #121212;
  --muted: #5e5e58;
  --rule: #e3e3dd;
  --accent: #c8341a;
  --focus: #121212;
  --font: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e0d;
    --surface: #171716;
    --ink: #f2f2ee;
    --muted: #a6a69e;
    --rule: #2a2a28;
    --accent: #ff6a4a;
    --focus: #f2f2ee;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.7;
  word-break: auto-phrase; line-break: strict; overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--bg); padding: 10px 14px; z-index: 20; }
.skip:focus { top: 8px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 760px; }

.notice { margin: 0; padding: 8px 24px; background: var(--ink); color: var(--bg); font-size: 13px; text-align: center; }

/* header */
.site-header { border-bottom: 1px solid var(--rule); }
.bar { display: flex; align-items: center; gap: 28px; min-height: 64px; }
.logo { display: inline-flex; align-items: baseline; gap: 8px; text-decoration: none; min-height: 44px; align-items: center; }
.logo-word { font-weight: 700; font-size: 24px; letter-spacing: -0.02em; line-height: 1; margin: 0; }
.logo-sub { font-size: 12px; color: var(--muted); }
.gnav { flex: 1; min-width: 0; }
.gnav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.gnav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font-size: 14.5px; font-weight: 500; text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; }
.gnav a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--accent); }
.gnav a:hover { color: var(--accent); }
.search-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; font-size: 14px; text-decoration: none; border: 1px solid var(--rule); border-radius: 2px; }
.search-link[aria-current="page"] { border-color: var(--ink); }

/* common */
main { padding-bottom: 72px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 6px; font-size: 12.5px; color: var(--muted); }
.meta a { position: relative; text-decoration: none; }
.meta a::after { content: ""; position: absolute; inset: -10px -4px; }
.kind { color: var(--accent); font-weight: 700; }
.chip-lite { border: 1px solid var(--rule); border-radius: 2px; padding: 0 6px; line-height: 1.6; color: var(--ink); }
.badge { border: 1px solid var(--ink); border-radius: 2px; padding: 0 6px; line-height: 1.6; font-weight: 700; color: var(--ink); }
.sec { font-size: 15px; font-weight: 700; margin: 40px 0 8px; padding-top: 12px; border-top: 2px solid var(--ink); letter-spacing: 0; }
.page-head { padding: 40px 0 8px; }
.page-head h1 { font-size: 32px; line-height: 1.3; margin: 4px 0 8px; letter-spacing: 0; }
.crumb { margin: 0; font-size: 13px; color: var(--muted); }
.lead { margin: 0; color: var(--muted); max-width: 44em; }
.note { color: var(--muted); font-size: 13.5px; }
.empty { padding: 32px 0; color: var(--muted); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; }

/* tag row */
.tagrow ul { display: flex; gap: 8px; list-style: none; margin: 0; padding: 14px 0; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--rule); }
.tagrow a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; font-size: 14px; text-decoration: none; border: 1px solid var(--rule); border-radius: 2px; white-space: nowrap; }
.tagrow a:hover { border-color: var(--accent); }
.tagrow .count { color: var(--muted); font-size: 12px; }
.tagrow .more { border-style: dashed; color: var(--muted); }

/* feature */
.feature { padding: 28px 0 24px; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 1fr; gap: 6px; }
.feature-title { font-size: 30px; line-height: 1.4; margin: 4px 0 4px; letter-spacing: 0; }
.feature-title a { text-decoration: none; }
.feature-title a:hover { color: var(--accent); }
.feature-desc { margin: 0 0 10px; color: var(--muted); font-size: 16px; }
.feature-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 2px; background: var(--surface); }

/* rows */
.rows { display: block; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) 168px; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.row:has(.thumb:not([src])) { grid-template-columns: 1fr; }
.row-title { font-size: 18px; line-height: 1.5; margin: 0 0 4px; letter-spacing: 0; }
.row-title a { text-decoration: none; }
.row-title a:hover { color: var(--accent); }
.row-desc { margin: 0; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.thumb { width: 168px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 2px; background: var(--surface); align-self: start; }
.rows.compact .row { grid-template-columns: 1fr; padding: 14px 0; }
.rows.compact .row-title { font-size: 15px; }
.rows.compact .row-desc { display: none; }

/* rail */
.col-rail { padding-top: 28px; }
.rail-box { padding: 16px 0 20px; border-top: 2px solid var(--ink); margin-bottom: 20px; }
.rail-h { font-size: 14px; font-weight: 700; margin: 0 0 10px; }
.rail-text { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.rail-foot { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.rail-foot a { display: inline-flex; align-items: center; min-height: 44px; }
.status-list, .plain { list-style: none; margin: 0; padding: 0; }
.status-list li { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.plain li a { display: flex; align-items: center; min-height: 44px; text-decoration: none; border-bottom: 1px solid var(--rule); }
.plain li a[aria-current="page"] { color: var(--accent); font-weight: 700; }

/* status mark */
.st { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13.5px; font-weight: 500; }
.st-mark { font-size: 12px; }
.st-live .st-mark { color: var(--accent); }
.st-unknown, .st-unavailable { color: var(--muted); }

/* tables */
.table-wrap { overflow-x: auto; margin: 12px 0 8px; border-top: 1px solid var(--rule); }
.table-wrap:focus-visible { outline-offset: -3px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { background: var(--surface); font-size: 12.5px; color: var(--muted); font-weight: 700; padding-left: 8px; white-space: nowrap; }
tbody th { font-weight: 700; }
td:first-child, th:first-child { padding-left: 8px; }
.others summary, .art-toc summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; font-size: 14px; }
.dict { margin-top: 24px; }

/* tag list */
.tag-list { list-style: none; margin: 0; padding: 0; }
.tag-list li { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.tag-list a { display: flex; justify-content: space-between; align-items: center; min-height: 44px; text-decoration: none; }
.tag-name { font-size: 18px; font-weight: 700; }
.tag-count { color: var(--muted); font-size: 13px; }
.tag-list p { margin: 0; color: var(--muted); font-size: 14px; }

/* pager, search */
.pager { display: flex; gap: 12px; padding: 20px 0; }
.pager a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--ink); border-radius: 2px; text-decoration: none; }
.search-form label { display: block; font-weight: 700; font-size: 14px; margin: 16px 0 6px; }
.search-box { display: flex; gap: 8px; }
.search-box input { flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--ink); border-radius: 2px; }
.search-box button { min-height: 48px; padding: 0 20px; font: inherit; font-weight: 700; cursor: pointer; color: var(--bg); background: var(--ink); border: 0; border-radius: 2px; }

/* article */
.crumbs ol { display: flex; gap: 8px; list-style: none; margin: 0; padding: 16px 0 0; font-size: 13px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 8px; }
.crumbs a { display: inline-flex; align-items: center; min-height: 32px; text-decoration: none; }
.art-grid { display: grid; grid-template-columns: 200px minmax(0, 680px) 1fr; gap: 48px; padding-top: 8px; justify-content: space-between; }
.art-grid:not(:has(.art-toc)) { grid-template-columns: minmax(0, 680px) 1fr; margin-left: 248px; }
.art-toc { position: sticky; top: 16px; align-self: start; padding-top: 28px; font-size: 13.5px; }
.art-toc ol { margin: 0; padding: 0 0 0 1.2em; }
.art-toc li { margin: 0; }
.art-toc a { display: inline-flex; align-items: center; min-height: 36px; line-height: 1.4; }
.art-head { padding: 28px 0 8px; }
.art-head h1 { font-size: 30px; line-height: 1.45; margin: 6px 0 12px; letter-spacing: 0; }
.art-lead { margin: 0 0 12px; color: var(--muted); font-size: 16.5px; }
.byline { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; font-size: 13px; color: var(--muted); }
.ai-note { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.ai-note::before { content: "◆ "; color: var(--accent); }
.art-cover { margin: 20px 0 8px; }
.art-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 2px; background: var(--surface); }
.art-cover figcaption { margin-top: 6px; font-size: 12px; color: var(--muted); }
.points { margin: 24px 0; padding: 16px 20px; background: var(--surface); border-left: 3px solid var(--accent); }
.points h2 { font-size: 14px; margin: 0 0 6px; }
.points ul { margin: 0; padding-left: 1.2em; }
.points li { margin: 4px 0; }
.prose { font-size: 17px; line-height: 1.9; text-wrap: pretty; }
.prose h2 { font-size: 22px; line-height: 1.5; margin: 2.2em 0 0.6em; padding-top: 0.8em; border-top: 1px solid var(--rule); letter-spacing: 0; }
.prose h3 { font-size: 18px; margin: 1.8em 0 0.4em; }
.prose p { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.prose li { margin: 0.25em 0; }
.prose a { color: var(--accent); }
.prose .table-wrap table { font-size: 14.5px; }
.refs { margin-top: 40px; padding-top: 12px; border-top: 1px solid var(--rule); font-size: 14px; }
.refs h2 { font-size: 15px; margin: 0 0 8px; }
.refs ol, .hist { margin: 0; padding-left: 1.4em; }
.hist { list-style: none; padding: 0; }
.alt-link { margin-top: 32px; padding-top: 12px; border-top: 1px solid var(--rule); font-size: 13px; }
.alt-link a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); }
.art-side { padding-top: 28px; }
.art-side .rail-h { padding-top: 12px; border-top: 2px solid var(--ink); }

/* footer */
.site-footer { border-top: 1px solid var(--rule); background: var(--surface); padding: 32px 0 48px; font-size: 14px; }
.foot { display: grid; grid-template-columns: 1fr auto; gap: 16px 48px; }
.foot-brand p { margin: 4px 0; color: var(--muted); }
.foot-brand .logo-word { color: var(--ink); }
.foot nav ul { display: flex; flex-wrap: wrap; gap: 0 16px; list-style: none; margin: 0; padding: 0; }
.foot nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.disclaimer { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 13px; }

@media (max-width: 1100px) {
  .art-grid, .art-grid:not(:has(.art-toc)) { grid-template-columns: minmax(0, 1fr); margin-left: 0; gap: 8px; }
  .art-toc { position: static; padding-top: 16px; }
  .art-side { padding-top: 24px; }
}
@media (max-width: 860px) {
  .cols { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .col-rail { padding-top: 8px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .notice { padding: 8px 16px; text-align: left; }
  .bar { flex-wrap: wrap; gap: 0 12px; padding-top: 4px; }
  .logo { order: 1; }
  .search-link { order: 2; margin-left: auto; }
  .gnav { order: 3; flex-basis: 100%; margin: 0 -16px; padding: 0 12px; }
  .page-head h1 { font-size: 26px; }
  .feature-title { font-size: 24px; }
  .row { grid-template-columns: minmax(0, 1fr) 96px; gap: 14px; padding: 16px 0; }
  .thumb { width: 96px; }
  .row-title { font-size: 16px; }
  .row-desc { -webkit-line-clamp: 2; font-size: 13.5px; }
  .art-head h1 { font-size: 24px; }
  .prose { font-size: 16.5px; }
  .foot { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* wide data tables scroll sideways on small screens instead of squeezing */
table.data tbody th { white-space: nowrap; }
table.data td time { white-space: nowrap; }
@media (max-width: 640px) {
  table.data { min-width: 620px; }
  .prose table.data { min-width: 0; }
}

/* source tier label */
.src-tier { display: inline-block; font-size: 11px; line-height: 1.6; padding: 0 6px; margin-right: 4px; border: 1px solid var(--rule); border-radius: 3px; color: var(--muted); vertical-align: 1px; }
