/* ARBITER — beige, calm, formal */
:root {
  --bg: #f2ece1;
  --bg-2: #ebe3d5;
  --paper: #fbf8f2;
  --line: #ddd3c2;
  --line-2: #cfc3ae;
  --ink: #1b1916;
  --ink-2: #4a443b;
  --muted: #8a8173;
  --accent: #8b5e34;
  --accent-soft: #efe2cf;
  --gold: #b08a3e;
  --silver: #8e8d88;
  --bronze: #a0673a;
  --good: #3d7a52;
  --bad: #a4483a;
  --r: 10px;
  --shadow: 0 1px 2px rgba(60, 45, 20, 0.05), 0 6px 20px rgba(60, 45, 20, 0.06);
  --sans: 'Inter', 'Noto Sans JP', system-ui, -apple-system, 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
  --display: 'Archivo Black', 'Arial Black', 'Helvetica Neue', sans-serif;
  --accent-bar: #9a6a3a;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: 'palt' 1; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: fixed; left: 8px; top: 8px; transform: translateY(-200%); background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip-link:focus { transform: none; }
[dir="rtl"] .skip-link { left: auto; right: 8px; }
.page-h1 { font-size: 20px; font-weight: 800; margin: 2px 0 14px; letter-spacing: -0.01em; }
.page-h1 span { font-weight: 500; color: var(--muted); font-size: 14px; }
.kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; background: var(--bg); pointer-events: none; }
@media (hover: none) { .kbd { display: none; } }
a { color: inherit; }
button { font-family: inherit; font-size: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
code { font-family: var(--mono); font-size: 12px; background: var(--bg-2); padding: 1px 5px; border-radius: 4px; }

/* ---------- header ---------- */
#site-header { position: sticky; top: 0; z-index: 30; background: rgba(242, 236, 225, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1480px; margin: 0 auto; padding: 14px 24px 8px; display: flex; align-items: center; gap: 18px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); line-height: 1; flex: 0 0 auto; }
.logo-mark { width: 30px; height: 30px; flex: 0 0 auto; display: block; }
.logo-word { font-family: var(--display); font-size: 25px; letter-spacing: 0.06em; position: relative; padding-bottom: 5px; }
.logo-word::after { content: ''; position: absolute; left: 1px; bottom: 0; width: 28%; height: 3px; background: var(--accent-bar); }
.logo.small .logo-mark { width: 20px; height: 20px; }
.logo.small .logo-word { font-size: 16px; padding-bottom: 3px; }
.logo.small .logo-word::after { height: 2px; }
.tagline { margin: 0; color: var(--muted); font-size: 12px; letter-spacing: 0.04em; padding-left: 16px; border-left: 1px solid var(--line-2); }
.header-status { font: inherit; font-size: 12px; margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); background: var(--paper); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.ok { background: var(--good); box-shadow: 0 0 0 3px rgba(61, 122, 82, 0.15); }
.dot.warn { background: var(--gold); }
.dot.busy { background: var(--accent); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
.main-tabs { max-width: 1480px; margin: 0 auto; padding: 0 16px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.main-tabs::-webkit-scrollbar { display: none; }
.tab { text-decoration: none; border: 0; background: none; padding: 10px 14px 11px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.badge-count { font-style: normal; background: var(--ink); color: var(--paper); font-size: 10px; border-radius: 999px; padding: 1px 6px; line-height: 1.4; }

main { max-width: 1480px; margin: 0 auto; padding: 20px 24px 40px; min-height: 70vh; }

/* ---------- loading ---------- */
.loading { text-align: center; padding: 120px 0; color: var(--muted); }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--ink); border-radius: 50%; margin: 0 auto 16px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- highlights ---------- */
.highlights { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.hl { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; cursor: pointer; transition: border-color 0.15s, transform 0.15s; min-width: 0; }
.hl:hover { border-color: var(--ink-2); }
.hl-label { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; display: flex; gap: 6px; align-items: center; }
.hl-name { font-size: 17px; font-weight: 700; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hl-meta { font-size: 12px; color: var(--ink-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- domain bar ---------- */
.domain-bar { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: thin; }
.chip-d { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 500; white-space: nowrap; display: flex; align-items: center; gap: 7px; color: var(--ink-2); }
.chip-d i { font-size: 11px; color: var(--muted); }
.chip-d:hover { border-color: var(--ink-2); }
.chip-d.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip-d.active i { color: var(--paper); }

/* ---------- toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.toolbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.search-box { position: relative; flex: 0 1 340px; min-width: 200px; }
.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.search-box input { width: 100%; height: 36px; border: 1px solid var(--line); background: var(--paper); border-radius: 8px; padding: 0 12px 0 34px; font: inherit; color: var(--ink); outline: none; }
.search-box input:focus { border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(27, 25, 22, 0.06); }
.btn { height: 36px; border: 1px solid var(--line); background: var(--paper); border-radius: 8px; padding: 0 13px; display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.btn:hover { border-color: var(--ink-2); }
.btn.icon { width: 36px; padding: 0; justify-content: center; }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.on { background: var(--accent-soft); border-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--paper); height: 36px; }
.seg button { border: 0; background: none; padding: 0 12px; font-weight: 500; color: var(--muted); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.active { background: var(--ink); color: var(--paper); }
.seg.small { height: 30px; }
.seg.small button { padding: 0 10px; font-size: 12px; }

/* ---------- filters ---------- */
.filter-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin-bottom: 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px 24px; }
.f-group h4 { margin: 0 0 8px; font-size: 11px; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.f-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.f-opt { border: 1px solid var(--line); background: var(--bg); border-radius: 6px; padding: 4px 9px; font-size: 12px; }
.f-opt.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.f-range { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.f-range input[type=range] { flex: 1; accent-color: var(--ink); }
.f-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.af { background: var(--accent-soft); border: 1px solid #dcc6a6; border-radius: 999px; padding: 2px 6px 2px 11px; font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.af button { border: 0; background: none; color: var(--accent); width: 18px; height: 18px; border-radius: 50%; }
.af button:hover { background: rgba(139, 94, 52, 0.15); }

/* ---------- table ---------- */
.table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow: auto; max-height: calc(100vh - 150px); box-shadow: var(--shadow); }
.rank-table { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.rank-table th, .rank-table td { padding: 0 10px; height: 46px; border-bottom: 1px solid #ece5d8; white-space: nowrap; text-align: center; }
.rank-table thead th { position: sticky; top: 0; z-index: 3; background: var(--paper); height: auto; padding: 10px 10px 9px; font-size: 11px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); vertical-align: bottom; cursor: pointer; user-select: none; letter-spacing: 0.02em; }
.rank-table thead th:hover { color: var(--ink); }
.rank-table thead th .th-sub { display: block; font-weight: 400; font-size: 10px; color: var(--muted); letter-spacing: 0; margin-top: 1px; }
.rank-table thead th.sorted { color: var(--ink); }
.rank-table thead th .sort-ic { font-size: 9px; margin-left: 3px; opacity: 0.8; }
.rank-table th.sticky-1, .rank-table td.sticky-1 { position: sticky; left: 0; z-index: 2; background: var(--paper); }
.rank-table th.sticky-2, .rank-table td.sticky-2 { position: sticky; left: 52px; z-index: 2; background: var(--paper); text-align: left; box-shadow: 1px 0 0 var(--line); }
.rank-table thead th.sticky-1, .rank-table thead th.sticky-2 { z-index: 4; }
.rank-table tbody tr { cursor: pointer; }
.rank-table tbody tr:hover td { background: #f6f1e8; }
.rank-table tbody tr.pinned td { background: #f3ead9; }
.col-rank { width: 52px; min-width: 52px; font-weight: 700; font-size: 15px; }
.col-name { min-width: 250px; max-width: 320px; }
.col-overall { min-width: 118px; background: #f7f2e9 !important; }
.rank-table tbody tr:hover td.col-overall { background: #efe7d9 !important; }
.medal { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; }
.medal.g { background: var(--gold); }
.medal.s { background: var(--silver); }
.medal.b { background: var(--bronze); }
.m-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.m-logo { width: 28px; height: 28px; border-radius: 8px; flex: 0 0 28px; display: inline-flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--line); font-size: 11px; font-weight: 700; color: var(--ink-2); letter-spacing: 0; }
.m-logo img { width: 18px; height: 18px; display: block; }
.m-logo.mono { background: var(--bg-2); }
.m-title a { color: inherit; text-decoration: none; }
.m-text { min-width: 0; line-height: 1.25; }
.m-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.m-title span { overflow: hidden; text-overflow: ellipsis; }
.m-sub { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em; padding: 1px 5px; border-radius: 4px; flex: 0 0 auto; }
.tag.new { background: var(--ink); color: var(--paper); }
.tag.open { background: #e2eadc; color: #3f6440; }
.tag.reason { background: #e9e1f0; color: #5d4a78; }
.tag.prov { background: transparent; color: var(--muted); border: 1px dashed var(--line-2); font-weight: 600; }
.overall-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.overall-num { font-weight: 700; font-size: 15px; }
.bar { position: relative; width: 76px; height: 5px; background: #e6ddcd; border-radius: 3px; overflow: hidden; }
.bar > i { position: relative; display: block; height: 100%; background: var(--ink); border-radius: 3px; }
.bar > b.ci { position: absolute; top: 0; bottom: 0; background: rgba(154, 106, 58, 0.45); z-index: 1; }
.ci-line { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); margin-top: 10px; font-variant-numeric: tabular-nums; }
.ci-track { position: relative; flex: 1; height: 8px; background: #e6ddcd; border-radius: 4px; }
.ci-track b { position: absolute; top: 0; bottom: 0; background: rgba(154, 106, 58, 0.5); border-radius: 4px; }
.ci-track i { position: absolute; top: -3px; width: 3px; height: 14px; background: var(--ink); border-radius: 2px; transform: translateX(-50%); }
.table-note a { color: var(--accent); font-weight: 600; }
.trend { font-size: 10px; font-weight: 600; margin-left: 3px; }
.trend.up { color: var(--good); }
.trend.down { color: var(--bad); }
.cell { display: inline-flex; min-width: 42px; height: 26px; align-items: center; justify-content: center; border-radius: 6px; font-weight: 600; font-size: 13px; padding: 0 6px; }
.cell.na { color: #c4b9a6; font-weight: 400; }
.cell small { font-size: 10px; font-weight: 400; opacity: 0.7; margin-left: 2px; }
.cov { font-size: 11px; color: var(--muted); }
.table-note { font-size: 12px; color: var(--muted); margin: 10px 2px 0; }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.load-more { display: block; margin: 12px auto 0; }

/* ---------- cards ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.card h2 { font-size: 15px; margin: 0; letter-spacing: 0.01em; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-sub { font-size: 12px; color: var(--muted); margin: 4px 0 12px; }
.analysis-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.span-2 { grid-column: span 2; }
.chart-box { position: relative; height: 240px; }
.chart-box.tall { height: 420px; }
.mini-list { margin: 0; padding: 0; list-style: none; counter-reset: i; }
.mini-list li { counter-increment: i; display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid #efe8dc; cursor: pointer; font-size: 13px; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list li .m-logo { width: 22px; height: 22px; flex-basis: 22px; border-radius: 6px; }
.mini-list li .m-logo img { width: 14px; height: 14px; }
.mini-list li::before { content: counter(i); width: 20px; color: var(--muted); font-weight: 600; font-size: 12px; }
.mini-list li .ml-name { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list li .ml-val { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 12px; }
.mini-list li:hover .ml-name { text-decoration: underline; }
.corr-wrap { overflow-x: auto; }
.corr { border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums; }
.corr th { font-weight: 600; color: var(--ink-2); padding: 4px 6px; white-space: nowrap; }
.corr thead th { writing-mode: vertical-rl; transform: rotate(180deg); height: 110px; text-align: left; }
.corr td { width: 46px; height: 32px; text-align: center; border: 2px solid var(--paper); border-radius: 4px; }

/* ---------- sources ---------- */
.method { margin-bottom: 14px; }
.method-steps { margin: 12px 0 0; padding-left: 20px; color: var(--ink-2); }
.method-steps li { margin-bottom: 6px; }
.source-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.src-card h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.src-card .src-org { font-size: 12px; color: var(--muted); margin-top: 2px; }
.src-card p { font-size: 13px; color: var(--ink-2); margin: 10px 0; }
.src-kv { display: grid; grid-template-columns: 90px 1fr; gap: 4px 10px; font-size: 12px; }
.src-kv dt { color: var(--muted); }
.src-kv dd { margin: 0; }
.src-metrics { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.src-metrics span { font-size: 11px; background: var(--bg); border: 1px solid var(--line); padding: 1px 7px; border-radius: 4px; }
.src-metrics span.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.src-status { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-left: auto; }
.src-status.ok { background: #e2eadc; color: var(--good); }
.src-status.ng { background: #f3dcd7; color: var(--bad); }
.src-card a.src-link { font-size: 12px; font-weight: 600; text-decoration: none; color: var(--accent); }
.src-card a.src-link:hover { text-decoration: underline; }

/* ---------- drawer ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(27, 25, 22, 0.35); z-index: 40; animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--bg); z-index: 41; overflow-y: auto; box-shadow: -10px 0 40px rgba(27, 25, 22, 0.18); animation: slide 0.2s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer-close { position: sticky; top: 12px; float: right; margin: 12px 12px 0 0; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); z-index: 2; }
.drawer-close:hover { border-color: var(--ink); }
.d-head { padding: 26px 28px 18px; border-bottom: 1px solid var(--line); background: var(--paper); }
.d-kicker { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.d-title { font-size: 26px; font-weight: 700; margin: 6px 0 8px; letter-spacing: -0.01em; line-height: 1.2; }
.d-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.d-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.d-body { padding: 20px 28px 40px; display: flex; flex-direction: column; gap: 14px; }
.d-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; }
.big-score { display: flex; align-items: baseline; gap: 10px; }
.big-score .v { font-size: 46px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.big-score .u { color: var(--muted); font-size: 13px; }
.d-rank { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 14px; font-size: 12px; }
.stat-grid div span { display: block; color: var(--muted); font-size: 11px; }
.stat-grid div b { font-size: 14px; font-weight: 600; }
.site-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.site-table th { white-space: nowrap; text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.site-table td:nth-child(2) { white-space: nowrap; }
.site-table td { padding: 9px 8px; border-bottom: 1px solid #efe8dc; font-size: 13px; vertical-align: middle; }
.site-table tr.sub td { padding-top: 5px; padding-bottom: 5px; font-size: 12px; color: var(--ink-2); }
.site-table tr.sub td:first-child { padding-left: 22px; }
.site-table tr.overall-row td { background: #f3ecdf; font-weight: 700; }
.site-table .pbar { width: 100%; min-width: 70px; height: 6px; background: #e6ddcd; border-radius: 3px; overflow: hidden; }
.site-table .pbar i { display: block; height: 100%; background: var(--ink); }
.site-table a { color: var(--accent); text-decoration: none; font-size: 11px; }
.variant { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.toggle-sub { border: 0; background: none; color: var(--accent); font-size: 11px; padding: 0 4px; }
.d-chart { height: 280px; position: relative; }
.alias-list { display: flex; flex-wrap: wrap; gap: 4px; }
.alias-list code { font-size: 11px; }

/* ---------- compare ---------- */
.compare-picker { position: relative; margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.suggest { position: absolute; top: 60px; left: 20px; width: 360px; max-height: 320px; overflow-y: auto; background: var(--paper); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow); z-index: 10; }
.suggest button { display: flex; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; gap: 8px; align-items: center; }
.suggest button:hover, .suggest button.hl-s { background: var(--bg); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line); padding: 4px 6px 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; }
.chip i.sw { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chip button { border: 0; background: none; color: var(--muted); }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cmp-table td, .cmp-table th { text-align: center; }
.cmp-table td:first-child, .cmp-table th:first-child { text-align: left; }
.cmp-table td.best { font-weight: 700; background: #efe6d3; }

/* ---------- toast / footer ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 8px; font-size: 13px; z-index: 60; box-shadow: var(--shadow); }
#site-footer { border-top: 1px solid var(--line); background: var(--bg-2); }
.footer-inner { max-width: 1480px; margin: 0 auto; padding: 28px 24px calc(28px + env(safe-area-inset-bottom)); font-size: 12px; color: var(--ink-2); display: grid; grid-template-columns: auto 1fr; gap: 12px 40px; align-items: start; }
.footer-inner p { margin: 6px 0 0; }
.footer-brand p { color: var(--muted); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: flex-end; }
.footer-nav a { text-decoration: none; font-weight: 600; }
.footer-nav a:hover { text-decoration: underline; }
.footer-legal, #footer-updated { grid-column: 1 / -1; }
/* SEO content */
.seo-article { margin-bottom: 16px; }
.seo-article h1 { font-size: 22px; margin: 6px 0 10px; }
.seo-article h2 { font-size: 15px; margin: 18px 0 8px; }
.crumbs { font-size: 12px; color: var(--muted); }
.crumbs a { color: var(--ink-2); }
.faq { margin-top: 24px; }
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq details:first-of-type { margin-top: 10px; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-weight: 400; color: var(--muted); font-size: 18px; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq details p { margin: 8px 0 0; color: var(--ink-2); font-size: 13px; }
body:not([data-tab="models"]) .page-h1, body:not([data-tab="models"]) .faq { display: none; }

.tip { position: fixed; z-index: 70; background: var(--ink); color: var(--paper); font-size: 12px; padding: 8px 10px; border-radius: 6px; pointer-events: none; max-width: 280px; line-height: 1.45; box-shadow: var(--shadow); }
.tip b { color: #fff; }

/* ---------- responsive ---------- */
@media (min-width: 1800px) {
  .header-inner, .main-tabs, main, .footer-inner { max-width: 1720px; }
  body { font-size: 15px; }
}
@media (max-width: 1100px) {
  .highlights { grid-template-columns: repeat(2, 1fr); }
  .analysis-grid { grid-template-columns: 1fr 1fr; }
  .span-2 { grid-column: 1 / -1; }
  .compare-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .tagline { display: none; }
  .table-wrap { max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px); }
  .drawer { width: 100vw; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-nav { justify-content: flex-start; }
}
@media (max-width: 640px) {
  body { font-size: 13.5px; }
  .header-inner { padding: 10px 12px 4px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); gap: 10px; }
  .logo-mark { width: 24px; height: 24px; }
  .logo-word { font-size: 20px; }
  .header-status { padding: 4px 9px; font-size: 11px; max-width: 52vw; overflow: hidden; }
  #status-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .main-tabs { padding: 0 6px; }
  .tab { padding: 9px 10px 10px; font-size: 13px; gap: 6px; }
  main { padding: 12px 10px 28px; padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .page-h1 { font-size: 17px; margin-bottom: 10px; }
  .page-h1 span { display: block; font-size: 12px; }
  .highlights { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; margin: 0 -10px 12px; padding: 0 10px 4px; scrollbar-width: none; }
  .highlights::-webkit-scrollbar { display: none; }
  .hl { flex: 0 0 72%; scroll-snap-align: start; padding: 10px 12px; }
  .hl-name { font-size: 15px; }
  .domain-bar { margin: 0 -10px 10px; padding: 0 10px 4px; scrollbar-width: none; }
  .domain-bar::-webkit-scrollbar { display: none; }
  .toolbar { gap: 6px; }
  .search-box { flex: 1 1 100%; min-width: 0; }
  .search-box input { height: 40px; font-size: 16px; } /* avoid iOS zoom */
  .btn, .seg { height: 38px; }
  .seg button { padding: 0 10px; }
  .toolbar-right { margin-left: auto; }
  #result-count { display: none; }
  .filter-panel { grid-template-columns: 1fr; padding: 14px; }
  .analysis-grid, .d-hero { grid-template-columns: 1fr; }
  .chart-box.tall { height: 320px; }
  .table-wrap { border-radius: 8px; margin: 0 -10px; border-left: 0; border-right: 0; border-radius: 0; }
  .rank-table th, .rank-table td { padding: 0 5px; height: 50px; }
  .col-rank { width: 38px; min-width: 38px; font-size: 13px; }
  .rank-table th.sticky-2, .rank-table td.sticky-2 { left: 38px; }
  .col-name { min-width: 148px; max-width: 160px; }
  .m-name { gap: 7px; }
  .m-logo { width: 22px; height: 22px; flex-basis: 22px; border-radius: 6px; }
  .m-logo img { width: 14px; height: 14px; }
  .m-title { font-size: 13px; }
  .m-title .tag { display: none; }
  .col-overall { min-width: 74px; }
  .overall-num { font-size: 14px; }
  .bar { width: 52px; }
  .cell { min-width: 36px; height: 24px; font-size: 12px; }
  .medal { width: 24px; height: 24px; font-size: 12px; }
  .d-head, .d-body { padding-left: 16px; padding-right: 16px; }
  .d-head { padding-top: 20px; }
  .d-title { font-size: 21px; }
  .big-score .v { font-size: 38px; }
  .site-table td, .site-table th { padding-left: 5px; padding-right: 5px; }
  .site-table td:nth-child(3), .site-table th:nth-child(3) { display: none; }
  .card { padding: 14px; }
  .source-grid { grid-template-columns: 1fr; }
  .suggest { left: 10px; right: 10px; width: auto; }
  .corr td { width: 34px; height: 28px; }
  .toast { bottom: calc(16px + env(safe-area-inset-bottom)); max-width: 90vw; }
}
@media (max-width: 380px) {
  .btn-label { display: none; }
  .col-name { min-width: 128px; max-width: 136px; }
  .logo-word { font-size: 18px; }
  .seg button { padding: 0 8px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print {
  #site-header, .toolbar, .domain-bar, #site-footer, .drawer, .backdrop { display: none !important; }
  .table-wrap { max-height: none; overflow: visible; box-shadow: none; }
}

/* ---------------- i18n: language switch, RTL ---------------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.header-right .header-status { margin-left: 0; }
.lang-switch { position: relative; display: flex; align-items: center; flex-shrink: 0; }
.lang-switch i { position: absolute; left: 10px; font-size: 12px; color: var(--muted); pointer-events: none; }
.lang-switch select { appearance: none; -webkit-appearance: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 5px 26px 5px 28px; cursor: pointer; max-width: 150px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 13px) 52%, calc(100% - 9px) 52%; background-size: 4px 4px; background-repeat: no-repeat; }
.lang-switch select:hover { border-color: var(--line-2); }
.lang-switch select:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.footer-langs { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.footer-langs a { text-decoration: none; color: var(--muted); }
.footer-langs a:hover { color: var(--ink); text-decoration: underline; }
.footer-langs a[aria-current] { color: var(--ink); font-weight: 700; }
@media (max-width: 640px) {
  .lang-switch select { max-width: 112px; padding: 4px 22px 4px 26px; font-size: 11px; }
  .header-status { max-width: 40vw; }
}
@media (max-width: 380px) {
  .header-status #status-text { display: none; }
}
/* scripts with tall glyphs */
html[lang="hi"], html[lang="bn"], html[lang="pa"] { line-height: 1.6; }
html[lang="ar"] body, html[lang="ur"] body { font-family: Inter, 'Noto Sans Arabic', 'Noto Nastaliq Urdu', system-ui, sans-serif; }
/* RTL (Arabic, Urdu) */
[dir="rtl"] .tagline { padding-left: 0; padding-right: 16px; border-left: 0; border-right: 1px solid var(--line-2); }
[dir="rtl"] .header-right { margin-left: 0; margin-right: auto; }
[dir="rtl"] .lang-switch i { left: auto; right: 10px; }
[dir="rtl"] .lang-switch select { padding: 5px 28px 5px 26px; background-position: 13px 52%, 9px 52%; }
[dir="rtl"] .search-box i { left: auto; right: 12px; }
[dir="rtl"] .search-box input { padding: 0 34px 0 12px; }
[dir="rtl"] .kbd { right: auto; left: 9px; }
[dir="rtl"] .toolbar-right { margin-left: 0; margin-right: auto; }
[dir="rtl"] .drawer { right: auto; left: 0; }
[dir="rtl"] .drawer-close { float: left; margin: 12px 0 0 12px; }
[dir="rtl"] .drawer { box-shadow: 10px 0 40px rgba(27, 25, 22, 0.18); }
[dir="rtl"] .rank-table th, [dir="rtl"] .rank-table td { text-align: right; }
[dir="rtl"] .rank-table th.sticky-1, [dir="rtl"] .rank-table td.sticky-1 { left: auto; right: 0; }
[dir="rtl"] .rank-table th.sticky-2, [dir="rtl"] .rank-table td.sticky-2 { left: auto; right: 52px; text-align: right; box-shadow: -1px 0 0 var(--line); }
@media (max-width: 640px) { [dir="rtl"] .rank-table th.sticky-2, [dir="rtl"] .rank-table td.sticky-2 { left: auto; right: 38px; } }
[dir="rtl"] .footer-nav { justify-content: flex-start; }
[dir="rtl"] .method-steps { padding-right: 1.4em; padding-left: 0; }
/* keep model names, numbers and code LTR inside RTL pages */
[dir="rtl"] .m-title, [dir="rtl"] .overall-num, [dir="rtl"] .cell, [dir="rtl"] .cov, [dir="rtl"] code, [dir="rtl"] .logo { direction: ltr; unicode-bidi: isolate; }
