/* =========================
   DESIGN SYSTEM — utilitieskit
========================= */
:root {
  --bg: #ffffff;
  --surface: #f0f6ff90;
  --surface-elevated: #ffffff;
  --text: #111111;
  --muted: #5e5e60;
  --border: #e5e5e7;
  --accent: #0076FF;
  --accent-soft: rgba(0,118,255,0.10);
  --accent-hover: #0057C2;
  --accent-contrast: #ffffff;
  --accent-soft-light: rgba(0,118,255,0.06);
  --radius: 14px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

[data-theme="dark"] {
  --bg: #0f0f11;
  --surface: #1c1c1e;
  --surface-elevated: #232326;
  --text: #f5f5f7;
  --muted: #8f8f90;
  --border: #2c2c2e;
  --accent: #4DA3FF;
  --accent-soft: rgba(0,118,255,0.15);
  --accent-hover: #7ABBFF;
  --accent-contrast: #00142e;
  --accent-soft-light: rgba(0,118,255,0.10);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
}

/* =========================
   BASE
========================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px 16px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease-out;
}

/* =========================
   TYPOGRAPHY
========================= */

h1 {
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
}

h2 {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 1.75rem 0 0.75rem;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 1.25rem 0 0.5rem;
}

h4 {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 1rem 0 0.5rem;
}

h5 {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 1rem 0 0.5rem;
}

p {
  margin: 0 0 20px;
  color: var(--muted);
}

ul {
    list-style: none;
    padding-left: 1em;
}

ul li::before {
    content: '►';
    display: inline-block;
    width: 1em;
    margin-left: -1em;
    margin-right: 0.4em;
    color: var(--accent);
    font-size: 1em;
    vertical-align: middle;
}

.tool-help {
  font-size: 0.85rem;
  margin-bottom: 12px;
}

/* =========================
   HEADER & LOGO
========================= */

.site-header {
  width: 95%;
  max-width: 720px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  position: relative;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.3px;
  text-decoration: none;
  line-height: 1;
  flex-shrink: 0;
  color: var(--text);
}

.logo-main { color: var(--accent); }
.logo-sub  { color: var(--text); margin-left: 2px; }

/* =========================
   DESKTOP NAV
========================= */

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 7px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
  opacity: 1;
}

.nav-link.nav-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

.nav-icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

/* =========================
   BURGER TOGGLE — CSS ONLY
========================= */

.nav-toggle-input {
  display: none;
}

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
  border-radius: 8px;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.nav-burger:hover {
  background: var(--accent-soft);
}

.nav-burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

/* Burger → X animation when checked */
.nav-toggle-input:checked ~ .nav-burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle-input:checked ~ .nav-burger span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle-input:checked ~ .nav-burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =========================
   MOBILE OVERLAY
========================= */

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 98;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.nav-toggle-input:checked ~ .nav-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* =========================
   MOBILE DRAWER
========================= */

.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 65%;
  max-width: 300px;
  height: 100%;
  background: var(--surface-elevated);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 99;
  flex-direction: column;
  padding: 0;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.nav-toggle-input:checked ~ .mobile-nav {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.mobile-nav-title {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.3px;
  text-decoration: none;
}

.mobile-nav-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-close:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.mobile-nav-close .nav-icon {
  width: 18px;
  height: 18px;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-link:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.mobile-nav-link.nav-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  border-left: 3px solid var(--accent);
  padding-left: 17px;
}

.mobile-nav-link .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.mobile-nav-logo {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.3px;
  text-decoration: none;
  line-height: 1;
}

/* =========================
   MOBILE BREAKPOINT — 600px
========================= */

@media (max-width: 600px) {

  .main-nav {
    display: none;
  }

  .nav-burger {
    display: flex;
  }

  .nav-overlay {
    display: block;
  }

  .mobile-nav {
    display: flex;
  }

}

/* =========================
   HEADER MOBILE LAYOUT
========================= */

@media (max-width: 601px) {
  .site-header {
    width: 95%;
    padding: 4px 0;
  }

  .logo {
    font-size: 1.5rem;
  }
}


/* =========================
   TOOL ICONS
========================= */

.tool-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.tool-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .tool-icon {
    width: 18px;
    height: 18px;
  }
}

/* =========================
   PRIMARY-LINK (Home / Main Tools)
========================= */

.primary-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius);
  background: var(--surface-elevated);
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-link svg {
  stroke: currentColor;
}

.primary-link:hover {
  background: var(--accent-soft-light); /* subtle tint */
  box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 0 8px var(--accent-soft);
  transform: translateY(-1px);
}

/* =========================
   TIP ICONS
========================= */

.icon-inline {
  display: inline-block;
  stroke-width: 2;
  fill: var(--bg);
  width: 16px;
  height: 16px;
  margin-right: 0px;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateY(2px); /* adjust for vertical alignment */
}

.icon-ads {
  display: inline-block;
  stroke-width: 2;
  fill: var(--bg);
  width: 20px;
  height: 20px;
  margin-right: 0px;
  stroke: var(--accent);
  transform: translateY(4px); /* adjust for vertical alignment */
}

.icon-h2 {
  display: inline-block;
  stroke-width: 2;
  fill: none;
  width: 24px;
  height: 24px;
  margin-right: 2px;
  stroke: var(--text);
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateY(3px); /* adjust for vertical alignment */
}

.icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* =========================
   LAYOUT
========================= */

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

/* Card - light and dark modes */
.card {
  background: var(--surface-elevated);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0,0,0,0.05); /* subtle edge in light mode */
  transition: background 0.25s ease, box-shadow 0.25s ease, border 0.25s ease;
}

.card > :last-child {
  margin-bottom: 0; /* prevent extra bottom gap */
}

/* Light-mode card tweaks */
[data-theme="light"] .card {
  background: #fafafa; /* off-white for contrast */
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: var(--shadow-md);
}

/* Dark-mode card tweaks */
[data-theme="dark"] .card {
  background: var(--surface-elevated);
  border: 1px solid rgba(255,255,255,0.08); /* subtle highlight */
  box-shadow: var(--shadow-md);
}

/* =========================
   LINKS
========================= */

a,
a:visited {
  color: var(--accent);
  text-decoration: none;
}

a:hover { opacity: 0.85; }

/* =========================
   TOOLS LIST SECTION
========================= */

.tools-section .tool-list {
  display: flex;
  flex-direction: column;
  gap: 12px; /* spacing between buttons */
}

/* Base tool buttons (matches original primary-link) */
.tools-section .tool-list a {
  display: inline-flex;      /* align icon + text */
  align-items: center;       /* vertical alignment */
  gap: 8px;                  /* space between icon and text */
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 500;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
}

/* Hover effect */
.tools-section .tool-list a:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  background: var(--surface-elevated);
}

.tools-section a.primary-link:hover {
  background: var(--accent-soft-light);  /* subtle tint */
  box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 0 8px var(--accent-soft);
  border: 1px solid var(--accent);
  transform: translateY(-1px);
}

/* =========================
   TOOLS SECTION HEADINGS
========================= */

.tools-section h1,
.tools-section h2 {
  display: flex;
  align-items: left;   /* vertical center icon + text */
  gap: 0.3em;            /* spacing between icon and text */
  font-weight: 600;
  margin-bottom: 0.5em;
}

/* icons scale slightly smaller than text for balance */
.tools-section h1 svg {
  width: 1.2em;          /* slightly smaller than h1 text */
  height: 1.2em;
  stroke: currentColor;
  flex-shrink: 0;
}

.tools-section h2 svg {
  width: 1.2em;          /* slightly smaller than h2 text */
  height: 1.2em;
  stroke: currentColor;
  flex-shrink: 0;
}

/* =========================
   FORM CONTROLS (TOOLS)
========================= */

textarea {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: block;

  min-height: 280px;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);

  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.5;

  resize: vertical;

  font-size: 16px;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}


/* =========================
   BUTTONS
========================= */

button {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 26px rgba(0,0,0,0.16);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* =========================
   PRIMARY
========================= */

.primary-btn {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.primary-btn:hover {
  background: var(--accent-hover);
}

/* =========================
   SECONDARY
========================= */

.secondary-btn {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

/* =========================
   TERTIARY
========================= */

.tertiary-btn {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid transparent;
}

.tertiary-btn:hover {
  background: var(--accent);
  color: var(--accent-contrast);
}

/* =========================
   GHOST
========================= */

.ghost-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
}

.ghost-btn:hover {
  background: var(--surface);
  color: var(--text);
}

/* =========================
   TOOL ACTIONS
========================= */

.tool-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.primary-result.has-result {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* =========================
   OUTPUT
========================= */

pre {
  width: 100%;
  max-width: 900px;
  margin: 1rem auto 0;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Real CSV output */
pre[data-state="output"] {
  padding: 1rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-x: auto;
}

/* Error / helper text */
pre[data-state="message"] {
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
}

/* =========================
   FOOTER
========================= */

.site-footer {
  margin-top: 20px;
  padding: 20px 0;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

.footer-brand {
  text-decoration: none;
  font-weight: 600; /* optional */
}

.footer-brand .brand-main {
  color: var(--accent);
}

.footer-brand .brand-sub {
  color: var(--text);
}

/* =========================
   ANIMATION
========================= */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================
   BREADCRUMB
========================= */

.breadcrumb {
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  color: #666;
}

.breadcrumb a {
  text-decoration: none;
  color: var(--accent);
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* =========================
   DIVIDERS
========================= */

.section-divider {
  border: none;
  height: 1px;
  background-color: var(--border);
  margin: 26px 0;
}

.section-divider-2 {
  border: none;
  height: 1px;
  background-color: var(--border);
  margin: 1px 0;
}

/* =========================
   RELATED TOOLS CARD
========================= */

.related-tools-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin: 22px auto;
  border: 1px solid var(--border);
  max-width: 670px;
  text-align: center;
}

.related-tools-card h3 {
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--text);
}

.related-tools-card p {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

.related-tools-card a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

.related-tools-card a:hover {
  opacity: 0.85;
}

/* =========================
   GUIDES / CARDS LAYOUT & COLLAPSIBLE
========================= */

/* Intro text */
.guide-intro {
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Search box */
.guide-search {
  width: 100%;
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.guide-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.guide-search {
  background: var(--surface-elevated);
  color: var(--text);
}

.guide-search::placeholder {
  color: var(--muted);
}

/* Show All / Hide All container */
.guides-toggle-all {
  text-align: right;
  margin-bottom: 0.5rem;
}
.guides-toggle-all button {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.guides-toggle-all button:hover {
  background: var(--accent);
  color: #fff;
}

/* Section */
.guides-section {
  margin-bottom: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem 0.75rem 0.75rem;
  background: var(--surface);
  transition: background 0.2s, border-color 0.2s;
}

/* Section header with collapse toggle */
.guides-section h2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
}

/* Collapse button */
.guides-section h2 .toggle-btn {
  font-size: 0.85rem;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.guides-section h2 .toggle-btn:hover {
  background: var(--accent);
  color: #fff;
}

.label-content {
  display: inline-flex;   /* keep icon and text together */
  align-items: center;    /* vertically center icon + text */
  gap: 0.3em;             /* spacing between icon and text */
}

/* Collapsed section hides grid */
.guides-section.collapsed .guide-grid {
  display: none;
}

/* Grid */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

/* Card */
.guide-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  min-height: 80px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
}

/* Hover & touch highlight */
.guide-card:hover,
.guide-card:active {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Card title */
.guide-card h3 {
  margin: 0 0 0.35rem 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

/* Tags container under title (clickable filter only) */
.guide-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

/* Individual tags */
.guide-tags .badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  border-radius: 8px;
  background-color: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.guide-tags .badge:hover {
  background-color: var(--accent-soft);
}

.guide-tags .badge.active {
  background-color: var(--accent);
  color: #fff;
}

/* Controls row (search + reset + show/hide) */
.guide-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

/* Responsive: full-width grid for small screens */
@media (max-width: 600px) {
  .guide-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================
   PREMIUM SLIDER
========================= */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 12px 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text); /* your default text color */
}

.theme-label svg {
  user-select: none;
  display: block;
  width: 1.25em;      /* adjust size for desktop/mobile */
  height: 1.25em;
  stroke: currentColor;
  flex-shrink: 0;   /* prevent shrinking in flex layout */
  transform: translateY(-1px); /* adjust up/down as needed */
}

/* Switch container */
.theme-switch {
  position: relative;
  display: inline-block;
  width: 36px;   /* was 50px */
  height: 20px;  /* was 28px */
}

/* Hide default checkbox */
.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Slider background */
.theme-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc; /* light track default */
  border-radius: 999px;
  transition: background-color 0.3s;
}

/* Thumb */
.theme-slider::before {
  content: "";
  position: absolute;
  height: 16px;  /* was 24px */
  width: 16px;   /* was 24px */
  left: 2px;
  top: 2px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Checked state */
.theme-switch input:checked + .theme-slider {
  background-color: var(--accent);
}

.theme-switch input:checked + .theme-slider::before {
  transform: translateX(16px);
}

/* =========================
   FORM
========================= */

/* Report Issue Form */

#issueForm {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

/* Labels */
#issueForm label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.3px;
}

/* Inputs, Select, Textarea */
#issueForm select,
#issueForm textarea,
#issueForm input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

#issueForm textarea {
  resize: vertical;
  min-height: 140px;
}

/* Focus state */
#issueForm select:focus,
#issueForm textarea:focus,
#issueForm input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Submit Button */
#issueForm button {
  align-self: flex-start;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

#issueForm button:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

#issueForm button:active {
  transform: translateY(0);
}

/* =========================
   CALC INPUTS
========================= */

/* Tool inputs specifically */
input[type="number"],
input[type="text"],
select {
  font-size: 16px;
}

/* =========================
   TOOL TABLE
========================= */

.tool-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.tool-table th,
.tool-table td {
  padding: 8px;
  text-align: left;
}

.tool-table th {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border);
  height: 55px; /* or whatever feels right */
  vertical-align: middle; /* ensures text is centered if header wraps */
}

.tool-table tr:not(:last-child) td {
  border-bottom: 1px solid var(--border);
}

.tool-table input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text);
  font-size: 16px; /* prevent iOS zoom */
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.tool-table input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Center cells and align numbers inside inputs */
.tool-table td {
  text-align: center;
  vertical-align: middle;
}

.tool-table td input[type="number"] {
  width: 75%;        /* fill most of the cell */
  box-sizing: border-box;
  text-align: right; /* numbers inside input aligned right */
}

.tool-table-50-50  th:nth-child(1),
.tool-table-50-50  th:nth-child(1),
.tool-table-50-50  th:nth-child(2),
.tool-table-50-50  th:nth-child(2) {
  width: 50%;
}

.tool-table-33-33-33  th:nth-child(1),
.tool-table-33-33-33  th:nth-child(1),
.tool-table-33-33-33  th:nth-child(2),
.tool-table-33-33-33  th:nth-child(2),
.tool-table-33-33-33  th:nth-child(3),
.tool-table-33-33-33  th:nth-child(3) {
  width: 33%;
}

.tool-table-25-75 th:nth-child(1),
.tool-table-25-75 td:nth-child(1) {
  width: 25%;
}

.tool-table-25-75 th:nth-child(2),
.tool-table-25-75 td:nth-child(2) {
  width: 75%;
}

.tool-table-10-45-45 th:nth-child(1),
.tool-table-10-45-45 td:nth-child(1) {
  width: 10%;
}

.tool-table-10-45-45 th:nth-child(2),
.tool-table-10-45-45 td:nth-child(2) {
  width: 45%;
}

.tool-table-10-45-45 th:nth-child(3),
.tool-table-10-45-45 td:nth-child(3) {
  width: 45%;
}

.tool-table-20-40-40 th:nth-child(1),
.tool-table-20-40-40 td:nth-child(1) {
  width: 20%;
}

.tool-table-20-40-40 th:nth-child(2),
.tool-table-20-40-40 td:nth-child(2) {
  width: 40%;
}

.tool-table-20-40-40 th:nth-child(3),
.tool-table-20-40-40 td:nth-child(3) {
  width: 40%;
}


/* Center checkboxes in their cell */
.tool-table td.checkbox-cell {
  display: flex;
  justify-content: center;
  align-items: center;
}

.tool-table td.checkbox-cell input[type="checkbox"] {
  width: auto;        /* prevent full-width from general input styles */
  margin: 0;
  transform: scale(1.4) translateY(10px); /* adjust 1-3px as needed */
  padding: 0;         /* remove padding from general input styles */
  cursor: pointer; /* optional, makes it clear it’s clickable */
}

/* Responsive for mobile */
@media (max-width: 600px) {
  .tool-table td input[type="number"] {
    width: 95%;
  }
}

/* Portfolio result states */
.result-positive {
  color: #16a34a; /* green */
}

.result-negative {
  color: #dc2626; /* red */
}

.result-value {
  font-size: 1.8rem;
  font-weight: 700;
}

.row-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.row-controls button {
  width: 160px;        /* same fixed width */
  text-align: center;
}

.fund-number {
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  vertical-align: middle;
}

/* Centre Fund column header */
.tool-table th:first-child {
  text-align: center;
}

/* Centre Fund column cells */
.tool-table td:first-child {
  text-align: center;
}

.tool-table thead th {
  text-align: center;
}

/* =========================
   DIV TABLE WRAPPER
========================= */

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
}

.table-wrapper table {
  width: 100%;
  min-width: 600px; /* optional, prevents the table from collapsing too small */
  border-collapse: collapse;
}

.table-wrapper th,
.table-wrapper td {
  border: 1px solid #ddd; /* light gray lines */
  padding: 8px;
}

.table-wrapper th {
  background-color: var(--surface-elevated);
  text-align: left;
}

/* =========================
   BACK TO GUIDES BUTTON
========================= */

.back-to-guides {
  display: flex;
  flex-direction: column;  /* stack everything vertically */
  align-items: center;     /* center horizontally */
  gap: 0px;                /* space between button and link */
  margin: 2.5rem 0;
  font-size: 1rem;      /* sets font size for link text */
}

.back-to-guides button,
.back-to-guides a {
  display: inline-flex;
  align-items: center;     /* vertical alignment for icons */
  gap: 1px;                /* space between icon and text */
  text-decoration: none;
}

.icon-inline-guides {
  display: inline-block;
  stroke-width: 3; 
  width: 16px;
  height: 16px;
  margin-right: 2px;
  color: var(--accent);
  transform: translateY(0px); /* adjust for vertical alignment */
}

/* =========================
   GUIDES
========================= */


.guide-article {
  max-width: 760px;
  margin: 0 auto 30px auto;
  line-height: 1.7;
}

.guide-article h1 {
  margin-bottom: 16px;
}

.guide-article h2 {
  margin-top: 36px;
  margin-bottom: 12px;
}

.guide-article p {
  margin-bottom: 16px;
  color: var(--text);
}

.guide-article ul {
  margin-bottom: 16px;
  padding-left: 20px;
}

.guide-article li {
  margin-bottom: 6px;
  color: var(--text);
}

.guide-article pre {
  background: var(--surface);
  border: 1px solid var(--border);
}

.guide-article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

.guide-article h5 {
  text-align: center;
  margin-top: 1em;
  margin-bottom: 0.5em;
  color: var(--text);
}

.guide-article canvas {
  display: block;
  margin: 0 auto;
}

/* =========================
   GUIDE TABLES
========================= */

.guide-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  table-layout: fixed;
}

.guide-table th,
.guide-table td {
  padding: 8px;
  text-align: left;
}

/* =========================
   TOOL RESULTS CARD
========================= */

.results {
  margin: 20px 0;
}

.primary-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

/* Remove default paragraph spacing inside card */
.primary-result p {
  margin: 6px 0;
}

/* Top label (e.g. Mortgage Result) */
.result-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

/* Divider under label */
.result-divider {
  border: none;
  height: 1px;
  background: var(--border);
  background-color: var(--accent-soft);
  margin: 12px 0 18px;
  width: 100%;
}

/* Large primary number (when used) */
.result-value {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 10px 0 16px;
}

/* Multi-line result body (mortgage-style outputs) */
.result-body {
  font-size: 1rem;
  line-height: 1.6;
}

/* Placeholder message */
.result-placeholder {
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
  line-height: 1.6;
}

.result-sub span:last-child {
  font-weight: 600;
}



/* =========================
   GUIDES SEARCH + RESET FIX
========================= */

/* Keep controls layout stable */
.guide-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* Wrap search */
.search-wrapper {
  position: relative;
  flex: 1; /* makes search take remaining space */
}

/* Search input full width */
.search-wrapper .guide-search {
  width: 100%;
  padding-right: 90px; /* room for reset */
  margin-bottom: 0; /* remove default spacing */
}

/* Reset button inside input */
.search-wrapper #resetFilters {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);

  padding: 4px 10px;
  font-size: 0.8rem;
  line-height: 1;

  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);

  box-shadow: none;
}

.search-wrapper #resetFilters:hover {
  background: var(--accent);
  color: #fff;
}

/* Bottom-only reset button styling */
#resetFiltersBottom {
  padding: 6px 12px;          /* slightly bigger */
  font-size: 0.95rem;         /* match top buttons better */
  border-radius: 8px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

#resetFiltersBottom:hover {
  background: var(--accent);
  color: #fff;
}

.guides-toggle-all.bottom-reset {
  text-align: right;         /* match top buttons alignment */
  margin: 1rem 0 0 0;        /* some spacing from content above */
}

.button-only {
  display: flex;
  justify-content: center;
}

/* =========================
   FEATURED GUIDES - HOMEPAGE
========================= */

.featured-guides {
  display: flex;
  flex-direction: column;
  gap: 16px; /* spacing between cards */
  max-width: 720px;
  margin: 0 auto;
}

.featured-guide-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.featured-guide-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.featured-guide-card:nth-child(even) {
  flex-direction: row-reverse; /* alternate icon/text sides */
}

.featured-guide-icon {
  flex: 0 0 20%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
}

.featured-guide-icon svg {
  width: 64px;
  height: 64px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
}

@media (max-width: 600px) {
  .featured-guide-icon svg {
    width: 40px;
    height: 40px;
    stroke-width: 2.5;
  }
}

.featured-guide-content {
  flex: 1 1 80%;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
}

.featured-guide-content h3 {
  margin: 0 0 8px 0;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.featured-guide-content p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.featured-guide-cta {
  margin-top: 12px;
}

.featured-guide-cta a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--accent);
  text-decoration: none;
  transition: all 0.2s ease;
}

.featured-guide-cta a:hover {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 4px 12px var(--accent-soft);
}

/* DEFAULT SECTION */
.featured-guides:not(.alt-start) .featured-guide-card:nth-child(odd) {
  flex-direction: row;
}

.featured-guides:not(.alt-start) .featured-guide-card:nth-child(even) {
  flex-direction: row-reverse;
}

/* ALT SECTION (flip start) */
.featured-guides.alt-start .featured-guide-card:nth-child(odd) {
  flex-direction: row-reverse;
}

.featured-guides.alt-start .featured-guide-card:nth-child(even) {
  flex-direction: row;
}

  .featured-guide-icon {
    padding: 0;
    margin-bottom: 12px;
  }

  .featured-guide-content {
    padding: 0;
  }

.featured-guide-card {
  cursor: pointer;
}

.featured-guides h2 a {
  color: var(--text);
  text-decoration: none;
  text-align: left;
}

.featured-guides h2 a:hover {
  text-decoration: underline;
}



.fg h2, 
h2.section-sub {
  position: relative;
  padding-left: 12px;
}

.fg h2::before,
h2.section-sub::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 70%;
  background: var(--accent);
  border-radius: 2px;
}


/* =========================
   SECTION HEADING (HOME)
========================= */

.section-heading {
  margin: 28px -24px 16px;
  padding: 14px 24px;

background: linear-gradient(to right, var(--accent-soft-light), var(--accent-contrast));
border-top: 1px solid var(--accent-soft);
border-bottom: 1px solid var(--accent-soft);

  display: flex;
  flex-direction: column;
  justify-content: center; /* vertical centering */
}

.section-heading h2 {
  display: flex;
  align-items: center;
  gap: 0.3em;
  margin-bottom: 0.5em;
  margin: 0;
}

.section-heading p {
  margin: 4px 0 0;
}

/* Link styling */
.section-heading h2 a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  transition: opacity 0.15s ease;
}

.section-heading h2 a:hover {
  opacity: 0.7; /* no green */
}

/* Icon sizing + alignment */
.section-heading h2 svg {
  width: 1.2em;
  height: 1.2em;
  stroke: currentColor;
  flex-shrink: 0;
  transform: translateY(1px); /* fine-tune vertical alignment */
}

/* Responsive */
@media (max-width: 600px) {
  .featured-guide-card {
    flex-direction: column;
    text-align: center;
  }}

/* =========================
   HOME FAQ + WHY USE
========================= */

/* Wrapper for both sections */
.trust-faq-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;              /* space between main blocks inside wrapper */
  max-width: 720px;
  margin: 18px auto 0 auto;
}

/* Titles – generic style */
.trust-faq-title {
  text-align: center;
  margin: 0;
  padding-bottom: 18px;           /* spacing below the title */
}

/* =========================
   WHY USE GRID
========================= */

.why-use-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;                      /* space between cards */
}

.why-use-section .trust-faq-title {
  margin-top: 0;                   /* ensure no extra gap above */
  padding-bottom: 12px;           /* spacing to cards */
}

/* =========================
   FAQ SECTION
========================= */
.faq-cards {
  display: flex;
  flex-direction: column;
  gap: 0;                         /* no extra gap above title */
  margin: 0;
}

.faq-cards .trust-faq-title {
  margin: 0 !important;           /* removes default h3 margin */
  padding-bottom: 12px;           /* spacing to cards */
}

/* FAQ grid layout */
.faq-cards .faq-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;                      /* spacing between FAQ cards */
}

/* =========================
   TRUST / FAQ CARDS
========================= */

.trust-faq-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;            /* vertical centering */
  gap: 12px;
}

.trust-faq-card p {
  margin: 0;
}

/* Icon sizing */
.trust-faq-card .icon {
  width: 28px;
  height: 28px;
  stroke: var(--accent);
  flex-shrink: 0;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 600px) {
  .why-use-grid {
    grid-template-columns: 1fr;
  }
  .faq-cards .faq-grid {
    grid-template-columns: 1fr;
  }
  .trust-faq-card {
    justify-content: center;
    text-align: center;
  }
}

/* =========================
   FEATURED TOOL – HERO STYLE
========================= */

.featured-tool-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;

  padding: 22px 20px;

  width: 80%;
  max-width: 560px;   /* keeps it tight on desktop */
  margin: 24px auto;  /* centers it */

  border-radius: var(--radius);
  border: 1px solid var(--border);

  /* stronger visual identity */
  background: linear-gradient(
    to bottom,
    var(--accent-soft) 0%,
    transparent 80%
  );

  box-shadow: var(--shadow-md);

  cursor: pointer;

  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.featured-tool-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.14);
}

/* Label */
.featured-tool-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 10px;
}

/* Icon */
.featured-tool-icon svg {
  width: 56px;
  height: 56px;
  stroke: var(--accent);
  margin-bottom: 10px;
}

/* Title */
.featured-tool-hero h3 {
  margin: 6px 0 8px;

}

/* Description */
.featured-tool-hero p {
  max-width: 420px;
  margin: 0 auto;
  color: var(--muted);
}

/* CTA */
.featured-tool-cta {
  margin-top: 14px;
}

.featured-tool-cta a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
 
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--accent);

  color: var(--accent);
  background: var(--surface);

  transition: all 0.2s ease;
}

.featured-tool-cta a:hover {
  background: var(--accent);
  color: var(--accent-contrast);
}

/* =========================
   RELATED LINKS (GUIDES + TOOLS)
========================= */

.related-section {
  margin: 28px 0;
}

.related-grid {
  display: grid;
  gap: 12px;
}

/* 2x2 grid (tools) */
.related-grid.tools {
  grid-template-columns: repeat(2, 1fr);
}

/* stacked (guides) */
.related-grid.guides {
  grid-template-columns: 1fr;
  width: 90%;
  margin: 0 auto;
}

/* Card = clickable */
.related-card {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 14px 16px;
  border-radius: var(--radius);

  background: var(--accent-soft);
  border: 1px solid var(--border);

  color: var(--accent);
  text-decoration: none;
  font-weight: 500;

  transition: transform 0.15s ease,
              box-shadow 0.15s ease,
              border-color 0.15s ease,
              background 0.15s ease,
              color 0.15s ease;
}

/* Icon color matches text */
.related-card .icon {
  stroke: var(--accent);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: stroke 0.15s ease;
}

/* Tools hover = accent background, text/icon contrast */
.related-grid.tools .related-card:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: var(--accent-contrast);
}

.related-grid.tools .related-card:hover .icon {
  stroke: var(--accent-contrast);
}

/* Guides = initial soft accent, text/icon same */
.related-grid.guides .related-card,
.related-grid.guides .related-card a {
  color: var(--accent);
}

.related-grid.guides .related-card .icon {
  stroke: var(--accent);
}

/* Guides hover = everything accent-contrast (text + icon) */
.related-grid.guides .related-card:hover,
.related-grid.guides .related-card:hover a {
  color: var(--accent-contrast); /* text & link */
}

.related-grid.guides .related-card:hover .icon {
  stroke: var(--accent-contrast);
}

.related-grid.guides .related-card:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Guides = softer initial background, text/icon same */
.related-grid.guides .related-card {
  background: var(--accent-soft-light); /* <-- lighter green */
  color: var(--accent);
}

.related-grid.guides .related-card .icon {
  stroke: var(--accent);
}

/* =========================
   GUIDE HERO CARD (tool & guide pages)
========================= */

.guide-hero-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: linear-gradient(to right, var(--accent-soft), var(--accent-soft-light));
  margin: 24px 0;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.guide-hero-card:hover {
  box-shadow: 0 4px 16px var(--accent-soft);
  transform: translateY(-1px);
}

.guide-hero-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
}

.guide-hero-icon .icon {
  width: 22px;
  height: 22px;
  stroke: var(--accent);
}

.guide-hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.guide-hero-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.guide-hero-content h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.guide-hero-content h3 a {
  color: var(--text);
  text-decoration: none;
}

.guide-hero-content h3 a:hover {
  color: var(--accent);
}

.guide-hero-content p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
}

.guide-hero-cta {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 6px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  text-decoration: none;
  background: var(--surface-elevated);
  transition: background 0.2s ease, color 0.2s ease;
  align-self: flex-start;
}

.guide-hero-cta:hover {
  background: var(--accent);
  color: var(--accent-contrast);
  opacity: 1;
}

@media (max-width: 600px) {
  .guide-hero-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .guide-hero-icon {
    width: 40px;
    height: 40px;
  }
}


/* =========================
   SHARING CARD
========================= */

.sharing-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  max-width: 90%;
  margin: 12px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0px;
  flex-wrap: wrap; /* allows wrapping on mobile */
  background: var(--bg);
}

.sharing-card-header {
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.sharing-actions {
  display: flex;
  gap: 8px;
  flex: 1 1 auto; /* take remaining space */
  justify-content: flex-start;
}

.sharing-btn {
  flex: 1 1 auto;
  font-size: 13px;
  padding: 6px 12px;
  min-width: 100px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.sharing-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 6px var(--accent-soft);
}

.sharing-btn:active {
  transform: translateY(1px);
}

.sharing-btn .icon-inline,
.sharing-card-header .icon-inline {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.sharing-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

/* Mobile stacking */
@media (max-width: 600px) {
  .sharing-actions {
    justify-content: center;
    gap: 4%;
  }

  .sharing-btn {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4%;
    width: 28%;
    aspect-ratio: 1 / 0.6;
    padding: 10px 8px;
    font-size: 0.75rem;
    border-radius: var(--radius);
  }

  .sharing-btn .icon-inline {
    width: 22px;
    height: 22px;
    transform: none;
  }
}


/* =========================
   MOBILE TYPOGRAPHY
    !NEAR END ALWAYS!
========================= */

@media (max-width: 600px) {
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.2rem; }
  h3 { font-size: 1.0rem; }
  h4 { font-size: 0.95rem; }
  h5 { font-size: 0.90rem; }
  p, li { font-size: 0.9rem; }

  ul {
    padding-left: 0.8em;
  }

  ul li::before {
    font-family: Arial, sans-serif;
    content: '►';
    color: var(--accent);
    font-size: 1.1rem;
    margin-right: 0.25em;
    margin-left: -0.3em;
    display: inline;
    width: auto;
    position: relative;
    top: -0.1em;
  }

  h1 svg, h2 svg, h3 svg, h4 svg, h5 svg {
    width: 1em;
    height: 1em;
  }

  .icon, .icon-h2 {
    width: 20px;
    height: 20px;
  }

  .featured-guide-cta a,
  .featured-tool-cta a {
    font-size: 0.9rem;
  }
  
  .table-wrapper table,
  .table-wrapper th,
  .table-wrapper td {
    font-size: 0.9rem;
  }
  
  .related-grid.tools {
    grid-template-columns: 1fr;
  }

}