:root {
  --primary-dark: #0e4469;
  --primary-mid: #1a6496;
  --primary-darker: #093356;
  --bg: #f7f9fc;
}

/* ── Sticky header + footer layout ─────────────────────────────── */
/* body must NOT have a fixed height: sticky children can only stick
   within their parent's box, so a 100%-tall body un-sticks them
   after one screen of scrolling. min-height keeps short pages full. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: var(--bg);
}

/* main content area grows to push the footer down when short */
.page-main {
  flex: 1 0 auto;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem 1rem;
  color: #5a6a7e;
}

/* ── AppBar ─────────────────────────────────────────────────────── */
.app-header {
  flex-shrink: 0;
  background: linear-gradient(
    135deg,
    var(--primary-dark) 0%,
    var(--primary-mid) 60%,
    var(--primary-dark) 100%
  );
  box-shadow: 0 2px 12px rgba(14, 68, 105, 0.25);
  min-height: 64px;
  border-radius: 12px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.app-header .inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem;
  min-height: 64px;
}

/* ── Logo / Brand ───────────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.brand:hover {
  opacity: 0.9;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
}

.brand-logo img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
  display: block;
}

.brand-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}

.spacer {
  flex-grow: 1;
}

/* ── Nav items ──────────────────────────────────────────────────── */
.nav-items {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  /* margin-right: 0.5rem; */
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.85rem;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  background: transparent;
  border: 1px solid transparent;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.nav-item:active {
  transform: translateY(0);
}

.nav-item i {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.2s ease;
}

.nav-item span.label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.25);
}

.nav-item.active i,
.nav-item.active span.label {
  color: #fff;
}

.nav-item.active::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  opacity: 0.9;
}

.nav-item .new-badge {
  height: 16px;
  font-size: 0.5rem;
  font-weight: 800;
  background: #ef4444;
  color: #fff;
  border-radius: 4px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

/* ── Notification bell ─────────────────────────────────────────── */
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all 0.2s ease;
  position: relative;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.1);
}
.icon-btn:active {
  transform: scale(0.95);
}

.icon-btn i {
  font-size: 1.05rem;
}

.icon-btn .badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 8px;
  background: #f44336;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--primary-dark);
}

/* ── Mobile bottom nav (shown < 992px) ─────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: linear-gradient(
    135deg,
    var(--primary-dark) 0%,
    var(--primary-mid) 100%
  );
  display: none;
  align-items: center;
  justify-content: space-around;
  z-index: 1030;
}

.bottom-nav .bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 500;
}
.bottom-nav .bn-item.active {
  color: #fff;
}
.bottom-nav .bn-item i {
  font-size: 1.2rem;
}

/* ── Mobile menu toggle + slide-in panel ───────────────────────── */
.menu-toggle {
  display: none;
  cursor: pointer;
}
.menu-toggle i {
  font-size: 1.4rem;
}

.mobile-menu {
  --bs-offcanvas-width: 280px;
  background: linear-gradient(
    160deg,
    var(--primary-dark) 0%,
    var(--primary-mid) 100%
  );
  color: #fff;
}
.mobile-menu .offcanvas-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.mobile-menu .offcanvas-title {
  margin: 0;
}
.mm-items {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.mm-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease;
}
.mm-item i {
  font-size: 1.1rem;
}
.mm-item:hover,
.mm-item:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.mm-item.active {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

@media (max-width: 900px) {
  .nav-items {
    display: none;
  }
  .menu-toggle {
    display: flex;
  }
  .app-footer {
    display: none;
  }
  .bottom-nav {
    display: flex;
  }
  /* leave room so the fixed bottom nav never covers the page content */
  body {
    padding-bottom: 64px;
  }
}

/* ── Footer ───────────────────────────────────────────── */
.app-footer {
  flex-shrink: 0;
  width: 100%;
  padding: 1rem 0;
  text-align: center;
  box-shadow: 0 -2px 12px rgba(14, 68, 105, 0.08);
}

.app-footer .footer-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
}

.app-footer .footer-copy {
  font-size: 0.74rem;
  margin-bottom: 0;
}

/* ── Light mode (default) ──────────────────────────────────────── */
.app-footer {
  background: linear-gradient(135deg, #eef2f8 0%, #f8faff 50%, #e9eef6 100%);
  border-top: 1px solid rgba(14, 68, 105, 0.1);
}
.app-footer .footer-title,
.app-footer .footer-copy {
  color: #5a6a7e; /* text.secondary */
}

/* ── Dark mode ──────────────────────────────────────────────────── */
body.dark {
  background: #0d1117;
}
body.dark .page-main {
  color: rgba(255, 255, 255, 0.7);
}
body.dark .app-footer {
  background: linear-gradient(135deg, #161b22 0%, #1c232d 50%, #161b22 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
body.dark .app-footer .footer-title {
  color: rgba(255, 255, 255, 0.5);
}
body.dark .app-footer .footer-copy {
  color: rgba(255, 255, 255, 0.35);
}

/* ══════════════════════════════════════════════════════════════════
   Article page
   ══════════════════════════════════════════════════════════════════ */

:root {
  --text-strong: #1a2332;
  --text-body: #334155;
  --text-muted: #5a6a7e;
  --surface: #ffffff;
  --border: rgba(14, 68, 105, 0.12);
  --accent: #f59e0b;
  --header-offset: 80px;
  --footer-height: 70px;
}

/* ── Skip link ─────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 1100;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: var(--primary-darker);
  color: #fff;
  text-decoration: none;
}
.skip-link:focus {
  top: 0.5rem;
}

/* ── Reading progress ──────────────────────────────────────────── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1031;
  pointer-events: none;
}
.reading-progress-bar {
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}

/* ── Article typography ────────────────────────────────────────── */
.article {
  color: var(--text-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  min-width: 0;
}

.article h1,
.article h2,
.article h3 {
  color: var(--text-strong);
  letter-spacing: -0.015em;
}

.article h2 {
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.85rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 1rem;
}

.article h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.article p,
.article ul,
.article ol {
  margin-bottom: 1.15rem;
}

.article li {
  margin-bottom: 0.4rem;
}

.article a:not(.btn):not(.resource-link) {
  color: var(--primary-mid);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(26, 100, 150, 0.35);
  text-underline-offset: 3px;
}
.article a:not(.btn):not(.resource-link):hover {
  color: var(--primary-darker);
  text-decoration-color: currentColor;
}

.article-section {
  padding-top: 2.5rem;
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.article-section,
.article h3 {
  scroll-margin-top: var(--header-offset);
}

/* sections receive programmatic focus after TOC jumps; no visible ring needed */
.article-section:focus {
  outline: none;
}

/* ── Hero ──────────────────────────────────────────────────────── */
.article-hero {
  margin-bottom: 2rem;
}

.article-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(14, 68, 105, 0.08);
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.article-hero h1 {
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.article-meta i {
  margin-right: 0.25rem;
}

.article-hero .lead {
  font-size: 1.2rem;
  line-height: 1.65;
  color: var(--text-strong);
  padding-left: 1rem;
  border-left: 4px solid var(--accent);
}

/* ── Tables ────────────────────────────────────────────────────── */
.article-table {
  --bs-table-bg: var(--surface);
  font-size: 0.95rem;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.article-table caption {
  caption-side: top;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.article-table thead th {
  background: var(--primary-dark);
  color: #fff;
  font-weight: 600;
  border-color: var(--primary-dark);
}
.article-table tbody th {
  color: var(--text-strong);
  white-space: nowrap;
}

/* ── Table of contents ─────────────────────────────────────────── */
.toc-list {
  list-style: none;
  counter-reset: toc;
  padding-left: 0;
  margin: 0;
}
.toc-list li {
  counter-increment: toc;
  margin: 0;
}
.toc-list a {
  display: flex;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.4;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}
.toc-list a::before {
  content: counter(toc, decimal-leading-zero);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  opacity: 0.6;
}
.toc-list a:hover {
  background: rgba(14, 68, 105, 0.06);
  color: var(--primary-dark);
}
.toc-list a.is-active {
  background: rgba(14, 68, 105, 0.08);
  color: var(--primary-dark);
  font-weight: 600;
  border-left-color: var(--primary-mid);
}

.toc-sidebar {
  position: sticky;
  top: var(--header-offset);
  /* stay clear of the sticky footer on desktop */
  max-height: calc(100vh - var(--header-offset) - var(--footer-height) - 1rem);
  overflow-y: auto;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.toc-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-left: 0.6rem;
}

.toc-mobile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
}
.toc-mobile summary {
  font-weight: 600;
  color: var(--text-strong);
  cursor: pointer;
}
.toc-mobile[open] summary {
  margin-bottom: 0.5rem;
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn-cta,
.btn-cta-outline,
.btn-cta-light,
.btn-cta-ghost,
.btn-chip {
  font-weight: 600;
  border-radius: 10px;
  padding: 0.6rem 1.1rem;
  font-size: 0.95rem;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
}
.btn-cta {
  background: var(--primary-dark);
  color: #fff;
  border: 1px solid var(--primary-dark);
}
.btn-cta:hover,
.btn-cta:focus-visible {
  background: var(--primary-darker);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(14, 68, 105, 0.25);
}
.btn-cta-outline {
  background: transparent;
  color: var(--primary-dark);
  border: 1px solid var(--primary-dark);
}
.btn-cta-outline:hover,
.btn-cta-outline:focus-visible {
  background: var(--primary-dark);
  color: #fff;
}
.btn-chip {
  background: var(--surface);
  color: var(--primary-dark);
  border: 1px solid var(--border);
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}
.btn-chip:hover,
.btn-chip:focus-visible {
  border-color: var(--primary-mid);
  color: var(--primary-darker);
  background: #eef4fa;
}
.btn-cta-light {
  background: #fff;
  color: var(--primary-darker);
  border: 1px solid #fff;
}
.btn-cta-light:hover,
.btn-cta-light:focus-visible {
  background: #fef3c7;
  color: var(--primary-darker);
  transform: translateY(-1px);
}
.btn-cta-ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.6);
}
.btn-cta-ghost:hover,
.btn-cta-ghost:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: #fff;
}

/* ── CTA block (ends every major section) ──────────────────────── */
.cta-block {
  margin-top: 2rem;
  padding: 1.25rem 1.25rem 1.35rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #eef4fa 0%, #f8fbff 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary-mid);
}
.cta-title {
  font-weight: 700;
  color: var(--text-strong);
  font-size: 1.05rem;
  margin-bottom: 0.25rem !important;
}
.cta-title i {
  color: var(--primary-mid);
  margin-right: 0.3rem;
}
.cta-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.9rem !important;
}
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.cta-actions-wrap {
  margin-bottom: 0.9rem;
}

/* Primary CTA placed inside the article hero, under the lead paragraph */
.cta-hero {
  margin-top: 1.5rem;
  border-left-color: var(--accent);
  background: linear-gradient(135deg, #fff8e6 0%, #fffdf7 100%);
}

.cta-final {
  background: linear-gradient(
    135deg,
    var(--primary-dark) 0%,
    var(--primary-mid) 60%,
    var(--primary-dark) 100%
  );
  border: none;
  padding: 1.75rem;
}
.cta-final .cta-title,
.cta-final .cta-title i {
  color: #fff;
  font-size: 1.2rem;
}
.cta-final .cta-text {
  color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 575.98px) {
  .cta-actions .btn {
    width: 100%;
  }
}

/* ── Resource finder ───────────────────────────────────────────── */
.finder {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
}
.finder-controls {
  margin-bottom: 1rem;
}
.finder-search {
  position: relative;
  margin-bottom: 0.75rem;
}
.finder-search i {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.finder-search .form-control {
  padding: 0.7rem 1rem 0.7rem 2.5rem;
  border-radius: 10px;
  border-color: var(--border);
  font-size: 1rem;
}
.finder-search .form-control:focus {
  border-color: var(--primary-mid);
  box-shadow: 0 0 0 0.2rem rgba(26, 100, 150, 0.18);
}
.finder-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.chip {
  border: 1px solid var(--border);
  background: #f3f6fa;
  color: var(--text-body);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}
.chip:hover {
  background: #e6eef6;
}
.chip[aria-pressed="true"] {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}
.finder-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.75rem 0 0 !important;
}
.finder-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 1.5rem 0 0.5rem;
  margin: 0 !important;
}

.resource-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fbfcfe;
  color: var(--text-strong);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}
.resource-link:hover,
.resource-link:focus-visible {
  border-color: var(--primary-mid);
  box-shadow: 0 6px 16px rgba(14, 68, 105, 0.12);
  transform: translateY(-2px);
  color: var(--primary-darker);
}
.rl-cat {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-mid);
  margin-bottom: 0.2rem;
}

/* ── Revision tool cards ───────────────────────────────────────── */
.tool-card {
  height: 100%;
  padding: 1.25rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.tool-card > i {
  font-size: 1.5rem;
  color: var(--primary-mid);
  margin-bottom: 0.5rem;
}
.article .tool-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.4rem;
}
.article .tool-card p {
  font-size: 0.92rem;
  line-height: 1.6;
  flex-grow: 1;
  margin-bottom: 0.75rem;
}
.article .tool-card a {
  font-size: 0.92rem;
  font-weight: 600;
}

/* ── Breadcrumb ────────────────────────────────────────────────── */
.breadcrumb-nav .breadcrumb {
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}
.breadcrumb-nav a {
  color: var(--primary-mid);
  text-decoration: none;
}
.breadcrumb-nav a:hover {
  text-decoration: underline;
}
.breadcrumb-nav .breadcrumb-item.active {
  color: var(--text-muted);
}

/* ── Mnemonic cards ────────────────────────────────────────────── */
.mn-card {
  height: 100%;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fbfcfe;
  display: flex;
  flex-direction: column;
}
.mn-card .rl-cat {
  display: block;
}
.article .mn-card h3 {
  font-size: 1rem;
  line-height: 1.4;
  margin: 0 0 0.6rem;
}
.article .mn-trick {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-darker);
  background: #fef3c7;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  margin-bottom: 0.75rem;
}
.mn-decode {
  margin-top: auto;
  font-size: 0.92rem;
  line-height: 1.6;
}
.mn-decode summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary-mid);
  font-size: 0.88rem;
}
.mn-decode[open] summary {
  margin-bottom: 0.5rem;
}
.article .mn-decode ol,
.article .mn-decode ul,
.article .mn-decode p {
  margin-bottom: 0.5rem;
}
.article .mn-decode li {
  margin-bottom: 0.2rem;
}
.mn-decode strong {
  color: var(--primary-dark);
}
.article .mn-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── "Best for" line inside tool cards ─────────────────────────── */
.article .tool-card .tool-best {
  flex-grow: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: #f3f6fa;
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
}

/* ── Keyword flow (3-step diagram) ─────────────────────────────── */
.article .kw-flow {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  counter-reset: kw;
}
.kw-step {
  position: relative;
  counter-increment: kw;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--primary-mid);
  font-size: 0.92rem;
  line-height: 1.5;
}
.article .kw-step {
  margin: 0;
}
.kw-step > i {
  font-size: 1.5rem;
  color: var(--primary-mid);
}
.kw-step strong {
  color: var(--text-strong);
  font-size: 1rem;
}
.kw-step strong::before {
  content: counter(kw) ". ";
  color: var(--primary-mid);
}
.kw-step span {
  color: var(--text-muted);
}
/* arrow between steps */
.kw-step:not(:last-child)::after {
  content: "\2192";
  position: absolute;
  right: -1.55rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
}
@media (max-width: 767.98px) {
  .article .kw-flow {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .kw-step:not(:last-child)::after {
    content: "\2193";
    right: auto;
    left: 50%;
    top: auto;
    bottom: -1.65rem;
    transform: translateX(-50%);
  }
}

/* ── Comparison table ──────────────────────────────────────────── */
.compare-table td:last-child {
  font-weight: 600;
  color: var(--text-strong);
  background: #f5fbf7;
}
.compare-table td i {
  margin-right: 0.35rem;
}
.compare-table tbody th {
  white-space: normal;
}

/* ── Temporary review hub (index.html) ─────────────────────────── */
.hub-group {
  margin-top: 2rem;
}
.article .hub-group h2 {
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hub-count {
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--primary-dark);
  color: #fff;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
}
.hub-meta {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
  word-break: break-all;
}
.hub-warn {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #b45309;
}

/* ── Mistakes list ─────────────────────────────────────────────── */
.mistake-list {
  list-style: none;
  padding-left: 0;
}
.mistake-list li {
  position: relative;
  padding-left: 1.9rem;
  margin-bottom: 0.9rem;
}
.mistake-list li::before {
  content: "\2715";
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.3rem;
  text-align: center;
}

/* ── FAQ accordion ─────────────────────────────────────────────── */
.faq .accordion-item {
  border-color: var(--border);
}
.article .faq .accordion-header {
  margin: 0;
}
.faq .accordion-button {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-strong);
}
.faq .accordion-button:not(.collapsed) {
  background: #eef4fa;
  color: var(--primary-darker);
  box-shadow: none;
}
.faq .accordion-button:focus {
  box-shadow: 0 0 0 0.2rem rgba(26, 100, 150, 0.2);
}
.faq .accordion-body {
  font-size: 0.98rem;
  line-height: 1.7;
}

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