/* ============================================================
   TrueRate stylesheet (task 7.2)
   Hand-written CSS only. No framework, no charting library.
   Layout goal: the Result_Panel sits above the fold; the
   Breakdown_Visual is a flexbox stacked bar of four colored
   <div> segments with a color -> label -> $/hr -> % legend.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Neutrals */
  --color-bg: #f4f6f8;
  --color-surface: #ffffff;
  --color-border: #d8dee4;
  --color-text: #1c2530;
  --color-text-muted: #566372;
  --color-heading: #10171f;

  /* Brand / accent */
  --color-brand: #0f766e;
  --color-brand-dark: #0b5a54;
  --color-accent: #0d9488;

  /* Breakdown segment colors (four distinct hues) */
  --seg-commission: #d97706; /* amber  - platform commission */
  --seg-tax: #dc2626;        /* red    - taxes */
  --seg-operating: #7c3aed;  /* violet - operating costs */
  --seg-net: #0f766e;        /* teal   - net take-home (emphasized) */

  /* Focus ring */
  --focus-ring: #2563eb;

  /* Spacing / shape */
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(16, 23, 31, 0.08), 0 4px 16px rgba(16, 23, 31, 0.06);
  --maxw: 1080px;
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg);
  background-image: radial-gradient(rgba(15, 118, 110, 0.015) 1px, transparent 1px);
  background-size: 24px 24px;
}

h1,
h2,
h3 {
  color: var(--color-heading);
  line-height: 1.25;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--color-brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-brand-dark);
}

/* Visible, high-contrast focus states everywhere (accessibility). */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- Layout container ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(135deg, var(--color-brand-dark) 0%, var(--color-brand) 50%, var(--color-accent) 100%);
  border-bottom: none;
  padding-block: 4px;
}

.site-header .container {
  display: flex;
  align-items: center;
  min-height: 52px;
}

.brand {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #ffffff;
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* ---------- Main / intro ---------- */
#app {
  padding-block: clamp(20px, 4vw, 36px) 48px;
}

.intro {
  margin-bottom: 24px;
  padding: 32px 0 24px;
}

.intro h1 {
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  letter-spacing: -0.015em;
  max-width: 32ch;
  color: var(--color-brand-dark);
}

.subhead {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--color-text-muted);
  max-width: 60ch;
  margin-bottom: 0;
  margin-top: 8px;
}

/* ============================================================
   Tool grid
   Mobile: single column, Result_Panel first (above the fold).
   Wider screens: two columns, result panel prominent on the left.
   ============================================================ */
.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-block: 24px;
}

@media (min-width: 860px) {
  .tool-grid {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
  }
}

/* Panels */
.result-panel,
.input-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 28px);
}

.result-panel,
.input-panel {
  min-width: 0;
}

/* Result panel is the hero: it comes first in the source and stays
   first / prominent on load so the real rate is visible without
   scrolling. On wide screens it can stick while inputs scroll. */
.result-panel {
  order: -1;
  overflow: hidden;
  border-top: 3px solid var(--color-brand);
}



.panel-title {
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 16px;
  background: linear-gradient(90deg, rgba(15,118,110,0.05), transparent);
  padding: 8px 12px;
  border-radius: 4px;
  display: inline-block;
}

/* ---------- Hero net rate ---------- */
.hero {
  padding: 24px 20px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.03) 0%, rgba(13, 148, 136, 0.06) 100%);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.hero-label {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.hero-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--color-brand-dark);
  font-weight: 800;
  letter-spacing: -0.02em;
}

#hero-net-rate {
  font-size: clamp(2.6rem, 8vw, 3.75rem);
  line-height: 1;
  background: linear-gradient(135deg, var(--color-brand-dark), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-unit {
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  font-weight: 700;
  color: var(--color-text-muted);
}

/* ---------- Income cards ---------- */
.income-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.income-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(16, 23, 31, 0.06);
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.income-card:hover {
  box-shadow: 0 4px 12px rgba(16, 23, 31, 0.1);
  transform: translateY(-1px);
}

.income-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.income-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-heading);
}

/* ============================================================
   Breakdown_Visual: horizontal stacked bar of four <div> segments
   ui.js sets each segment's width/flex-basis inline, so the bar is
   a flex row that respects those inline sizes.
   ============================================================ */
.breakdown-title {
  font-size: 1rem;
  margin-bottom: 12px;
}

.breakdown-bar {
  display: flex;
  width: 100%;
  height: 40px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-bg); /* neutral empty state when grossRate == 0 */
  border: 1px solid var(--color-border);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}

.breakdown-segment {
  height: 100%;
  min-width: 0; /* allow segments to shrink to their inline width */
  flex-grow: 0;
  flex-shrink: 1;
  transition: flex-basis 160ms ease, width 160ms ease;
}

/* Four distinct colors matching the legend swatches. */
.segment-commission {
  background: var(--seg-commission);
}
.segment-tax {
  background: var(--seg-tax);
}
.segment-operating {
  background: var(--seg-operating);
}
/* Net take-home is emphasized: strongest color plus an inset accent line. */
.segment-net {
  background: var(--seg-net);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

/* ---------- Legend: color -> label -> $/hr -> % ---------- */
.breakdown-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-item {
  display: grid;
  grid-template-columns: 16px 1fr auto auto;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  padding: 4px 0;
  border-bottom: 1px solid var(--color-border);
}

.legend-item:last-child {
  border-bottom: none;
}

.legend-item:hover {
  background: rgba(15, 118, 110, 0.02);
  border-radius: 4px;
}

/* Emphasize the net take-home row in the legend too. */
.legend-item[data-segment="net"] {
  font-weight: 700;
}

.legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex: none;
  border: 1px solid rgba(16, 23, 31, 0.15);
}

.swatch-commission {
  background: var(--seg-commission);
}
.swatch-tax {
  background: var(--seg-tax);
}
.swatch-operating {
  background: var(--seg-operating);
}
.swatch-net {
  background: var(--seg-net);
}

.legend-label {
  color: var(--color-text);
}

.legend-amount {
  color: var(--color-heading);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.legend-pct {
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 3.5ch;
}

/* ---------- Impact message & disclaimer ---------- */
.impact-message {
  margin-top: 20px;
  padding: 14px 16px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-left: 4px solid var(--color-brand);
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 600;
  color: #064e3b;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.08);
}

.tax-disclaimer {
  margin-top: 12px;
  margin-bottom: 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* ============================================================
   Input panel
   ============================================================ */
.field-group {
  border: 1px solid rgba(216, 222, 228, 0.7);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 0 0 18px;
  box-shadow: 0 1px 3px rgba(16, 23, 31, 0.03);
}

.field-group:last-of-type {
  margin-bottom: 0;
}

.field-group legend {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-brand-dark);
  padding: 0 6px;
}

.field {
  margin-bottom: 16px;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 6px;
  color: var(--color-heading);
}

.field input[type="number"],
.field select {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  appearance: none;
}

.field input[type="number"]:hover,
.field select:hover {
  border-color: #b6bfc9;
}

.field input[type="number"]:focus,
.field select:focus,
.field input[type="range"]:focus {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-color: var(--color-brand);
}

/* Range slider */
.field input[type="range"] {
  width: 100%;
  accent-color: var(--color-brand);
  cursor: pointer;
  margin: 4px 0;
}

.field-note {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

/* Hidden manual-commission field toggled by ui.js via the [hidden] attr. */
.field[hidden] {
  display: none;
}

/* ============================================================
   Ad slot placeholders (clearly marked as placeholders)
   ============================================================ */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70px;
  margin: 12px 0;
  background: var(--color-bg);
  border: 1px solid rgba(216, 222, 228, 0.5);
  border-radius: var(--radius-sm);
}

.ad-slot-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #8a97a5;
}

/* ============================================================
   FAQ
   ============================================================ */
.faq {
  margin-top: 0;
}

.faq > h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  margin-bottom: 20px;
}

.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 12px;
}

.faq-item h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.faq-item p {
  margin-bottom: 0;
  color: var(--color-text-muted);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding-block: 24px;
  margin-top: 40px;
}

.site-footer p {
  margin: 0 0 6px;
}

.footer-note {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ============================================================
   Motion & responsiveness tweaks
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

@media (max-width: 420px) {
  .income-row {
    grid-template-columns: 1fr;
  }

  .legend-item {
    grid-template-columns: 16px 1fr auto;
    row-gap: 2px;
  }

  /* Let the percentage wrap under the amount on very narrow screens. */
  .legend-pct {
    grid-column: 2 / -1;
    text-align: left;
    min-width: 0;
  }
}

/* ============================================================
   SEO content guide (new content-only section)
   Additive styles for the .content-guide block. Does not modify
   any existing rules.
   ============================================================ */
.content-guide {
  margin-top: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 3vw, 32px);
}

.content-guide > h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  margin-bottom: 16px;
}

.content-guide h3 {
  font-size: 1.15rem;
  margin-top: 28px;
  margin-bottom: 10px;
}

.content-guide p {
  color: var(--color-text-muted);
  max-width: 72ch;
}

.content-guide ul,
.content-guide ol {
  color: var(--color-text-muted);
  max-width: 72ch;
  margin: 0 0 1em;
  padding-left: 1.4em;
}

.content-guide li {
  margin-bottom: 8px;
}

.content-guide li:last-child {
  margin-bottom: 0;
}

.content-guide strong {
  color: var(--color-text);
}

/* ============================================================
   TrueRate v2 — Mode toggle, currency selector, rate range,
   rate units, impact factors, and new field styles.
   Additive only — does not modify any existing rules.
   ============================================================ */

/* ---------- Mode Toggle (segmented control) ---------- */
.mode-toggle {
  display: flex;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 18px;
  gap: 2px;
}

.mode-btn {
  flex: 1;
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
}

.mode-btn:hover {
  color: var(--color-text);
  background: rgba(15, 118, 110, 0.06);
}

.mode-btn.active,
.mode-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-accent) 100%);
  color: #fff;
  box-shadow: 0 1px 3px rgba(15, 118, 110, 0.25);
  text-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.mode-btn:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Currency Selector ---------- */
.currency-selector {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
}

.currency-selector select {
  padding: 6px 28px 6px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 2l5 4 5-4' stroke='%23566372' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.currency-selector select:hover {
  border-color: #b6bfc9;
}

.currency-selector select:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-color: var(--color-brand);
}

/* Position the currency selector in the result-panel header row */
.result-panel .panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.result-panel .panel-header .panel-title {
  margin-bottom: 0;
}

/* ---------- Rate Range ---------- */
.rate-range {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: baseline;
  padding: 0;
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
  margin-bottom: 16px;
  margin-top: 16px;
}

.rate-range-item {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rate-range-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.rate-range-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-heading);
  font-variant-numeric: tabular-nums;
}

.rate-range-indicator {
  display: none;
  width: auto;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  text-align: center;
}

.rate-range-indicator.above {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.rate-range-indicator.below {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.rate-range-indicator.equal {
  background: var(--color-bg);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

/* ---------- Rate Units (responsive grid of 5 cards) ---------- */
.rate-units {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.rate-unit {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-accent);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(16, 23, 31, 0.05);
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.rate-unit:hover {
  box-shadow: 0 4px 12px rgba(16, 23, 31, 0.1);
  transform: translateY(-1px);
}

.unit-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.unit-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-heading);
  font-variant-numeric: tabular-nums;
}

/* ---------- Impact Factors Panel ---------- */
.impact-factors {
  margin-bottom: 20px;
  background: linear-gradient(180deg, var(--color-bg) 0%, rgba(244,246,248,0) 100%);
  padding: 16px;
  border-radius: var(--radius-sm);
}

.impact-factors-title {
  font-size: 1rem;
  margin-bottom: 12px;
}

.impact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.impact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.92rem;
}

.impact-item:first-child {
  border-top: 1px solid var(--color-border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.impact-item:last-child {
  border-bottom: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.impact-item:first-child:last-child {
  border-radius: var(--radius-sm);
}

.impact-label {
  color: var(--color-text);
  font-weight: 500;
}

.impact-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Subtractive factors: red/minus */
.impact-item.impact-sub .impact-value {
  color: #dc2626;
}

/* Additive factors: green/plus */
.impact-item.impact-add .impact-value {
  color: #059669;
}

/* Background alternation for readability */
.impact-item:nth-child(even) {
  background: var(--color-bg);
}

/* ---------- Field Group (Rate targets fieldset) ---------- */
/* Existing .field-group rules cover most of the styling. These
   additions ensure v2 fieldsets blend in. */
.field-group .field + .field {
  margin-top: 16px;
}

/* ---------- Screen-reader only utility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================================
   v2 Responsive overrides at existing breakpoints
   ============================================================ */

@media (min-width: 860px) {
  /* Rate units: on wider screens, use 3 columns to prevent overflow */
  .rate-units {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 420px) {
  /* Mode toggle: slightly tighter on very narrow screens */
  .mode-btn {
    padding: 8px 10px;
    font-size: 0.85rem;
  }

  /* Rate range: stack floor and recommended vertically */
  .rate-range {
    flex-direction: column;
    gap: 12px;
  }

  /* Rate units: 2 columns on narrow screens */
  .rate-units {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Impact items: tighter padding */
  .impact-item {
    padding: 8px 10px;
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mode-btn {
    transition: none;
  }
}

/* Prevent horizontal layout shift from changing monetary values */
.income-value,
.legend-amount,
.rate-range-value,
.unit-value,
.impact-value {
  min-width: 5ch;
}



/* ============================================================
   Collapsible content sections
   ============================================================ */
.content-guide-wrapper,
.faq-wrapper {
  margin-top: 32px;
}

.content-guide-wrapper summary,
.faq-wrapper summary {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-heading);
  cursor: pointer;
  padding: 16px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 3px rgba(16, 23, 31, 0.05);
  list-style: none;
  display: block;
  transition: background 120ms ease;
}

.content-guide-wrapper summary:hover,
.faq-wrapper summary:hover {
  background: var(--color-bg);
}

/* Hide default browser marker/triangle */
.content-guide-wrapper summary::-webkit-details-marker,
.faq-wrapper summary::-webkit-details-marker {
  display: none;
}

.content-guide-wrapper summary::marker,
.faq-wrapper summary::marker {
  content: "";
  display: none;
}

.content-guide-wrapper[open] summary,
.faq-wrapper[open] summary {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: none;
}

.content-guide-wrapper[open] .content-guide,
.faq-wrapper[open] .faq {
  margin-top: 0;
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

/* ============================================================
   Tooltip "?" icons
   ============================================================ */
.tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  cursor: help;
  position: relative;
  vertical-align: middle;
  margin-left: 4px;
  line-height: 1;
}

.tooltip-trigger:hover {
  color: var(--color-brand);
  border-color: var(--color-brand);
  background: rgba(15, 118, 110, 0.05);
}

.tooltip-trigger:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-heading);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  white-space: normal;
  width: max-content;
  max-width: 220px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(16, 23, 31, 0.15);
  pointer-events: none;
}

.tooltip-trigger:hover::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--color-heading);
  z-index: 100;
  pointer-events: none;
}
