/* ============================================
   Reasoning GP — shared design system
   Editorial / Red Whale–inspired
   ============================================ */

:root{
  /* Neutrals — warm, off-white, editorial */
  --bg: #f6f2e9;            /* warm cream */
  --bg-soft: #efe9dc;        /* slightly deeper cream */
  --surface: #ffffff;
  --surface-2: #fbf8f1;
  --ink: #15202b;
  --ink-2: #2a3744;
  --muted: #6b7280;
  --muted-2: #94a3b8;
  --line: #e7e0d1;
  --line-2: #d8cfba;

  /* Primary — deep teal */
  --teal: #0c4a47;
  --teal-2: #0e5c58;
  --teal-3: #18746f;
  --teal-soft: #d5e6e4;

  /* Accent — warm rust/coral */
  --rust: #b54c2b;
  --rust-2: #9b3e22;
  --rust-soft: #f7e3da;

  /* Mustard — secondary accent */
  --mustard: #b8862d;
  --mustard-soft: #f6e9c8;

  /* Clinical colour-coding */
  --r: #b91c1c; --r-bg: #fef2f2; --r-bd: #fecaca;
  --a: #b45309; --a-bg: #fffbeb; --a-bd: #fde68a;
  --g: #15803d; --g-bg: #f0fdf4; --g-bd: #bbf7d0;
  --b: #1d4ed8; --b-bg: #eff6ff; --b-bd: #bfdbfe;
  --p: #6d28d9; --p-bg: #f5f3ff; --p-bd: #ddd6fe;
  --ps:#be185d; --ps-bg:#fdf2f8; --ps-bd:#fbcfe8;

  /* Shadows — soft, paper-like */
  --shadow-1: 0 1px 2px rgba(20,30,40,.04), 0 2px 8px rgba(20,30,40,.04);
  --shadow-2: 0 4px 14px rgba(20,30,40,.07), 0 1px 3px rgba(20,30,40,.04);
  --shadow-3: 0 10px 30px rgba(20,30,40,.10), 0 2px 6px rgba(20,30,40,.05);

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;

  --content: 1180px;
}

*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{
  font-family:'DM Sans','Helvetica Neue',Helvetica,Arial,sans-serif;
  background:var(--bg);
  color:var(--ink);
  font-size:15.5px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

h1,h2,h3,h4,h5,.serif{
  font-family:'Source Serif 4','Source Serif Pro',Georgia,serif;
  font-weight:500;
  letter-spacing:-0.01em;
  color:var(--ink);
  line-height:1.15;
  text-wrap:balance;
}
h1{font-size:clamp(2.2rem, 4.4vw, 3.6rem);font-weight:500;letter-spacing:-0.02em}
h2{font-size:clamp(1.6rem,2.6vw,2.2rem)}
h3{font-size:1.25rem}

a{color:var(--teal-2);text-decoration:none}
a:hover{color:var(--rust)}

/* ---------- APP LAYOUT (sidebar + main) ---------- */
.app{
  display:grid;
  grid-template-columns: 296px 1fr;
  min-height:100vh;
  transition: grid-template-columns .25s ease;
}
.app.sb-collapsed{
  grid-template-columns: 0 1fr;
}
.app.sb-collapsed .sidebar{
  transform: translateX(-100%);
  opacity:0;
  pointer-events:none;
}
.sidebar{
  background:var(--bg-soft);
  border-right:1px solid var(--line);
  position:sticky;top:0;
  height:100vh;
  overflow:hidden;
  display:flex;flex-direction:column;
  transition: transform .25s ease, opacity .2s ease;
}
.sb-head{
  padding:18px 20px 14px;
  border-bottom:1px solid var(--line);
  display:flex;align-items:flex-start;justify-content:space-between;gap:10px;
}
.sb-collapse-btn{
  background:transparent;border:none;
  width:28px;height:28px;border-radius:6px;cursor:pointer;
  display:grid;place-items:center;
  color:var(--muted);
  flex-shrink:0;margin-top:2px;
  transition:.12s ease;
}
.sb-collapse-btn:hover{background:var(--surface);color:var(--ink)}
.sb-collapse-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}

/* Floating show-sidebar button (desktop, when collapsed) */
.sb-show-btn{
  position:fixed;left:14px;top:14px;z-index:50;
  width:38px;height:38px;border-radius:10px;
  background:var(--teal);color:#f6f2e9;border:none;cursor:pointer;
  display:none;align-items:center;justify-content:center;
  box-shadow:var(--shadow-2);
  transition:.15s ease;
}
.sb-show-btn:hover{background:var(--teal-2)}
.sb-show-btn svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.app.sb-collapsed .sb-show-btn{display:flex}
.app.sb-collapsed .main{padding-left:0}
.sb-brand{display:flex;align-items:center;gap:11px;text-decoration:none;color:var(--ink)}
.sb-search{
  margin:14px 20px 8px;
  position:relative;
}
.sb-search input{
  width:100%;
  font-family:inherit;
  font-size:13.5px;
  padding:9px 12px 9px 34px;
  border-radius:8px;
  background:var(--surface);
  border:1px solid var(--line);
  color:var(--ink);
  outline:none;
  transition:border-color .15s ease;
}
.sb-search input:focus{border-color:var(--teal-3)}
.sb-search-ic{
  position:absolute;left:11px;top:50%;transform:translateY(-50%);
  width:14px;height:14px;
  fill:none;stroke:var(--muted-2);stroke-width:2;
}
.sb-mode{
  margin:6px 20px 12px;
  display:flex;background:var(--surface);border:1px solid var(--line);
  border-radius:8px;padding:3px;gap:2px;
}
.sb-mode button{
  flex:1;
  font-family:inherit;font-size:12px;font-weight:600;
  padding:6px 8px;border:none;background:transparent;
  border-radius:6px;cursor:pointer;color:var(--muted);
  transition:.15s ease;
}
.sb-mode button.active{background:var(--teal);color:#f6f2e9}
.sb-mode button:not(.active):hover{color:var(--ink)}

.sb-scroll{
  flex:1;overflow-y:auto;padding:6px 12px 24px;
}
.sb-scroll::-webkit-scrollbar{width:8px}
.sb-scroll::-webkit-scrollbar-thumb{background:var(--line-2);border-radius:4px}
.sb-scroll::-webkit-scrollbar-track{background:transparent}

.sb-section{margin:14px 8px 4px}
.sb-section-t{
  font-size:10.5px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;
  color:var(--muted);padding:0 8px 6px;
  display:flex;align-items:center;justify-content:space-between;
}
.sb-count{
  font-size:10px;background:var(--bg);color:var(--muted);
  padding:1px 6px;border-radius:99px;font-weight:600;letter-spacing:.02em;
}

.sb-item{
  display:flex;align-items:flex-start;gap:9px;
  padding:8px 10px;
  border-radius:7px;
  text-decoration:none;color:var(--ink-2);
  font-size:13.5px;line-height:1.35;
  transition:background .12s ease;
  cursor:pointer;
}
.sb-item:hover{background:var(--surface)}
.sb-item.active{background:var(--teal-soft);color:var(--teal);font-weight:600}
.sb-item .sb-i-dot{
  width:7px;height:7px;border-radius:50%;
  background:var(--line-2);margin-top:7px;flex-shrink:0;
}
.sb-item.is-done .sb-i-dot{background:var(--g)}
.sb-item.is-progress .sb-i-dot{background:var(--mustard)}
.sb-item .sb-i-text{flex:1}
.sb-item .sb-i-meta{
  font-size:11px;color:var(--muted);margin-top:2px;
  display:flex;gap:6px;flex-wrap:wrap;align-items:center;
}
.sb-i-stub{
  font-size:9.5px;background:var(--bg);color:var(--muted);
  padding:1px 6px;border-radius:99px;font-weight:600;
  letter-spacing:.05em;text-transform:uppercase;
}
.sb-i-caret{
  width:14px;height:14px;flex-shrink:0;margin-top:6px;
  display:none;
  color:var(--muted);transition:transform .2s ease;
}
.sb-item.active .sb-i-caret{display:inline-block;color:var(--teal)}
.sb-item.is-open .sb-i-caret{transform:rotate(90deg)}

/* sub-list of sections under active sidebar topic */
.sb-sub{
  display:none;
  margin:2px 0 6px 26px;
  padding:4px 0 4px 10px;
  border-left:1px solid var(--line-2);
}
.sb-item.is-open + .sb-sub,
.sb-sub.is-open{display:block}
.sb-sub a{
  display:flex;align-items:center;gap:8px;
  padding:5px 9px;border-radius:6px;
  text-decoration:none;color:var(--ink-2);
  font-size:12.5px;line-height:1.35;
  transition:background .12s ease;
}
.sb-sub a:hover{background:var(--surface);color:var(--ink)}
.sb-sub a.active{background:var(--teal-soft);color:var(--teal);font-weight:600}
.sb-sub a .sb-sub-n{
  font-family:'Source Serif 4',serif;font-style:italic;
  color:var(--rust);opacity:.7;flex-shrink:0;width:14px;text-align:center;font-size:13px;
}
.sb-sub a.active .sb-sub-n{opacity:1}

.sb-foot{
  border-top:1px solid var(--line);
  padding:12px 20px;
  font-size:11.5px;color:var(--muted);
  display:flex;justify-content:space-between;align-items:center;
}

/* main panel */
.main{
  min-width:0;
}

/* mobile sidebar toggle */
.sb-toggle{
  display:none;
  position:fixed;top:14px;left:14px;z-index:120;
  width:42px;height:42px;border-radius:10px;
  background:var(--teal);color:#f6f2e9;
  border:none;cursor:pointer;
  align-items:center;justify-content:center;
  box-shadow:var(--shadow-2);
}
@media (max-width:920px){
  .app{grid-template-columns:1fr}
  .sidebar{
    position:fixed;top:0;left:0;width:296px;
    transform:translateX(-100%);
    transition:transform .25s ease;
    z-index:110;box-shadow:var(--shadow-3);
  }
  .sidebar.is-open{transform:translateX(0)}
  .sb-toggle{display:flex}
  .main{padding-top:60px}
  .sb-overlay{
    display:none;position:fixed;inset:0;background:rgba(15,20,30,.4);z-index:105;
  }
  .sb-overlay.is-open{display:block}
}

/* ---------- TOP BAR (legacy fallback for non-app pages) ---------- */
.nav{
  position:sticky; top:0; z-index:100;
  background:rgba(246,242,233,.85);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  border-bottom:1px solid var(--line);
}
.nav-inner{
  max-width:var(--content);
  margin:0 auto;
  padding:14px 24px;
  display:flex; align-items:center; gap:32px;
}
.brand{display:flex;align-items:center;gap:11px;text-decoration:none;color:var(--ink)}
.brand-mark{
  width:36px;height:36px;border-radius:9px;
  background:var(--teal);color:#f3ede0;
  display:grid;place-items:center;
  font-family:'Source Serif 4',serif;font-weight:600;font-size:18px;
  letter-spacing:-.02em;
  position:relative;
  box-shadow: 0 2px 6px rgba(12,74,71,.25);
}
.brand-mark::after{
  content:""; position:absolute; right:-3px; bottom:-3px;
  width:10px;height:10px;border-radius:50%;
  background:var(--rust);
  border:2px solid var(--bg);
}
.brand-name{
  font-family:'Source Serif 4',serif;
  font-size:18px;font-weight:600;letter-spacing:-.015em;
  line-height:1;
}
.brand-tag{font-size:11px;color:var(--muted);letter-spacing:.05em;text-transform:uppercase;margin-top:3px;display:block}

.nav-links{display:flex;gap:6px;margin-left:auto;align-items:center}
.nav-links a{
  font-size:14px;color:var(--ink-2);padding:8px 12px;border-radius:8px;
  font-weight:500;
}
.nav-links a:hover{background:var(--bg-soft);color:var(--ink)}
.nav-links a.active{color:var(--teal);background:var(--teal-soft)}
.nav-cta{
  background:var(--teal);color:#fff !important;
  padding:8px 16px !important;border-radius:8px !important;
  font-weight:600 !important;
}
.nav-cta:hover{background:var(--teal-2);color:#fff !important}

@media (max-width:760px){
  .nav-inner{gap:14px;padding:12px 16px}
  .nav-links{gap:0;flex-wrap:wrap;justify-content:flex-end}
  .nav-links a{padding:6px 9px;font-size:13px}
  .brand-tag{display:none}
}

/* ---------- CONTAINERS ---------- */
.wrap{max-width:var(--content);margin:0 auto;padding:0 24px}
.wrap-narrow{max-width:880px;margin:0 auto;padding:0 24px}

/* ---------- TAGS ---------- */
.tag{
  display:inline-flex;align-items:center;gap:5px;
  font-size:11.5px;font-weight:600;letter-spacing:.03em;
  padding:3px 9px;border-radius:99px;
  background:var(--bg-soft);color:var(--ink-2);
  border:1px solid var(--line);
  line-height:1.4;
}
.tag-teal{background:var(--teal-soft);color:var(--teal);border-color:var(--teal-soft)}
.tag-rust{background:var(--rust-soft);color:var(--rust-2);border-color:var(--rust-soft)}
.tag-mustard{background:var(--mustard-soft);color:#8a630e;border-color:var(--mustard-soft)}
.tag-r{background:var(--r-bg);color:var(--r);border-color:var(--r-bd)}
.tag-a{background:var(--a-bg);color:var(--a);border-color:var(--a-bd)}
.tag-g{background:var(--g-bg);color:var(--g);border-color:var(--g-bd)}
.tag-b{background:var(--b-bg);color:var(--b);border-color:var(--b-bd)}
.tag-p{background:var(--p-bg);color:var(--p);border-color:var(--p-bd)}

.tag-dot{width:6px;height:6px;border-radius:50%;display:inline-block;flex-shrink:0}
.dot-r{background:var(--r)} .dot-a{background:var(--a)} .dot-g{background:var(--g)}
.dot-b{background:var(--b)} .dot-teal{background:var(--teal)} .dot-rust{background:var(--rust)}

/* ---------- BUTTONS ---------- */
.btn{
  display:inline-flex;align-items:center;gap:8px;
  font-family:inherit;font-size:14px;font-weight:600;
  padding:11px 20px;border-radius:10px;
  cursor:pointer;border:1px solid transparent;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
  text-decoration:none;
}
.btn:hover{transform:translateY(-1px)}
.btn-primary{background:var(--teal);color:#f6f2e9;border-color:var(--teal)}
.btn-primary:hover{background:var(--teal-2);color:#fff}
.btn-ghost{background:transparent;color:var(--ink);border-color:var(--line-2)}
.btn-ghost:hover{background:var(--surface);border-color:var(--ink-2)}
.btn-rust{background:var(--rust);color:#fff;border-color:var(--rust)}
.btn-rust:hover{background:var(--rust-2);color:#fff}

/* ---------- FOOTER ---------- */
.footer{
  margin-top:80px;
  border-top:1px solid var(--line);
  background:var(--bg-soft);
}
.footer-inner{
  max-width:var(--content);margin:0 auto;
  padding:40px 24px 28px;
  display:grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap:32px;
}
@media (max-width:760px){.footer-inner{grid-template-columns:1fr 1fr;gap:24px}}
.footer h5{
  font-family:'DM Sans',sans-serif;
  font-size:11px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
  color:var(--muted);margin-bottom:12px;
}
.footer ul{list-style:none;display:flex;flex-direction:column;gap:8px}
.footer a{color:var(--ink-2);font-size:14px}
.footer a:hover{color:var(--teal)}
.footer-bottom{
  max-width:var(--content);margin:0 auto;
  padding:20px 24px 36px;
  border-top:1px solid var(--line);
  font-size:12.5px;color:var(--muted);
  display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px;
}
.footer-disclaimer{
  background:var(--surface);border:1px solid var(--line);
  border-radius:var(--r-md);padding:14px 18px;
  font-size:12.5px;color:var(--muted);line-height:1.55;
  max-width:var(--content);margin:24px auto 0;
}
.footer-disclaimer strong{color:var(--ink-2)}

/* ---------- CANONICAL LISTING (.alg-*) — shared fallback for tool pages
   that don't define their own inline copy (calculators, med chooser).
   Pages with inline copies load them after this file and override. ---------- */
.alg-controls{ display:flex; gap:14px; align-items:center; flex-wrap:wrap; margin-bottom:8px; }
.alg-search{ position:relative; flex:1; min-width:260px; }
.alg-search svg{ position:absolute; left:14px; top:50%; transform:translateY(-50%); color:var(--muted); pointer-events:none; }
.alg-search input{ width:100%; font:inherit; font-size:15px; padding:12px 14px 12px 42px; border:1px solid var(--line-2); border-radius:10px; background:#fff; color:var(--ink); }
.alg-search input:focus{ outline:none; border-color:var(--teal); box-shadow:0 0 0 4px var(--teal-soft); }
.alg-count-pill{ font-size:13px; color:var(--muted); font-weight:500; white-space:nowrap; }
.alg-count-pill b{ color:var(--ink); font-feature-settings:"tnum"; }

.alg-empty{ display:none; padding:48px 20px; text-align:center; color:var(--muted); font-size:15px; }
.alg-empty.show{ display:block; }

.alg-group{ margin-top:30px; }
.alg-group:first-of-type{ margin-top:6px; }
.alg-group-head{ display:flex; align-items:center; gap:10px; margin-bottom:14px; padding:0 0 8px 18px; border-bottom:1px solid var(--line); }
.agh-icon{ font-size:18px; }
.alg-group-head h2{ font-family:'Source Serif 4',Georgia,serif; font-weight:500; font-size:21px; color:var(--ink); letter-spacing:-.01em; }
.agh-count{ font-size:11px; font-weight:700; color:var(--muted); background:var(--bg-soft); border:1px solid var(--line); border-radius:99px; padding:2px 9px; }

.alg-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(264px,1fr)); gap:10px; }
.alg-card{ display:flex; align-items:flex-start; gap:12px; padding:13px 15px; background:#fff; border:1px solid var(--line); border-radius:12px; text-decoration:none; color:inherit; transition:all .15s ease; position:relative; }
.alg-card:hover{ border-color:var(--teal); box-shadow:var(--shadow-2); transform:translateY(-1px); }
.ac-icon{ font-size:22px; line-height:1.1; flex-shrink:0; width:30px; text-align:center; }
.ac-text{ display:flex; flex-direction:column; gap:2px; min-width:0; flex:1; }
.ac-text b{ font-size:14.5px; font-weight:600; color:var(--ink); line-height:1.25; }
.ac-text small{ font-size:12px; color:var(--muted); line-height:1.4; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.ac-arrow{ color:var(--line-2); font-size:16px; flex-shrink:0; align-self:center; transition:.15s ease; }
.alg-card:hover .ac-arrow{ color:var(--teal); transform:translateX(2px); }

.alg-foot{ margin-top:36px; padding:14px 18px; background:var(--bg-soft); border:1px solid var(--line); border-radius:10px; font-size:12.5px; color:var(--muted); line-height:1.5; }
.alg-foot strong{ color:var(--ink-2); }

/* ---------- DIRECTORY FILTER RAIL (shared by listing pages) ---------- */
.tool-page:has(.dir-layout){ max-width:1340px; }
.dir-layout{ display:grid; grid-template-columns:236px 1fr; gap:28px; align-items:start; margin-top:4px; }
.dir-rail{
  position:sticky; top:18px; align-self:start;
  max-height:calc(100vh - 36px); overflow-y:auto;
  padding:2px 6px 8px 2px;
}
.dir-rail::-webkit-scrollbar{ width:7px; }
.dir-rail::-webkit-scrollbar-thumb{ background:var(--line-2); border-radius:4px; }
.dir-rail-top{ display:flex; align-items:center; justify-content:space-between; padding-bottom:10px; border-bottom:1px solid var(--line); }
.dir-rail-title{ font-size:11px; letter-spacing:.14em; text-transform:uppercase; color:var(--muted); font-weight:700; }
.dir-rail-actions{ display:flex; align-items:center; gap:10px; }
.dir-reset{ font:inherit; font-size:12.5px; font-weight:600; color:var(--teal-2); background:none; border:none; cursor:pointer; padding:0; }
.dir-reset:hover{ color:var(--rust); text-decoration:underline; text-underline-offset:2px; }
.dir-rail-min{ width:24px; height:24px; border:none; background:none; cursor:pointer; color:var(--muted); display:grid; place-items:center; border-radius:6px; flex-shrink:0; }
.dir-rail-min:hover{ background:var(--bg-soft); color:var(--ink); }
.dir-rail-min svg{ width:16px; height:16px; }
.dir-rail-sec{ margin-top:14px; }
.dir-rail-h{ font-family:'Source Serif 4',Georgia,serif; font-size:14.5px; font-weight:600; color:var(--ink); margin-bottom:8px; }
.dir-rail-list{ display:flex; flex-direction:column; gap:1px; }
.dir-check{ display:flex; align-items:center; gap:9px; padding:6px 8px; border-radius:8px; cursor:pointer; transition:background .12s ease; }
.dir-check:hover{ background:var(--bg-soft); }
.dir-check input{ position:absolute; opacity:0; width:0; height:0; }
.dir-check-box{ width:16px; height:16px; border:1.5px solid var(--line-2); border-radius:5px; flex-shrink:0; position:relative; transition:all .12s ease; background:#fff; }
.dir-check-box::after{ content:""; position:absolute; left:4px; top:1px; width:5px; height:9px; border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg) scale(0); transition:transform .12s ease; }
.dir-check input:checked + .dir-check-box{ background:var(--teal); border-color:var(--teal); }
.dir-check input:checked + .dir-check-box::after{ transform:rotate(45deg) scale(1); }
.dir-check input:focus-visible + .dir-check-box{ box-shadow:0 0 0 3px var(--teal-soft); }
.dir-check-label{ font-size:13.5px; color:var(--ink-2); line-height:1.3; flex:1; }
.dir-check input:checked ~ .dir-check-label{ color:var(--ink); font-weight:600; }
.dir-check-n{ font-size:11px; font-weight:700; color:var(--muted); font-feature-settings:"tnum"; }

.dir-main{ min-width:0; }
.dir-toolbar{ margin-bottom:20px; }
.dir-toolbar.alg-controls{ margin-bottom:20px; }
.dir-sort label{ display:inline-flex; align-items:center; gap:2px; font-size:13px; color:var(--muted); font-weight:500; white-space:nowrap; }
.dir-sort select{
  font:inherit; font-size:13.5px; font-weight:600; color:var(--ink);
  padding:10px 32px 10px 13px; border:1px solid var(--line-2); border-radius:9px;
  background:#fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%236b7280" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>') no-repeat right 11px center;
  -webkit-appearance:none; appearance:none; cursor:pointer;
}
.dir-sort select:focus{ outline:none; border-color:var(--teal); box-shadow:0 0 0 4px var(--teal-soft); }
.dir-flat{ margin-top:4px; }
.dir-filters-toggle{
  display:none; align-items:center; gap:7px; font:inherit; font-size:13px; font-weight:600;
  padding:10px 14px; border:1px solid var(--line-2); border-radius:9px; background:#fff; color:var(--ink-2); cursor:pointer;
}
.dir-filters-toggle:hover{ border-color:var(--teal); color:var(--teal); }
.dir-filters-toggle .n{ background:var(--teal); color:#fff; border-radius:99px; padding:0 6px; font-size:11px; line-height:1.5; }

/* desktop: minimized rail → results go full width, "Filters" button reopens */
@media (min-width:861px){
  .dir-layout.rail-collapsed{ grid-template-columns:1fr; }
  .dir-layout.rail-collapsed .dir-rail{ display:none; }
  .dir-layout.rail-collapsed .dir-filters-toggle{ display:inline-flex; }
}

@media (max-width:860px){
  .dir-layout{ grid-template-columns:1fr; gap:0; }
  .dir-rail{ position:static; max-height:none; overflow:visible; display:none; margin-bottom:16px; padding:14px 16px; background:var(--bg-soft); border:1px solid var(--line); border-radius:12px; }
  .dir-rail.open{ display:block; }
  .dir-filters-toggle{ display:inline-flex; }
}

/* ---------- UTIL ---------- */
.eyebrow{
  font-size:11.5px;font-weight:700;
  letter-spacing:.14em;text-transform:uppercase;
  color:var(--rust);
}
.muted{color:var(--muted)}
.center{text-align:center}
.divider{height:1px;background:var(--line);margin:32px 0}

/* Decorative underline under serif headings */
.h-underline{position:relative;display:inline-block;padding-bottom:4px}
.h-underline::after{
  content:"";position:absolute;left:0;right:30%;bottom:-2px;height:3px;
  background:var(--rust);border-radius:2px;
}

/* ---------- LANDING / OVERVIEW PAGE ---------- */
.panel{padding:32px 40px 60px}
@media (max-width:760px){.panel{padding:20px 18px 50px}}

.hero{
  display:grid;
  grid-template-columns: 1.4fr 1fr;
  gap:36px;
  align-items:start;
  padding:28px 0 18px;
}
@media (max-width:900px){.hero{grid-template-columns:1fr;gap:18px}}

.hero-eyebrow{
  display:inline-flex;align-items:center;gap:8px;
  font-size:11.5px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;
  color:var(--rust);
}
.hero-eyebrow::before{
  content:"";width:18px;height:1px;background:var(--rust);display:inline-block;
}
.hero h1{margin-top:14px;font-size:clamp(2.2rem,3.6vw,3.2rem)}
.hero h1 em{font-style:italic;color:var(--teal);font-weight:500}
.hero-sub{
  font-size:17px;color:var(--ink-2);line-height:1.55;margin-top:18px;max-width:60ch;
  text-wrap:pretty;
}
.hero-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:24px}

.hero-aside{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  padding:22px 22px 18px;
  box-shadow:var(--shadow-1);
  position:relative;
}
.hero-aside h4{
  font-family:'DM Sans',sans-serif;
  font-size:11.5px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;
  color:var(--muted);margin-bottom:12px;
}
.hero-aside ol{list-style:none;display:flex;flex-direction:column;gap:2px;counter-reset:step}
.hero-aside ol li{
  counter-increment:step;
  display:flex;gap:12px;align-items:flex-start;
  padding:7px 0;
  border-bottom:1px dashed var(--line);
}
.hero-aside ol li:last-child{border-bottom:none}
.hero-aside ol li::before{
  content:counter(step);
  font-family:'Source Serif 4',serif;font-weight:500;font-size:14px;
  color:var(--rust);min-width:18px;
}
.hero-aside ol li b{
  font-family:'DM Sans',sans-serif;font-weight:600;font-size:14px;color:var(--ink);
  display:block;
}
.hero-aside ol li small{
  font-size:12px;color:var(--muted);
}

/* ---------- CASE CARDS GRID ---------- */
.section-head{
  display:flex;align-items:flex-end;justify-content:space-between;gap:16px;
  margin:48px 0 18px;
  padding-bottom:14px;
  border-bottom:1px solid var(--line);
}
.section-head h2{font-size:clamp(1.5rem,2.2vw,1.9rem)}
.section-head .eyebrow{margin-bottom:6px;display:block}
.section-head p{color:var(--muted);font-size:14px;max-width:60ch;margin-top:6px}

.case-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
  gap:18px;
}
.case-card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  padding:20px 22px 18px;
  display:flex;flex-direction:column;gap:10px;
  text-decoration:none;color:inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  position:relative;
  overflow:hidden;
}
.case-card:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow-2);
  border-color:var(--line-2);
}
.case-card .cc-cat{
  font-size:11px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
  color:var(--rust);
}
.case-card h3{
  font-size:1.2rem;line-height:1.2;
  font-family:'Source Serif 4',serif;font-weight:500;
}
.case-card .cc-sub{font-size:13.5px;color:var(--muted);line-height:1.5}
.case-card .cc-meta{
  display:flex;gap:6px;flex-wrap:wrap;margin-top:8px;
}
.case-card .cc-arrow{
  position:absolute;right:18px;top:18px;
  width:30px;height:30px;border-radius:50%;
  border:1px solid var(--line);
  display:grid;place-items:center;
  color:var(--muted);font-size:14px;
  transition: all .15s ease;
}
.case-card:hover .cc-arrow{
  background:var(--teal);color:#fff;border-color:var(--teal);
  transform:translate(2px,-2px);
}
.case-card.is-flagship{
  background:linear-gradient(135deg,#fff 0%,#fffaf0 100%);
  border-color:var(--mustard-soft);
}
.case-card.is-stub{
  background:transparent;
  border-style:dashed;
  border-color:var(--line-2);
}
.case-card.is-stub h3{color:var(--ink-2)}

/* ---------- THE FRAMEWORK SECTION ---------- */
.framework{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r-xl);
  padding:36px 40px;
  margin-top:32px;
}
@media (max-width:760px){.framework{padding:24px 20px}}
.framework-head{margin-bottom:22px}
.framework-head h2{margin-top:6px}
.framework-head p{color:var(--muted);max-width:62ch;margin-top:10px;font-size:14.5px;line-height:1.55}

.fw-steps{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:12px;
}
.fw-step{
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:var(--r-md);
  padding:16px 18px;
  display:flex;flex-direction:column;gap:6px;
  position:relative;
}
.fw-step-num{
  font-family:'Source Serif 4',serif;
  font-size:28px;color:var(--rust);line-height:1;font-weight:500;
}
.fw-step h4{
  font-family:'DM Sans',sans-serif;
  font-size:14.5px;font-weight:600;color:var(--ink);
}
.fw-step p{font-size:12.5px;color:var(--muted);line-height:1.5}

/* ---------- INFO BLOCKS (general) ---------- */
.note{
  background:var(--surface-2);
  border:1px solid var(--line);
  border-left:3px solid var(--teal);
  border-radius:var(--r-sm);
  padding:12px 16px;
  font-size:13.5px;color:var(--ink-2);
  line-height:1.55;
}
.note strong{color:var(--ink)}
.note-rust{border-left-color:var(--rust)}
.note-mustard{border-left-color:var(--mustard)}

/* ---------- FILTER CHIPS ---------- */
.chips{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0 18px}
.chip{
  font-family:inherit;font-size:12.5px;font-weight:500;
  padding:5px 12px;border-radius:99px;
  background:var(--surface);border:1px solid var(--line);
  color:var(--ink-2);cursor:pointer;
  transition:.12s ease;
}
.chip:hover{border-color:var(--ink-2)}
.chip.active{background:var(--teal);border-color:var(--teal);color:#f6f2e9}

/* Print-friendly */
@media print{
  .nav,.footer,.footer-bottom,.sidebar,.sb-toggle{display:none}
  body{background:#fff}
  .app{grid-template-columns:1fr}
  .main{padding-top:0}
}


/* ============================================
   TOPNAV — replaces sidebar layout
   ============================================ */
:root { --rgp-nav-h: 116px; --rgp-nav-row-h: 56px; }

/* Neutralise legacy sidebar layout */
body.rgp-topnav { padding-top: var(--rgp-nav-h); background: var(--bg); }
body.rgp-topnav .app { display: block !important; grid-template-columns: none !important; min-height: auto !important; transition: none; }
body.rgp-topnav .sidebar,
body.rgp-topnav .sb-toggle,
body.rgp-topnav .sb-overlay,
body.rgp-topnav .sb-show-btn { display: none !important; }
body.rgp-topnav .main { max-width: 1280px; margin: 0 auto; padding: 0 20px; min-width: 0; }
body.rgp-topnav .app.sb-collapsed .main { padding-left: 20px; }

/* Top nav shell */
.rgp-nav{
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  height: var(--rgp-nav-h);
  background: rgba(246, 242, 233, .82);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s ease, background .2s ease;
}
.rgp-nav.is-mega-open{
  background: var(--surface);
  box-shadow: var(--shadow-2);
}
.rgp-nav-row{
  max-width: 1280px; margin: 0 auto; padding: 0 20px;
  height: var(--rgp-nav-row-h);
  display: flex; align-items: center; gap: 14px;
}

/* Dedicated centred strip for the Clinic / SCA interface switch */
/* Top band: brand · Viewing switch · Sign in/up */
.rgp-iface-bar{
  height: calc(var(--rgp-nav-h) - var(--rgp-nav-row-h));
  display: flex; align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.45);
}
body.mode-sca .rgp-iface-bar{ background: rgba(247,227,218,.4); }
.rgp-iface-inner{
  width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 20px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px;
}
.rgp-iface-inner .rgp-iface{ justify-self: center; }
.rgp-iface-inner .rgp-auth{ justify-self: end; }

/* Brand */
.rgp-brand{
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink); flex-shrink: 0;
}
.rgp-brand-mark{
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--teal); color: #f3ede0;
  display: grid; place-items: center;
  font-family: 'Source Serif 4', serif; font-weight: 600; font-size: 18px;
  position: relative;
}
.rgp-brand-mark::after{
  content: ""; position: absolute; right: -2px; bottom: -2px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--rust);
  border: 2px solid var(--bg);
}
.rgp-brand-text{ display: flex; flex-direction: column; line-height: 1.1; }
.rgp-brand-text b{ font-family: 'Source Serif 4', Georgia, serif; font-weight: 500; font-size: 15px; color: var(--ink); letter-spacing: -.01em; }
.rgp-brand-text small{ font-size: 10px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-top: 2px; }
@media (max-width: 720px){
  .rgp-brand-text small{ display: none; }
}

/* Primary nav */
.rgp-primary{ display: flex; align-items: center; gap: 4px; }
.rgp-nav-btn{
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  background: transparent; border: none; cursor: pointer;
  padding: 8px 11px; border-radius: 8px;
  text-decoration: none; line-height: 1; transition: .15s ease;
}
.rgp-nav-btn:hover{ background: var(--bg-soft); color: var(--ink); }
.rgp-nav-btn[aria-expanded="true"]{ background: var(--teal-soft); color: var(--teal); }
.rgp-pill{
  font-size: 10.5px; font-weight: 700; color: var(--rust-2);
  background: var(--rust-soft); padding: 1px 6px; border-radius: 99px;
}
.rgp-nav-btn[aria-expanded="true"] .rgp-pill{ background: #fff; color: var(--rust-2); }
.rgp-chev{ width: 11px; height: 11px; opacity: .55; transition: transform .2s ease; }
.rgp-nav-btn[aria-expanded="true"] .rgp-chev{ transform: rotate(180deg); opacity: 1; }

/* Search command button */
.rgp-search{
  display: inline-flex; align-items: center; gap: 8px;
  margin-left: auto;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 6px 8px 6px 11px;
  font-family: inherit; font-size: 12.5px; color: var(--muted);
  cursor: pointer; min-width: 240px; transition: .15s ease;
}
.rgp-search:hover{ border-color: var(--teal-3); color: var(--ink-2); }
.rgp-search svg{ width: 14px; height: 14px; fill: none; stroke: var(--muted-2); stroke-width: 2; }
.rgp-search-txt{ flex: 1; text-align: left; }
.rgp-search-kbd{ display: inline-flex; gap: 2px; }
.rgp-search-kbd kbd{
  font-family: inherit; font-size: 10.5px; font-weight: 600;
  color: var(--muted); background: var(--bg-soft); border: 1px solid var(--line);
  padding: 1px 5px; border-radius: 4px; line-height: 1.4;
}

/* Mode segmented control */
.rgp-mode{
  display: inline-flex; background: var(--bg-soft); border-radius: 8px; padding: 3px; gap: 2px;
  border: 1px solid var(--line);
}
.rgp-mode button{
  font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 5px 8px; border: none; background: transparent; border-radius: 6px;
  cursor: pointer; color: var(--muted); line-height: 1;
}
.rgp-mode button.active{ background: var(--teal); color: #f6f2e9; }
.rgp-mode button:not(.active):hover{ color: var(--ink); }

/* ===== Interface switch (Clinic / SCA) — centred strip under the nav ===== */
.rgp-iface{ flex-shrink:0; align-items:center; gap:4px; padding:3px; }
.rgp-iface-cap{ font-size:11px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--muted); padding:0 10px 0 6px; white-space:nowrap; }
.rgp-iface-hint{ font-size:12px; color:var(--muted); padding:0 6px 0 10px; white-space:nowrap; }
.rgp-iface button{ display:inline-flex; align-items:center; gap:7px; padding:7px 16px; border-radius:7px; font-size:13.5px; }
.rgp-iface .rgp-iface-ic{ font-size:15px; line-height:1; }
.rgp-iface .rgp-iface-lbl{ font-size:13.5px; font-weight:600; letter-spacing:.01em; }
.rgp-iface button:not(.active){ color:var(--muted); }
.rgp-iface button.active{ background:var(--teal); color:#f6f2e9; box-shadow:0 1px 4px rgba(12,74,71,.28); }
.rgp-iface button[data-mode="sca"].active{ background:var(--rust); color:#fdf2ee; box-shadow:0 1px 4px rgba(181,76,43,.28); }
@media (max-width: 600px){ .rgp-iface-hint{ display:none; } }
@media (max-width: 460px){ .rgp-iface-cap{ display:none; } }
/* Reclaim row width: collapse the verbose search label to icon + ⌘K on typical
   desktops so the SCA-mode primary nav (2 extra buttons) never pushes the
   Sign in / Sign up cluster off the right edge. */
@media (max-width: 1360px){
  .rgp-search-txt{ display:none; }
  .rgp-search{ padding:7px 11px; }
}

/* ===== Interface scoping — show the right set per chosen interface =====
   In SCA mode: hide clinic-only chrome, reveal SCA-only chrome.
   In any non-SCA (Clinic) mode: hide SCA-only chrome. */
body.mode-sca .rgp-clinic-only{ display:none !important; }
body:not(.mode-sca) .rgp-sca-only{ display:none !important; }

/* SCA interface — nav order is driven by inline styles via applyNavOrder()
   in site.js (re-applied on every mode toggle), because this environment does
   not re-resolve CSS flex `order` on a body-class change. */

/* Home reshape — only the matching home shows */
body:not(.mode-sca) .home-sca{ display:none !important; }
body.mode-sca .home-clinic{ display:none !important; }

/* ===== Per-interface accent on the nav so you always know where you are ===== */
.rgp-nav{ border-top:3px solid var(--teal); transition:border-color .2s ease; }
body.mode-sca .rgp-nav{ border-top-color:var(--rust); }
body.mode-sca .rgp-nav-btn[aria-expanded="true"]{ background:var(--rust-soft); color:var(--rust-2); }
.rgp-nav-link{ cursor:pointer; }
.rgp-nav-link.is-active{ background:var(--teal-soft); color:var(--teal); font-weight:700; }
body.mode-sca .rgp-nav-link.is-active{ background:var(--rust-soft); color:var(--rust-2); }

/* SCA 'More' menu: show only Audios, Resources, Articles */
body.mode-sca .rgp-mega[data-mega="more"] .rgp-mm-tool:not(.rgp-more-sca){ display:none !important; }

/* Burger (mobile only) */
.rgp-burger{
  display: none;
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--line); cursor: pointer;
  align-items: center; justify-content: center; color: var(--ink);
}
.rgp-burger svg{ width: 18px; height: 18px; }

/* Mobile breakpoints */
@media (max-width: 920px){
  .rgp-search{ min-width: 0; padding: 6px 8px; }
  .rgp-search-txt, .rgp-search-kbd{ display: none; }
  .rgp-search::after{ content: "Search"; font-size: 12px; }
}
@media (max-width: 820px){
  .rgp-primary { display: none; }
  .rgp-burger{ display: inline-flex; }
  .rgp-search{ margin-left: auto; }
  .rgp-nav.is-burger-open .rgp-primary{
    display: flex; position: absolute; top: var(--rgp-nav-h);
    left: 0; right: 0; background: var(--surface);
    border-bottom: 1px solid var(--line); padding: 12px 20px; flex-direction: column; align-items: stretch; gap: 6px;
    box-shadow: var(--shadow-2);
  }
}

/* ============ Mega menu ============ */
.rgp-mega{
  position: fixed; left: 0; right: 0; top: var(--rgp-nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  max-height: calc(100vh - var(--rgp-nav-h));
  overflow-y: auto;
  animation: rgp-mega-in .18s ease;
}
@keyframes rgp-mega-in{
  from{ opacity: 0; transform: translateY(-4px); }
  to{ opacity: 1; transform: translateY(0); }
}
.rgp-mega[hidden]{ display: none !important; }
.rgp-mega-close{ display: none; }
@media (max-width: 820px){
  .rgp-mega-close{
    display: flex; align-items: center; gap: 8px; width: 100%;
    font: inherit; font-weight: 700; font-size: 14px; box-sizing: border-box;
    color: var(--teal); background: var(--bg-soft);
    border: 1px solid var(--line); border-radius: 10px;
    padding: 11px 14px; margin-bottom: 14px; cursor: pointer;
  }
  .rgp-mega-close span{ font-size: 17px; line-height: 1; }
}
.rgp-mega-inner{
  max-width: 1280px; margin: 0 auto; padding: 24px 20px 28px;
}

/* Cases mega — column grid */
.rgp-mm-cols{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px 24px;
}
.rgp-mm-col{ min-width: 0; }
.rgp-mm-h{
  font-family: 'DM Sans', sans-serif; font-size: 10.5px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--rust); margin-bottom: 8px;
  padding-bottom: 6px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.rgp-mm-count{
  font-size: 10px; color: var(--muted); background: var(--bg-soft);
  padding: 1px 6px; border-radius: 99px; letter-spacing: normal;
}
.rgp-mm-item{
  display: grid; grid-template-columns: 8px 1fr;
  align-items: baseline; gap: 6px 8px;
  padding: 5px 6px; border-radius: 6px;
  text-decoration: none; color: var(--ink-2);
  line-height: 1.35; transition: background .12s ease;
}
.rgp-mm-item:hover{ background: var(--bg-soft); color: var(--ink); }
.rgp-mm-item.is-active{ background: var(--teal-soft); color: var(--teal); font-weight: 600; }
.rgp-mm-item.is-disabled{ opacity: .55; cursor: not-allowed; pointer-events: none; }
.rgp-mm-dot{
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--line-2); margin-top: 6px;
}
.rgp-mm-dot.is-done{ background: var(--g, #15803d); }
.rgp-mm-dot.is-prog{ background: var(--mustard); }
.rgp-mm-name{
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  grid-column: 2 / 3;
}
.rgp-mm-meta{
  grid-column: 2 / 3;
  font-size: 10.5px; color: var(--muted); margin-top: 1px;
}
.rgp-mm-stub{
  font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  background: var(--bg-soft); color: var(--muted);
  padding: 1px 6px; border-radius: 99px;
}

/* Tools mega — single column list */
.rgp-mm-tools{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}
.rgp-mm-tool{
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink); transition: .15s ease;
}
.rgp-mm-tool:hover{ border-color: var(--rust); transform: translateY(-1px); box-shadow: var(--shadow-1); }
.rgp-mm-tool.is-active{ border-color: var(--rust); background: var(--rust-soft); }
.rgp-mm-tool-ic{
  font-size: 22px; flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--bg-soft); display: grid; place-items: center;
}
.rgp-mm-tool b{ font-size: 13px; font-weight: 700; display: block; color: var(--ink); }
.rgp-mm-tool small{ display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }

/* ============ Command palette ============ */
.rgp-palette{
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: flex-start center;
  padding-top: 12vh;
}
.rgp-palette[hidden]{ display: none !important; }
.rgp-palette-backdrop{
  position: absolute; inset: 0; background: rgba(15, 32, 43, .35);
  backdrop-filter: blur(4px); cursor: pointer;
  animation: rgp-fade-in .15s ease;
}
@keyframes rgp-fade-in{ from{ opacity: 0; } to{ opacity: 1; } }
.rgp-palette-shell{
  position: relative;
  width: min(640px, 92vw);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 32, 43, .25), 0 4px 14px rgba(15, 32, 43, .08);
  overflow: hidden;
  animation: rgp-palette-in .18s ease;
}
@keyframes rgp-palette-in{
  from{ opacity: 0; transform: translateY(-8px); }
  to{ opacity: 1; transform: translateY(0); }
}
.rgp-palette-input-wrap{
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.rgp-palette-input-wrap svg{ width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }
.rgp-palette-input{
  flex: 1; font-family: inherit; font-size: 16px; color: var(--ink);
  background: transparent; border: none; outline: none;
}
.rgp-palette-input::placeholder{ color: var(--muted); }
.rgp-palette-input-wrap kbd{
  font-family: inherit; font-size: 10.5px; font-weight: 600;
  color: var(--muted); background: var(--bg-soft); border: 1px solid var(--line);
  padding: 2px 6px; border-radius: 4px; letter-spacing: .05em;
}
.rgp-palette-list{
  max-height: 52vh; overflow-y: auto;
  padding: 8px 0;
}
.rgp-pl-group{
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
  padding: 10px 18px 4px;
}
.rgp-pl-item{
  display: grid; grid-template-columns: 28px 1fr auto;
  align-items: center; gap: 10px;
  padding: 8px 18px;
  text-decoration: none; color: var(--ink); cursor: pointer;
  transition: background .12s ease;
}
.rgp-pl-item:hover, .rgp-pl-item.is-active{
  background: var(--teal-soft); color: var(--teal);
}
.rgp-pl-item.is-active .rgp-pl-key{ color: var(--teal); border-color: var(--teal-3); }
.rgp-pl-type{
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--bg-soft); display: grid; place-items: center;
  font-size: 13px;
}
.rgp-pl-mid b{ font-size: 13.5px; font-weight: 600; display: block; line-height: 1.2; }
.rgp-pl-mid small{ display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.rgp-pl-item.is-active .rgp-pl-mid small{ color: var(--teal-3); }
.rgp-pl-key{
  font-size: 10px; color: var(--muted-2);
  border: 1px solid var(--line-2); padding: 1px 5px; border-radius: 4px;
  opacity: 0; transition: opacity .12s;
}
.rgp-pl-item:hover .rgp-pl-key,
.rgp-pl-item.is-active .rgp-pl-key{ opacity: 1; }
.rgp-pl-empty{
  padding: 30px 20px; text-align: center; color: var(--muted);
  font-size: 13px; font-style: italic;
}
.rgp-palette-foot{
  display: flex; gap: 16px; justify-content: flex-end;
  padding: 8px 14px; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--muted);
  background: var(--surface-2);
}
.rgp-palette-foot kbd{
  font-family: inherit; font-size: 10px; font-weight: 600;
  color: var(--muted); background: var(--bg-soft); border: 1px solid var(--line);
  padding: 1px 4px; border-radius: 3px; margin-right: 3px;
}

/* Print */
@media print{
  .rgp-nav, .rgp-palette { display: none !important; }
  body.rgp-topnav { padding-top: 0; }
}

/* Offset legacy sticky elements (case-head + case-nav) under fixed topnav */
body.rgp-topnav .case-head { top: var(--rgp-nav-h) !important; }
body.rgp-topnav .case-nav  { top: calc(var(--rgp-nav-h) + var(--case-head-h, 64px)) !important; }
/* Smooth-scroll anchor offset so #s1 etc. don't hide behind topnav */
body.rgp-topnav { scroll-padding-top: calc(var(--rgp-nav-h) + 12px); }

/* ============================================
   GLOBAL FOOTER — injected by site.js on every page
   ============================================ */
.rgp-footer{
  margin-top: 80px;
  background: var(--teal);
  color: #d5e6e4;
  border-top: 1px solid var(--teal-2);
}
.rgp-footer-mission{
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--teal-2);
  padding: 56px 0;
}
.rgp-footer-mission-inner{
  max-width: 1100px; margin: 0 auto; padding: 0 28px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px;
  align-items: start;
}
@media (max-width: 820px){ .rgp-footer-mission-inner{ grid-template-columns: 1fr; gap: 32px; } }
.rgp-mv{
  position: relative;
}
.rgp-mv-eyebrow{
  font-size: 11.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--rust);
  margin-bottom: 12px;
}
.rgp-mv h3{
  font-family: 'Source Serif 4', serif; font-weight: 500;
  font-size: clamp(22px, 2.6vw, 30px); line-height: 1.18;
  color: var(--ink); margin: 0 0 14px 0; letter-spacing: -.01em;
}
.rgp-mv h3 em{ font-style: italic; color: var(--teal); font-weight: 500; }
.rgp-mv p{
  font-size: 15px; line-height: 1.62; color: var(--ink-2);
  max-width: 42ch; margin: 0;
}

/* Subscriptions strip */
.rgp-footer-subs{
  background: var(--bg);
  padding: 64px 0;
  border-bottom: 1px solid var(--teal-2);
}
.rgp-footer-subs-inner{
  max-width: 1100px; margin: 0 auto; padding: 0 28px;
}
.rgp-subs-head{
  text-align: center; margin-bottom: 36px;
}
.rgp-subs-head .eyebrow{
  font-size: 11.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--rust); display: block; margin-bottom: 8px;
}
.rgp-subs-head h2{
  font-family: 'Source Serif 4', serif; font-weight: 500;
  font-size: clamp(26px, 3vw, 34px); color: var(--ink); margin: 0 0 8px 0;
  letter-spacing: -.01em;
}
.rgp-subs-head p{
  font-size: 14px; color: var(--muted); margin: 0; max-width: 50ch; margin: 0 auto;
}
.rgp-subs-grid{
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
@media (max-width: 820px){ .rgp-subs-grid{ grid-template-columns: 1fr; } }
.rgp-sub-card{
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 26px 24px 22px;
  display: flex; flex-direction: column; gap: 14px;
  position: relative; transition: .2s ease;
}
.rgp-sub-card:hover{ border-color: var(--teal-3); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.rgp-sub-card.is-featured{
  border-color: var(--rust); background: linear-gradient(180deg, #ffffff 0%, var(--rust-soft) 100%);
}
.rgp-sub-card.is-featured::before{
  content: "Most popular";
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  background: var(--rust); color: #fff; padding: 4px 12px; border-radius: 99px;
}
.rgp-sub-name{
  font-size: 11.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
.rgp-sub-card.is-featured .rgp-sub-name{ color: var(--rust-2); }
.rgp-sub-price{
  font-family: 'Source Serif 4', serif; font-weight: 500;
  font-size: 36px; line-height: 1; color: var(--ink); margin-top: -4px;
}
.rgp-sub-price small{
  font-size: 13px; color: var(--muted); font-weight: 400; font-family: 'DM Sans', sans-serif;
  margin-left: 4px;
}
.rgp-sub-desc{
  font-size: 13px; color: var(--ink-2); line-height: 1.5; min-height: 38px;
}
.rgp-sub-features{
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 7px;
  font-size: 13px; color: var(--ink-2); line-height: 1.45;
}
.rgp-sub-features li{
  padding-left: 22px; position: relative;
}
.rgp-sub-features li::before{
  content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 700;
}
.rgp-sub-features li.is-na{ color: var(--muted-2); }
.rgp-sub-features li.is-na::before{ content: "—"; color: var(--muted-2); }
.rgp-sub-cta{
  margin-top: auto;
  display: inline-block; text-align: center;
  font-size: 13.5px; font-weight: 600; padding: 10px 16px;
  border-radius: 8px; text-decoration: none;
  background: var(--bg-soft); color: var(--ink); border: 1px solid var(--line-2);
  transition: .15s ease;
}
.rgp-sub-cta:hover{ background: var(--ink); color: #f6f2e9; border-color: var(--ink); }
.rgp-sub-card.is-featured .rgp-sub-cta{
  background: var(--rust); color: #fff; border-color: var(--rust);
}
.rgp-sub-card.is-featured .rgp-sub-cta:hover{ background: var(--rust-2); border-color: var(--rust-2); }

/* 4-tier subscriptions + billing toggle */
.rgp-subs-grid-4{ grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1080px){ .rgp-subs-grid-4{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px){ .rgp-subs-grid-4{ grid-template-columns: 1fr; } }
.rgp-bill-toggle{ display:inline-flex; gap:4px; padding:4px; border-radius:999px; background:var(--bg-soft); border:1px solid var(--line); margin:0 auto 24px; }
.rgp-subs{ text-align:center; }
.rgp-subs-grid-4{ text-align:left; }
.rgp-bill-toggle button{ font:inherit; font-size:13.5px; font-weight:700; color:var(--ink-2); background:transparent; border:none; border-radius:999px; padding:8px 18px; cursor:pointer; display:inline-flex; align-items:center; gap:8px; }
.rgp-bill-toggle button.active{ background:var(--teal); color:#f6f2e9; }
.rgp-bill-save{ font-size:10px; font-weight:800; letter-spacing:.03em; text-transform:uppercase; color:var(--mustard,#caa23f); }
.rgp-bill-toggle button.active .rgp-bill-save{ color:#ffe6a8; }
.rgp-tier-badge{ font-size:12px; font-weight:800; letter-spacing:.02em; color:var(--ink); margin-bottom:8px; }
.rgp-tier-bronze .rgp-tier-badge{ color:#9a6a3a; }
.rgp-tier-silver .rgp-tier-badge{ color:#6b7280; }
.rgp-tier-gold .rgp-tier-badge{ color:#b8860b; }
.rgp-tier-platinum .rgp-tier-badge{ color:#3f5c93; }
.rgp-sub-flag{ position:absolute; top:-10px; right:16px; font-size:10px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; color:#fff; background:var(--rust); border-radius:999px; padding:3px 11px; }
.rgp-sub-price .price-y{ display:none; }
.rgp-subs.bill-yearly .rgp-sub-price .price-m{ display:none; }
.rgp-subs.bill-yearly .rgp-sub-price .price-y{ display:inline; }
.rgp-sub-price-note{ font-size:11.5px; color:var(--muted); font-weight:600; margin:6px 0 0; min-height:1em; }
.rgp-sub-price-note .price-y{ display:none; }
.rgp-subs.bill-yearly .rgp-sub-price-note .price-m{ display:none; }
.rgp-subs.bill-yearly .rgp-sub-price-note .price-y{ display:inline; }
.rgp-tier-platinum.is-featured::before{ content:"Best value"; }

/* Main footer columns */
.rgp-footer-cols{
  max-width: 1100px; margin: 0 auto; padding: 56px 28px 28px;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 48px;
}
@media (max-width: 820px){ .rgp-footer-cols{ grid-template-columns: 1fr 1fr; gap: 36px; } }
@media (max-width: 540px){ .rgp-footer-cols{ grid-template-columns: 1fr; } }
.rgp-foot-brand{ display: flex; flex-direction: column; gap: 14px; }
.rgp-foot-brand-row{ display: flex; align-items: center; gap: 12px; }
.rgp-foot-mark{
  width: 40px; height: 40px; border-radius: 10px;
  background: #f3ede0; color: var(--teal);
  display: grid; place-items: center;
  font-family: 'Source Serif 4', serif; font-weight: 600; font-size: 20px;
  position: relative;
}
.rgp-foot-mark::after{
  content: ""; position: absolute; right: -3px; bottom: -3px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--rust);
  border: 2px solid var(--teal);
}
.rgp-foot-brand-name{ font-family: 'Source Serif 4', serif; font-weight: 500; font-size: 19px; color: #f3ede0; line-height: 1.1; }
.rgp-foot-brand-tag{ font-size: 11px; color: var(--teal-soft); letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }
.rgp-foot-about{
  font-size: 13px; line-height: 1.65; color: #d5e6e4; max-width: 36ch; margin: 0;
}
.rgp-foot-col h5{
  font-family: 'DM Sans', sans-serif; font-size: 11.5px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: #f3ede0;
  margin: 0 0 14px 0;
}
.rgp-foot-col ul{ list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rgp-foot-col a{
  font-size: 13.5px; color: #d5e6e4; text-decoration: none;
  transition: color .12s ease;
}
.rgp-foot-col a:hover{ color: #fff; text-decoration: underline; }

/* Connect column */
.rgp-foot-connect-links{ display: flex; flex-direction: column; gap: 10px; }
.rgp-foot-link{
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; color: #d5e6e4; text-decoration: none;
  padding: 8px 10px; border-radius: 8px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  transition: .15s ease;
}
.rgp-foot-link:hover{ background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }
.rgp-foot-link svg{ width: 16px; height: 16px; flex-shrink: 0; }
.rgp-foot-link-text{ display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rgp-foot-link-text small{ font-size: 10.5px; color: var(--teal-soft); text-transform: uppercase; letter-spacing: .06em; }
.rgp-foot-link-text b{ font-weight: 600; font-size: 13px; color: #fff; }

/* Trust strip */
.rgp-foot-trust{
  max-width: 1100px; margin: 0 auto; padding: 18px 28px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--teal-soft); letter-spacing: .03em;
}
.rgp-foot-trust b{ color: #f3ede0; font-weight: 600; }
.rgp-foot-trust-dot{ width: 4px; height: 4px; border-radius: 50%; background: var(--teal-soft); opacity: .5; }

/* Bottom bar */
.rgp-foot-bottom{
  border-top: 1px solid rgba(255,255,255,.08);
}
.rgp-foot-bottom-inner{
  max-width: 1100px; margin: 0 auto; padding: 18px 28px;
  display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--teal-soft);
}
.rgp-foot-bottom-links{ display: flex; gap: 18px; flex-wrap: wrap; }
.rgp-foot-bottom-links a{ color: var(--teal-soft); text-decoration: none; }
.rgp-foot-bottom-links a:hover{ color: #fff; text-decoration: underline; }

/* Top nav section direct-link buttons (SCA, Leaflets, CPD, Audios, Updates, EBM) */
.rgp-nav-sect{ gap: 4px; padding-left: 10px; padding-right: 10px; }
.rgp-nav-sect-ic{ font-size: 14px; line-height: 1; }
.rgp-nav-btn.rgp-nav-sect.is-active{
  background: var(--teal-soft); color: var(--teal); font-weight: 700;
}
@media (max-width: 1180px){
  .rgp-nav-sect span:not(.rgp-nav-sect-ic){ display: none; }
  .rgp-nav-sect{ padding: 8px 9px; }
}

/* Auth buttons */
.rgp-auth{ display: inline-flex; gap: 6px; margin-left: 4px; }
.rgp-auth-btn{
  font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 7px 13px; border-radius: 8px; cursor: pointer;
  transition: .15s ease; line-height: 1.1;
}
.rgp-auth-signin{
  background: transparent; color: var(--ink); border: 1px solid var(--line-2);
}
.rgp-auth-signin:hover{ border-color: var(--teal); color: var(--teal); }
.rgp-auth-signup{
  background: var(--teal); color: #f6f2e9; border: 1px solid var(--teal);
}
.rgp-auth-signup:hover{ background: var(--teal-2); border-color: var(--teal-2); }

@media (max-width: 820px){ .rgp-auth-signin{ display: none; } }

/* Auth modal */
.rgp-auth-modal{
  position: fixed; inset: 0; z-index: 220;
  display: grid; place-items: flex-start center;
  padding-top: 9vh;
}
.rgp-auth-modal[hidden]{ display: none !important; }
.rgp-auth-backdrop{
  position: absolute; inset: 0; background: rgba(15,32,43,.45);
  backdrop-filter: blur(6px); cursor: pointer; animation: rgp-fade-in .15s ease;
}
.rgp-auth-shell{
  position: relative; width: min(420px, 92vw);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15,32,43,.3), 0 4px 14px rgba(15,32,43,.1);
  overflow: hidden; padding: 32px 28px 22px;
  animation: rgp-palette-in .18s ease;
}
.rgp-auth-close{
  position: absolute; top: 10px; right: 14px;
  width: 30px; height: 30px; border-radius: 8px;
  background: transparent; border: none; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--muted);
}
.rgp-auth-close:hover{ background: var(--bg-soft); color: var(--ink); }
.rgp-auth-tabs{
  display: flex; gap: 4px; background: var(--bg-soft); padding: 4px;
  border-radius: 10px; margin-bottom: 22px;
}
.rgp-auth-tab{
  flex: 1; font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 8px 10px; border: none; background: transparent; border-radius: 7px;
  cursor: pointer; color: var(--muted); transition: .15s;
}
.rgp-auth-tab.active{ background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.rgp-auth-form h3{
  font-family: 'Source Serif 4', serif; font-weight: 500;
  font-size: 22px; margin: 0 0 4px 0; color: var(--ink);
}
.rgp-auth-sub{ font-size: 13px; color: var(--muted); margin: 0 0 16px 0; }
.rgp-auth-form label{
  display: block; font-size: 12px; font-weight: 600; color: var(--ink-2);
  margin-bottom: 12px;
}
.rgp-auth-form input[type="email"],
.rgp-auth-form input[type="password"],
.rgp-auth-form input[type="text"]{
  display: block; width: 100%; margin-top: 5px;
  font-family: inherit; font-size: 14px;
  padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); outline: none;
  transition: border-color .15s ease;
}
.rgp-auth-form input:focus{ border-color: var(--teal-3); }
.rgp-auth-check{
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px; font-weight: 400; color: var(--ink-2); line-height: 1.5;
}
.rgp-auth-check input{ margin-top: 3px; accent-color: var(--teal); }
.rgp-auth-check a{ color: var(--teal-2); }
.rgp-auth-submit{
  width: 100%; margin-top: 14px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 11px 16px; border-radius: 8px; cursor: pointer;
  background: var(--teal); color: #f6f2e9; border: 1px solid var(--teal);
  transition: .15s ease;
}
.rgp-auth-submit:hover{ background: var(--teal-2); }
.rgp-auth-forgot{
  display: block; margin-top: 12px; text-align: center;
  font-size: 12px; color: var(--teal-2); text-decoration: none;
}
.rgp-auth-forgot:hover{ color: var(--rust); }
.rgp-auth-done{ text-align: center; padding: 10px 0; }
.rgp-auth-done-ic{
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--teal); color: #f6f2e9; font-size: 28px;
  margin: 0 auto 14px; display: grid; place-items: center;
}
.rgp-auth-done h3{
  font-family: 'Source Serif 4', serif; font-weight: 500; font-size: 22px;
  color: var(--ink); margin: 0 0 8px 0;
}
.rgp-auth-done p{ font-size: 13.5px; color: var(--ink-2); line-height: 1.5; margin: 0 0 18px 0; }
.rgp-auth-foot{
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted); text-align: center;
}
.rgp-auth-foot a{ color: var(--teal-2); font-weight: 600; text-decoration: none; }
.rgp-auth-foot a:hover{ color: var(--rust); }

/* Language switcher + RTL support */
.rgp-lang{ position: relative; margin-left: 4px; }
.rgp-lang-btn{
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 7px 9px; cursor: pointer; transition: .15s ease;
}
.rgp-lang-btn:hover{ border-color: var(--teal-3); color: var(--teal); }
.rgp-lang-btn[aria-expanded="true"]{ background: var(--teal-soft); color: var(--teal); border-color: var(--teal-soft); }
.rgp-lang-flag{ font-size: 16px; line-height: 1; }
.rgp-lang-code{ font-size: 11px; letter-spacing: .04em; }
.rgp-lang-menu{
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-2);
  min-width: 200px; padding: 6px;
  z-index: 110; display: flex; flex-direction: column; gap: 2px;
  animation: rgp-mega-in .15s ease;
}
.rgp-lang-menu[hidden]{ display: none !important; }
.rgp-lang-opt{
  display: flex; align-items: center; gap: 10px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--ink-2);
  background: transparent; border: none; border-radius: 6px;
  padding: 8px 10px; cursor: pointer; text-align: left;
  transition: .12s ease;
}
.rgp-lang-opt:hover{ background: var(--bg-soft); color: var(--ink); }
.rgp-lang-opt-flag{ font-size: 18px; line-height: 1; flex-shrink: 0; }
.rgp-lang-opt-name{ flex: 1; }
.rgp-lang-opt-rtl{
  font-size: 9.5px; font-weight: 700; letter-spacing: .08em;
  color: var(--rust); background: var(--rust-soft); padding: 1px 5px; border-radius: 4px;
}
.rgp-lang-translate-btn{
  margin-top: 4px; border-top: 1px solid var(--line); padding-top: 8px;
  display: flex; align-items: center; gap: 8px;
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--rust);
  background: transparent; border: none; border-radius: 6px;
  padding: 10px; cursor: pointer; text-align: left;
}
.rgp-lang-translate-btn:hover{ background: var(--rust-soft); color: var(--rust-2); }
.rgp-lang-translate-btn::before{ content: "🌐"; }

/* Generic content page (cpd / audios / updates / ebm) */
body.rgp-rtl{ direction: rtl; }
body.rgp-rtl .rgp-nav-row{ flex-direction: row-reverse; }
body.rgp-rtl .rgp-primary{ flex-direction: row-reverse; }
body.rgp-rtl .rgp-brand{ flex-direction: row-reverse; }
body.rgp-rtl .rgp-search{ flex-direction: row-reverse; margin-left: 0; margin-right: auto; }
body.rgp-rtl .rgp-lang-menu{ right: auto; left: 0; }
body.rgp-rtl .rgp-mega-inner{ direction: rtl; }
body.rgp-rtl .rgp-mm-item{ grid-template-columns: 1fr 8px; }
body.rgp-rtl .rgp-mm-item .rgp-mm-name,
body.rgp-rtl .rgp-mm-item .rgp-mm-meta{ grid-column: 1 / 2; text-align: right; }
body.rgp-rtl .rgp-mm-h{ text-align: right; }
body.rgp-rtl .rgp-foot-brand-row{ flex-direction: row-reverse; }
body.rgp-rtl .rgp-foot-mark::after{ right: auto; left: -3px; }
body.rgp-rtl .rgp-foot-link{ flex-direction: row-reverse; text-align: right; }
body.rgp-rtl .rgp-foot-trust{ flex-direction: row-reverse; }
body.rgp-rtl .rgp-foot-bottom-inner{ flex-direction: row-reverse; }
body.rgp-rtl .rgp-foot-bottom-links{ flex-direction: row-reverse; }
body.rgp-rtl .rgp-subs-grid{ direction: rtl; }
body.rgp-rtl .rgp-sub-card{ text-align: right; }
body.rgp-rtl .rgp-sub-features li{ padding-left: 0; padding-right: 22px; }
body.rgp-rtl .rgp-sub-features li::before{ left: auto; right: 0; }
body.rgp-rtl .case-head{ flex-direction: row-reverse; }
body.rgp-rtl .case-head-tags{ flex-direction: row-reverse; }
/* Mode toggle stays LTR even in RTL — emojis/icons read same */
body.rgp-rtl .rgp-mode{ direction: ltr; }
/* Search palette + auth modal keep LTR for input correctness */
body.rgp-rtl .rgp-palette-shell,
body.rgp-rtl .rgp-auth-shell{ direction: ltr; }
.page-hero{
  background: linear-gradient(135deg, var(--bg-soft) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  padding: 56px 0;
}
.page-hero-inner{ max-width: 980px; margin: 0 auto; padding: 0 28px; }
.page-hero .eyebrow{
  font-size: 11.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--rust); margin-bottom: 14px; display: block;
}
.page-hero h1{
  font-family: 'Source Serif 4', serif; font-weight: 500;
  font-size: clamp(32px, 4vw, 48px); line-height: 1.1; color: var(--ink);
  margin-bottom: 16px; letter-spacing: -.02em;
}
.page-hero h1 em{ font-style: italic; color: var(--teal); font-weight: 500; }
.page-hero p{
  font-size: 16px; color: var(--ink-2); line-height: 1.6; max-width: 60ch; margin: 0;
}
.page-body{ max-width: 1100px; margin: 0 auto; padding: 56px 28px; }
.page-section{ margin-bottom: 56px; }
.page-section h2{
  font-family: 'Source Serif 4', serif; font-weight: 500;
  font-size: clamp(22px, 2.6vw, 28px); color: var(--ink);
  margin-bottom: 18px; letter-spacing: -.01em;
}
.page-section h2 .eyebrow{
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--rust); display: block; margin-bottom: 6px;
  font-family: 'DM Sans', sans-serif;
}
.page-grid{
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px;
}
.page-card{
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px 22px 20px; transition: .2s ease;
}
.page-card:hover{ border-color: var(--teal-3); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.page-card-eyebrow{
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--rust); margin-bottom: 6px;
}
.page-card h3{
  font-family: 'DM Sans', sans-serif; font-size: 16px; font-weight: 700;
  color: var(--ink); margin: 0 0 8px 0;
}
.page-card p{ font-size: 13.5px; color: var(--ink-2); line-height: 1.55; margin: 0 0 12px 0; }
.page-card-meta{ font-size: 12px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.page-card-meta b{ color: var(--ink-2); }
.page-card-cta{
  display: inline-block; margin-top: 12px;
  font-size: 12.5px; font-weight: 600; color: var(--teal-2);
  text-decoration: none;
}
.page-card-cta:hover{ color: var(--rust); }
