/* ===== 1. Variables (tokens) ===== */
:root {
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --type-hero: 2.25rem;
  --type-h1: 1.5rem;
  --type-h2: 1.125rem;
  --type-h3: 0.9375rem;
  --type-body: 0.9375rem;
  --type-small: 0.8125rem;
  --type-label: 0.75rem;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;
  --c-text: #1a1a2e;
  --c-text-2: #4a5568;
  --c-text-3: #718096;
  --c-bg: #ffffff;
  --c-bg-alt: #f7f8fa;
  --c-border: #e2e8f0;
  --c-accent: #1e3a5f;
  --c-cta: #d97706;
  --c-cta-hover: #b45309;
  --c-green: #16a34a;
  --c-red: #dc2626;
}

/* ===== 2. Reset + base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); font-size: var(--type-body); line-height: 1.7; color: var(--c-text); background: var(--c-bg); -webkit-font-smoothing: antialiased; text-align: left; }
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
table, svg, pre, code { max-width: 100%; }
body { overflow-x: hidden; }

/* ===== 3. Typography ===== */
.hero-title { font-size: var(--type-hero); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; color: var(--c-text); margin-bottom: var(--space-md); text-align: left; }
h1 { font-size: var(--type-h1); font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; text-align: left; }
h2 { font-size: var(--type-h2); font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; text-align: left; margin-top: var(--space-lg); margin-bottom: var(--space-sm); }
h3 { font-size: var(--type-h3); font-weight: 600; line-height: 1.4; text-align: left; }
.body-text { color: var(--c-text-2); max-width: 72ch; }
.text-small { font-size: var(--type-small); color: var(--c-text-3); }
.label { font-size: var(--type-label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-accent); text-align: left; }

/* ===== 4. Layout (container, grid) ===== */
.container { max-width: 1080px; padding: 0 var(--space-lg); margin: 0 auto; }
.section { padding: var(--space-xl) 0; }
.section--alt { background: var(--c-bg-alt); padding: var(--space-md) 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }
.grid-hero { display: grid; grid-template-columns: 60fr 40fr; gap: var(--space-xl); align-items: center; }

/* ===== 5. Components (card, btn, badge) ===== */
.card { background: var(--c-bg); border: 1px solid var(--c-border); border-radius: 8px; padding: var(--space-md); }
.btn { display: inline-block; padding: 12px 24px; border-radius: 6px; font-size: var(--type-body); font-weight: 600; cursor: pointer; border: none; transition: background 0.15s; }
.btn-primary { background: var(--c-cta); color: #fff; }
.btn-primary:hover { background: var(--c-cta-hover); text-decoration: none; }
.btn-secondary { background: var(--c-bg-alt); border: 1px solid var(--c-border); color: var(--c-text); }
.btn-secondary:hover { border-color: var(--c-text-3); background: var(--c-border); text-decoration: none; }
.btn-large { padding: 14px 32px; font-size: 1rem; }
.badge { font-size: var(--type-label); font-weight: 600; padding: 2px 8px; border-radius: 3px; white-space: nowrap; }
.badge-guide { background: #E1F5EE; color: #085041; }
.badge-glossary { background: #FAEEDA; color: #633806; }
.badge-research-card { background: #E8F4F8; color: #155E75; }
.badge-base-article { background: #E6F1FB; color: #0C447C; }
.badge-research-article { background: #EEEDFE; color: #3C3489; }
.badge-field-note { background: #FAECE7; color: #712B13; }
.badge-dated-platform-change { background: #F1F5F9; color: #475569; }
.badge-reference { background: #FAEEDA; color: #633806; }
.page-header { padding: var(--space-sm) 0; border-bottom: 1px solid var(--c-border); background: var(--c-bg-alt); }
.page-header h1 { font-size: var(--type-h1); }
.page-header .label { margin-bottom: var(--space-sm); }
.page-header p { color: var(--c-text-2); margin-top: var(--space-sm); }
.page-cta { text-align: center; padding: var(--space-lg) 0; border-top: 1px solid var(--c-border); margin-top: var(--space-lg); hyphens: none; }
.page-cta p { color: var(--c-text-2); margin-bottom: var(--space-md); }
.note { background: var(--c-bg-alt); padding: var(--space-sm) var(--space-md); border-radius: 0 8px 8px 0; margin: var(--space-sm) 0; font-size: var(--type-small); color: var(--c-text-2); border: 1px solid var(--c-border); border-left: 3px solid var(--c-cta); text-align: justify; hyphens: auto; -webkit-hyphens: auto; }

/* ===== 6. Header + nav + logo + lang switcher ===== */
.site-header { border-bottom: 1px solid var(--c-border); padding: 14px 0; }
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.header-logo { font-size: 1.1rem; font-weight: 700; color: var(--c-text); display: flex; align-items: center; gap: 6px; }
.header-logo:hover { text-decoration: none; }
.logo-icon { width: 24px; height: 24px; }
.header-nav { display: flex; gap: var(--space-lg); }
.header-nav a { font-size: var(--type-small); color: var(--c-text-2); text-align: left; display: flex; align-items: center; gap: 5px; }
.header-nav a:hover { color: var(--c-text); text-decoration: none; }
.header-nav a.active { color: var(--c-text); font-weight: 600; }
.nav-icon { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.5; }
.header-nav a:hover .nav-icon, .header-nav a.active .nav-icon { opacity: 0.8; }
.lang-switcher { position: relative; }
.lang-current { cursor: pointer; line-height: 1; padding: 6px; border-radius: 6px; border: 1px solid transparent; transition: border-color 0.15s; user-select: none; display: flex; align-items: center; }
.lang-current:hover { border-color: var(--c-border); }
.lang-dropdown { display: none; position: absolute; right: 0; top: 100%; margin-top: 4px; background: var(--c-bg); border: 1px solid var(--c-border); border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); min-width: 160px; padding: var(--space-xs) 0; z-index: 100; }
.lang-dropdown.open { display: block; }
.lang-option { display: flex; align-items: center; gap: var(--space-sm); padding: 8px var(--space-md); font-size: var(--type-small); color: var(--c-text-2); text-decoration: none; transition: background 0.1s; }
.lang-option:hover { background: var(--c-bg-alt); text-decoration: none; }
.lang-option.active { color: var(--c-text); font-weight: 600; }
.lang-flag { width: 22px; height: 16px; border-radius: 2px; flex-shrink: 0; overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,0.1); }
.lang-flag svg { display: block; width: 100%; height: 100%; }

/* ===== 7. Footer ===== */
.site-footer { border-top: 1px solid var(--c-border); padding: var(--space-xl) 0 var(--space-lg); }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-xl); }
.footer-title { font-size: var(--type-body); font-weight: 700; margin-bottom: var(--space-sm); }
.footer-text { font-size: var(--type-small); color: var(--c-text-2); line-height: 1.6; }
.footer-link { font-size: var(--type-small); font-weight: 600; display: inline-block; margin-top: var(--space-sm); }
.footer-legal { margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid var(--c-border); font-size: var(--type-small); color: var(--c-text-3); text-align: center; }
.footer-legal a { color: var(--c-text-3); }

/* ===== 8. Page: home ===== */
.hero { padding: var(--space-lg) 0 var(--space-md); }
.hero .label { margin-bottom: var(--space-sm); }
.hero-body { color: var(--c-text-2); margin-bottom: var(--space-lg); max-width: 60ch; }
.hero-actions { display: flex; gap: var(--space-md); align-items: center; margin-bottom: var(--space-sm); }
.hero-link { font-size: var(--type-small); font-weight: 600; }
.hero-preview { background: var(--c-bg-alt); border: none; border-left: 4px solid var(--c-accent); border-radius: 0 8px 8px 0; padding: var(--space-md); hyphens: none; }
.hero-preview .label { margin-bottom: var(--space-sm); }
.hero-preview-item { padding: var(--space-sm) 0; border-bottom: 1px solid var(--c-border); }
.hero-preview-item:last-child { border-bottom: none; padding-bottom: 0; }
.hero-preview-item h3 { margin-bottom: 2px; }
.proof { text-align: center; padding: var(--space-md) var(--space-md); hyphens: none; }
.proof-number { font-size: 2rem; font-weight: 700; color: var(--c-accent); line-height: 1; margin-bottom: var(--space-xs); font-variant-numeric: tabular-nums; }
.proof-label { font-size: var(--type-small); color: var(--c-text-2); text-align: center; }
.cta-block { text-align: center; padding: var(--space-md) 0; hyphens: none; }
.cta-price { font-size: var(--type-h1); font-weight: 700; margin-bottom: var(--space-md); }
.cta-note { font-size: var(--type-small); color: var(--c-text-3); margin-top: var(--space-md); }

/* ===== 9. Page: methodology ===== */
.content-grid { display: grid; grid-template-columns: 1fr 160px; gap: var(--space-lg); padding: var(--space-lg) 0; }
.content-main p { margin-bottom: var(--space-sm); color: var(--c-text-2); text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.content-main h2 { margin-top: var(--space-lg); }
.content-section { padding: var(--space-xs) 0; }
.content-section + .content-section { margin-top: var(--space-xs); }
/* Article meta bar */
.article-meta { background: var(--c-bg-alt); border-radius: 8px; padding: var(--space-sm) var(--space-md); margin-bottom: var(--space-md); font-size: var(--type-small); }
.article-meta-item { display: flex; gap: var(--space-sm); padding: 6px 0; }
.article-meta-item + .article-meta-item { border-top: 1px solid var(--c-border); }
.article-meta-item dt { min-width: 180px; flex-shrink: 0; font-weight: 600; color: var(--c-text); }
.article-meta-item dd { margin: 0; color: var(--c-text-2); }
/* Article lead quote */
.article-quote { border-left: 3px solid var(--c-cta); padding: var(--space-sm) var(--space-md); margin: var(--space-md) 0; color: var(--c-text-2); font-style: italic; font-size: var(--type-body); line-height: 1.6; background: linear-gradient(90deg, rgba(217,119,6,0.04), transparent 80%); border-radius: 0 6px 6px 0; }
/* Article changelog */
.article-changelog { font-size: var(--type-small); color: var(--c-text-3); margin-bottom: var(--space-sm); opacity: 0.7; }
.article-changelog[open] { opacity: 1; }
.section-icon { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; background: var(--c-accent); border-radius: 6px; margin-right: var(--space-sm); vertical-align: middle; position: relative; top: -2px; }
.section-icon svg { width: 16px; height: 16px; stroke: #fff; fill: none; stroke-width: 1.5; }
.section-icon--warm { background: var(--c-cta); }
.toc { position: sticky; top: var(--space-lg); align-self: start; border-left: 1px solid var(--c-border); padding-left: var(--space-md); }
.toc-title { font-size: var(--type-label); font-weight: 700; color: var(--c-text-3); margin-bottom: var(--space-sm); text-align: left; text-transform: uppercase; letter-spacing: 0.08em; }
.toc a { display: block; font-size: var(--type-small); color: var(--c-text-3); padding: 4px 0; text-align: left; border-left: 2px solid transparent; padding-left: var(--space-sm); transition: color 0.15s, border-color 0.15s; }
.toc a:hover { color: var(--c-text); text-decoration: none; }
.toc a.active { color: var(--c-cta); border-left-color: var(--c-cta); font-weight: 600; }
.steps { counter-reset: step; margin: var(--space-sm) 0 var(--space-lg); }
.step { display: flex; gap: var(--space-sm); margin-bottom: var(--space-sm); counter-increment: step; }
.step::before { content: counter(step); display: flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; background: var(--c-cta); color: #fff; border-radius: 6px; font-size: var(--type-small); font-weight: 700; flex-shrink: 0; margin-top: 2px; }
.step-content h3 { margin-bottom: 2px; }
.step-content p { color: var(--c-text-2); font-size: var(--type-small); text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.method-table { width: 100%; border-collapse: collapse; margin: var(--space-sm) 0 var(--space-md); font-size: var(--type-small); table-layout: fixed; }
.method-table th { text-align: left; font-weight: 600; padding: 8px 12px; border-bottom: 2px solid var(--c-accent); color: var(--c-text); background: var(--c-bg-alt); }
.method-table td { padding: 8px 12px; border-bottom: 1px solid var(--c-border); color: var(--c-text-2); }
.method-table tr:hover td { background: var(--c-bg-alt); }
.method-table td:last-child { font-weight: 600; color: var(--c-cta); }
.method-table tr:last-child td { border-bottom: none; }
.method-table th:first-child, .method-table td:first-child { width: 180px; }
.method-table th:last-child, .method-table td:last-child { width: 70px; text-align: right; }
.method-table.two-col th:last-child, .method-table.two-col td:last-child { width: auto; text-align: left; font-weight: 400; color: var(--c-text-2); }
.formula-block { background: var(--c-bg-alt); border-left: 4px solid var(--c-accent); padding: var(--space-lg); margin: var(--space-sm) 0 var(--space-md); border-radius: 0 8px 8px 0; hyphens: none; text-align: center; }
.formula-math { font-family: 'Georgia', 'Times New Roman', serif; font-size: 1.35rem; color: var(--c-text); margin-bottom: var(--space-sm); display: flex; align-items: center; justify-content: center; gap: 6px; }
.formula-math .frac { display: inline-flex; flex-direction: column; align-items: center; font-size: 0.95rem; vertical-align: middle; }
.formula-math .frac-line { width: 100%; height: 1px; background: var(--c-text); margin: 2px 0; }
.formula-math .fn { font-style: italic; }
.formula-math .var { font-style: italic; color: var(--c-accent); }
.formula-math .var-result { font-style: italic; color: var(--c-cta); font-weight: 600; }
.formula-legend { display: flex; gap: var(--space-lg); justify-content: center; margin-top: var(--space-sm); flex-wrap: wrap; }
.formula-legend span { font-size: var(--type-small); color: var(--c-text-3); }
.formula-legend .var { font-family: 'Georgia', serif; font-style: italic; color: var(--c-accent); font-weight: 600; }
.formula-legend .var-result { font-family: 'Georgia', serif; font-style: italic; color: var(--c-cta); font-weight: 600; }
.formula-chart { margin: var(--space-md) 0 var(--space-sm); }
.formula-chart svg { display: block; margin: 0 auto; }

/* ===== 10. Page: sample-report ===== */
.report { background: var(--c-bg); border: 1px solid var(--c-border); border-radius: 8px; margin: var(--space-lg) 0; overflow: hidden; }
.report-header { background: var(--c-accent); color: #fff; padding: var(--space-md) var(--space-lg); display: flex; justify-content: space-between; align-items: center; }
.report-brand { font-size: var(--type-h2); font-weight: 700; }
.report-meta { font-size: var(--type-small); opacity: 0.7; margin-top: 2px; }
.report-date { font-size: var(--type-small); opacity: 0.6; text-align: right; }
.report-score { display: flex; align-items: stretch; border-bottom: 1px solid var(--c-border); }
.score-main { padding: var(--space-md) var(--space-lg); text-align: center; border-right: 1px solid var(--c-border); min-width: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--c-bg-alt); }
.score-number { font-size: 2.5rem; font-weight: 700; color: var(--c-cta); line-height: 1; }
.score-label { font-size: var(--type-small); color: var(--c-text-3); margin-top: 2px; }
.score-range { font-size: var(--type-small); color: var(--c-text-2); margin-top: var(--space-xs); padding: 2px 8px; background: var(--c-bg); border-radius: 4px; display: inline-block; }
.score-metrics { padding: var(--space-md) var(--space-lg); flex: 1; display: flex; justify-content: space-around; align-items: center; }
.score-metric { text-align: center; padding: 0 var(--space-md); border-right: 1px solid var(--c-border); }
.score-metric:last-child { border-right: none; }
.score-metric-value { font-size: var(--type-h1); font-weight: 700; color: var(--c-text); line-height: 1; }
.score-metric-value span { font-size: var(--type-small); font-weight: 400; color: var(--c-text-3); }
.score-metric-label { font-size: var(--type-label); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--c-text-3); margin-top: 4px; }
.score-metric-hint { font-size: 10px; color: var(--c-text-3); margin-top: 1px; font-weight: 400; }
.score-range-label { font-size: 10px; color: var(--c-text-3); margin-top: 2px; }
.report-section { padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--c-border); }
.report-section:last-child { border-bottom: none; }
.report-section h2 { margin-bottom: var(--space-sm); display: flex; align-items: center; gap: var(--space-sm); }
.leader-row { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: 5px; font-size: var(--type-small); }
.leader-rank { min-width: 18px; font-weight: 700; color: var(--c-text-3); text-align: right; }
.leader-name { min-width: 130px; max-width: 130px; font-weight: 600; color: var(--c-text); }
.leader-name.is-brand { color: var(--c-cta); }
.leader-bar-bg { flex: 1; height: 12px; background: #edf0f4; border-radius: 6px; overflow: hidden; position: relative; }
.leader-bar { height: 100%; border-radius: 6px; display: block; }
.leader-bar--brand { background: var(--c-cta); }
.leader-bar--other { background: #a3b4c8; }
.leader-score { min-width: 40px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.scenario-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-sm); }
.scenario-card { background: var(--c-bg-alt); border-radius: 6px; padding: var(--space-sm) var(--space-md); text-align: center; }
.scenario-card-name { font-size: var(--type-small); color: var(--c-text-2); margin-bottom: 2px; }
.scenario-card-score { font-size: var(--type-h2); font-weight: 700; }
.scenario-card-score.high { color: var(--c-green); }
.scenario-card-score.mid { color: var(--c-cta); }
.scenario-card-score.low { color: var(--c-red); }
.scenario-bar { height: 4px; background: var(--c-border); border-radius: 2px; margin-top: 4px; overflow: hidden; }
.scenario-bar span { display: block; height: 100%; border-radius: 2px; }
.scenario-bar .high { background: var(--c-green); }
.scenario-bar .mid { background: var(--c-cta); }
.scenario-bar .low { background: var(--c-red); }
.growth-item { display: flex; gap: var(--space-sm); padding: var(--space-sm) 0; border-bottom: 1px solid var(--c-border); }
.growth-item:last-child { border-bottom: none; }
.growth-num { min-width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: var(--c-cta); color: #fff; border-radius: 6px; font-size: var(--type-small); font-weight: 700; flex-shrink: 0; }
.growth-content h3 { margin-bottom: 2px; }
.growth-content p { font-size: var(--type-small); color: var(--c-text-2); }
.growth-tag { display: inline-block; font-size: var(--type-label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 8px; border-radius: 4px; margin-top: var(--space-xs); }
.growth-tag--impact { background: #fef3c7; color: #92400e; }
.growth-tag--effort { background: #dbeafe; color: #1e40af; }

/* ===== 11. Page: knowledge-base ===== */
.page-stats { font-size: var(--type-small); color: var(--c-text-3); margin-top: var(--space-xs); }
.mode-grid { display: flex; gap: 0; border-bottom: 2px solid var(--c-border); margin-bottom: var(--space-md); }
.mode-card { padding: var(--space-sm) var(--space-md); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: border-color 0.15s, color 0.15s; display: flex; align-items: center; gap: var(--space-sm); }
.mode-card:hover { border-bottom-color: var(--c-text-3); }
.mode-card.active { border-bottom-color: var(--c-cta); }
.mode-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.4; }
.mode-card.active .mode-icon { opacity: 1; stroke: var(--c-cta); }
.mode-title { font-size: var(--type-small); font-weight: 600; white-space: nowrap; }
.mode-card.active .mode-title { color: var(--c-cta); }
.mode-desc { display: none; }
.mode-content { display: none; padding-bottom: var(--space-xl); }
.mode-content.active { display: block; }
.mode-section-label { font-size: var(--type-small); color: var(--c-text-3); margin-bottom: var(--space-sm); }
.kb-search { margin-bottom: var(--space-md); }
.kb-search input { width: 100%; padding: 8px 12px; border: 1px solid var(--c-border); border-radius: 6px; font-size: var(--type-body); font-family: var(--font); }
.kb-search input:focus { outline: 2px solid var(--c-accent); outline-offset: 2px; border-color: var(--c-accent); }
.kb-table { width: 100%; border-collapse: collapse; }
.kb-table th { text-align: left; padding: 8px; font-weight: 600; font-size: var(--type-label); text-transform: uppercase; letter-spacing: 0.05em; color: var(--c-text-3); border-bottom: 2px solid var(--c-accent); cursor: pointer; user-select: none; white-space: nowrap; }
.kb-table th:hover { color: var(--c-text); }
.kb-table th:last-child { text-align: right; }
.sort-icon { display: inline-block; width: 12px; height: 12px; vertical-align: middle; margin-left: 3px; opacity: 0.3; }
.kb-table th:hover .sort-icon { opacity: 0.6; }
.kb-table th.sorted .sort-icon { opacity: 1; color: var(--c-cta); }
.kb-table th.sorted { color: var(--c-accent); }
.kb-table td { padding: 10px 8px; border-bottom: 1px solid var(--c-border); vertical-align: top; }
.kb-table td:last-child { text-align: right; }
.kb-table tr:hover td { background: var(--c-bg-alt); }
.kb-table tbody { counter-reset: kb-row; }
.kb-table tbody tr { counter-increment: kb-row; }
.kb-num { display: inline-block; min-width: 22px; color: var(--c-text-3); font-size: var(--type-small); font-variant-numeric: tabular-nums; }
.kb-num::before { content: counter(kb-row); }
.kb-title { font-weight: 600; }
.kb-summary { font-size: var(--type-small); color: var(--c-text-3); display: block; }
.kb-level { font-size: var(--type-small); color: var(--c-text-2); white-space: nowrap; }
tr[data-level="intro"] .kb-level::before { content: "● "; color: #38a169; }
tr[data-level="middle"] .kb-level::before { content: "●● "; color: #d97706; }
tr[data-level="advanced"] .kb-level::before { content: "●●● "; color: #e53e3e; }
.article-difficulty[data-level="intro"]::before { content: "● "; color: #38a169; }
.article-difficulty[data-level="middle"]::before { content: "●● "; color: #d97706; }
.article-difficulty[data-level="advanced"]::before { content: "●●● "; color: #e53e3e; }
.kb-min { font-size: var(--type-small); color: var(--c-text-3); font-variant-numeric: tabular-nums; }
.task-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-sm); }
.task-card { padding: 5px 12px; border: 1px solid var(--c-border); border-radius: 20px; cursor: pointer; transition: all 0.15s; }
.task-card:hover { border-color: var(--c-accent); background: var(--c-bg-alt); }
.task-card.active { border-color: var(--c-cta); background: #fffbf5; color: var(--c-cta); }
.task-card h3 { font-size: var(--type-small); font-weight: 500; margin-bottom: 0; }
.task-card p { display: none; }
.filter-row { display: flex; gap: var(--space-sm); align-items: center; margin-bottom: var(--space-md); }
.filter-row select { flex: 1; }
.filter-row .btn { white-space: nowrap; }
.task-results { margin-top: var(--space-md); }
.route-list { display: flex; flex-direction: column; gap: 6px; }
.route-card { display: block; padding: var(--space-sm) var(--space-md); border: 1px solid var(--c-border); border-radius: 8px; cursor: pointer; transition: border-color 0.15s; }
.route-card:hover { border-color: var(--c-accent); text-decoration: none; }
.route-card.open { border-color: var(--c-cta); }
.route-card.open .route-num { background: var(--c-cta); }
.route-header { display: flex; align-items: center; gap: var(--space-sm); }
.route-expand { display: none; margin-top: var(--space-xs); padding-left: 36px; }
.route-card.open .route-expand { display: block; }
.route-table td { padding: 6px 8px; }
.route-table td:first-child .route-step-n { font-weight: 700; color: var(--c-cta); font-size: var(--type-small); margin-right: 2px; display: inline; }
.route-table td:first-child .kb-title { display: inline; }
.route-start { display: inline-block; margin-top: 2px; font-size: var(--type-small); font-weight: 600; color: var(--c-cta); }
.route-start:hover { text-decoration: underline; }
.route-num { min-width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; background: var(--c-accent); color: #fff; border-radius: 5px; font-size: var(--type-label); font-weight: 700; flex-shrink: 0; }
.route-info { flex: 1; }
.route-info h3 { margin-bottom: 0; }
.route-info p { font-size: var(--type-small); color: var(--c-text-3); margin: 0; }
.route-meta { font-size: var(--type-small); color: var(--c-text-3); white-space: nowrap; text-align: right; }
.route-meta strong { color: var(--c-text); }
.route-step { display: flex; gap: var(--space-sm); padding: 3px 0; align-items: baseline; }
.route-step:last-child { border-bottom: none; padding-bottom: 0; }
.route-step-n { min-width: 20px; font-size: var(--type-small); font-weight: 700; color: var(--c-cta); }
.route-step a { font-size: var(--type-small); font-weight: 600; }
.route-step span { font-size: var(--type-small); color: var(--c-text-3); margin-left: var(--space-xs); }
.ref-section { margin-bottom: var(--space-lg); }
.ref-section h2 { margin-bottom: var(--space-sm); display: flex; align-items: center; gap: var(--space-sm); }
.ref-icon { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; background: var(--c-accent); border-radius: 5px; flex-shrink: 0; }
.ref-icon svg { width: 14px; height: 14px; }
.term-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-sm); }
.term-item { padding: var(--space-sm) var(--space-md); border-left: 3px solid var(--c-border); }
.term-item strong { font-size: var(--type-small); display: block; }
.term-item p { font-size: var(--type-small); color: var(--c-text-3); margin: 0; }
.scheme-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-sm); }
.scheme-card { background: var(--c-bg-alt); border-radius: 8px; padding: var(--space-md); text-align: center; }
.scheme-thumb { width: 100%; height: 60px; background: var(--c-border); border-radius: 4px; margin-bottom: var(--space-sm); }
.scheme-card p { font-size: var(--type-small); margin: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-sm); }
.metric-card { background: var(--c-bg-alt); border-radius: 8px; padding: var(--space-sm) var(--space-md); }
.metric-card strong { font-size: var(--type-small); display: block; color: var(--c-accent); }
.metric-card p { font-size: var(--type-small); color: var(--c-text-3); margin: 2px 0 0; }

/* Article route nav */
.route-nav-bar { background: var(--c-bg-alt); border: 1px solid var(--c-border); border-radius: 6px; padding: var(--space-sm) var(--space-md); margin-bottom: var(--space-md); }
.route-nav-header { display: flex; align-items: center; gap: var(--space-sm); }
.route-nav-center { flex: 1; font-size: var(--type-small); }
.route-nav-center strong { font-weight: 600; }
.route-nav-step { color: var(--c-text-3); margin-left: var(--space-sm); }
.route-nav-icon { margin-right: 4px; }
.route-arrow { font-size: var(--type-body); color: var(--c-accent); text-decoration: none; padding: 4px 8px; }
.route-arrow:hover { color: var(--c-cta); }
.route-arrow-disabled { color: var(--c-border); }
.route-nav-progress { height: 3px; background: var(--c-border); border-radius: 2px; margin-top: var(--space-xs); overflow: hidden; }
.route-nav-progress-fill { height: 100%; background: var(--c-cta); border-radius: 2px; }
.route-nav-bottom { display: flex; justify-content: space-between; align-items: center; padding: var(--space-md) 0; border-top: 1px solid var(--c-border); margin-top: var(--space-lg); font-size: var(--type-small); gap: var(--space-md); }
.route-nav-bottom a { max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-nav-counter { color: var(--c-text-3); font-weight: 600; flex-shrink: 0; }

/* Reference section */
.ref-section-title { margin-bottom: var(--space-sm); }
.ref-terms { margin: 0; }
.ref-term { padding: var(--space-sm) 0; border-bottom: 1px solid var(--c-border); }
.ref-term:last-child { border-bottom: none; }
.ref-term dt { font-weight: 600; font-size: var(--type-body); margin-bottom: 2px; }
.ref-term dd { font-size: var(--type-small); color: var(--c-text-2); margin: 0; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.ref-practical { color: var(--c-text-3); font-style: italic; }
#mode-ref .method-table { table-layout: auto; }
#mode-ref .method-table th:first-child, #mode-ref .method-table td:first-child { width: 160px; }
#mode-ref .method-table th:nth-child(2), #mode-ref .method-table td:nth-child(2) { width: 50px; text-align: right; font-weight: 600; color: var(--c-cta); }
#mode-ref .method-table th:last-child { width: auto; text-align: left; font-weight: 400; color: var(--c-text-2); }
#mode-ref .method-table td:last-child { width: auto; text-align: justify; hyphens: auto; -webkit-hyphens: auto; font-weight: 400; color: var(--c-text-2); }

/* Article images */
.kb-richtext { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.kb-richtext img, .article-content img { max-width: 100%; height: auto; border: 1px solid var(--c-border); border-radius: 6px; margin: var(--space-sm) 0; }
.kb-richtext table { width: 100%; border-collapse: collapse; margin: var(--space-md) 0; font-size: var(--type-small); }
.kb-richtext th { text-align: left; font-weight: 600; padding: 8px 12px; border-bottom: 2px solid var(--c-accent); color: var(--c-text); background: var(--c-bg-alt); white-space: nowrap; }
.kb-richtext td { padding: 8px 12px; border-bottom: 1px solid var(--c-border); color: var(--c-text-2); }
.kb-richtext tr:hover td { background: var(--c-bg-alt); }
.kb-richtext td:first-child { font-weight: 600; color: var(--c-text); }
.source-ref { color: var(--c-accent); text-decoration: none; font-size: 0.85em; cursor: pointer; }
.source-ref:hover { text-decoration: underline; }
.source-entry { transition: background 0.3s; padding: 2px 4px; border-radius: 4px; }
.source-num { font-weight: 600; color: var(--c-text); margin-right: 4px; }
.sources-section a { color: var(--c-accent); word-break: break-all; }

/* ===== 12. Page: faq ===== */
.faq-list { max-width: 760px; margin: 0 auto; padding: var(--space-lg) 0; }
.faq-item { border-bottom: 1px solid var(--c-border); }
.faq-q { display: flex; align-items: center; justify-content: space-between; padding: var(--space-md) 0; cursor: pointer; gap: var(--space-md); font-weight: 600; font-size: var(--type-body); color: var(--c-text); }
.faq-q:hover { color: var(--c-accent); }
.faq-arrow { width: 20px; height: 20px; flex-shrink: 0; transition: transform 0.2s; stroke: var(--c-text-3); }
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-a { display: none; padding: 0 0 var(--space-md); color: var(--c-text-2); text-align: justify; hyphens: auto; }
.faq-item.open .faq-a { display: block; }

/* ===== 13. Page: access ===== */
.access-content { max-width: 700px; margin: 0 auto; padding: var(--space-xl) 0; }
.price-block { text-align: center; padding: var(--space-lg); background: var(--c-bg-alt); border-radius: 8px; border: 1px solid var(--c-border); margin-bottom: var(--space-lg); }
.price-amount { font-size: 2.5rem; font-weight: 700; color: var(--c-text); line-height: 1; }
.price-period { font-size: var(--type-small); color: var(--c-text-3); margin-top: var(--space-xs); }
.features { margin: var(--space-lg) 0; }
.feature { display: flex; align-items: flex-start; gap: var(--space-sm); padding: var(--space-sm) 0; }
.feature-check { width: 20px; height: 20px; flex-shrink: 0; color: var(--c-cta); margin-top: 2px; }
.feature-text { color: var(--c-text-2); }
.key-form { margin-top: var(--space-lg); padding-top: var(--space-lg); border-top: 1px solid var(--c-border); }
.key-form h2 { margin-bottom: var(--space-sm); }
.key-form p { color: var(--c-text-2); font-size: var(--type-small); margin-bottom: var(--space-md); }
.input-row { display: flex; gap: var(--space-sm); }
.key-input { flex: 1; padding: 10px 14px; border: 1px solid var(--c-border); border-radius: 6px; font-size: var(--type-body); font-family: var(--font); }
.key-input:focus { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.key-input:focus { border-color: var(--c-accent); }
.key-status-card { display: grid; grid-template-columns: auto 1fr; gap: 4px var(--space-md); font-size: var(--type-small); }
.key-status-row { display: contents; }
.key-status-row span { color: var(--c-text-3); }
.key-status-row strong { color: var(--c-text); font-weight: 600; }

/* Run list */
.run-row-wrap { display: flex; align-items: center; border-bottom: 1px solid var(--c-border); }
.run-row-wrap:last-child { border-bottom: none; }
.run-row { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-sm) 0; font-size: var(--type-small); text-decoration: none; color: var(--c-text); flex: 1; min-width: 0; }
.run-row:hover { background: var(--c-bg-alt); text-decoration: none; }
.run-brand { font-weight: 600; min-width: 120px; }
.run-meta { flex: 1; color: var(--c-text-3); }
.run-vl { font-weight: 700; letter-spacing: 0.05em; color: var(--c-accent); }
.run-date { color: var(--c-text-3); white-space: nowrap; }
.run-delete-btn { background: none; border: none; cursor: pointer; padding: 6px; color: var(--c-text-3); opacity: 0; transition: opacity 0.15s, color 0.15s; flex-shrink: 0; }
.run-row-wrap:hover .run-delete-btn { opacity: 1; }
.run-delete-btn:hover { color: #e53e3e; }
.run-sort { cursor: pointer; }
.run-sort:hover { color: var(--c-accent); }
.run-sort.active { color: var(--c-text); }
.run-search:focus { border-color: var(--c-accent); }

/* Admin */
.admin-field { margin-bottom: var(--space-sm); }
.admin-field label { display: block; font-size: var(--type-small); font-weight: 600; color: var(--c-text-3); margin-bottom: 4px; }
.admin-field input, .admin-field textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--c-border); border-radius: 6px; font-size: var(--type-body); font-family: var(--font); }
.admin-field input:focus, .admin-field textarea:focus { border-color: var(--c-accent); outline: 2px solid var(--c-accent); outline-offset: 2px; }

/* ===== 14. Global fixes ===== */
html { overflow-x: hidden; }
.content-main img { max-width: 100%; height: auto; }

/* ===== 15. Burger + mobile nav ===== */
.burger-toggle { display: none; background: none; border: none; cursor: pointer; width: 32px; height: 32px; padding: 4px; }
.burger-toggle svg { width: 100%; height: 100%; stroke: var(--c-text); }
.site-nav { display: none; }
.site-nav-overlay { display: none; }

/* ===== 16. Mobile (@media <768px) ===== */
@media (max-width: 768px) {
  :root { --type-hero: 1.75rem; --type-h1: 1.25rem; --type-h2: 1rem; }
  .grid-hero, .grid-2, .grid-3, .footer-grid { grid-template-columns: 1fr; }
  .header-nav { display: none; }
  .burger-toggle { display: block; }
  .hero { padding: 10px 0 0; margin-bottom: 20px; }
  .hero-body { margin-bottom: 8px; }
  .hero-actions { margin-bottom: 0; }
  .hero-link { margin-bottom: 0; }
  .grid-hero { gap: 4px; }
  .hero-preview { padding: 10px 12px; margin-top: 0; margin-bottom: 0; }
  .hero-preview .label { margin-bottom: 2px; font-size: 11px; }
  .hero-preview-item { padding: 4px 0; }
  .section, .section--alt { padding: 20px 0; }
  .cta-block { padding: 20px 0; }
  .proof { text-align: center; padding: 4px 0; border-bottom: 1px solid var(--c-border); }
  .proof:last-child { border-bottom: none; }
  .content-grid { display: flex; flex-direction: column; padding: 0; gap: 8px; }
  .toc { position: static; border-left: none; border-bottom: none; padding: 10px 0 0; margin-bottom: 0; order: -1; }
  .content-section:first-child { padding-top: 0; }
  .content-section:first-child h2:first-child { margin-top: 0; }
  .report-score { flex-direction: column; }
  .score-main { border-right: none; border-bottom: 1px solid var(--c-border); }
  .scenario-grid { grid-template-columns: repeat(2, 1fr); }
  .report-header { flex-direction: column; gap: var(--space-sm); }
  .mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .mode-grid > * { min-width: 0; }
  .task-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-row { flex-wrap: wrap; }
  .term-list { grid-template-columns: 1fr; }
  .scheme-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .input-row { flex-direction: column; }
  /* B1: Mobile nav */
  .site-nav { display: block; position: fixed; top: 0; right: -220px; width: 220px; height: 100vh; background: var(--c-bg); z-index: 1000; transition: right 0.3s; box-shadow: -4px 0 20px rgba(0,0,0,0.1); padding: 20px; overflow-y: auto; }
  .site-nav.open { right: 0; }
  .site-nav-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
  .site-nav-close { background: none; border: none; font-size: 28px; cursor: pointer; color: var(--c-text-3); min-height: 44px; }
  .site-nav-links a { display: flex; align-items: center; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--c-border); font-size: 16px; color: var(--c-text); text-decoration: none; min-height: 44px; }
  .site-nav-links a svg { width: 15px; height: 15px; flex-shrink: 0; }
  .site-nav-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.3); z-index: 999; }
  .site-nav-overlay.open { display: block; }
  body.menu-open { overflow: hidden; }
  /* C4: KB summaries hide */
  .kb-summary { display: none; }
  /* B3: Tables scroll */
  .kb-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* Method-table: card layout on mobile */
  .method-table { display: block; }
  .method-table thead { display: none; }
  .method-table tbody { display: block; }
  .method-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--c-border); }
  .method-table td { display: block; padding: 2px 0; border: none; text-align: left; width: auto; max-width: none; }
  .method-table td:first-child { font-weight: 700; color: var(--c-text); font-size: var(--type-body); display: inline; width: auto; max-width: none; }
  .method-table td:first-child::after { content: '\00a0\00a0'; }
  /* Glossary (KB): columns = Metric / Weight / Description */
  #mode-ref .method-table td:nth-child(2) { font-size: var(--type-small); color: var(--c-cta); display: inline; font-weight: 600; width: auto; }
  #mode-ref .method-table td:last-child { font-size: var(--type-small); color: var(--c-text-2); font-weight: 400; text-align: left; width: auto; }
  /* Methodology: columns = Metric / Description / Weight — reorder on mobile */
  .content-main .method-table tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
  .content-main .method-table td:first-child { order: 1; display: block; }
  .content-main .method-table td:first-child::after { content: none; }
  .content-main .method-table td:nth-child(2) { order: 3; width: 100%; font-size: var(--type-small); color: var(--c-text-2); font-weight: 400; }
  .content-main .method-table td:last-child { order: 2; font-size: var(--type-small); color: var(--c-cta); font-weight: 600; width: auto; }
  /* two-col tables (no weight column) */
  .method-table.two-col td:first-child { display: block; }
  .method-table.two-col td:first-child::after { content: none; }
  .method-table.two-col td:nth-child(2) { display: block; color: var(--c-text-2); font-weight: 400; }
  .kb-table td:nth-child(2), .kb-table td:nth-child(3),
  .kb-table th:nth-child(2), .kb-table th:nth-child(3) { display: none; }
  /* B4: Text-align left */
  body { text-align: left; }
  .content-main p, .hero-body, .faq-a { text-align: left; hyphens: auto; }
  /* B7: Touch targets */
  .site-footer { padding: 12px 0 8px; }
  .footer-grid { gap: 8px; }
  .footer-title { margin-bottom: 2px; font-size: 14px; }
  .footer-legal { margin-top: 8px; padding-top: 8px; font-size: 11px; line-height: 1.3; }
  .footer-text { margin-bottom: 2px; font-size: 12px; line-height: 1.4; }
  .footer-legal a { min-height: 32px; display: inline-flex; align-items: center; padding: 4px; }
  .hero-link { min-height: 44px; display: inline-flex; align-items: center; }
  /* B8: Formula scroll */
  .formula-block { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .formula-block svg { min-width: 300px; }
  /* Article meta: stack on mobile */
  .article-meta-item { flex-direction: column; gap: 2px; }
  .article-meta-item dt { min-width: auto; }
  /* Run list */
  .run-row { flex-direction: column; gap: 4px; padding: 12px 0; }
  .run-delete-btn { opacity: 0.5; }
  .run-meta { display: none; }
  /* Mobile spacing tighten */
  .content-section { padding: 6px 0; }
  .content-section + .content-section { margin-top: var(--space-md); }
  .content-main h2 { margin-top: var(--space-lg); }
  .content-section:first-child h2:first-child { margin-top: 0; }
  h2 { margin-bottom: 6px; }
  .page-header { padding: 10px 0; }
  /* Glossary: handled by method-table card layout above */
  /* B9: Bar chart + competitor grid stack */
  .bar-row { grid-template-columns: 1fr; gap: 4px; }
  .bar-score { text-align: left; }
  .competitor-grid { grid-template-columns: 1fr; }
}

/* Admin link safety hide */
a[href="/admin"] { display: none; }
/* ===== Skip link ===== */
.skip-link { position: absolute; top: -40px; left: 0; padding: 8px 16px; background: var(--c-accent); color: #fff; z-index: 1000; text-decoration: none; font-size: var(--type-small); }
.skip-link:focus { top: 0; }
