@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Pattern F5 — Minimal Mono (控えめなネイビー × ニュートラル構造) */
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-pale: #f4f4f5;
  --bg-yellow: #fefce8;
  --bg-pink: #fdf2f8;
  --bg-blue: #eef2ff;
  --bg-green: #f0fdf4;
  --bg-red: #fef2f2;
  --ink: #0f0f12;
  --ink-2: #27272a;
  --muted: #71717a;
  --muted-2: #a1a1aa;
  --line: #e4e4e7;
  --line-soft: #f4f4f5;

  /* 落ち着いたインディゴ・ネイビーをアクセントに使用 */
  --teal: #1e40af;
  --teal-deep: #1e3a8a;
  --teal-mid: #4f46e5;
  --teal-soft: #eef2ff;
  --teal-pale: #f5f7fc;

  --blue: #1e40af;
  --blue-soft: #dbeafe;
  --green: #15803d;
  --green-soft: #dcfce7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --pink: #be185d;
  --gold: #525252;
  --gold-soft: #fafafa;
  --silver: #a1a1aa;
  --bronze: #71717a;

  --sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Yu Gothic UI', 'Meiryo', sans-serif;
  --display: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Yu Gothic UI', 'Meiryo', sans-serif;

  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
  --shadow-teal: none;
}

/* ── F5: structural elements stay neutral, navy used only on key emphasis ── */
.utility-bar { background: var(--ink); }
.brand-mark { background: transparent; }
.section-heading::after { background: var(--ink); }
.category-card { border-top-color: var(--ink); }
.related-area h3 { border-bottom-color: var(--ink); }
.search-button:hover { border-color: var(--ink); color: var(--ink); }

/* Soften the H1 highlight chip to light gray */
h1 em { background: var(--bg-pale); color: var(--ink); }

/* Article body backgrounds become neutral, blue stays only on the accent rule */
.article > h3 { background: var(--bg-pale); }
.toc-box { background: var(--bg-pale); }
.point-box { background: var(--bg-pale); }
.merit-box .mb-bad { background: var(--muted); }
.question-card button.selected { background: var(--bg-pale); }
.answer-note { background: var(--bg-green); }

/* Footer brand-mark: transparent so the inline SVG (with its own background) shows cleanly */
.site-footer .brand-mark { background: transparent; }

* { box-sizing: border-box; }
html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 500;
  line-height: 1.85;
  letter-spacing: 0.01em;
  font-feature-settings: 'palt' 1;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 80px;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--teal); color: #fff; }

.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;
}

.pattern-badge {
  position: fixed; bottom: 18px; left: 18px; z-index: 80;
  display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 999px;
  font-family: var(--sans); font-weight: 600;
  font-size: 11.5px; box-shadow: none;
}
.pattern-badge a { color: #6ad3df; padding-right: 12px; border-right: 1px solid rgba(255,255,255,0.2); }

.utility-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 8px clamp(18px, 4vw, 48px);
  background: var(--teal); color: #fff;
  font-family: var(--sans); font-size: 12.5px;
  font-weight: 600; letter-spacing: 0.02em;
}
.utility-bar a {
  color: #fff; font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px;
  transition: opacity 0.25s;
}
.utility-bar a:hover { opacity: 0.85; }

.site-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 12px clamp(18px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: max-content; }
.brand-mark {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 6px;
  background: transparent;
  font-family: var(--display);
  font-weight: 800; font-size: 18px;
  box-shadow: none;
  overflow: hidden;
}
.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}
.brand strong {
  display: block; font-family: var(--display);
  font-weight: 800; font-size: 17px;
  letter-spacing: 0.02em;
}
.brand small {
  display: block; color: var(--muted);
  font-family: var(--sans); font-size: 11px;
  letter-spacing: 0.02em; font-weight: 500;
}

.desktop-nav {
  display: flex; gap: 22px; font-family: var(--sans);
  font-size: 14px; font-weight: 700;
}
.desktop-nav a {
  color: var(--ink); padding: 8px 0; position: relative;
  transition: color 0.25s;
}
.desktop-nav a::after {
  content: ''; position: absolute; left: 50%; bottom: 2px;
  width: 0; height: 3px; background: var(--teal);
  transform: translateX(-50%); transition: width 0.25s;
  border-radius: 2px;
}
.desktop-nav a:hover { color: var(--teal-deep); }
.desktop-nav a:hover::after { width: 100%; }

button, .search-button {
  min-height: 40px; border: 1.5px solid var(--line);
  border-radius: 6px; background: #fff; color: var(--ink);
  padding: 0 14px; font-family: var(--sans); font-weight: 700;
  font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.search-button:hover { border-color: var(--teal); color: var(--teal-deep); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.header-cta {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; border-radius: 6px;
  background: var(--teal); color: #fff;
  padding: 0 18px;
  font-family: var(--sans); font-size: 13.5px; font-weight: 800;
  box-shadow: none;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.header-cta:hover { background: var(--teal-deep); transform: translateY(-1px); box-shadow: none; }

main { width: min(1180px, calc(100% - 36px)); margin: 0 auto; }

/* Breadcrumb */
.breadcrumbs {
  font-family: var(--sans); font-size: 12px; font-weight: 500;
  color: var(--muted); padding: 14px 0;
  letter-spacing: 0.02em;
}
.breadcrumbs a { color: var(--teal); transition: opacity 0.2s; }
.breadcrumbs a:hover { opacity: 0.7; }
.breadcrumbs span { color: var(--ink); font-weight: 700; }

/* HERO */
.hero { padding-bottom: 28px; }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px; align-items: start;
}
.hero-copy { display: flex; flex-direction: column; gap: 16px; }

.hero-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-block; padding: 4px 10px;
  border-radius: 3px; font-family: var(--sans);
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.04em;
}
.badge-hot { background: var(--red); color: #fff; }
.badge-pick { background: var(--teal); color: #fff; }
.badge-free { background: var(--ink); color: #fff; }

h1 {
  margin: 4px 0 0; font-family: var(--display);
  font-weight: 800; font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.45; letter-spacing: 0; color: var(--ink);
}
h1 em {
  font-style: normal; color: var(--teal-deep);
  background: var(--teal-soft);
  padding: 0 8px;
  border-radius: 4px;
}

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 4px 18px;
  font-family: var(--sans); font-size: 12.5px;
  color: var(--muted); font-weight: 500;
}

.rating-box {
  background: var(--bg-yellow);
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.rating-stars {
  display: flex; align-items: baseline; gap: 8px;
}
.stars {
  font-family: var(--sans);
  color: var(--gold); font-size: 22px; letter-spacing: 1px;
}
.stars i { font-style: normal; color: #d9e3e5; }
.rating-stars strong {
  font-family: var(--display); font-weight: 900;
  font-size: 26px; color: var(--teal-deep); letter-spacing: 0;
}
.rating-stars em {
  font-style: normal; font-family: var(--sans);
  color: var(--muted); font-weight: 600; font-size: 12px;
}
.rating-box p {
  margin: 0; font-family: var(--sans);
  font-size: 12px; font-weight: 700; color: var(--ink-2);
}
.rating-box p b { color: var(--teal-deep); font-weight: 900; letter-spacing: 1px; }

.lead {
  margin: 4px 0 0; font-family: var(--sans);
  font-size: 15.5px; font-weight: 500; color: var(--ink-2); line-height: 1.95;
}

/* Conclusion box */
.conclusion-box {
  border: 2px solid var(--teal);
  border-radius: 8px;
  background: var(--teal-pale);
  padding: 0;
  margin-top: 8px;
  overflow: hidden;
}
.conclusion-head {
  background: var(--teal);
  color: #fff;
  padding: 8px 16px;
}
.conclusion-tag {
  font-family: var(--display); font-weight: 800;
  font-size: 14px; letter-spacing: 0.04em;
}
.conclusion-box ul {
  margin: 16px 18px 4px; padding: 0; list-style: none;
}
.conclusion-box ul li {
  position: relative; padding: 6px 0 6px 28px;
  font-family: var(--sans); font-size: 14.5px;
  font-weight: 500; color: var(--ink-2); line-height: 1.75;
  border-bottom: 1px dashed rgba(13, 107, 122, 0.18);
}
.conclusion-box ul li:last-child { border-bottom: 0; }
.conclusion-box ul li::before {
  content: '✓'; position: absolute; left: 4px; top: 5px;
  display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--teal); color: #fff;
  font-size: 12px; font-weight: 700;
}
.conclusion-box ul li b { color: var(--teal-deep); font-weight: 800; }
.conclusion-cta {
  display: block; margin: 12px 14px 14px;
  background: var(--teal);
  color: #fff; text-align: center;
  padding: 14px; border-radius: 6px;
  font-family: var(--display); font-weight: 800; font-size: 15px;
  box-shadow: none;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.conclusion-cta:hover { background: var(--teal-deep); transform: translateY(-2px); box-shadow: none; }

/* Hero sidebar */
.hero-side { display: flex; flex-direction: column; gap: 14px; }
.side-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: 8px; padding: 16px;
  box-shadow: none;
}
.side-tag {
  display: block; font-family: var(--sans);
  font-size: 12px; font-weight: 800; color: var(--teal-deep);
  letter-spacing: 0.02em; margin-bottom: 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--teal-soft);
}
.side-cta-card {
  background: var(--teal-pale);
  border: 1.5px solid var(--teal);
  text-align: center;
}
.side-cta-head { margin-bottom: 12px; }
.side-cta-tag {
  display: inline-block; background: var(--teal); color: #fff;
  padding: 3px 10px; border-radius: 999px;
  font-family: var(--sans); font-size: 11.5px; font-weight: 800;
  letter-spacing: 0.04em;
}
.side-cta-card p {
  margin: 8px 0 0; font-family: var(--display);
  font-weight: 800; font-size: 15px;
  color: var(--ink); line-height: 1.55;
}
.side-cta-btn {
  display: block;
  background: var(--teal);
  color: #fff; padding: 14px;
  border-radius: 6px;
  font-family: var(--display); font-weight: 800; font-size: 15px;
  box-shadow: none;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.side-cta-btn:hover { background: var(--teal-deep); transform: translateY(-2px); box-shadow: none; }
.side-cta-card small {
  display: block; margin-top: 8px;
  font-family: var(--sans); font-size: 11px;
  color: var(--muted); font-weight: 500;
}

.supervisor-mini { display: flex; gap: 12px; align-items: flex-start; }
.sv-avatar {
  flex-shrink: 0; width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--teal);
  display: grid; place-items: center;
  color: #fff; font-family: var(--display);
  font-weight: 800; font-size: 22px;
  box-shadow: none;
}
.supervisor-mini strong {
  display: block; font-family: var(--display);
  font-weight: 800; font-size: 14.5px; color: var(--ink);
}
.supervisor-mini em {
  display: block; font-style: normal;
  font-family: var(--sans); font-size: 11.5px;
  color: var(--teal); font-weight: 700;
}
.supervisor-mini p {
  margin: 4px 0 0; font-family: var(--sans);
  font-size: 12px; color: var(--muted-2);
  line-height: 1.65; font-weight: 500;
}

/* ToC */
.toc-section { margin: 24px 0 36px; }
.toc-box {
  border: 1.5px solid var(--teal);
  border-radius: 6px;
  background: var(--teal-pale);
  padding: 14px 18px;
}
.toc-box summary {
  cursor: pointer; font-family: var(--display);
  font-weight: 800; font-size: 15px; color: var(--teal-deep);
  letter-spacing: 0.02em; list-style: none;
}
.toc-box summary::-webkit-details-marker { display: none; }
.toc-box summary::after {
  content: '▼'; float: right; font-size: 12px; transition: transform 0.2s;
}
.toc-box[open] summary::after { transform: rotate(180deg); }
.toc-box ol {
  margin: 12px 0 0; padding-left: 0; list-style: none;
  counter-reset: toc;
}
.toc-box > ol > li {
  counter-increment: toc; position: relative;
  padding: 6px 0 6px 32px;
}
.toc-box > ol > li::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute; left: 0; top: 6px;
  font-family: var(--display); font-weight: 800;
  color: var(--teal); font-size: 14px;
}
.toc-box ol ol {
  margin: 4px 0 0; padding-left: 14px;
  counter-reset: subtoc; border-left: 1px solid var(--teal-soft);
}
.toc-box ol ol li {
  counter-increment: subtoc; position: relative;
  padding: 3px 0 3px 22px;
}
.toc-box ol ol li::before {
  content: counter(toc) '-' counter(subtoc);
  position: absolute; left: 0; top: 4px;
  font-family: var(--sans); font-weight: 700;
  font-size: 11px; color: var(--teal);
}
.toc-box a {
  font-family: var(--sans); font-weight: 700;
  font-size: 14px; color: var(--ink-2);
}
.toc-box ol ol a { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.toc-box a:hover { color: var(--teal-deep); text-decoration: underline; }

/* Sections */
.section { margin: 56px 0; }
.section-heading {
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 3px solid var(--teal);
  position: relative;
}
.section-heading::after {
  content: ''; position: absolute;
  left: 0; bottom: -3px; height: 3px; width: 80px;
  background: var(--ink);
}
.eyebrow {
  margin: 0; font-family: var(--sans);
  font-size: 12px; font-weight: 800; color: var(--teal);
  letter-spacing: 0.04em;
}
.section-heading h2 {
  margin: 4px 0 4px; font-family: var(--display);
  font-weight: 900; font-size: clamp(22px, 3vw, 30px);
  line-height: 1.3; letter-spacing: 0;
  color: var(--ink);
}
.muted {
  color: var(--muted); font-family: var(--sans);
  font-size: 13.5px; line-height: 1.7;
}

/* Categories */
.category-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.category-card {
  position: relative;
  background: #fff; border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  border-radius: 6px; padding: 20px 18px 16px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: none;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.category-card:hover {
  transform: translateY(-3px); box-shadow: none;
  border-top-color: var(--teal-deep);
}
.cat-rank {
  position: absolute; top: -10px; left: 14px;
  background: var(--red);
  color: #fff; padding: 4px 10px;
  border-radius: 3px; font-family: var(--display);
  font-weight: 800; font-size: 11px;
  box-shadow: none;
  letter-spacing: 0.04em;
}
.cat-rank.rank-2 { background: var(--teal-mid); }
.cat-icon {
  width: 44px; height: 44px; border-radius: 8px;
  background: var(--teal-soft); display: grid; place-items: center;
  font-size: 22px;
}
.category-card span {
  font-family: var(--display); font-weight: 800;
  font-size: 16px; color: var(--ink);
}
.cat-stars {
  font-family: var(--sans); color: var(--gold);
  font-size: 13px; letter-spacing: 0.5px; font-weight: 700;
}
.cat-stars i { font-style: normal; color: #d9e3e5; }
.cat-stars em {
  font-style: normal; color: var(--teal-deep);
  font-weight: 800; font-size: 13px; margin-left: 4px;
}
.category-card strong {
  display: block; font-family: var(--sans);
  font-weight: 500; font-size: 12.5px;
  color: var(--ink-2); line-height: 1.7;
}
.category-card small {
  margin-top: auto; padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-family: var(--sans); font-weight: 700;
  font-size: 12px; color: var(--teal-deep);
}
.category-card small b {
  font-family: var(--display); font-weight: 900;
  font-size: 16px; margin-right: 2px;
}

/* Ranking */
.rank-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.rank {
  display: grid; grid-template-columns: 70px 1fr auto;
  gap: 16px; align-items: center;
  background: #fff; border: 1.5px solid var(--line);
  border-radius: 8px; padding: 14px 18px;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.rank:hover { transform: translateY(-2px); box-shadow: none; }
.rank-1 { border-color: var(--gold); background: #fffceb; }
.rank-2 { border-color: var(--silver); background: #f6f8fa; }
.rank-3 { border-color: var(--bronze); background: #fbf2e6; }

.rank-medal {
  display: grid; place-items: center;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--muted);
  color: #fff; font-family: var(--display);
  font-weight: 900; font-size: 24px;
  box-shadow: none;
  position: relative;
}
.rank-medal small {
  display: block; font-size: 10px;
  font-weight: 700; margin-top: -4px;
  letter-spacing: 0.04em;
}
.rank-1 .rank-medal {
  background: var(--gold);
  box-shadow: none;
}
.rank-2 .rank-medal {
  background: var(--silver);
  box-shadow: none;
}
.rank-3 .rank-medal {
  background: var(--bronze);
  box-shadow: none;
}
.rank-other {
  background: var(--bg-soft) !important; color: var(--ink) !important;
  width: 44px !important; height: 44px !important;
  font-size: 18px !important; box-shadow: none;
  border: 1.5px solid var(--line);
}

.rank-body h3 {
  margin: 0; font-family: var(--display);
  font-weight: 800; font-size: 17px;
  color: var(--ink); letter-spacing: 0;
}
.rank-stars {
  font-family: var(--sans); color: var(--gold);
  font-size: 13px; letter-spacing: 0.5px; font-weight: 700;
  margin: 2px 0;
}
.rank-stars i { font-style: normal; color: #d9e3e5; }
.rank-stars em { font-style: normal; color: var(--teal-deep); font-weight: 800; font-size: 12px; margin-left: 4px; }
.rank-body p {
  margin: 4px 0 0; font-family: var(--sans);
  font-size: 13px; color: var(--muted); line-height: 1.7; font-weight: 500;
}

.rank-cta {
  background: var(--teal);
  color: #fff; padding: 10px 16px;
  border-radius: 6px; font-family: var(--display);
  font-weight: 800; font-size: 13px;
  white-space: nowrap; transition: background 0.2s, transform 0.2s;
  box-shadow: none;
}
.rank-cta:hover { background: var(--teal-deep); transform: translateY(-1px); }
.rank-cta-small {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--teal-soft); color: var(--teal-deep);
  font-weight: 800; font-size: 14px;
}

/* Article shell */
.article-shell {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px; align-items: start;
  margin: 56px 0;
}

.article {
  background: #fff; border: 1px solid var(--line);
  border-radius: 8px; padding: clamp(20px, 4vw, 40px);
  box-shadow: none;
}
.article-tag {
  display: inline-block; margin: 0 0 6px;
  padding: 4px 10px; border-radius: 3px;
  background: var(--teal-soft); color: var(--teal-deep);
  font-family: var(--sans); font-weight: 800; font-size: 11.5px;
  letter-spacing: 0.04em;
}
.article > h2 {
  margin: 6px 0 12px; font-family: var(--display);
  font-weight: 900; font-size: clamp(22px, 3vw, 32px);
  line-height: 1.4; letter-spacing: 0; color: var(--ink);
}
.article > .article-meta {
  display: flex; flex-wrap: wrap; gap: 4px 16px;
  font-family: var(--sans); font-size: 12px; color: var(--muted); font-weight: 500;
}
.rating-inline {
  display: inline-flex; align-items: baseline; gap: 6px;
  margin: 8px 0 14px;
  padding: 6px 10px; border-radius: 4px;
  background: var(--bg-yellow); border: 1px solid var(--gold);
}
.rating-inline strong {
  color: var(--gold); font-size: 16px;
  letter-spacing: 1px; font-weight: 400;
}
.rating-inline strong i { font-style: normal; color: #d9e3e5; }
.rating-inline em {
  font-style: normal; font-family: var(--sans);
  font-size: 11.5px; color: var(--ink-2); font-weight: 700;
}

/* Article conclusion */
.article-conclusion {
  border: 2px solid var(--teal);
  border-radius: 8px;
  background: var(--teal-pale);
  padding: 16px 18px;
  margin: 18px 0 24px;
  position: relative;
}
.ac-head {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--teal); color: #fff;
  padding: 5px 12px; border-radius: 3px;
  font-family: var(--display); font-weight: 800; font-size: 13px;
  margin-bottom: 8px;
}
.ac-head span { font-size: 14px; }
.article-conclusion ul {
  margin: 4px 0 0; padding: 0; list-style: none;
}
.article-conclusion li {
  position: relative; padding: 6px 0 6px 28px;
  font-family: var(--sans); font-size: 14px;
  font-weight: 500; color: var(--ink-2); line-height: 1.75;
}
.article-conclusion li::before {
  content: '✓'; position: absolute; left: 6px; top: 7px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--teal); color: #fff;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800;
}
.article-conclusion li b { color: var(--teal-deep); font-weight: 800; }

.article > h3 {
  margin: 36px 0 14px; font-family: var(--display);
  font-weight: 900; font-size: 19px;
  line-height: 1.5; padding: 10px 14px 10px 16px;
  border-left: 5px solid var(--teal);
  border-bottom: 1px solid var(--line);
  background: var(--teal-pale);
  color: var(--ink); letter-spacing: 0;
  border-radius: 0 4px 0 0;
}
.article > p {
  margin: 12px 0 14px; font-size: 15px;
  line-height: 1.95; color: var(--ink-2); font-weight: 500;
}

/* Point box */
.point-box {
  border: 1.5px dashed var(--teal-mid);
  background: var(--teal-pale);
  border-radius: 6px; padding: 14px 18px;
  margin: 14px 0 20px;
}
.pb-tag {
  display: inline-block; background: var(--teal-mid); color: #fff;
  padding: 3px 10px; border-radius: 3px;
  font-family: var(--display); font-weight: 800; font-size: 12px;
  margin-bottom: 6px;
}
.point-box p {
  margin: 0; font-family: var(--sans);
  font-size: 14px; color: var(--ink-2);
  line-height: 1.85; font-weight: 500;
}
.point-box b { color: var(--teal-deep); font-weight: 800; }

/* Compare table */
.compare-table-wrap {
  margin: 18px 0 24px;
  border-radius: 6px; overflow: hidden;
  border: 1.5px solid var(--teal);
  box-shadow: none;
}
.compare-table {
  width: 100%; border-collapse: collapse;
  font-family: var(--sans); font-size: 13.5px;
}
.compare-table thead { background: var(--teal); color: #fff; }
.compare-table th {
  padding: 12px; text-align: center;
  font-family: var(--display); font-weight: 800; font-size: 13px;
  border-right: 1px solid rgba(255,255,255,0.18);
}
.compare-table th:last-child { border-right: 0; }
.compare-table th.t-ok { background: var(--green); }
.compare-table th.t-ng { background: var(--red); }
.compare-table td {
  padding: 12px; text-align: center; vertical-align: middle;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line-soft);
  font-weight: 600; color: var(--ink-2);
  background: #fff;
}
.compare-table td:first-child {
  text-align: left; background: var(--bg-soft);
  font-weight: 700; color: var(--ink);
}
.compare-table td:last-child { border-right: 0; }
.compare-table tr:last-child td { border-bottom: 0; }
.compare-table td.t-ok {
  background: var(--bg-green); color: var(--green);
  font-weight: 800;
}
.compare-table td.t-ok::before {
  content: '◯  '; font-weight: 900;
}
.compare-table td.t-ng {
  background: var(--bg-red); color: var(--red);
  font-weight: 800; text-decoration: line-through;
  text-decoration-color: rgba(185, 28, 28, 0.4);
}
.compare-table td.t-ng::before {
  content: '× ';
}

/* Numbered steps */
.numbered-steps {
  display: grid; gap: 10px; margin: 14px 0 24px;
  padding: 0; list-style: none; counter-reset: step;
}
.numbered-steps li {
  position: relative;
  background: #fff; border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 4px; padding: 14px 16px 14px 60px;
  counter-increment: step;
  box-shadow: none;
}
.numbered-steps li::before {
  position: absolute; top: 14px; left: 12px;
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--teal);
  color: #fff; content: 'STEP\A' counter(step);
  white-space: pre; line-height: 1.1;
  font-family: var(--display); font-weight: 900; font-size: 12px;
  text-align: center; padding-top: 2px;
  box-shadow: none;
}
.numbered-steps li strong { font-family: var(--display); font-weight: 800; font-size: 15.5px; color: var(--ink); }
.numbered-steps li span { display: block; margin-top: 4px; font-family: var(--sans); font-size: 13.5px; color: var(--muted); line-height: 1.8; font-weight: 500; }

/* Merit/Demerit */
.merit-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px; margin: 14px 0 24px;
}
.merit-box {
  border: 1.5px solid var(--line);
  border-radius: 6px; overflow: hidden;
  background: #fff;
}
.mb-head {
  padding: 10px 14px;
  font-family: var(--display); font-weight: 800; font-size: 15px;
  display: flex; align-items: center; gap: 8px;
  color: #fff;
}
.mb-head span {
  display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  font-size: 14px; font-weight: 900;
}
.mb-good { background: var(--green); }
.mb-bad { background: var(--teal-mid); }
.merit-box ul {
  margin: 0; padding: 14px 16px 14px 16px; list-style: none;
}
.merit-box li {
  position: relative; padding: 6px 0 6px 22px;
  font-family: var(--sans); font-size: 13.5px;
  color: var(--ink-2); line-height: 1.7; font-weight: 500;
  border-bottom: 1px dashed var(--line);
}
.merit-box li:last-child { border-bottom: 0; }
.merit-box li::before {
  content: '◯'; position: absolute; left: 0; top: 5px;
  font-size: 12px; color: var(--green); font-weight: 800;
}
.mb-bad + ul li::before { content: '△'; color: var(--teal-mid); }
.merit-box b { color: var(--teal-deep); font-weight: 800; }

/* Examples */
.example {
  display: flex; align-items: flex-start; gap: 14px;
  border-radius: 6px; padding: 14px 16px;
  margin: 12px 0 18px; font-family: var(--sans);
}
.example span {
  flex-shrink: 0; padding: 4px 10px; border-radius: 3px;
  font-family: var(--display); font-weight: 800; font-size: 12px;
  letter-spacing: 0.04em; color: #fff;
}
.example p { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.7; color: var(--ink); }
.example-ng { background: var(--bg-red); border: 1px solid var(--red); }
.example-ng span { background: var(--red); }
.example-ok { background: var(--bg-green); border: 1px solid var(--green); }
.example-ok span { background: var(--green); }

/* CTA banner */
.cta-banner {
  display: flex; align-items: center; gap: 16px;
  background: var(--teal);
  color: #fff; padding: 18px 22px;
  border-radius: 8px; margin: 28px 0;
  box-shadow: none;
  border: 1px solid var(--teal-deep);
}
.cta-banner > div:first-child { flex: 1; }
.cta-banner span {
  display: block; font-family: var(--sans);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.04em; opacity: 0.85;
}
.cta-banner strong {
  display: block; font-family: var(--display);
  font-weight: 800; font-size: 17px; margin-top: 2px;
  line-height: 1.5;
}
.cta-banner a {
  background: #fff; color: var(--teal-deep);
  padding: 12px 20px; border-radius: 6px;
  font-family: var(--display); font-weight: 800; font-size: 14px;
  white-space: nowrap;
  box-shadow: none;
  transition: transform 0.2s, background 0.2s;
}
.cta-banner a:hover { transform: translateY(-2px); background: var(--bg-soft); }

/* Summary box */
.summary-box {
  border: 1.5px solid var(--pink);
  border-radius: 8px; background: var(--bg-pink);
  padding: 0; margin: 24px 0;
  overflow: hidden;
}
.sb-head {
  background: var(--pink); color: #fff;
  padding: 10px 16px;
  font-family: var(--display); font-weight: 800; font-size: 14px;
}
.summary-box ul {
  margin: 14px 18px; padding: 0; list-style: none;
}
.summary-box li {
  position: relative; padding: 6px 0 6px 24px;
  font-family: var(--sans); font-size: 14px;
  color: var(--ink-2); line-height: 1.75; font-weight: 500;
  border-bottom: 1px dashed rgba(190, 24, 93, 0.18);
}
.summary-box li:last-child { border-bottom: 0; }
.summary-box li::before {
  content: '📌'; position: absolute; left: 0; top: 6px;
  font-size: 13px;
}
.summary-box b { color: var(--pink); font-weight: 800; }

/* Supervisor profile */
.supervisor-profile {
  display: flex; gap: 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-top: 32px;
}
.sp-avatar {
  flex-shrink: 0; width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff; display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 28px;
  box-shadow: none;
}
.sp-tag {
  display: inline-block; background: var(--teal-deep); color: #fff;
  padding: 3px 10px; border-radius: 3px;
  font-family: var(--sans); font-size: 11.5px; font-weight: 800;
  letter-spacing: 0.04em; margin-bottom: 6px;
}
.supervisor-profile p { margin: 4px 0; font-family: var(--sans); font-size: 13.5px; color: var(--muted); line-height: 1.85; font-weight: 500; }
.supervisor-profile p strong { font-family: var(--display); font-weight: 800; font-size: 17px; color: var(--ink); margin-right: 4px; }
.supervisor-profile p em { font-style: normal; color: var(--teal); font-weight: 700; font-size: 12.5px; }

/* Related */
.related-area { margin-top: 32px; }
.related-area h3 {
  margin: 0 0 14px; font-family: var(--display);
  font-weight: 800; font-size: 16px;
  color: var(--ink); border-bottom: 2px solid var(--teal);
  padding-bottom: 8px;
}
.related-card {
  display: grid; grid-template-columns: 56px 1fr auto;
  align-items: center; gap: 14px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 6px; padding: 12px 14px;
  margin: 8px 0;
  transition: transform 0.2s, border-color 0.2s;
}
.related-card:hover { transform: translateX(4px); border-color: var(--teal); }
.rc-thumb {
  display: grid; place-items: center;
  width: 56px; height: 56px; border-radius: 6px;
  background: var(--teal-soft);
  font-size: 24px;
}
.related-card strong { display: block; font-family: var(--display); font-weight: 800; font-size: 14.5px; color: var(--ink); }
.related-card small { display: block; font-family: var(--sans); font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.related-card em { font-style: normal; color: var(--teal-deep); font-weight: 800; font-size: 16px; }

/* Side panel */
.side-panel {
  position: sticky; top: 80px; align-self: start;
  display: flex; flex-direction: column; gap: 14px;
}
.side-panel .side-card > a {
  display: block; font-family: var(--sans);
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  padding: 7px 0; border-bottom: 1px dashed var(--line);
  transition: color 0.2s, padding 0.2s;
}
.side-panel .side-card > a:hover { color: var(--teal-deep); padding-left: 4px; }
.side-panel .side-card > a:last-child { border-bottom: 0; }

.side-rank {
  display: flex !important; align-items: center; gap: 10px !important;
  padding: 10px 0 !important; border-bottom: 1px solid var(--line) !important;
}
.side-rank:last-child { border-bottom: 0 !important; }
.side-rank b {
  display: grid; place-items: center; flex-shrink: 0;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-soft); color: var(--ink);
  font-family: var(--display); font-weight: 900; font-size: 13px;
}
.side-rank b.sr-1 { background: var(--gold); color: #fff; }
.side-rank b.sr-2 { background: var(--silver); color: #fff; }
.side-rank b.sr-3 { background: var(--bronze); color: #fff; }
.side-rank strong { display: block; font-family: var(--display); font-weight: 800; font-size: 13.5px; color: var(--ink); }
.side-rank em { display: block; font-style: normal; font-family: var(--sans); font-size: 11px; color: var(--teal); font-weight: 600; }

/* Test */
.test-preview { margin-bottom: 80px; }
.question-card {
  background: #fff; border: 1.5px solid var(--teal);
  border-radius: 8px;
  padding: clamp(20px, 4vw, 36px);
  box-shadow: none;
}
.q-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.q-progress {
  flex: 1; height: 8px; background: var(--bg-soft);
  border-radius: 999px; overflow: hidden;
  border: 1px solid var(--line);
}
.q-progress span {
  display: block; height: 100%;
  background: var(--teal);
  border-radius: 999px;
}
.question-count {
  background: var(--teal); color: #fff;
  padding: 4px 12px; border-radius: 3px;
  font-family: var(--display); font-size: 13px; font-weight: 800;
  letter-spacing: 0.04em;
}
.question-card h3 {
  margin: 14px 0 22px; font-family: var(--display);
  font-weight: 800; font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.5; color: var(--ink);
}
.question-card button {
  display: flex; align-items: center; gap: 14px;
  width: 100%; margin: 8px 0;
  min-height: auto; border: 1.5px solid var(--line);
  border-radius: 6px; background: #fff; color: var(--ink);
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  text-align: left; padding: 14px 16px;
  letter-spacing: 0; box-shadow: none;
  transition: all 0.2s;
}
.question-card button::before {
  content: 'A'; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg-soft); border: 1.5px solid var(--line);
  color: var(--muted); font-family: var(--display);
  font-size: 14px; font-weight: 900;
  flex-shrink: 0; transition: all 0.2s;
}
.question-card button:nth-of-type(2)::before { content: 'B'; }
.question-card button:nth-of-type(3)::before { content: 'C'; }
.question-card button:nth-of-type(4)::before { content: 'D'; }
.question-card button:hover { border-color: var(--teal); }
.question-card button:hover::before { border-color: var(--teal); color: var(--teal-deep); }
.question-card button.selected {
  border-color: var(--teal); background: var(--teal-pale);
}
.question-card button.selected::before {
  background: var(--teal); border-color: var(--teal); color: #fff;
}
.answer-note {
  display: flex; gap: 12px; align-items: flex-start;
  margin-top: 20px;
  background: var(--bg-green);
  border: 1px solid var(--green);
  border-radius: 6px; padding: 14px 16px;
  font-family: var(--sans);
}
.answer-note span {
  flex-shrink: 0; background: var(--green); color: #fff;
  padding: 4px 10px; border-radius: 3px;
  font-family: var(--display); font-weight: 800; font-size: 12px;
}
.answer-note p { margin: 0; font-size: 13.5px; color: #065f46; line-height: 1.7; font-weight: 500; }

/* Manner tests */
.test-cover .cover-stamp {
  border-color: var(--accent);
}
.test-index {
  width: min(100%, 980px);
  margin: 0 auto;
}
.test-index-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 1.35em 0 0;
}
.test-index-card {
  display: grid;
  gap: 3px;
  padding: 13px 14px;
  border: 1px solid var(--rule);
  color: var(--coal);
  text-decoration: none;
  background: var(--paper);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.test-index-card:hover {
  background: var(--paper-2);
  border-color: var(--coal);
  transform: translateY(-1px);
}
.test-index-card strong {
  color: var(--coal);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.45;
}
.test-index-card small {
  color: var(--coal-2);
  font-size: 12.5px;
  line-height: 1.7;
}
.manner-test {
  display: grid;
  gap: 12px;
  margin: 1.2em 0 0;
}
.article-prose + .manner-test {
  margin-top: 0.3em;
}
.test-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--rule-soft);
  background: var(--paper-2);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
}
.test-question {
  margin: 0;
  padding: 0;
  border: 1px solid var(--rule);
  background: var(--paper);
}
.test-question legend {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 13px 14px;
  border-bottom: 1px solid var(--rule-soft);
  color: var(--coal);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.55;
}
.test-question legend span {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.test-options {
  display: grid;
  gap: 8px;
  padding: 10px;
}
.test-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px 12px;
  border: 1px solid var(--rule-soft);
  background: var(--paper);
  color: var(--coal);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.test-option:hover {
  background: var(--paper-2);
  border-color: var(--rule);
}
.test-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.test-option-letter {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  color: var(--muted);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}
.test-option-text {
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.65;
}
.test-option-text p {
  margin: 0;
}
.test-option:has(input:checked),
.test-option.is-selected {
  border-color: var(--accent);
  background: var(--accent-tint);
}
.test-option:has(input:checked) .test-option-letter,
.test-option.is-selected .test-option-letter {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--paper);
}
.test-question.is-correct {
  border-color: color-mix(in srgb, var(--ok) 42%, var(--rule));
}
.test-question.is-wrong,
.test-question.is-unanswered {
  border-color: color-mix(in srgb, var(--ng) 42%, var(--rule));
}
.test-option.is-answer {
  border-color: color-mix(in srgb, var(--ok) 55%, var(--rule));
  background: color-mix(in srgb, var(--ok) 7%, var(--paper));
}
.test-option.is-answer .test-option-letter {
  border-color: var(--ok);
  color: var(--ok);
}
.test-feedback {
  margin: 0;
  padding: 11px 14px;
  border-top: 1px solid var(--rule-soft);
  background: var(--paper-2);
  color: var(--coal-2);
  font-size: 13px;
  line-height: 1.75;
}
.test-feedback p {
  margin: 0;
}
.test-feedback-result {
  display: inline-block;
  margin-right: 8px;
  color: var(--accent);
  font-family: var(--display);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.test-feedback strong {
  margin-right: 8px;
  color: var(--coal);
}
.test-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 0;
  background: linear-gradient(to bottom, transparent, var(--paper) 24%);
}
.test-submit,
.test-reset {
  appearance: none;
  min-height: 42px;
  border-radius: 4px;
  padding: 0 16px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}
.test-submit {
  border: 1px solid var(--coal);
  background: var(--coal);
  color: var(--paper);
}
.test-reset {
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--coal);
}
.test-result {
  padding: 16px;
  border: 2px solid var(--coal);
  background: var(--paper);
}
.test-result-top {
  scroll-margin-top: 96px;
}
.test-result-label {
  margin: 0 0 4px;
  color: var(--accent);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.test-result-score {
  margin: 0;
  color: var(--coal);
  font-family: var(--display);
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 900;
  line-height: 1.25;
}
.test-result-copy {
  margin: 8px 0 0;
  color: var(--coal-2);
  font-size: 14px;
  line-height: 1.75;
}

/* Floating CTA */
.floating-cta {
  position: fixed; right: 18px; bottom: 80px;
  z-index: 40; display: flex; align-items: center; gap: 12px;
  background: var(--teal);
  color: #fff; padding: 12px 16px;
  border-radius: 999px;
  font-family: var(--display); font-weight: 800; font-size: 13px;
  box-shadow: none;
  border: 1px solid var(--teal-deep);
}
.floating-cta a {
  background: #fff; color: var(--teal-deep);
  padding: 6px 14px; border-radius: 999px;
  font-family: var(--display); font-weight: 800; font-size: 12.5px;
}

/* Modal */
.search-modal {
  position: fixed; inset: 0; z-index: 50;
  display: none; place-items: start center;
  background: rgba(16, 42, 49, 0.55);
  backdrop-filter: blur(6px); padding: 80px 18px;
}
.search-modal.is-open { display: grid; }
.search-dialog {
  width: min(720px, 100%); background: #fff;
  border-radius: 8px; padding: 22px;
  box-shadow: none;
  border-top: 3px solid var(--teal);
}
.search-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.search-head strong { font-family: var(--display); font-weight: 800; font-size: 16px; }
.search-head button { min-height: 36px; padding: 0 12px; font-size: 12px; }
.search-dialog input[type="search"] {
  background: var(--bg-soft); border: 1.5px solid var(--line);
  border-radius: 6px; padding: 12px 16px;
  width: 100%; font-family: var(--sans); font-size: 15px;
}
.search-results { display: grid; gap: 8px; margin-top: 14px; }
.search-results a {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 6px; padding: 14px;
  transition: all 0.2s;
}
.search-results a:hover { border-color: var(--teal); background: #fff; }
.search-results a strong { font-family: var(--display); font-weight: 800; font-size: 14.5px; color: var(--ink); }
.search-results a span { font-family: var(--sans); font-size: 12px; color: var(--teal-deep); font-weight: 700; }

/* Footer */
.site-footer {
  margin-top: 56px; padding: 48px clamp(18px, 4vw, 48px) 24px;
  background: var(--ink); color: #c4d4d8;
}
.site-footer-inner {
  width: min(1180px, 100%); margin: 0 auto;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
}
.site-footer .brand-mark { background: transparent; }
.site-footer .brand strong { color: #fff; }
.site-footer .brand small { color: #6ad3df; }
.site-footer h4 {
  margin: 0 0 14px; font-family: var(--display);
  font-size: 14px; font-weight: 800; color: #6ad3df;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a {
  font-family: var(--sans); font-size: 13.5px;
  color: #c4d4d8; font-weight: 500;
  transition: color 0.25s;
}
.site-footer a:hover { color: #fff; }
.footer-tagline {
  font-family: var(--sans); font-size: 13px;
  line-height: 1.85; color: #94a8af;
  margin: 14px 0 0; max-width: 360px;
}
.site-footer-bottom {
  width: min(1180px, 100%); margin: 36px auto 0;
  padding-top: 18px; border-top: 1px solid #2d4750;
  font-family: var(--sans); font-size: 11.5px; color: #6e848b;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}

@media (max-width: 960px) {
  .utility-bar, .desktop-nav { display: none; }
  .hero-grid, .article-shell { grid-template-columns: 1fr; gap: 20px; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section { margin: 40px 0; }
  .side-panel { position: static; }
  .site-footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .floating-cta { right: 12px; bottom: 70px; }
}

@media (max-width: 640px) {
  main { width: min(100% - 28px, 1180px); }
  .site-header { gap: 12px; padding: 10px 14px; }
  .header-cta { display: none; } .brand small { display: none; }
  h1 { font-size: 22px; }
  .rating-box { flex-direction: column; align-items: flex-start; }
  .rank { grid-template-columns: 56px 1fr; gap: 12px; }
  .rank > .rank-cta, .rank > .rank-cta-small { grid-column: 1 / -1; justify-self: stretch; text-align: center; margin-top: 6px; }
  .merit-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: 1fr; }
  .cta-banner { flex-direction: column; align-items: stretch; gap: 12px; }
  .cta-banner a { text-align: center; }
  .compare-table { font-size: 12.5px; }
  .compare-table th, .compare-table td { padding: 8px; }
  .pattern-badge { font-size: 10.5px; padding: 8px 12px; }
}

/* ============================================================
   F5-fix — 細部のブラッシュアップ層（F5の見た目は維持）
   - キーボードフォーカス可視化
   - 字詰め・数字等幅・レンダリング最適化
   - prefers-reduced-motion
   - 印刷対応
   - 色覚配慮（NG/OK 二重コーディング補強）
   ============================================================ */

html { text-rendering: optimizeLegibility; -moz-osx-font-smoothing: grayscale; }
body { font-feature-settings: 'palt' 1, 'kern' 1, 'liga' 1, 'calt' 1; }

/* 数値系は等幅で並びを揃える（崩れず読みやすく） */
.hero-meta, .article-meta, .question-count, .q-progress,
.rank-medal, .cat-count, .sr-1, .sr-2, .sr-3,
.compare-table, .answer-note, .badge { font-variant-numeric: tabular-nums; }

/* スキップリンク（フォーカス時のみ可視） */
.skip-link {
  position: fixed; top: -40px; left: 12px; z-index: 200;
  background: var(--ink); color: #fff;
  padding: 10px 14px; border-radius: 6px;
  font-family: var(--sans); font-weight: 700; font-size: 13px;
  text-decoration: none;
  transition: top 0.18s ease;
}
.skip-link:focus, .skip-link:focus-visible {
  top: 12px; outline: 3px solid var(--teal); outline-offset: 2px;
}

/* キーボードフォーカスの強化（マウスクリック時は出さない） */
a:focus, button:focus, [tabindex]:focus, input:focus, summary:focus { outline: none; }
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ホバー以外でもリンクが識別できるよう、本文中アンカーには下線の足場を残す */
.lead a, .article p a, .article li a {
  text-underline-offset: 3px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--teal) 35%, transparent);
}
.lead a:hover, .article p a:hover, .article li a:hover {
  text-decoration-color: var(--teal);
}

/* NG/OK の二重コーディング（色＋記号＋取消線で色覚に依存しない） */
.example-ng > p { text-decoration: line-through; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, var(--red) 55%, transparent); }
.compare-table td.t-ng { text-decoration: line-through; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, var(--red) 45%, transparent); }

/* モーションを抑制したいユーザー向け */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* 印刷時：固定UI/CTAを除去し、紙面で読める形に */
@media print {
  .pattern-badge, .floating-cta, .utility-bar,
  .site-header, .search-modal, .header-actions { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  main { width: auto; margin: 0; }
  a { color: inherit; text-decoration: underline; }
  .toc-box, .point-box, .article > h3 { background: transparent !important; }
  .conclusion-box, .article-conclusion,
  .merit-box, .category-card, .question-card,
  .summary-box, .cta-banner, .related-card, .side-card {
    break-inside: avoid;
  }
}

/* ────────────────────────────────────────────────────────────
   Hugo統合用オーバーライド（design流用後の補正）
   - 14テーマ・長文タイトル対応
   - floating-cta 未採用に伴うレイアウト調整
   - 子記事h1の見出しスタイル統一
   - footerトーン補正
──────────────────────────────────────────────────────────── */

/* floating-cta を使わないので body 下余白を控えめに */
body { padding-bottom: 24px; }

/* design スタディ用の左下バッジは Hugo では使わない */
.pattern-badge { display: none !important; }

/* デスクトップナビ：長文テーマ名で折り返しさせない */
.desktop-nav a {
  max-width: 14em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* サイドカードのリンク：長い漢字混じりタイトルを折り返し */
.side-panel .side-card > a,
.hero-side .side-card > a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* category-card 内テキストの高さ揃え＋長文の2行クランプ */
.category-card { display: flex; flex-direction: column; }
.category-card span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.category-card strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.category-card small { margin-top: auto; }

/* 子記事 h1：design の h2 と同じ見た目に統一 */
.article > h1 {
  margin: 6px 0 12px;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--ink);
}

/* TOP用ユーティリティ：lead 補足テキスト */
.lead-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

/* テーマ hero の conclusion-box 内 small で description を補助表示 */
.conclusion-box li small {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 2px;
  font-weight: 500;
}

/* ============================================================
   ALMANAC LAYER — full editorial overhaul (2026.05)
   This appended layer redefines TOP / Theme / Article pages
   as a serial-publication "編集帳". Old card patterns inside
   markdown body (.compare-table, .point-box, etc.) are kept
   intact, but page chrome and primary layout are rebuilt.
   ============================================================ */

:root {
  --paper:    #f7f4ec;
  --paper-2:  #efeae0;
  --paper-3:  #e6e0d2;
  --coal:     #18181b;
  --coal-2:   #2a2a2e;
  --rule:     #1f1f23;
  --rule-soft:#d4cdbf;
  --rule-pale:#e7e1d4;
  --accent:   #1e40af;
  --accent-2: #16308a;
  --accent-tint: #e7ecf7;
  --ok:       #15803d;
  --ng:       #b91c1c;
}

/* ── kill legacy chrome we no longer use ───────────────────── */
.utility-bar,
.site-header,
.site-footer,
.floating-cta,
.pattern-badge,
.toc-section,
.hero,
.hero-grid,
.hero-side,
.hero-copy,
.hero-badges,
.conclusion-box,
.section-heading::after,
.article-shell { display: none !important; }

/* keep .article-shell visible when used as legacy fallback for non-list/single pages */
body:not(.page-home):not(.page-theme):not(.page-article) .article-shell { display: grid !important; }

/* ── page substrate ────────────────────────────────────────── */
body.page-home,
body.page-theme,
body.page-article {
  background: var(--paper);
  color: var(--coal);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.85;
  letter-spacing: 0.01em;
  padding-bottom: 0;
  font-feature-settings: 'palt' 1, 'kern' 1, 'liga' 1, 'calt' 1, 'tnum' 1;
}

body.page-home main,
body.page-theme main,
body.page-article main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0;
}

::selection { background: var(--coal); color: var(--paper); }

/* ── masthead (replaces site-header + utility-bar) ─────────── */
.masthead {
  background: var(--paper);
  color: var(--coal);
  border-top: 4px solid var(--accent);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 30;
}
.masthead-inner {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 36px;
  padding: 14px 0;
}
.masthead .brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  text-decoration: none;
}
.masthead .brand-text { min-width: 0; }
.masthead .brand-text strong {
  display: block;
  color: var(--coal);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.04em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.masthead .brand-text small {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  margin-top: 3px;
}
.brand-glyph {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  background: var(--paper);
  color: var(--coal);
  font-family: var(--display);
  font-weight: 900;
  font-size: 17px;
  letter-spacing: 0;
  border-radius: 2px;
  position: relative;
}
.brand-glyph span {
  position: absolute;
  right: -2px; bottom: -2px;
  background: var(--accent);
  color: var(--paper);
  width: 18px; height: 18px;
  display: grid; place-items: center;
  font-size: 10.5px;
  font-weight: 800;
  border-radius: 2px;
}
.masthead-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.masthead-nav a {
  color: var(--coal-2);
  padding: 6px 0;
  transition: color 0.2s;
  position: relative;
  white-space: nowrap;
  max-width: 12em;
  overflow: hidden;
  text-overflow: ellipsis;
}
.masthead-nav a:hover { color: var(--accent); }
.masthead-nav a[aria-current="page"] {
  color: var(--coal);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.masthead-nav .masthead-more {
  color: var(--coal);
  border-left: 1px solid var(--rule);
  padding-left: 16px;
  margin-left: 4px;
}

/* ── HOME: masthead-strip (publication mast) ───────────────── */
.masthead-strip {
  border-bottom: 1px solid var(--rule);
  margin-top: 18px;
  padding-bottom: 10px;
}
.strip-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 28px;
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--coal-2);
  font-weight: 500;
  letter-spacing: 0.06em;
}
.strip-label {
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--coal);
}
.strip-meta b {
  font-weight: 800;
  color: var(--coal);
  font-variant-numeric: tabular-nums;
}

/* ── HOME: hero ────────────────────────────────────────────── */
.home-hero {
  padding: 36px 0 34px;
  border-bottom: 1px solid var(--rule);
}
.hero-kicker {
  margin: 0 0 18px;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.home-hero h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(28px, 3.8vw, 44px);
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--coal);
}
.home-hero h1 em {
  font-style: normal;
  background: none;
  padding: 0;
  border-bottom: 4px solid var(--accent);
  color: var(--coal);
}
.hero-lead {
  margin: 16px 0 0;
  width: 100%;
  max-width: none;
  font-size: 15.5px;
  line-height: 1.95;
  color: var(--coal-2);
  font-weight: 400;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.hero-primary,
.hero-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.hero-primary {
  background: var(--coal);
  color: var(--paper);
}
.hero-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}
.hero-secondary {
  appearance: none;
  background: transparent;
  color: var(--coal);
}
.hero-secondary:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.hero-rule {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0 12px;
}
.hero-rule .rule-line {
  flex: 1; height: 1px; background: var(--rule);
}
.hero-rule .rule-mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 11.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--coal);
}
.hero-quickjump {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-left: 1px solid var(--rule);
}
.hero-quickjump li {
  border-right: 1px solid var(--rule);
}
.hero-quickjump a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--coal);
  transition: background 0.2s;
}
.hero-quickjump a:hover { background: var(--paper-2); }
.hero-quickjump a b {
  font-family: var(--display);
  font-weight: 900;
  font-size: 18px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.home-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-top: 24px;
  border-top: 2px solid var(--coal);
  border-left: 1px solid var(--rule);
}
.home-tool-card {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  color: var(--coal);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}
.home-tool-card:hover {
  background: var(--paper-2);
  border-bottom-color: var(--coal);
}
.home-tool-card span {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.home-tool-card strong {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.4;
}
.home-tool-card small {
  color: var(--coal-2);
  font-size: 13px;
  line-height: 1.75;
}

/* ── HOME: scene finder ───────────────────────────────────── */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 2px solid var(--coal);
  border-left: 1px solid var(--rule);
}
.scene-card {
  min-width: 0;
  padding: 16px 18px 14px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  display: grid;
  gap: 8px;
  align-content: start;
  position: relative;
  transition: background 0.2s;
}
.scene-card:hover { background: var(--paper-2); }
.scene-tag {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.scene-card h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: 19px;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--coal);
}
.scene-card h3 a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 5px;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.scene-card h3 a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
.scene-card h3 a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}
.scene-card h3 a:focus-visible::after {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
}
.scene-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
  color: var(--coal-2);
  font-weight: 400;
}
.scene-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 3px;
  padding-top: 9px;
  border-top: 1px dashed var(--rule-soft);
}
.scene-links a {
  position: relative;
  z-index: 2;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12px;
  color: var(--coal);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--accent);
  transition: color 0.2s, text-decoration-thickness 0.2s;
}
.scene-links a:hover {
  color: var(--accent);
  text-decoration-thickness: 2px;
}

/* ── shared block headings ─────────────────────────────────── */
.block-head {
  display: grid;
  gap: 6px;
  padding: 34px 0 16px;
  border-top: 1px solid var(--rule);
  margin-top: 30px;
}
.scene-finder > .block-head { margin-top: 0; border-top: none; padding-top: 0; }
.block-head h2 {
  margin: 2px 0 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(26px, 3.6vw, 36px);
  line-height: 1.3;
  letter-spacing: 0;
  color: var(--coal);
}
.block-head h2 small {
  display: inline-block;
  margin-left: 14px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  color: var(--coal-2);
  letter-spacing: 0;
}
.block-sub {
  margin: 6px 0 0;
  max-width: 70ch;
  font-size: 14px;
  color: var(--coal-2);
  line-height: 1.85;
}

/* ── HOME: theme ledger (the spine of the site) ────────────── */
.theme-ledger {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--coal);
}
.ledger-row {
  border-bottom: 1px solid var(--rule);
}
.ledger-link {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: start;
  gap: 28px;
  padding: 22px 16px;
  color: var(--coal);
  transition: background 0.2s, padding 0.2s;
  position: relative;
}
.ledger-link:hover {
  background: var(--paper-2);
  padding-left: 24px;
}
.ledger-link:hover .ledger-arrow { transform: translateX(6px); }
.ledger-serial {
  font-family: var(--display);
  font-weight: 900;
  font-size: 44px;
  line-height: 1;
  letter-spacing: 0;
  color: var(--coal);
  font-variant-numeric: tabular-nums;
  position: relative;
  padding-right: 12px;
  border-right: 1px solid var(--rule-soft);
}
.ledger-serial::before {
  content: 'No.';
  position: absolute;
  top: -4px; left: 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--coal-2);
  opacity: 0.5;
}
.ledger-body { display: grid; gap: 6px; min-width: 0; }
.ledger-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 19px;
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--coal);
}
.ledger-desc {
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--coal-2);
  font-weight: 400;
  max-width: 64ch;
}
.ledger-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--coal-2);
  letter-spacing: 0.04em;
  margin-top: 4px;
}
.ledger-meta .lm-key { color: var(--accent); }
.ledger-meta .lm-count {
  font-variant-numeric: tabular-nums;
  background: var(--coal);
  color: var(--paper);
  padding: 2px 8px;
  font-weight: 700;
}
.ledger-arrow {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 900;
  color: var(--accent);
  transition: transform 0.2s;
  align-self: center;
}

/* ── HOME: routes (立場別) ─────────────────────────────────── */
.route-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 2px solid var(--coal);
  border-left: 1px solid var(--rule);
}
.route-card {
  padding: 16px 18px 14px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  display: grid;
  gap: 7px;
  align-content: start;
  position: relative;
}
.route-card:hover { background: var(--paper-2); }
.route-tag {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 11.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.route-card h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: 0;
  color: var(--coal);
}
.route-card h3 small {
  display: block;
  margin-top: 3px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 12px;
  color: var(--coal-2);
  letter-spacing: 0;
}
.route-card p {
  margin: 2px 0 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--coal-2);
  font-weight: 400;
}
.route-card p b { color: var(--coal); font-weight: 700; }
.route-sequence {
  list-style: none;
  margin: 3px 0 2px;
  padding: 8px 0 0;
  border-top: 1px dashed var(--rule-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  counter-reset: route-step;
}
.route-sequence li {
  counter-increment: route-step;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--coal);
  letter-spacing: 0;
}
.route-sequence li::before {
  content: counter(route-step);
  position: static;
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 11px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  background: var(--accent-tint);
  padding: 0 5px;
}
.route-link {
  margin-top: 2px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--coal);
  letter-spacing: 0.02em;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent);
  align-self: end;
}
.route-link:hover {
  color: var(--accent);
  text-decoration-thickness: 2px;
}

/* ── HOME: importance links ───────────────────────────────── */
.importance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 2px solid var(--coal);
  border-left: 1px solid var(--rule);
  margin-top: 4px;
}
.importance-card {
  padding: 18px 20px 16px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  display: grid;
  gap: 9px;
  align-content: start;
  position: relative;
  min-width: 0;
  transition: background 0.2s;
}
.importance-card:hover { background: var(--paper-2); }
.importance-no {
  display: inline-block;
  font-family: var(--display);
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
  color: var(--accent);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.importance-card h3 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 18px;
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--coal);
}
.importance-card p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.78;
  color: var(--coal-2);
}
.importance-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--rule-soft);
}
.importance-links a {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--coal);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--accent);
  transition: color 0.2s, text-decoration-thickness 0.2s;
}
.importance-links a:hover {
  color: var(--accent);
  text-decoration-thickness: 2px;
}

/* ── THEME: cover + body ───────────────────────────────────── */
.trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 8px;
  padding: 20px 0 0;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--coal-2);
  letter-spacing: 0.04em;
}
.trail a {
  color: var(--accent);
  transition: opacity 0.2s;
}
.trail a:hover { opacity: 0.6; }
.trail-sep { color: var(--rule); }
.trail-here {
  color: var(--coal);
  font-weight: 700;
}

.chapter-cover {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  padding: 48px 0 36px;
  margin-top: 24px;
  border-bottom: 2px solid var(--coal);
}
.cover-stamp {
  position: relative;
  padding: 14px 18px;
  background: var(--accent-tint);
  color: var(--accent);
  border-left: 4px solid var(--accent);
  display: inline-flex;
  align-items: center;
  justify-self: start;
  align-self: end;
}
.stamp-label {
  font-family: var(--display);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}
.cover-meta { display: grid; gap: 14px; align-content: end; }
.cover-kicker {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.chapter-cover h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(30px, 4.4vw, 48px);
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--coal);
}
.cover-subtitle {
  margin: -2px 0 0;
  font-family: var(--display);
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.55;
  color: var(--accent);
  font-weight: 800;
}
.cover-lead {
  position: relative;
  margin: 6px 0 2px;
  padding: 18px 22px 18px 26px;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 2.05;
  color: var(--coal);
  background: var(--paper-2);
  border-left: 3px solid var(--accent);
  max-width: 62ch;
  letter-spacing: 0.005em;
  font-weight: 500;
}
.cover-lead::before {
  content: '';
  position: absolute;
  left: 16px;
  top: -1px;
  width: 36px;
  height: 2px;
  background: var(--accent);
}
.cover-spec {
  margin: 8px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-top: 1px solid var(--rule);
}
.cover-spec > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 24px 10px 0;
  border-right: 1px solid var(--rule-soft);
  margin-right: 24px;
}
.cover-spec > div:last-child { border-right: none; }
.cover-spec dt {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.cover-spec dd {
  margin: 0;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 13px;
  color: var(--coal);
  font-variant-numeric: tabular-nums;
}

.chapter-body {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  margin: 44px 0 0;
}
.chapter-prose {} /* uses .article-prose styles */

.chapter-rail {
  display: grid;
  gap: 24px;
  align-content: start;
  position: sticky;
  top: 88px;
  align-self: start;
}
.rail-block {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}
.rail-block:last-child { border-bottom: none; }
.rail-tag {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  counter-reset: rl;
}
.rail-list li { counter-increment: rl; }
.rail-list a {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px dashed var(--rule-soft);
  color: var(--coal);
  transition: padding 0.2s;
}
.rail-list a:hover { padding-left: 4px; color: var(--accent); }
.rail-list a b {
  font-family: var(--display);
  font-weight: 900;
  font-size: 12.5px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.rail-list a span {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}

.rail-prev-next {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.prev-next {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  background: var(--paper-2);
  color: var(--coal);
  border-left: 3px solid var(--accent);
  transition: background 0.2s;
}
.prev-next:hover { background: var(--paper-3); }
.prev-next.disabled {
  background: transparent;
  border-left-color: var(--rule-soft);
  opacity: 0.4;
}
.prev-next small {
  font-family: var(--display);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.prev-next strong {
  font-family: var(--display);
  font-weight: 800;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--coal);
  letter-spacing: 0;
}

.rail-others {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.rail-others a {
  display: block;
  padding: 6px 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--coal-2);
  border-bottom: 1px dotted var(--rule-soft);
  transition: padding 0.2s, color 0.2s;
}
.rail-others a:hover { padding-left: 4px; color: var(--accent); }
.rail-allthemes {
  display: block;
  margin-top: 12px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--coal);
  letter-spacing: 0.02em;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--accent);
}

/* ── GLOSSARY: searchable term index ───────────────────────── */
.glossary-search {
  margin: 0 0 34px;
  padding: 20px;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--coal);
  background: var(--paper);
  display: grid;
  gap: 14px;
}
.glossary-search-head {
  display: grid;
  gap: 6px;
}
.glossary-search-head h2 {
  margin: 0;
  padding: 0;
  border: 0;
  display: block;
  font-size: 22px;
  line-height: 1.4;
  letter-spacing: 0;
}
.glossary-search-head p {
  margin: 0;
  color: var(--coal-2);
  font-size: 13.5px;
  line-height: 1.7;
}
.glossary-search-box {
  display: block;
}
.glossary-search-box input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #fff;
  color: var(--coal);
  font: inherit;
  font-size: 15px;
  letter-spacing: 0;
  outline: none;
}
.glossary-search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}
.glossary-search-box input::placeholder {
  color: var(--muted);
  font-weight: 400;
}
.glossary-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.glossary-suggestions button {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--coal);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
}
.glossary-suggestions button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.glossary-status,
.glossary-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}
.glossary-results {
  display: grid;
  gap: 10px;
}
.glossary-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--rule-soft);
}
.glossary-result-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.glossary-result h3 {
  margin: 0;
  padding: 0;
  border: 0;
  display: block;
  font-size: 17px;
  line-height: 1.45;
  letter-spacing: 0;
}
.glossary-result p {
  margin: 0;
  max-width: none;
  font-size: 13.5px;
  line-height: 1.75;
}
.glossary-result-meta,
.glossary-result-formal {
  color: var(--muted);
}
.glossary-result-type {
  align-self: start;
  padding: 3px 8px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--accent);
  background: var(--paper-2);
  font-family: var(--display);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.6;
  letter-spacing: 0;
  white-space: nowrap;
}

/* ── THEME: chapter list (full table at end) ───────────────── */
.chapter-toc {
  margin-top: 56px;
}
.chapter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--coal);
}
.chapter-row {
  border-bottom: 1px solid var(--rule);
}
.chapter-link {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  align-items: start;
  gap: 28px;
  padding: 22px 16px;
  color: var(--coal);
  transition: background 0.2s, padding 0.2s;
}
.chapter-link:hover {
  background: var(--paper-2);
  padding-left: 24px;
}
.chapter-link:hover .chapter-arrow { transform: translateX(6px); }
.chapter-serial {
  font-family: var(--display);
  font-weight: 900;
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.chapter-body-cell { display: grid; gap: 6px; min-width: 0; }
.chapter-body-cell strong {
  font-family: var(--display);
  font-weight: 800;
  font-size: 17.5px;
  line-height: 1.5;
  color: var(--coal);
  letter-spacing: 0;
}
.chapter-desc {
  font-size: 13px;
  line-height: 1.8;
  color: var(--coal-2);
  max-width: 62ch;
}
.chapter-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--coal-2);
}
.chapter-arrow {
  font-family: var(--display);
  font-weight: 900;
  font-size: 20px;
  color: var(--accent);
  align-self: center;
  transition: transform 0.2s;
}

/* ── COLOPHON (replaces site-footer) ───────────────────────── */
.colophon {
  margin-top: 46px;
  padding: 34px 0 18px;
  background: var(--coal);
  color: var(--paper);
}
.colophon-inner {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(360px, 1.6fr) minmax(200px, 0.9fr);
  gap: 38px;
}
.colophon-brand { display: grid; gap: 14px; }
.colophon-brand p {
  margin: 0;
  font-family: var(--display);
  line-height: 1.6;
}
.colophon-brand strong {
  font-weight: 800;
  font-size: 15px;
  color: var(--paper);
}
.colophon-brand small {
  display: block;
  color: rgba(247, 244, 236, 0.5);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-top: 2px;
}
.colophon-tag {
  margin: 8px 0 0 !important;
  font-family: var(--sans) !important;
  font-size: 12.5px !important;
  font-weight: 400 !important;
  line-height: 1.85;
  color: rgba(247, 244, 236, 0.65) !important;
  max-width: 36ch;
}
.colophon-heading {
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: rgba(247, 244, 236, 0.92);
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(247, 244, 236, 0.16);
}
.colophon-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.colophon-col a {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 12.5px;
  color: rgba(247, 244, 236, 0.82);
  letter-spacing: 0;
  transition: color 0.2s, padding 0.2s;
}
.colophon-col a:hover {
  color: #ffffff;
  padding-left: 4px;
}
.colophon-col--scenes ul {
  display: block;
  columns: 2 14rem;
  column-gap: 22px;
}
.colophon-col--scenes li {
  break-inside: avoid;
  margin-bottom: 8px;
}
.colophon-bottom {
  width: min(1180px, calc(100% - 40px));
  margin: 24px auto 0;
  padding: 14px 0 0;
  border-top: 1px solid rgba(247, 244, 236, 0.12);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(247, 244, 236, 0.5);
}

/* ── responsive ────────────────────────────────────────────── */
@media (max-width: 980px) {
  .masthead-nav { display: none; }
  .masthead-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 18px; }
  .masthead-actions { flex-wrap: nowrap; min-width: max-content; }
  .hero-quickjump { grid-template-columns: 1fr; border-left: 0; border-top: 1px solid var(--rule); }
  .hero-quickjump li { border-right: 0; border-bottom: 1px solid var(--rule); }
  .home-tools { grid-template-columns: 1fr; }
  .scene-grid { grid-template-columns: 1fr; }
  .route-grid { grid-template-columns: 1fr; }
  .importance-grid { grid-template-columns: 1fr; }
  .chapter-cover { gap: 16px; }
  .chapter-body { grid-template-columns: 1fr; gap: 32px; }
  .chapter-rail { position: static; }
  .reading-shell { grid-template-columns: 1fr; gap: 0; }
  .reading-rail { position: static; order: 2; padding: 12px 0; }
  .reading-main { order: 1; }
  /* モバイル: details をブロックに戻してトグル表示 */
  .rail-toc { display: block; }
  .rail-toc-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 0;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 700;
    color: var(--coal-2);
    cursor: pointer;
    list-style: none;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    gap: 8px;
  }
  .rail-toc-toggle::-webkit-details-marker { display: none; }
  .rail-toc-toggle::after { content: "▼"; font-size: 10px; transition: transform 0.2s; }
  details.rail-toc[open] .rail-toc-toggle::after { transform: rotate(180deg); }
  details.rail-toc[open] .rail-chapters { display: grid; }
  details.rail-toc:not([open]) .rail-chapters { display: none; }
  .ledger-link { grid-template-columns: 56px 1fr auto; gap: 16px; padding: 18px 12px; }
  .ledger-serial { font-size: 30px; padding-right: 8px; }
  .ledger-serial::before { font-size: 8px; }
  .chapter-link { grid-template-columns: 72px 1fr auto; gap: 16px; padding: 18px 12px; }
  .chapter-serial { font-size: 18px; }
  .colophon-inner { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 640px) {
  body.page-home main,
  body.page-theme main,
  body.page-article main { width: min(100% - 24px, 1100px); }
  .masthead-inner { width: min(100% - 16px, 1100px); padding: 8px 0; gap: 8px; }
  .masthead .brand { gap: 8px; }
  .masthead .brand-text strong { font-size: 13.5px; letter-spacing: 0; }
  .masthead .brand-text small { display: none; }
  .masthead .brand-glyph { width: 32px; height: 32px; flex: 0 0 32px; }
  .masthead-actions { gap: 8px; }
  .masthead-link {
    font-size: 12px;
    letter-spacing: 0;
    padding: 6px 0;
    white-space: nowrap;
  }
  .search-btn {
    min-height: 34px;
    gap: 4px;
    padding: 6px 8px;
    font-size: 12px;
    letter-spacing: 0;
    white-space: nowrap;
  }
  .search-btn .search-icon { display: none; }
  .home-hero { padding: 24px 0 24px; }
  .home-hero h1 { font-size: clamp(24px, 6.6vw, 34px); line-height: 1.3; }
  .hero-lead {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.85;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .hero-actions { margin-top: 13px; }
  .hero-rule { display: none; }
  .hero-quickjump { display: none; }
  /* 場面から探す を tools より先に表示 */
  body.page-home main { display: flex; flex-direction: column; }
  body.page-home .masthead-strip { order: 1; }
  body.page-home .home-hero   { order: 2; }
  body.page-home .scene-finder { order: 3; }
  body.page-home .home-tools  { order: 4; }
  body.page-home .routes      { order: 5; }
  body.page-home .importance  { order: 6; }
  .block-head { padding: 26px 0 12px; margin-top: 24px; }
  .strip-inner { gap: 4px 16px; font-size: 10.5px; }
  .ledger-link {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 6px;
    padding: 16px 8px;
  }
  .ledger-serial {
    border-right: none;
    border-bottom: none;
    font-size: 32px;
    padding-right: 0;
    padding-bottom: 4px;
  }
  .ledger-arrow { display: none; }
  .chapter-link {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 16px 8px;
  }
  .chapter-serial { font-size: 16px; }
  .chapter-arrow { display: none; }
  .glossary-search {
    padding: 14px;
  }
  .glossary-search-head h2 {
    font-size: 19px;
  }
  .glossary-search-box input {
    min-height: 46px;
    font-size: 14px;
  }
  .glossary-result {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .glossary-result-type {
    justify-self: start;
  }
  .cover-spec > div { padding: 8px 12px 8px 0; margin-right: 12px; }
  .prev-next-nav { grid-template-columns: 1fr; }
  .pn-next { text-align: left; }
  .reading-head h1 { font-size: clamp(22px, 7vw, 32px); }
  .article-prose h2 { font-size: 20px; }
  .article-prose h3 { font-size: 16.5px; }
  .article-prose table { font-size: 12.5px; display: block; overflow-x: auto; }
  .test-index-grid { grid-template-columns: 1fr; }
  .test-status { display: grid; }
  .test-question legend { grid-template-columns: 1fr; gap: 4px; }
  .test-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .test-submit,
  .test-reset {
    width: 100%;
  }
  .article-prose .topic-table tr { padding: 11px; }
  .article-prose .okng-table-wrap {
    overflow-x: visible;
    border: 0;
    background: transparent;
  }
  .article-prose .okng-caption {
    border: 1px solid var(--rule-soft);
    border-bottom: 0;
  }
  .article-prose .okng-table {
    min-width: 0;
    display: block;
    font-size: 13px;
  }
  .article-prose .okng-table thead {
    display: none;
  }
  .article-prose .okng-table tbody {
    display: grid;
    gap: 10px;
  }
  .article-prose .okng-table tr {
    display: grid;
    border: 1px solid var(--rule-soft);
    background: var(--paper);
  }
  .article-prose .okng-table tbody th,
  .article-prose .okng-table tbody td {
    display: block;
    width: auto;
    border-right: 0;
    border-bottom: 1px solid var(--rule-soft);
  }
  .article-prose .okng-table tbody td {
    display: grid;
    grid-template-columns: minmax(6.5em, auto) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }
  .article-prose .okng-table tbody td::before {
    content: attr(data-label);
    font-family: var(--display);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
  }
  .article-prose .okng-table tbody td.is-ng::before {
    color: var(--ng);
  }
  .article-prose .okng-table tbody td.is-ok::before {
    color: var(--ok);
  }
  .article-prose .okng-table tbody tr:last-child th,
  .article-prose .okng-table tbody tr:last-child td,
  .article-prose .okng-table tbody td:last-child {
    border-bottom: 0;
  }
  .prose-card { grid-template-columns: 1fr auto; gap: 12px; padding: 12px 8px; }
  .colophon-inner { width: min(100% - 24px, 1100px); gap: 24px; }
  .colophon-col--scenes ul { columns: 1; }
  .colophon-bottom { width: min(100% - 24px, 1100px); }
}

@media (max-width: 360px) {
  .masthead .brand-glyph { display: none; }
}

/* ────────────────────────────────────────────────────────────
   SEARCH LAYER (Fuse.js client-side search)
   - masthead 検索ボタン
   - 中央モーダル + キーボード操作
──────────────────────────────────────────────────────────── */

.masthead-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}
.masthead-link {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--coal-2);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.masthead-link:hover { color: var(--accent); border-bottom-color: var(--accent); }

.search-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 7px 12px 7px 14px;
  background: var(--paper);
  border: 1px solid var(--rule-soft);
  border-radius: 4px;
  color: var(--coal);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.search-btn:hover { border-color: var(--accent); color: var(--accent); }
.search-btn .search-icon {
  font-size: 16px;
  line-height: 1;
  color: var(--accent);
  font-weight: 700;
}
.search-shortcut {
  display: inline-block;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  padding: 1px 5px;
  line-height: 1.3;
}

/* Modal: reset legacy rules with explicit positioning */
.search-modal {
  display: flex !important;
  position: fixed;
  inset: 0;
  z-index: 80;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(40px, 8vh, 96px) 16px 16px;
  background: rgba(24, 24, 27, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: search-fade 0.18s ease-out;
}
.search-modal[hidden] { display: none !important; }
@keyframes search-fade { from { opacity: 0; } to { opacity: 1; } }
body.search-open { overflow: hidden; }

.search-dialog {
  width: 100%;
  max-width: 640px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  max-height: calc(100vh - 96px);
}

.search-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule-soft);
  background: var(--paper);
}
.search-head-icon {
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}
.search-head input[type="search"] {
  flex: 1;
  appearance: none;
  border: none;
  outline: none;
  background: transparent;
  color: var(--coal);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 4px 0;
}
.search-head input[type="search"]::placeholder { color: var(--muted); font-weight: 400; }
.search-head input[type="search"]::-webkit-search-cancel-button { display: none; }
.search-head button[data-close-search] {
  appearance: none;
  background: transparent;
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  width: 30px;
  height: 30px;
  min-height: 30px;
  flex: 0 0 30px;
  padding: 0;
  line-height: 1;
  align-self: center;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.search-head button[data-close-search]:hover { color: var(--coal); border-color: var(--coal); }

.search-results {
  display: block;
  margin: 0;
  padding: 8px 8px 12px;
  overflow-y: auto;
  background: var(--paper);
}
.search-results a.search-hit {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "section"
    "title"
    "summary";
  gap: 2px;
  padding: 12px 14px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: var(--paper);
  color: var(--coal);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.search-results a.search-hit:hover,
.search-results a.search-hit.is-active {
  background: var(--paper-2);
  border-color: var(--rule-soft);
}
.search-results .hit-section {
  grid-area: section;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.search-results .hit-title {
  grid-area: title;
  font-family: var(--display);
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.45;
  color: var(--coal);
  letter-spacing: 0;
}
.search-results .hit-summary {
  grid-area: summary;
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--coal-2);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-results .search-hint {
  padding: 24px 16px;
  margin: 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  text-align: center;
  letter-spacing: 0.02em;
}
.search-results .search-error { color: #b91c1c; }

.search-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-top: 1px solid var(--rule-soft);
  background: var(--paper-2);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.search-foot kbd {
  display: inline-block;
  background: var(--paper);
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  padding: 1px 5px;
  margin-right: 4px;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--coal-2);
  line-height: 1.3;
}

/* hide shortcut hint on small screens to save space */
@media (max-width: 640px) {
  .search-shortcut { display: none; }
  .search-foot { display: none; }
  .search-dialog { max-width: none; max-height: calc(100vh - 56px); }
  .search-modal { padding: 16px 12px; }
}

/* ────────────────────────────────────────────────────────────
   REQUESTED DESIGN REFINEMENTS
   - テーマ/記事上部の余白を圧縮
   - 空の前後ナビを出さないテンプレート変更に合わせた整形
   - 本文内の内部回遊カードを視認しやすく補強
   - ?skin=blue|green|wine|sumi で色味だけを比較
──────────────────────────────────────────────────────────── */

body.page-theme .trail,
body.page-article .trail {
  padding-top: 14px;
}

body.page-theme .chapter-cover {
  margin-top: 12px;
  padding: 24px 0 28px;
}

body.page-theme .chapter-body {
  margin-top: 28px;
}


body.skin-blue.page-home,
body.skin-blue.page-theme,
body.skin-blue.page-article {
  --paper: #f8fafc;
  --paper-2: #eef4fb;
  --paper-3: #dce8f5;
  --coal: #111827;
  --coal-2: #374151;
  --rule: #172033;
  --rule-soft: #c9d4e2;
  --rule-pale: #e4ebf3;
  --accent: #1d4ed8;
  --accent-2: #1e3a8a;
  --accent-tint: #dbeafe;
  --ok: #15803d;
  --ng: #b91c1c;
  background: var(--paper);
  color: var(--coal);
}

body.skin-green.page-home,
body.skin-green.page-theme,
body.skin-green.page-article {
  --paper: #fbfbf7;
  --paper-2: #eef5ef;
  --paper-3: #dfeade;
  --coal: #17211c;
  --coal-2: #435149;
  --rule: #193327;
  --rule-soft: #cbd8d0;
  --rule-pale: #e6eee8;
  --accent: #0f766e;
  --accent-2: #115e59;
  --accent-tint: #dff3ee;
  --ok: #15803d;
  --ng: #b91c1c;
  background: var(--paper);
  color: var(--coal);
}

body.skin-wine.page-home,
body.skin-wine.page-theme,
body.skin-wine.page-article {
  --paper: #fbf8f6;
  --paper-2: #f1e8e5;
  --paper-3: #e6d6d1;
  --coal: #23191b;
  --coal-2: #55464a;
  --rule: #3a252b;
  --rule-soft: #dccbc8;
  --rule-pale: #efe3df;
  --accent: #9f1239;
  --accent-2: #7f1d1d;
  --accent-tint: #f7dfe6;
  --ok: #15803d;
  --ng: #b91c1c;
  background: var(--paper);
  color: var(--coal);
}

body.skin-sumi.page-home,
body.skin-sumi.page-theme,
body.skin-sumi.page-article {
  --paper: #f7f7f4;
  --paper-2: #ededeb;
  --paper-3: #deded9;
  --coal: #161616;
  --coal-2: #444442;
  --rule: #1f1f1f;
  --rule-soft: #cfcfca;
  --rule-pale: #e5e5df;
  --accent: #525252;
  --accent-2: #262626;
  --accent-tint: #e5e5e5;
  --ok: #15803d;
  --ng: #b91c1c;
  background: var(--paper);
  color: var(--coal);
}

body.skin-blue .masthead,
body.skin-green .masthead,
body.skin-wine .masthead,
body.skin-sumi .masthead {
  border-top-color: var(--accent);
  border-bottom-color: var(--rule);
  background: color-mix(in srgb, var(--paper) 94%, #ffffff 6%);
}

body.skin-blue .colophon,
body.skin-green .colophon,
body.skin-wine .colophon,
body.skin-sumi .colophon {
  background: var(--coal);
}

@media (max-width: 640px) {
  body.page-theme .chapter-cover {
    margin-top: 10px;
    padding: 20px 0 22px;
  }

  .article-prose .prose-card {
    padding: 14px 12px;
  }
}

/* ────────────────────────────────────────────────────────────
   Brand glyph SVG: fill the 40x40 container cleanly
──────────────────────────────────────────────────────────── */
.brand-glyph {
  background: transparent;
  overflow: hidden;
  border-radius: 6px;
}
.brand-glyph svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ────────────────────────────────────────────────────────────
   Meta pages (about / privacy / terms / contact / changelog /
   editorial-policy) — simple article-like rendering
──────────────────────────────────────────────────────────── */
.meta-page {
  width: min(720px, 100%);
  margin: 24px auto 68px;
  padding: 0 4px;
}
.meta-head {
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--rule-soft);
}
.meta-kicker {
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}
.meta-page h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(26px, 3.6vw, 34px);
  letter-spacing: 0;
  color: var(--coal);
  margin: 0 0 12px;
  line-height: 1.4;
}
.meta-lead {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.85;
  color: var(--coal-2);
  margin: 0 0 12px;
}
.meta-updated {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--muted);
  margin: 0;
}
.meta-updated span {
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-right: 8px;
  color: var(--coal-2);
}
.meta-body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.9;
  color: var(--coal);
}
.meta-cta-wrap {
  margin: 22px 0;
  text-align: center;
}
.meta-cta {
  display: inline-flex;
  align-items: center;
  padding: 12px 22px;
  background: var(--accent);
  color: var(--paper);
  border-radius: 6px;
  font-weight: 800;
  text-decoration: none;
  transition: background 0.2s;
}
.meta-cta:hover { background: var(--accent-2); }
.meta-foot {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--rule-soft);
}
.meta-foot a {
  font-family: var(--sans);
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

/* ────────────────────────────────────────────────────────────
   404 Not Found page
──────────────────────────────────────────────────────────── */
.not-found {
  width: min(680px, 100%);
  margin: 52px auto 68px;
  padding: 0 4px;
  text-align: center;
}
.nf-code {
  font-family: var(--display);
  font-size: clamp(64px, 10vw, 96px);
  font-weight: 900;
  letter-spacing: 0;
  color: var(--accent);
  margin: 0 0 8px;
  line-height: 1;
}
.nf-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(20px, 3vw, 26px);
  color: var(--coal);
  margin: 0 0 14px;
  line-height: 1.5;
}
.nf-lead {
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--coal-2);
  margin: 0 0 28px;
}
.nf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 40px;
}
.nf-cta, .nf-link {
  display: inline-flex;
  align-items: center;
  padding: 12px 22px;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 13.5px;
  text-decoration: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.nf-cta {
  background: var(--accent);
  color: var(--paper);
  border: 1px solid var(--accent);
}
.nf-cta:hover { background: var(--accent-2); border-color: var(--accent-2); }
.nf-link {
  background: var(--paper);
  color: var(--coal);
  border: 1px solid var(--rule-soft);
}
.nf-link:hover { border-color: var(--accent); color: var(--accent); }
.nf-shortcut {
  margin-top: 16px;
  padding-top: 22px;
  border-top: 1px solid var(--rule-soft);
}
.nf-shortcut-label {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
.nf-shortcut ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
}
.nf-shortcut a {
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}
.nf-shortcut a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ────────────────────────────────────────────────────────────
   Home — quick tool cards (常識チェック / テンプレート集)
──────────────────────────────────────────────────────────── */
.home-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 18px 0 34px;
  border: 0;
}
.home-tool-card {
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  background: var(--paper);
  border: 1px solid var(--rule-soft);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  text-decoration: none;
  color: var(--coal);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.home-tool-card:hover {
  border-color: var(--accent);
  background: var(--paper-2);
  transform: translateY(-1px);
}
.home-tool-card span {
  font-family: var(--display);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.home-tool-card strong {
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0;
  color: var(--coal);
}
.home-tool-card small {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--coal-2);
  line-height: 1.6;
}
@media (max-width: 640px) {
  .home-tools {
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 18px 0 30px;
  }
}

/* ────────────────────────────────────────────────────────────
   References block (記事末の参考情報リスト)
──────────────────────────────────────────────────────────── */
.references-block {
  margin: 36px 0 0;
  padding: 18px 20px;
  background: var(--paper-2);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}
.references-block h2 {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
  border: 0;
  padding: 0;
}
.references-block ul {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
}
.references-block li {
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--coal-2);
}
.references-block a { color: var(--accent); text-underline-offset: 3px; }
.references-block a:hover { text-decoration: underline; }
.references-note {
  margin-top: 10px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}
