/* ========== SaveForWealth — Objective Section Styles (FINAL) ========== */
:root {
  --sfw-bg: #ffffff;
  --sfw-text: #1f2937;      /* gray-800 */
  --sfw-muted: #4b5563;     /* gray-600 */
  --sfw-accent: #0ea5e9;    /* sky-500 */
  --sfw-accent-2: #22c55e;  /* green-500 */
  --sfw-border: #e5e7eb;    /* gray-200 */
  --sfw-card: #f8fafc;      /* slate-50 */
  --sfw-link: #0369a1;      /* sky-700 */
  --sfw-shadow: 0 6px 24px rgba(2, 6, 23, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --sfw-bg: #0b1220;
    --sfw-text: #e5e7eb;
    --sfw-muted: #9ca3af;
    --sfw-accent: #38bdf8;
    --sfw-accent-2: #34d399;
    --sfw-border: #1f2937;
    --sfw-card: #0f172a;
    --sfw-link: #7dd3fc;
    --sfw-shadow: 0 8px 30px rgba(0,0,0,0.35);
  }
}

/* Base */
#objective-saveforwealth {
  background: var(--sfw-bg);
  color: var(--sfw-text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  line-height: 1.65;
  max-width: 960px;
  margin: 0 auto 2rem;        /* ✅ removed top gap */
  padding: 1.25rem 1rem 2.25rem;
}

#objective-saveforwealth > header {
  background: linear-gradient(180deg, var(--sfw-card), transparent 70%);
  border: 1px solid var(--sfw-border);
  border-radius: 16px;
  padding: 1rem 1.1rem;      /* ✅ tighter spacing */
  box-shadow: var(--sfw-shadow);
  margin-bottom: 1.5rem;
}

#objective-saveforwealth h2 {
  font-size: clamp(1.35rem, 1.1rem + 1.2vw, 1.9rem);
  line-height: 1.25;
  margin: 0 0 .25rem;
}

#objective-saveforwealth h3 {
  font-size: clamp(1.05rem, 0.95rem + .6vw, 1.25rem);
  line-height: 1.35;
  margin: 1.15rem 0 .45rem;
  color: var(--sfw-text);
}

#objective-saveforwealth p {
  margin: .55rem 0 1rem;
  color: var(--sfw-muted);
}

#objective-saveforwealth strong {
  color: var(--sfw-text);
}

/* Sections as cards */
#objective-saveforwealth section[aria-labelledby] {
  border: 1px solid var(--sfw-border);
  border-radius: 14px;
  padding: 1rem .9rem;
  margin-bottom: 1rem;
  background: var(--sfw-card);
}

#objective-saveforwealth ul {
  padding-left: 1.1rem;
  margin: .35rem 0 1rem;
}

#objective-saveforwealth li {
  margin: .25rem 0;
}

#objective-saveforwealth li::marker {
  color: var(--sfw-accent);
}

/* Links */
#objective-saveforwealth a {
  color: var(--sfw-link);
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}
#objective-saveforwealth a:hover {
  text-decoration: underline;
}

/* Responsive table */
#objective-saveforwealth .table-wrapper {
  border: 1px solid var(--sfw-border);
  border-radius: 12px;
  background: var(--sfw-bg);
  box-shadow: var(--sfw-shadow);
  margin: .75rem 0 1.25rem;
}

#objective-saveforwealth table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
  font-size: 0.95rem;
}

#objective-saveforwealth thead th {
  text-align: left;
  padding: .75rem .9rem;
  background: linear-gradient(180deg, var(--sfw-card), transparent 120%);
  border-bottom: 1px solid var(--sfw-border);
  position: sticky;
  top: 0;
  z-index: 1;
}

#objective-saveforwealth tbody td {
  padding: .7rem .9rem;
  border-bottom: 1px dashed var(--sfw-border);
  vertical-align: top;
}

#objective-saveforwealth tbody tr:hover {
  background: rgba(14,165,233,0.06);
}

/* Mobile optimizations */
@media (max-width: 640px) {
  #objective-saveforwealth {
    padding: 1rem .7rem 1.5rem;
    margin-bottom: 1.2rem;
  }
  #objective-saveforwealth section[aria-labelledby] {
    padding: .8rem .75rem;
    margin-bottom: .9rem;
  }
}

/* Print-friendly */
@media print {
  #objective-saveforwealth {
    box-shadow: none !important;
    margin: 0;
    max-width: none;
    color: #111827;
  }
  #objective-saveforwealth section[aria-labelledby] {
    break-inside: avoid;
    background: #fff;
  }
  #objective-saveforwealth .table-wrapper {
    box-shadow: none;
  }
}
