/* File: /htdocs/assets/site.css */

/* ============================================================
   Design Tokens (Colors, Radii, Shadows)
============================================================ */
:root{
  --bg: #0b1220;
  --panel: #0f1b33;
  --panel2: #0c162b;
  --text: #e8eefc;
  --muted: #a8b4d3;
  --line: rgba(255,255,255,.10);
  --brand: #26c281; /* green */
  --brand2: #1ea06a;
  --shadow: 0 14px 40px rgba(0,0,0,.35);
  --radius: 18px;

  /* Button feel */
  --btn-glow: 0 0 0 3px rgba(38,194,129,.14);
  --btn-shadow: 0 10px 26px rgba(0,0,0,.32);
  --btn-shadow-hover: 0 16px 34px rgba(0,0,0,.42);
  --btn-glow-hover: 0 0 0 3px rgba(38,194,129,.18), 0 10px 30px rgba(38,194,129,.12);

  /* Card hover feel (match button hover hue/glow) */
  --card-glow-hover: 0 0 0 3px rgba(38,194,129,.14), 0 14px 34px rgba(0,0,0,.42), 0 10px 30px rgba(38,194,129,.10);
  --card-bg-hover: linear-gradient(135deg, rgba(38,194,129,.12) 0%, rgba(255,255,255,.02) 65%, rgba(255,255,255,.01) 100%);
}

/* ============================================================
   Base Reset + Document Layout
============================================================ */
*{ box-sizing:border-box; }

html, body{
  margin: 0;
  padding: 0;
  height: 100%;
}

body{
  display: flex;
  flex-direction: column;
  min-height: 100vh;

  background:
    radial-gradient(1200px 800px at 20% 0%, #13264d 0%, transparent 60%),
    linear-gradient(180deg, #0b1220 0%, #081024 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;

  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.container{ width:min(1100px, calc(100% - 32px)); margin: 0 auto; }

/* ============================================================
   Links (Global)
============================================================ */
a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; }

/* ✅ IMPORTANT: anchors that are cards should never underline on hover */
a.card:hover,
a.card:hover * ,
a.card:focus,
a.card:focus * ,
a.card:active,
a.card:active *{
  text-decoration: none !important;
}

/* ============================================================
   Topbar / Header Navigation
============================================================ */
.topbar{
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11,18,32,.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 0;
}

/* Brand (full horizontal logo image) */
.brand{
  display:flex;
  align-items:center;
  text-decoration:none !important;
}
.brand-full{
  height: 46px;
  width: auto;
  display:block;
  transition: opacity .15s ease;
}
.brand:hover .brand-full{ opacity: .85; }

/* Nav */
.nav{ display:flex; gap:14px; align-items:center; }
.nav a{
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
}
.nav a:hover{
  color: var(--text);
  border-color: var(--line);
  text-decoration:none;
}

/* ============================================================
   Main Content Area
============================================================ */
main.container{
  flex: 1;
  padding: 22px 0 60px;
}

/* ============================================================
   Utility Classes
============================================================ */
.muted{ color: var(--muted); }

.section{ margin-top: 26px; }
.section-head{ display:flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.section-head h1, .section-head h2{ margin:0; }
.muted-link{ color: var(--muted); }
.muted-link:hover{ color: var(--text); text-decoration:none; }

/* ============================================================
   Cards (Base + Interactive Behavior)
============================================================ */
.card-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
@media (max-width: 900px){
  .card-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px){
  .card-grid{ grid-template-columns: 1fr; }
  .nav{ gap:8px; flex-wrap: wrap; justify-content:flex-end; }
}

.card{
  display:block;
  padding: 16px;

  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border: 1px solid var(--line);
  border-radius: var(--radius);

  box-shadow: none;
  transform: translateY(0);

  transition:
    transform .14s ease,
    border-color .16s ease,
    background .16s ease,
    box-shadow .16s ease;
  will-change: transform;
}

/* Hover/active/focus effects ONLY for interactive cards */
a.card:hover,
button.card:hover,
.card[role="button"]:hover{
  transform: translateY(-2px);
  border-color: rgba(38,194,129,.55);
  background: var(--card-bg-hover);
  box-shadow: var(--card-glow-hover);
  text-decoration:none;
}
a.card:active,
button.card:active,
.card[role="button"]:active{
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,.40);
}
a.card:focus-visible,
button.card:focus-visible,
.card[role="button"]:focus-visible{
  outline: none;
  border-color: rgba(38,194,129,.70);
  box-shadow: 0 0 0 3px rgba(38,194,129,.16), 0 14px 34px rgba(0,0,0,.42);
}

/* Card text helpers */
.card-kicker{ color: var(--muted); font-size: 13px; }
.card-title{ margin-top: 6px; font-weight: 750; letter-spacing: -.15px; }
.card-excerpt{ margin-top: 8px; color: var(--muted); }
.card-tags{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* Tag pill used across site */
.tag{
  display:inline-block;
  font-size: 12px;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  padding: 5px 8px;
  border-radius: 999px;
}

/* ============================================================
   Glossary Cards (Accordion list on /glossary.php)
============================================================ */
.glossary-card{
  cursor: pointer;
}

/* Hover feel */
.glossary-card:hover{
  transform: translateY(-2px);
  border-color: rgba(38,194,129,.55);
  background: var(--card-bg-hover);
  box-shadow: var(--card-glow-hover);
}

/* Pressed feel */
.glossary-card:active{
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,.40);
}

/* Keyboard focus: style the card when the inner button is focused */
.glossary-card:focus-within{
  border-color: rgba(38,194,129,.70);
  box-shadow: 0 0 0 3px rgba(38,194,129,.16), 0 14px 34px rgba(0,0,0,.42);
}

/* Glossary Page Only – Left-align tags inside glossary cards */
.glossary-card .card-tags{
  justify-content: flex-start; /* was "left" (invalid for flex) */
}

/* ============================================================
   Filters (Search + Select Row)
============================================================ */

/* Base filter row */
.filters{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* Split variant used by Articles/Guides/Certifications */
.filters.filters-split{
  justify-content: space-between;
}

.filters-left{
  display:flex;
  align-items:center;
  gap: 10px;
}

.filters-right{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0; /* allow input to shrink properly */
}

/* Inputs / selects */
.input, .select{
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text);
  outline: none;
}

/* Default input sizing (general usage) */
.input{
  width: 100%;
  max-width: 360px;
}

/* Select sizing */
.select{ min-width: 180px; }

/* ✅ Responsive, longer search box for filter bars (Articles/Guides/Certifications)
   - grows with available space
   - caps at a comfortable max width
*/
.filters-right .input{
  flex: 1 1 520px;     /* target "200% longer" feel vs old ~260–360px */
  width: auto;
  max-width: 720px;    /* prevents absurdly wide on huge screens */
  min-width: 260px;    /* keeps usability on medium widths */
}

/* Keep filter controls from collapsing weirdly */
.filters-left{
  flex: 0 0 auto;
}
.filters-right{
  flex: 1 1 460px;
  justify-content: flex-end;
}

/* ============================================================
   Glossary Filters Layout Fix
============================================================ */

[data-filters="glossary"]{
  display: block;
}

[data-filters="glossary"] .filters-left{
  width: 100%;
  margin-bottom: 14px;
}

[data-filters="glossary"] .filters-right{
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
}

/* Make search box consistent width */
[data-filters="glossary"] .filters-right .input{
  width: 420px;
  max-width: 100%;
}

/* Ensure native dropdown menu has correct contrast */
.select{
  color-scheme: dark;
  background-color: rgba(15,27,51,.92);
  border-color: var(--line);
  color: var(--text);
}
.select option{
  background-color: #0f1b33;
  color: var(--text);
}
.select option:checked{
  background-color: #13264d;
  color: var(--text);
}
.select optgroup{
  background-color: #0f1b33;
  color: var(--muted);
}

/* Small screens: stack controls cleanly */
@media (max-width: 620px){
  .filters{
    flex-direction: column;
    align-items: stretch;
  }
  .filters-left,
  .filters-right{
    width: 100%;
  }
  .filters-right{
    justify-content: flex-end;
  }
  .filters-right .input{
    max-width: none;   /* allow full width on mobile */
    min-width: 0;
  }
}

/* ============================================================
   Buttons
============================================================ */
.btn,
a.btn{
  height: 40px;
  border-radius: 12px;
  padding: 0 14px;

  display:inline-flex;
  align-items:center;
  justify-content:center;

  border: 1px solid transparent;

  background: linear-gradient(135deg, rgba(38,194,129,1) 0%, rgba(30,160,106,1) 100%);
  color: #06101d;

  font: inherit;
  font-weight: 800;
  line-height: 1;

  cursor: pointer;
  user-select: none;
  white-space: nowrap;

  box-shadow: var(--btn-shadow);
  transform: translateY(0);
  transition:
    transform .14s ease,
    box-shadow .16s ease,
    border-color .16s ease,
    background-position .18s ease,
    opacity .16s ease;

  will-change: transform;
  text-decoration: none;
}

.btn:hover,
a.btn:hover{
  text-decoration:none;
  transform: translateY(-2px);
  box-shadow: var(--btn-shadow-hover), var(--btn-glow-hover);
}

.btn:active,
a.btn:active{
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,.40);
}

.btn:focus-visible,
a.btn:focus-visible{
  outline: none;
  box-shadow: var(--btn-shadow-hover), var(--btn-glow);
}

/* Ghost */
.btn-ghost,
a.btn-ghost{
  background: transparent;
  border-color: var(--line);
  color: var(--text);
  font-weight: 700;
  box-shadow: none;
}

.btn-ghost:hover,
a.btn-ghost:hover{
  text-decoration:none;
  transform: translateY(-2px);
  border-color: rgba(38,194,129,.55);
  background: rgba(38,194,129,.14);
  box-shadow: 0 12px 30px rgba(0,0,0,.40), 0 0 0 3px rgba(38,194,129,.12);
}

.btn-ghost:active,
a.btn-ghost:active{
  transform: translateY(-1px);
}

.btn-ghost:focus-visible,
a.btn-ghost:focus-visible{
  outline: none;
  border-color: rgba(38,194,129,.70);
  box-shadow: 0 0 0 3px rgba(38,194,129,.16);
}

/* Disabled */
.btn:disabled,
.btn[aria-disabled="true"],
a.btn[aria-disabled="true"]{
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  pointer-events: none;
}

/* ============================================================
   Page Meta Pills (Breadcrumb / Tag Row)
============================================================ */
.breadcrumbs{ display:flex; gap:8px; align-items:center; flex-wrap: wrap; }
.meta-row{ display:flex; gap:10px; flex-wrap: wrap; margin-top: 10px; }
.meta-pill{
  display:inline-flex;
  align-items:center;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,.02);
  font-size: 13px;
}
.meta-link{ color: var(--text); }
.meta-link:hover{ text-decoration:none; border-color: rgba(38,194,129,.55); }

/* ============================================================
   Tables (Articles/Guides Lists)
============================================================ */
.topic-table{
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}
.topic-table th,
.topic-table td{
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.topic-table th{
  text-align: left;
  font-weight: 800;
  color: var(--text);
  font-size: 14px;
  letter-spacing: -.1px;
}
.topic-table td{ color: var(--text); }
.topic-table a{ text-decoration: none; }
.topic-table a:hover{ text-decoration: underline; }

/* Mobile: allow horizontal scroll instead of crushing columns */
@media (max-width: 620px){
  .topic-table{
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .topic-table th,
  .topic-table td{
    white-space: nowrap;
  }
}

/* ============================================================
   Prose Blocks (Article/Guide Content)
============================================================ */
.prose{
  margin-top: 14px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.02);
}
.prose h2{ margin: 18px 0 8px; }
.prose p, .prose li{ color: var(--text); }
.prose p{ margin: 10px 0; }
.prose ul{ margin: 10px 0 10px 18px; }

/* ============================================================
   Homepage Components
============================================================ */
.home-hero{ margin-top: 10px; }

.home-hero-inner{
  display:grid;
  grid-template-columns: 1.45fr .85fr;
  gap: 14px;
}
@media (max-width: 900px){
  .home-hero-inner{ grid-template-columns: 1fr; }
}

.home-hero-copy{
  background: linear-gradient(180deg, rgba(38,194,129,.12), rgba(255,255,255,.02));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.home-hero-copy h1{
  margin: 0 0 10px;
  font-size: 34px;
  letter-spacing: -.35px;
}

.home-hero-actions{
  display:flex;
  gap:12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.home-topics{ margin-top: 16px; }
.home-topics-label{ font-size: 13px; margin-bottom: 8px; }
.home-topics-chips{ display:flex; gap:10px; flex-wrap: wrap; }

.chip{
  display:inline-flex;
  align-items:center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.02);
  color: var(--text);
  font-size: 13px;
  text-decoration:none !important;
  transition: transform .14s ease, border-color .14s ease, background .14s ease, box-shadow .14s ease;
}
.chip:hover{
  border-color: rgba(38,194,129,.45);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0,0,0,.28);
}

.home-hero-panel{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(255,255,255,.02);
}
.home-hero-panel-title{ font-weight: 800; margin-bottom: 10px; }
.home-hero-panel-cards{ display:grid; gap: 10px; }

.mini-card{
  display:block;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.02);
  text-decoration:none !important;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
.mini-card:hover{
  border-color: rgba(38,194,129,.40);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0,0,0,.32);
}
.mini-card-title{ font-weight: 800; }
.mini-card-text{ margin-top: 6px; }

.home-cta{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: linear-gradient(135deg, rgba(38,194,129,.10), rgba(255,255,255,.02));
}
.home-cta-title{ font-weight: 900; font-size: 18px; }
.home-cta-text{ margin-top: 6px; }
.home-cta-actions{
  margin-top: 12px;
  display:flex;
  gap: 12px;
  flex-wrap: wrap;
}

.home-min-hero{ margin-top: 10px; }

.home-min-hero-inner{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  background: linear-gradient(180deg, rgba(38,194,129,.10), rgba(255,255,255,.02));
  box-shadow: var(--shadow);
}

.home-min-hero-inner h1{
  margin: 0 0 10px;
  font-size: 36px;
  letter-spacing: -.4px;
}

.home-min-actions{
  display:flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.home-min-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
@media (max-width: 900px){
  .home-min-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px){
  .home-min-grid{ grid-template-columns: 1fr; }
}

.home-min-note{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(255,255,255,.02);
}
.home-min-note-title{
  font-weight: 900;
  margin-bottom: 8px;
}

/* Hero split layout */
.home-min-hero-split{
  display:grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 18px;
  align-items: center;
}
.home-min-hero-copy{ min-width: 0; }
.home-min-hero-visual{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  opacity: .95;
}
@media (max-width: 900px){
  .home-min-hero-split{ grid-template-columns: 1fr; }
  .home-min-hero-visual{ justify-content:flex-start; }
}

/* Diagram sizing */
.ca-hero-diagram{
  width: min(420px, 100%);
  height: auto;
  display:block;
  filter: drop-shadow(0 18px 40px rgba(0,0,0,.35));
  opacity: .85;
}

/* Optional animation (Option B only) */
.ca-hero-diagram-anim .ca-flow{
  animation: caDash 3.5s linear infinite;
}
.ca-hero-diagram-anim .ca-flow-ion{
  animation-duration: 4.5s;
}
@keyframes caDash{
  to { stroke-dashoffset: -48; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .ca-hero-diagram-anim .ca-flow{ animation: none; }
}

/* ============================================================
   Notice Panel (Contact page)
============================================================ */
.notice-panel{
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: linear-gradient(135deg, rgba(38,194,129,.08), rgba(255,255,255,.02));
}
.notice-title{ font-weight: 900; margin-bottom: 8px; }
.notice-text{ font-size: 14px; }

/* ============================================================
   Footer
============================================================ */
.footer{
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,.25);
  margin-top: 40px;
}
.footer-inner{
  padding: 30px 0;
  display:flex;
  gap: 40px;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-col{
  min-width: 200px;
  max-width: 320px;
}

.footer-title{
  font-weight: 800;
  margin-bottom: 10px;
}

.footer-text{
  font-size: 14px;
  line-height: 1.6;
}

.footer-note{
  margin-top: 8px;
  font-size: 13px;
}

.footer-links{
  display:flex;
  flex-direction:column;
  gap: 6px;
}
.footer-links a{
  color: var(--muted);
  text-decoration:none;
}
.footer-links a:hover{
  color: var(--text);
}

.footer-right{
  display:flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 22px;
}

.footer-legal{
  display:flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content:flex-end;
}

.footer-legal a{
  color: var(--muted);
  text-decoration: none;
}
.footer-legal a:hover{
  color: var(--text);
}

.footer-risk{
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}

.footer-bottom{
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.footer-bottom-inner{
  display:flex;
  justify-content:flex-start;
}

/* ============================================================
   Glossary Term Page (single term pages)
============================================================ */
.glossary-term {
  padding: 32px 36px;
}
.glossary-term h1 {
  margin-top: 0;
  margin-bottom: 24px;
}
.glossary-term p {
  text-align: justify;
  text-justify: inter-word;
}
.glossary-figure {
  text-align: center;
  margin-top: 32px;
}
.glossary-figure img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.glossary-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

/* ============================================================
   Formula Pages (Official Formula Page Standard)
============================================================ */
.ca-formula{ display:grid; gap:14px; }

.ca-card{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.ca-h2{ margin:0 0 10px 0; font-size:1.15rem; }
.ca-lead{ margin:0; line-height:1.55; }
.ca-muted, .ca-note{ color: var(--muted); font-size:.95rem; }
.ca-note{ margin-top:10px; }

/* ============================================================
   Tables: right-align the last "action" column (e.g., Open)
   Applies site-wide to CA tables (and optionally topic tables)
============================================================ */

/* CA tables (your Related formulas/practice/tests tables use these) */
.ca-table thead th:last-child,
.ca-table tbody td:last-child{
  text-align: right;
  white-space: nowrap;
  width: 1%;           /* shrink-to-fit so the column stays tight */
}

/* If the last cell contains a button/link, keep it pinned right */
.ca-table tbody td:last-child > a,
.ca-table tbody td:last-child > button{
  margin-left: auto;
}

/* OPTIONAL: if you also want this behavior on your list tables */
.topic-table th:last-child,
.topic-table td:last-child{
  text-align: right;
  white-space: nowrap;
  width: 1%;
}

.ca-table-wrap{ overflow-x:auto; border-radius:14px; border:1px solid var(--line); }
.ca-table{ width:100%; border-collapse:collapse; min-width:720px; }
.ca-table th, .ca-table td{
  padding:10px 12px;
  border-bottom:1px solid var(--line);
  text-align:left;
  vertical-align:top;
}
.ca-table thead th{ background: rgba(255,255,255,.04); font-weight:650; }

.ca-formula-block{ margin-top:12px; padding-top:12px; border-top:1px solid var(--line); }
.ca-formula-title{ font-weight:750; margin-bottom:8px; }

.ca-defs{ display:grid; gap:6px; margin-top:10px; color: var(--muted); }

.ca-callout{
  margin-top:12px;
  padding:10px 12px;
  border-radius:14px;
  background: rgba(38,194,129,.08);
  border: 1px solid rgba(38,194,129,.22);
}

.ca-problem{ margin-top:12px; padding-top:12px; border-top:1px solid var(--line); }
.ca-problem-head{ font-weight:800; margin-bottom:6px; }

.ca-solution{
  margin-top:10px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius:14px;
  padding:12px;
}

.ca-answer{
  margin-top:10px;
  padding-top:10px;
  border-top:1px dashed var(--line);
}

.ca-list{ margin:0; padding-left:18px; }
.ca-list li{ margin: 6px 0; }

@media (max-width: 720px){
  .ca-card{ padding:14px; }
  .ca-table{ min-width:640px; }
}

/* ============================================================
   Professional Reference Table (Formula Pages)
============================================================ */
.ca-table-ref th {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: .3px;
}

.ca-table-ref .th-sub {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--muted);
}

.ca-table-ref td,
.ca-table-ref th {
  padding: 12px 14px;
}

.ca-table-ref tbody tr {
  transition: background .15s ease;
}

.ca-table-ref tbody tr:hover {
  background: rgba(255,255,255,.04);
}

.ca-table-ref .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ca-table-ref .muted {
  color: var(--muted);
}

@media (max-width: 720px){
  .ca-table-ref {
    min-width: 640px;
  }
}

/* Worked example: step divider (underlined separation) */
.ca-solution-steps .ca-solve-rule{
  height: 1px;
  background: rgba(255,255,255,.18);
  margin: 10px 0 12px;
  border-radius: 1px;
}

/* ============================================================
   Visual Guides Grid + Cards (List page tiles)
============================================================ */
.cards-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
  margin:18px 0 28px;
}
@media (max-width: 980px){
  .cards-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 640px){
  .cards-grid{ grid-template-columns:1fr; }
}

.card-guide .card-media{
  display:block;
  border-bottom:1px solid var(--line);
  overflow:hidden;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}
.card-guide .card-media img{
  display:block;
  width:100%;
  height:180px;
  object-fit:cover;
}

/* Center Visual Guide titles */
.card-guide .card-title{
  text-align: center;
}

/* Your Visual Guides summary paragraphs use <p class="muted"> */
.card-guide p.muted{
  text-align:center;
  margin: 12px auto 0;
  max-width: 34ch;
}

/* Make Visual Guide grid cards feel clickable (hover effects come from a.card:hover above) */
a.card.card-guide{
  cursor: pointer;
  text-decoration: none !important;

  transition:
    transform .14s ease,
    border-color .16s ease,
    background .16s ease,
    box-shadow .16s ease;

  will-change: transform;
  -webkit-tap-highlight-color: transparent;
}

/* Entire card clickable; inner content not individually interactive */
.card-guide *{ pointer-events: none; }
a.card.card-guide{ pointer-events: auto; }

/* Optional: accessible focus ring (does not change border/shadow) */
a.card.card-guide:focus-visible{
  outline: 2px solid rgba(38,194,129,.35);
  outline-offset: 3px;
}

/* ============================================================
   Certification Cards (Legacy)
   NOTE: current Certifications page uses a.card + card-title/card-excerpt.
   Keep this only if you reuse .ca-card-ghost elsewhere.
============================================================ */
.ca-card-ghost{
  display: block;
  text-decoration: none;
  border: 1px solid var(--line);
  background: transparent;
  transition: all .18s ease;
  cursor: pointer;
}
.ca-card-ghost:hover{
  border-color: var(--brand);
  box-shadow: var(--btn-shadow);
  transform: translateY(-2px);
}
.ca-card-ghost .ca-card-title{ margin-bottom: 8px; }
.ca-card-ghost .pill{ pointer-events: none; }

.ca-card .ca-actions {
  margin-top: 18px;
}
.ca-callout + .ca-actions {
  margin-top: 18px;
}

/* =========================================================
   Actions row (layout only)
   ========================================================= */

.ca-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

/* Small button variant (used for table "Open" links) */
.btn.btn-sm,
a.btn.btn-sm{
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
}

/* Optional rectangular primary button variant */
.btn.btn-primary-flat,
a.btn.btn-primary-flat{
  border-radius: 10px;
  background: var(--brand);
  color: #06151a;
}

.sim-plume-dot{ filter: drop-shadow(0 6px 10px rgba(0,0,0,.25)); }

/* ============================================================
   Topic links (remove underline, keep feature)
   ============================================================ */

/* Previously you had:
   a.topic-link { text-decoration: underline dotted; }
   a.topic-link:hover { text-decoration: underline; }
   This forced the underline. We remove it. */

a.topic-link{
  text-decoration: none;
}

a.topic-link:hover,
a.topic-link:focus-visible{
  text-decoration: none;
}

/* ============================================================
   Guide comparison tables (fix column alignment)
============================================================ */

/* Apply to prose tables inside guides */
.prose table{
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;          /* critical: prevents drifting */
}

/* Consistent cell alignment */
.prose th,
.prose td{
  vertical-align: top;          /* keeps rows aligned cleanly */
  text-align: left;
  padding: 12px 14px;
}

/* Optional: balanced column widths for 5-column comparison */
.prose table th:nth-child(1),
.prose table td:nth-child(1){ width: 10%; }

.prose table th:nth-child(2),
.prose table td:nth-child(2){ width: 22%; }

.prose table th:nth-child(3),
.prose table td:nth-child(3){ width: 14%; }

.prose table th:nth-child(4),
.prose table td:nth-child(4){ width: 27%; }

.prose table th:nth-child(5),
.prose table td:nth-child(5){ width: 27%; }

.ca-figure img {
  display: block;
  width: 100%;
  max-width: 1100px;
  height: auto;
  margin: 0 auto;
}

.ca-figure figcaption {
  text-align: center;
  margin-top: 8px;
  font-size: 0.9rem;
}

.sim-clickable{
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
#buttonTarget:focus {
  outline: none;
}

#buttonTarget ellipse:focus {
  outline: none;
}

#buttonTarget:focus-visible {
  outline: none;
}

.re-contour-label{
  font: 700 34px "Segoe UI", Arial, sans-serif;
  fill: rgba(245,248,250,0.95);
  paint-order: stroke;
  stroke: rgba(0,0,0,0.22);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.ca-math{
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 18px;
  overflow-x: auto;
  text-align: center;
}

.ca-math mjx-container{
  margin: 0 auto !important;
  font-size: 1.7rem !important;
}

.ca-worksheet {
  table-layout: fixed;
  width: 100%;
}

.ca-worksheet th,
.ca-worksheet td {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  text-align: center;
  vertical-align: middle;
  padding: 10px 12px;
  font-size: 0.95rem;
  line-height: 1.25;
}

.ca-worksheet th {
  line-height: 1.2;
}

.ca-worksheet .ws-formula {
  display: block;
  text-align: center;
  line-height: 1.2;
  margin: 0 0 2px 0;
  font-size: 0.88rem;
}

/* =========================================
   HEADER SEARCH
   ========================================= */

.topsearch {
  max-width: 1100px;
  margin: 0 auto;
}

.topsearch input[type="search"] {
  width: 100%;
  height: 46px;
  padding: 0 16px 0 44px;
  border-radius: 10px;

  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);

  color: #d6e3ff;
  font-size: 15px;

  outline: none;
  transition: all .18s ease;
}

/* placeholder */
.topsearch input::placeholder {
  color: rgba(214,227,255,0.45);
}

/* hover */
.topsearch input:hover {
  border-color: rgba(255,255,255,0.18);
}

/* focus glow */
.topsearch input:focus {
  border-color: #26c281;
  box-shadow: 0 0 0 1px rgba(38,194,129,0.45);
}

/* search icon */
.topsearch {
  position: relative;
}

.topsearch::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);

  opacity: .6;

  background-image: url("/assets/img/icons/search.svg");
  background-size: contain;
  background-repeat: no-repeat;
}

/* =========================
   Smart Search UI
========================= */

.smart-search-wrap {
  position: relative;
  max-width: 1180px;
  margin: 18px auto 6px auto;
}

.smart-search-input {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: border-color .18s ease, background .18s ease;
}

.smart-search-input::placeholder {
  color: rgba(255,255,255,.45);
}

.smart-search-input:focus {
  border-color: #26c281;
  background: rgba(255,255,255,.05);
}

/* dropdown */

.smart-search-results {
  position: absolute;
  top: 52px;
  left: 0;
  width: 100%;
  background: #141414;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 18px 36px rgba(0,0,0,.45);
  overflow: hidden;
  z-index: 1000;
}

/* results */

.smart-search-results a {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: background .15s ease;
}

.smart-search-results a:last-child {
  border-bottom: none;
}

.smart-search-results a:hover {
  background: rgba(255,255,255,.05);
}

.smart-search-results a[data-active="true"] {
  background: rgba(255,255,255,.08);
}

/* result text */

.smart-search-results .muted {
  font-size: .82rem;
  opacity: .6;
}

.smart-search-results strong {
  font-weight: 600;
}

/* highlights search words */
mark,
.smart-search-results mark,
main mark {
  background: #26c281;
  color: #021b14;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 600;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* mobile */

@media (max-width: 720px) {
  .smart-search-wrap {
    margin: 14px auto;
  }

  .smart-search-input {
    height: 44px;
    font-size: .95rem;
  }
}

.ca-standard-summary {
  border-left: 4px solid var(--accent, #26c281);
}

.ca-standard-facts {
  display: grid;
  gap: 0;
  margin-top: 6px;
}

.ca-standard-fact {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid rgba(255,255,255,.08);
  align-items: start;
}

.ca-standard-fact:first-child {
  border-top: 0;
}

.ca-standard-label {
  font-weight: 700;
  color: #fff;
}

.ca-standard-value {
  color: rgba(255,255,255,.92);
  min-width: 0;
}

@media (max-width: 700px) {
  .ca-standard-fact {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

.ca-related-group + .ca-related-group {
  margin-top: 16px;
}

.ca-related-label {
  margin-bottom: 8px;
  font-weight: 700;
}

.ca-related-group + .ca-related-group {
  margin-top: 16px;
}

.ca-related-label {
  margin-bottom: 8px;
  font-weight: 700;
}