/* ==========================================================================
   デザイントークン — 藍 (navy) / 金茶 (gold) / 朱 (crimson)
   テーマは <html data-theme="light|dark"> だけで切り替える（theme-init.js が描画前に必ず付ける）
   ========================================================================== */
:root {
  color-scheme: light;
  --bg: #f6f3ec;
  --bg-accent: #efe9dd;
  --surface: #fffdf8;
  --surface-2: #f3efe6;
  --border: #e2dacb;
  --border-strong: #cbbfa9;
  --text: #1c2333;
  --text-muted: #5d6475;
  --navy: #0f172a;
  --navy-soft: #1e2a44;
  --gold: #b45309;
  --gold-bright: #d97706;
  --gold-tint: #fdf2e1;
  --crimson: #b91c1c;
  --crimson-bright: #dc2626;
  --crimson-tint: #fdecec;
  --focus: #b45309; /* 背景（--bg・--surface など）に対して 4:1 以上（WCAG 1.4.11 は 3:1） */
  --glyph-bg: #fffefb;
  --guide: rgba(185, 28, 28, 0.22);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px -12px rgba(15, 23, 42, 0.18);
  --shadow-lg: 0 24px 64px -24px rgba(15, 23, 42, 0.45);
  --primary-bg: #0f172a;
  --primary-bg-hover: #1e2a44;
  --primary-fg: #f6f3ec;
  --inverse-bg: #0f172a;
  --inverse-fg: #f6f3ec;
  --ok: #15803d;
  --overlay-b: #0891b2;
  --overlay-blend: multiply;

  --font-ui: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", "Noto Sans JP", sans-serif;
  --font-glyph: "MJ Variant Mincho", "IPAmjMincho", "IPAmj明朝", serif;
  /* 最初の画面の字だけを入れた小さなフォント（scripts/build_webfont.py の PRESET_EXTRA）。無い字は通常のフォントで表示 */
  --font-glyph-preset: "MJ Variant Mincho Preset", var(--font-glyph);
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Consolas", monospace;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --gutter: clamp(16px, 4vw, 32px);
  --max-width: 1240px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0f1c;
  --bg-accent: #0e1526;
  --surface: #111a2d;
  --surface-2: #17223a;
  --border: #243251;
  --border-strong: #34466d;
  --text: #ece8df;
  --text-muted: #9aa3b8;
  --navy: #e9e4d8;
  --navy-soft: #c9c2b2;
  --gold: #f2a93b;
  --gold-bright: #f59e0b;
  --gold-tint: rgba(245, 158, 11, 0.12);
  --crimson: #f87171;
  --crimson-bright: #ef4444;
  --crimson-tint: rgba(248, 113, 113, 0.12);
  --focus: #f59e0b;
  --glyph-bg: #0d1424;
  --guide: rgba(248, 113, 113, 0.28);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 64px -24px rgba(0, 0, 0, 0.8);
  --primary-bg: #f59e0b;
  --primary-bg-hover: #fbbf24;
  --primary-fg: #0a0f1c;
  --inverse-bg: #e9e4d8;
  --inverse-fg: #0a0f1c;
  --ok: #4ade80;
  --overlay-b: #22d3ee;
  --overlay-blend: screen;
}

/* ==========================================================================
   ベース
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.7;
  font-feature-settings: "palt" 0;
}

a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-bright); }

button, input, select { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

code { font-family: var(--font-mono); font-size: 0.9em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 4px; }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link { position: absolute; left: 8px; top: -48px; z-index: 100; padding: 8px 14px; background: var(--navy); color: var(--bg); border-radius: var(--radius-sm); }
.skip-link:focus { top: 8px; }

.muted { color: var(--text-muted); }

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon--solid { fill: currentColor; stroke: none; }

.glyph { font-family: var(--font-glyph); font-weight: 400; line-height: 1; }

/* ==========================================================================
   ヘッダー
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  max-width: var(--max-width); margin: 0 auto; padding: 10px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--text); min-width: 0; }
/* ロゴ（.brand__mark）は自分で色を持つので、リンクの色の継承から外す */
.brand a:not(.brand__mark) { color: inherit; text-decoration: none; }
.brand__mark { text-decoration: none; }
.brand__title:hover { text-decoration: underline; text-underline-offset: 3px; }
.brand__mark {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 9px;
  background: #0f172a; color: #f6f3ec;
  font-family: var(--font-glyph-preset); font-size: 26px; line-height: 1;
  box-shadow: inset 0 -3px 0 #b91c1c;
}
.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__title { font-weight: 700; font-size: 17px; letter-spacing: 0.04em; line-height: 1.3; }
.brand__sub { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand__company { opacity: 0.85; }
.brand__company a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.brand__company a:hover { color: var(--gold-bright); }

.header-actions { display: flex; align-items: center; gap: 8px; }

.font-status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.font-status:hover { border-color: var(--border-strong); }
.font-status__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.font-status[data-state="local"] .font-status__dot,
.font-status[data-state="webfont"] .font-status__dot { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18); }
.font-status[data-state="unsupported"] .font-status__dot { background: var(--crimson-bright); box-shadow: 0 0 0 3px var(--crimson-tint); }
.font-status[data-state="checking"] .font-status__dot { animation: pulse 1.2s ease-in-out infinite; }

.icon-button {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
}
.icon-button:hover { border-color: var(--border-strong); }
a.icon-button { color: inherit; }
#source-link .icon { width: 18px; height: 18px; }
#theme-toggle .icon--sun,
:root[data-theme="dark"] #theme-toggle .icon--moon { display: none; }
:root[data-theme="dark"] #theme-toggle .icon--sun { display: block; }

.session-banner { background: var(--crimson-tint); border-bottom: 1px solid var(--crimson); }
.session-banner__inner {
  max-width: var(--max-width); margin: 0 auto; padding: 10px var(--gutter);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; font-size: 13.5px;
}
.session-banner__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.session-banner a.button { text-decoration: none; }

/* ==========================================================================
   レイアウト
   ========================================================================== */
.layout {
  flex: 1; width: 100%; max-width: var(--max-width); margin: 0 auto;
  padding: 24px var(--gutter) 120px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px;
}

@media (min-width: 1000px) {
  .layout { grid-template-columns: 320px minmax(0, 1fr); align-items: start; gap: 32px; }
  .search-panel { position: sticky; top: 84px; }
}

/* ==========================================================================
   ボタン・チップ・フォーム
   ========================================================================== */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 6px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.button:hover { border-color: var(--border-strong); background: var(--surface-2); }
.button:disabled { opacity: 0.5; cursor: not-allowed; }
.button--primary { background: var(--primary-bg); border-color: var(--primary-bg); color: var(--primary-fg); }
.button--primary:hover { background: var(--primary-bg-hover); border-color: var(--primary-bg-hover); }
.button--ghost { background: transparent; }
.button--small { min-height: 30px; padding: 3px 10px; font-size: 12.5px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; cursor: pointer; text-decoration: none; color: var(--text);
}
.chip:hover { border-color: var(--gold-bright); color: var(--text); }
.chip--ghost { background: transparent; }
.chip--toggle[aria-pressed="true"] { border-color: var(--navy); background: var(--inverse-bg); color: var(--inverse-fg); }
.chip__count { font-size: 11px; opacity: 0.7; }

.search-form { margin: 0; }
.search-box {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 6px 6px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-box:focus-within { border-color: var(--gold-bright); box-shadow: 0 0 0 4px var(--gold-tint); }
.search-box__icon { color: var(--text-muted); flex: none; }
.search-box input {
  flex: 1 1 8em; min-width: 6em; border: 0; background: transparent; outline: none;
  font-size: 17px; padding: 6px 2px;
  font-family: var(--font-glyph), var(--font-ui);
}
.search-box input::placeholder { color: var(--text-muted); font-family: var(--font-ui); font-size: 14px; }
/* 消去ボタン（×）: ブラウザ標準の青ではなく、周りと同じ色にする */
.search-box input::-webkit-search-cancel-button {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin-left: 6px; cursor: pointer;
  background-color: var(--text-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E") center / 14px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.search-box input::-webkit-search-cancel-button:hover { background-color: var(--text); }

.search-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.search-tools .button { flex: 1 1 auto; }

.examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 0; }
.examples__label { font-size: 12.5px; color: var(--text-muted); }

.search-history { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 0; }
.search-history__row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.search-history__label { font-size: 12px; color: var(--text-muted); }
.search-history__label--fav { color: var(--gold); font-weight: 600; }
.chip-item {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); padding: 0 4px 0 8px; font-size: 13px;
  line-height: 1.5; transition: border-color 0.15s, background 0.15s;
}
.chip-item:hover { border-color: var(--gold-bright); }
.chip-item--fav { border-color: var(--gold); background: var(--gold-tint); }
.chip-item__btn {
  background: none; border: none; padding: 2px 2px 2px 0;
  font: inherit; color: var(--text); cursor: pointer; text-decoration: none;
}
.chip-item__btn:hover { color: var(--gold-bright); }
.chip-item__remove {
  background: none; border: none; padding: 0 2px; margin-left: 2px;
  font-size: 13px; color: var(--text-muted); cursor: pointer; line-height: 1;
  opacity: 0.6; transition: opacity 0.15s, color 0.15s;
}
.chip-item__remove:hover { opacity: 1; color: var(--crimson); }
.search-history__clear {
  margin-left: auto; font-size: 11.5px; color: var(--text-muted);
  background: none; border: none; cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px; padding: 2px 4px;
}
.search-history__clear:hover { color: var(--crimson); }

.button--fav-active {
  border-color: var(--gold); background: var(--gold-tint); color: var(--gold);
}


.filters {
  margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.filters summary {
  cursor: pointer; padding: 10px 14px; font-size: 13.5px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; list-style: none;
}
.filters summary::-webkit-details-marker { display: none; }
.filters summary::before { content: "▸"; color: var(--text-muted); transition: transform 0.15s; }
.filters[open] summary::before { transform: rotate(90deg); }
.filters__count { margin-left: auto; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--gold-tint); color: var(--gold); }
.filters__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; padding: 4px 14px 12px; align-items: end; }
.filters__note { margin: 0; padding: 0 14px 12px; font-size: 12px; color: var(--text-muted); }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field__label { font-size: 12px; color: var(--text-muted); }
.field select, .field input[type="number"] {
  width: 100%; min-height: 36px; padding: 4px 8px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface);
}
.field select { font-family: var(--font-glyph), var(--font-ui); }
/* 閉じている間も選択中の文字のフォントが読み込まれるので、開くまでは UI のフォントにする（最初の画面を軽くする） */
.filters:not([open]) .field select { font-family: var(--font-ui); }
.field__range { display: flex; align-items: center; gap: 6px; }
.field__range input { min-width: 0; }
.field--check { flex-direction: row; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.field--check input { width: 16px; height: 16px; accent-color: var(--gold-bright); }
.field--inline { flex-direction: row; align-items: center; gap: 10px; }

.section-label { margin: 0 0 8px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em; color: var(--text-muted); }

.quick-access { margin-top: 20px; }
.quick-access > summary { cursor: pointer; list-style: none; }
.quick-access > summary::-webkit-details-marker { display: none; }
.quick-access > summary::after { content: ' ▸'; }
.quick-access[open] > summary::after { content: ' ▾'; }
.quick-access__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.quick-access__list button {
  font-family: var(--font-glyph-preset);
  aspect-ratio: 1; display: grid; place-items: center; padding: 0;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface);
  font-size: 24px; cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.quick-access__list button:hover { border-color: var(--gold-bright); transform: translateY(-1px); }

/* ==========================================================================
   結果
   ========================================================================== */
.results { min-width: 0; outline: none; }

.loading, .empty-state, .notice {
  padding: 32px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border);
  text-align: center; color: var(--text-muted);
}
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; }
.loading__spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--gold-bright); animation: spin 0.8s linear infinite; }

.notice { text-align: left; padding: 16px 20px; }
.notice--spaced { margin-bottom: 12px; }
.notice--compact { padding: 8px 12px; margin: 0 0 10px; }
.notice__actions { margin: 12px 0 0; }
.notice--error { border-color: var(--crimson); background: var(--crimson-tint); color: var(--text); }
.notice--warn { border-color: var(--gold-bright); background: var(--gold-tint); color: var(--text); }

.empty-state { padding: 40px 24px; }
.empty-state__glyph { font-family: var(--font-glyph-preset); font-size: 88px; color: var(--text); margin-bottom: 12px; }
.empty-state h2 { color: var(--text); margin: 0 0 8px; font-size: 20px; }
.empty-state ul { display: inline-grid; gap: 4px; text-align: left; margin: 16px auto 0; padding-left: 20px; }

.result-header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 12px; }
.result-header h2 { margin: 0; font-size: 18px; }
.result-header p { margin: 0; color: var(--text-muted); font-size: 13px; }

/* タブ */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: thin; }
.tab {
  display: flex; flex-direction: column; align-items: center; flex: none;
  min-width: 64px; padding: 8px 10px 6px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
}
.tab .glyph { font-size: 34px; }
.tab__meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-family: var(--font-mono); }
.tab[aria-selected="true"] { border-color: var(--navy); box-shadow: inset 0 -3px 0 var(--crimson-bright); background: var(--surface); }
.tab:hover { border-color: var(--border-strong); }

/* 文字パネル */
.char-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden;
}
.char-hero {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg-accent) 100%);
  border-bottom: 1px solid var(--border);
}
.char-hero__glyph {
  width: 112px; height: 112px; display: grid; place-items: center;
  font-size: 88px; border-radius: var(--radius); background: var(--glyph-bg);
  border: 1px solid var(--border);
}
.char-hero__title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0; font-size: 20px; }
.char-hero__title .glyph { font-size: 1.4em; }
.char-hero__code { font-family: var(--font-mono); font-size: 14px; color: var(--text-muted); font-weight: 400; }
.char-hero__facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.char-hero__readings { margin: 0; font-size: 13.5px; color: var(--text-muted); }
.char-hero__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

@media (max-width: 560px) {
  .char-hero { grid-template-columns: 1fr; justify-items: start; padding: 16px; }
  .char-hero__glyph { width: 96px; height: 96px; font-size: 76px; }
}

.badge {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px;
  font-size: 11.5px; line-height: 1.6; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted);
}
.badge--gold { border-color: transparent; background: var(--gold-tint); color: var(--gold); }
.badge--crimson { border-color: transparent; background: var(--crimson-tint); color: var(--crimson); }
.badge--ok { border-color: transparent; background: rgba(22, 163, 74, 0.12); color: var(--ok); }
.badge--warn { border-color: var(--gold-bright); background: transparent; color: var(--gold); }
.badge--muted { border-style: dashed; background: transparent; color: var(--text-muted); }
.gothic-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: -4px 0 12px; font-size: 12px; color: var(--text-muted); }
.badge--navy { border-color: transparent; background: var(--inverse-bg); color: var(--inverse-fg); }

.panel-section { padding: 18px 24px 22px; }
.panel-section + .panel-section { border-top: 1px solid var(--border); }
.panel-section__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.panel-section__head h3 { margin: 0; font-size: 15px; }
.panel-section__head p { margin: 0; font-size: 12.5px; color: var(--text-muted); }
@media (max-width: 560px) { .panel-section { padding: 14px 16px 18px; } }

/* 字形カード */
.glyph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
@media (max-width: 420px) { .glyph-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.glyph-card {
  position: relative; display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  content-visibility: auto; contain-intrinsic-size: auto 220px;
}
.glyph-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.glyph-card.is-focus { border-color: var(--crimson-bright); box-shadow: 0 0 0 3px var(--crimson-tint); }
.glyph-card.is-selected .glyph-card__compare { background: var(--gold-bright); border-color: var(--gold-bright); color: #0a0f1c; }

.glyph-card__face {
  display: grid; place-items: center; aspect-ratio: 1 / 0.86;
  margin: 6px 6px 0; border-radius: calc(var(--radius) - 4px);
  background: var(--glyph-bg); border: 0; cursor: zoom-in;
  font-size: clamp(56px, 7vw, 72px);
  background-image:
    linear-gradient(var(--guide), var(--guide)),
    linear-gradient(var(--guide), var(--guide));
  background-size: 100% 1px, 1px 100%;
  background-position: center, center;
  background-repeat: no-repeat;
  background-blend-mode: normal;
}
.glyph-card__face:not(:hover) { background-size: 0 0, 0 0; }
.glyph-card__face { position: relative; }
.glyph-card__face > * { grid-area: 1 / 1; }
/* 違いを色で表示: 文字の代わりに、通常の字形と重ねた画像（glyph-diff.js）を出す */
.glyph-card__face canvas { width: 1em; height: 1em; }
.glyph-card__face.is-diff .glyph-card__char { visibility: hidden; }
.glyph-card__face.is-default-glyph::after {
  content: 'IVSなしと同じ'; position: absolute; top: 6px; left: 6px;
  padding: 1px 6px; border-radius: 999px; background: var(--surface-2); color: var(--text-muted);
  font-family: var(--font-ui); font-size: 10.5px; line-height: 1.6;
}
.glyph-card.is-filtered-out { display: none; }

/* 字形の一覧の上の道具（絞り込み・違いを色で表示） */
.glyph-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.glyph-tools__filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.glyph-tools__label, .glyph-tools__status { font-size: 12px; color: var(--text-muted); }
.glyph-tools__filters .chip { padding: 2px 10px; font-size: 12.5px; }
.glyph-tools__empty { margin: 8px 0 0; }
.glyph-tools__diff { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-left: auto; }
.diff-toggle[aria-pressed="true"] { background: var(--inverse-bg); border-color: var(--inverse-bg); color: var(--inverse-fg); }
.diff-legend { display: none; gap: 10px; font-size: 12px; color: var(--text-muted); }
.diff-mode .diff-legend { display: inline-flex; flex-wrap: wrap; }
.diff-legend > span::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 4px; border-radius: 2px; vertical-align: -1px; }
.diff-legend__this::before { background: var(--crimson-bright); }
.diff-legend__base::before { background: var(--overlay-b); }

/* 見つからないときの案内 */
/* 呼び名（はしごだか など） */
.nickname-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.nickname-row {
  display: grid; grid-template-columns: minmax(7em, auto) auto minmax(0, 1fr); align-items: center; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.nickname-row__name { font-weight: 600; }
.nickname-row__targets { display: flex; flex-wrap: wrap; gap: 6px; }
.nickname-row__note { font-size: 12.5px; color: var(--text-muted); }
.nickname-target .glyph { font-size: 28px; }
.nickname-target__mj { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
@media (max-width: 560px) { .nickname-row { grid-template-columns: auto minmax(0, 1fr); } .nickname-row__note { grid-column: 1 / -1; } }

.not-found-help { margin-top: 20px; }
.not-found-help__tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.not-found-help ul { margin: 0; padding-left: 1.2em; font-size: 13.5px; color: var(--text-muted); }
.not-found-help li { margin: 6px 0; }

.glyph-card__body { padding: 8px 10px 4px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.glyph-card__mj { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; }
.glyph-card__seq { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); overflow-wrap: anywhere; }
.glyph-card__badges { display: flex; flex-wrap: wrap; gap: 4px; }
.glyph-card__actions { display: flex; gap: 4px; padding: 6px 8px 8px; }
.glyph-card__actions .button { flex: 1; min-height: 30px; padding: 2px 6px; font-size: 12px; }

/* 関連字 */
.related-list { display: flex; flex-direction: column; gap: 8px; }
.related {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.related > summary {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 8px 12px; cursor: pointer; list-style: none;
}
.related > summary::-webkit-details-marker { display: none; }
.related__glyph { font-size: 40px; width: 52px; text-align: center; }
.related__info { min-width: 0; }
.related__code { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-muted); }
.related__kinds { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.related__toggle { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.related[open] .related__toggle::after { content: "▴"; }
.related:not([open]) .related__toggle::after { content: "▾"; }
.related__content { padding: 4px 12px 12px; }
.related__more { margin: 10px 0 0; }
.related__content .glyph-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.reference-toggle { margin-top: 12px; }
.reference-toggle > summary { cursor: pointer; font-size: 13px; color: var(--text-muted); padding: 4px 0; }

/* 読み検索の候補 */
.name-suggestions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.name-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
}
.name-row__reading { font-weight: 600; min-width: 5em; }
.name-row .chip { font-family: var(--font-glyph); font-size: 20px; padding: 4px 14px; }

.candidate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.candidate {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px 6px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; text-decoration: none; color: var(--text);
  content-visibility: auto; contain-intrinsic-size: auto 96px;
}
.candidate:hover { border-color: var(--gold-bright); color: var(--text); }
.candidate .glyph { font-size: 38px; }
.candidate__meta { display: flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--text-muted); font-family: var(--font-mono); }
.candidate__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold-bright); }
.candidate-divider { grid-column: 1 / -1; margin: 8px 0 0; font-size: 12.5px; color: var(--text-muted); }
.more-button { display: flex; margin: 16px auto 0; }

.image-search { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.image-search__drop {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 32px 20px; border: 2px dashed var(--border-strong); border-radius: var(--radius); text-align: center;
  color: var(--text-muted); font-size: 13.5px;
}
.image-search__drop.is-over { border-color: var(--gold-bright); background: var(--gold-tint); }
.image-search__drop p { margin: 0; }
.image-search__stage { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.image-search__canvas {
  max-width: 100%; touch-action: none; cursor: crosshair;
  background: var(--glyph-bg); border: 1px solid var(--border-strong); border-radius: var(--radius);
}
.image-search__actions { display: flex; gap: 8px; }
.image-search__status { margin: 0; min-height: 2.6em; font-size: 13px; color: var(--text-muted); text-align: center; }
.image-search__status .loading { padding: 0; border: 0; background: none; }

.handwriting { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.handwriting__canvas {
  width: min(320px, 100%); aspect-ratio: 1; align-self: center; touch-action: none; cursor: crosshair;
  background: var(--glyph-bg); border: 1px solid var(--border-strong); border-radius: var(--radius);
}
.handwriting__actions { display: flex; justify-content: center; gap: 8px; }
.handwriting__status { margin: 0; min-height: 2.6em; font-size: 13px; color: var(--text-muted); text-align: center; }
.handwriting__status .loading { padding: 0; border: 0; background: none; }
.handwriting__candidates { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 56px; }
.hw-candidate {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 10px 4px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer;
}
.hw-candidate:hover { border-color: var(--gold-bright); }
.hw-candidate .glyph { font-size: 34px; }
.hw-candidate__count { font-size: 10.5px; color: var(--text-muted); font-family: var(--font-mono); }
.handwriting__note { margin: 0; font-size: 12px; color: var(--text-muted); line-height: 1.6; }

/* ==========================================================================
   比較トレイ・ダイアログ
   ========================================================================== */
.compare-tray {
  position: fixed; left: 50%; bottom: 16px; z-index: 30;
  width: min(760px, calc(100% - 32px)); transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: rise 0.2s ease-out;
}
.compare-tray__inner { display: flex; align-items: center; gap: 12px; padding: 10px 12px; flex-wrap: wrap; }
.compare-tray__label { font-size: 13px; font-weight: 600; white-space: nowrap; }
.compare-tray__list { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; flex: 1; min-width: 0; overflow-x: auto; }
.compare-tray__list button {
  width: 44px; height: 44px; display: grid; place-items: center; flex: none; padding: 0;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--glyph-bg);
  font-size: 30px; cursor: pointer; position: relative;
}
.compare-tray__list button:hover::after {
  content: "✕"; position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-ui); font-size: 16px; background: color-mix(in srgb, var(--crimson-bright) 80%, transparent); color: #fff; border-radius: inherit;
}
.compare-tray__actions { display: flex; gap: 6px; margin-left: auto; }

.dialog {
  width: min(640px, calc(100% - 32px)); max-height: calc(100vh - 48px);
  padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.dialog--wide { width: min(1100px, calc(100% - 32px)); }
.dialog::backdrop { background: rgba(10, 15, 28, 0.55); backdrop-filter: blur(3px); }
.dialog[open] { animation: pop 0.18s ease-out; }
.dialog__header {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.dialog__header h2 { margin: 0; font-size: 16px; }
.dialog .prose { padding: 16px 20px 20px; }
.prose h3 { font-size: 14.5px; margin: 20px 0 6px; }
.prose p { margin: 0 0 10px; }
.os-steps { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0 0 12px; }
.os-steps dt { font-weight: 600; }
.os-steps dd { margin: 0; }
@media (max-width: 480px) { .os-steps { grid-template-columns: 1fr; } .os-steps dd { margin-bottom: 8px; } }

.font-check { display: grid; gap: 6px; padding: 12px 14px; margin-bottom: 14px; border-radius: var(--radius); background: var(--surface-2); font-size: 13.5px; }
.font-check__row { display: flex; align-items: center; gap: 8px; }
.font-check__row .ok { color: #16a34a; font-weight: 700; }
.font-check__row .ng { color: var(--crimson); font-weight: 700; }
.font-check__sample { display: flex; gap: 12px; align-items: center; margin-top: 4px; }
.font-check__sample .glyph { font-size: 44px; padding: 4px 8px; background: var(--glyph-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }

/* 字形詳細 */
.glyph-detail { padding: 16px 20px 20px; }
.glyph-detail__top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; }
.glyph-detail__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.glyph-detail__glyph {
  width: 168px; height: 168px; display: grid; place-items: center; font-size: 136px;
  background: var(--glyph-bg); border: 1px solid var(--border); border-radius: var(--radius);
}
@media (max-width: 520px) {
  .glyph-detail__top { grid-template-columns: 1fr; }
  .glyph-detail__glyph { width: 100%; height: 180px; }
}
.copy-rows { display: flex; flex-direction: column; gap: 6px; }
.copy-row { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 13px; }
.copy-row__label { color: var(--text-muted); }
.copy-row__value { font-family: var(--font-mono); overflow-wrap: anywhere; padding: 3px 8px; border-radius: var(--radius-sm); background: var(--surface-2); }
.copy-row__value.glyph { font-family: var(--font-glyph); font-size: 20px; line-height: 1.3; }

.export-box { margin-top: 14px; padding: 10px 12px; border-radius: var(--radius); background: var(--gold-tint); }
.export-box__label { display: block; font-size: 12.5px; font-weight: 600; color: var(--gold); margin-bottom: 6px; }
.export-box__buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.export-box__note { margin: 8px 0 0; font-size: 12px; color: var(--text-muted); line-height: 1.6; }

.glyph-detail__sections { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.glyph-detail__section { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.glyph-detail__section-title {
  margin: 0; padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--text-muted);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.glyph-detail__section-title::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold);
}
.glyph-detail__section .info-table { margin-top: 0; }
.glyph-detail__section .info-table tr:last-child th,
.glyph-detail__section .info-table tr:last-child td { border-bottom: none; }

.info-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 13.5px; }
.info-table th, .info-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.info-table th { width: 11em; color: var(--text-muted); font-weight: 500; }
.info-table td { overflow-wrap: anywhere; }
.shrink-list { margin: 0; padding-left: 18px; }
.shrink-list .glyph { font-size: 18px; }

/* 比較 */
.compare-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.compare-stage { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; padding: 20px; --size: 200px; }
.compare-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.compare-item__glyph {
  position: relative; width: var(--size); height: var(--size); display: grid; place-items: center;
  font-size: calc(var(--size) * 0.86); background: var(--glyph-bg);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.compare-item__label { font-family: var(--font-mono); font-size: 12px; text-align: center; }
.compare-item__remove { min-height: 26px; padding: 1px 10px; font-size: 12px; }
.compare-controls__clear { margin-left: auto; }
/* ダイアログを開いている間は、画面下の比較トレイを隠す（背景越しに見えても押せないため） */
body:has(dialog[open]) .compare-tray { display: none; }
.compare-stage.show-guides .compare-item__glyph {
  background-image:
    linear-gradient(var(--guide), var(--guide)), linear-gradient(var(--guide), var(--guide)),
    linear-gradient(var(--guide), var(--guide)), linear-gradient(var(--guide), var(--guide)),
    linear-gradient(var(--guide), var(--guide)), linear-gradient(var(--guide), var(--guide));
  background-size: 100% 1px, 1px 100%, 100% 1px, 1px 100%, 100% 1px, 1px 100%;
  background-position: center 50%, 50% center, center 25%, 25% center, center 75%, 75% center;
  background-repeat: no-repeat;
}
.compare-overlay { position: relative; }
.compare-overlay .compare-item__glyph > span { position: absolute; inset: 0; display: grid; place-items: center; }
.compare-overlay .layer-a { color: var(--crimson-bright); opacity: 0.75; }
.compare-overlay .layer-b { color: var(--overlay-b); opacity: 0.75; mix-blend-mode: var(--overlay-blend); }
.compare-legend { display: flex; gap: 12px; font-size: 12px; }
.compare-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.compare-legend .a::before { background: var(--crimson-bright); }
.compare-legend .b::before { background: var(--overlay-b); }

/* 複数文字の連結書き出しコントロール */
.compare-export {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; border-top: 1px solid var(--border); background: var(--gold-tint);
  border-bottom-left-radius: inherit; border-bottom-right-radius: inherit;
}
.compare-export__label { font-size: 13px; font-weight: 600; color: var(--gold); }
.compare-export__options { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.compare-export__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.result-header__title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* トースト */
.clipboard-proxy { position: fixed; top: 0; left: 0; opacity: 0; pointer-events: none; }

.toast {
  position: fixed; left: 50%; top: 76px; z-index: 60; transform: translate(-50%, -12px);
  max-width: calc(100% - 32px); padding: 10px 18px; border-radius: 999px;
  background: #0f172a; color: #f6f3ec; font-size: 13.5px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity 0.18s, transform 0.18s;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast .glyph { font-size: 20px; vertical-align: -3px; margin: 0 2px; }

/* フッター */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-accent); padding-bottom: var(--tray-space, 0px); }
.site-footer__inner {
  max-width: var(--max-width); margin: 0 auto; padding: 24px var(--gutter) 28px;
  display: flex; flex-direction: column; gap: 10px; font-size: 12.5px; color: var(--text-muted);
}
.site-footer p { margin: 0; }
.site-footer__top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; }
.site-footer__brand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.site-footer__brand strong { color: var(--text); font-size: 14px; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-footer a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--text); }
/* 免責は区切り線の下に小さく（全文はライセンスのモーダルにある） */
.site-footer__disclaimer { padding-top: 10px; border-top: 1px solid var(--border); font-size: 11.5px; line-height: 1.7; }
.header-link {
  padding: 6px 4px; border: 0; background: none; color: var(--text-muted);
  font-size: 12.5px; cursor: pointer; white-space: nowrap;
  text-decoration: underline; text-underline-offset: 3px;
}
.header-link:hover { color: var(--gold-bright); }
/* 使い方 */
.help h3 { margin: 20px 0 8px; }
.help h3:first-child { margin-top: 0; }
.help ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.help-table { width: 100%; border-collapse: collapse; margin: 4px 0 12px; font-size: 13.5px; }
.help-table th { width: 9em; padding: 8px 12px 8px 0; text-align: left; vertical-align: top; font-weight: 600; white-space: nowrap; }
.help-table td { padding: 6px 0; color: var(--text-muted); }
.help-table tr + tr { border-top: 1px solid var(--border); }
.help-table .chip { margin: 2px 4px 2px 0; color: var(--text); }
.help-badges { list-style: none; padding-left: 0 !important; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px 16px !important; font-size: 13px; color: var(--text-muted); }
.help kbd { padding: 1px 6px; border: 1px solid var(--border-strong); border-radius: 4px; font-family: var(--font-mono); font-size: 12px; }
/* 狭い画面では、見出しを説明の上に置く */
@media (max-width: 560px) {
  .help-table tr, .help-table th, .help-table td { display: block; }
  .help-table th { width: auto; padding: 8px 0 2px; }
  .help-table td { padding: 0 0 8px; }
}

.help-guide-link {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.help-guide-link a {
  font-weight: 600;
}
.help-guide-link .muted {
  font-size: 12.5px;
}

.license h3 { margin: 18px 0 6px; }
.license h3:first-child { margin-top: 0; }
/* 混同しやすい字・異構字の相互リンク */
.confusables-section {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
}
.confusables-bar {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.confusables-bar + .confusables-bar { margin-top: 10px; }
.confusables-bar--warn {
  border-color: rgba(220, 38, 38, 0.35);
  background: linear-gradient(135deg, var(--surface) 0%, var(--crimson-tint) 100%);
}
.confusables-bar__header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
}
.confusables-bar__desc {
  flex: 1 1 auto; font-size: 13px; color: var(--text); font-weight: 500;
}
.confusables-bar__compare-btn {
  flex: none; font-size: 12px; padding: 2px 8px; min-height: 26px;
}
.confusables-bar__body {
  display: flex; flex-direction: column; gap: 8px;
}
.confusables-bar__chips {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.chip--confusable {
  padding: 4px 10px; font-size: 13px;
}
.chip--warn {
  border-color: rgba(220, 38, 38, 0.4);
  background: var(--crimson-tint);
}
.chip--warn:hover {
  border-color: var(--crimson-bright);
}
.confusable-chip__inner {
  display: inline-flex; align-items: baseline; gap: 6px;
}
.confusable-chip__glyph {
  font-size: 18px; font-weight: 600; line-height: 1;
}
.confusable-chip__code {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
}
.confusable-chip__note {
  font-size: 11.5px; color: var(--text-muted); opacity: 0.85;
}
.confusables-bar__mynote {
  margin: 0; font-size: 12px; color: var(--text-muted); line-height: 1.4;
}

/* 検索結果ヘッダーの表記候補サジェスト */
.variant-suggestions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 10px; padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
.variant-suggestions__label {
  font-size: 12.5px; font-weight: 600; color: var(--text-muted);
}
.variant-suggestions__chips {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.variant-suggestion-chip {
  display: inline-flex; align-items: baseline; gap: 4px;
}
.variant-suggestion-chip__word {
  font-weight: 600;
}
.variant-suggestion-chip__diff {
  font-size: 11px; color: var(--text-muted);
}

/* ==========================================================================
   アニメーション
   ========================================================================== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.3; } }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 12px); } }
@keyframes pop { from { opacity: 0; transform: scale(0.98); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 900px) {
  .brand__company { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .brand__sub { display: none; }
  .header-link { font-size: 11.5px; }
  .header-link__long { display: none; }
  .brand__title { white-space: nowrap; }
  .header-actions { gap: 4px; }
  /* 狭い画面では、フォント状態は文字を省いて点だけにする（押すと詳細が開く） */
  .font-status { padding: 6px 9px; }
  .font-status__label { display: none; }
  .layout { padding-top: 16px; }
  .compare-tray__actions { width: 100%; }
  .compare-tray__actions .button { flex: 1; }
  .info-table th { width: 9em; padding: 5px 6px; }
  .info-table td { padding: 5px 6px; }
}
