/* ============================================================
   smartdataai.ai — legacy.css
   Token-based styles for legacy markup classes that the tool
   JavaScript depends on (hooks) or that have no design-system
   equivalent. All values come from tokens.css. Zero inline styles.
   ============================================================ */

/* ---- toast (JS hook: #toast + .on) ---- */
.toast {
  position: fixed; left: 50%; bottom: var(--s-6); transform: translate(-50%, 16px);
  background: var(--ink); color: #fff; font-size: var(--t-14); font-weight: 500;
  padding: var(--s-3) var(--s-5); border-radius: 999px; opacity: 0;
  pointer-events: none; transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  z-index: 200; max-width: calc(100vw - 48px); text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---- FAQ (JS hooks: .faq-item/.faq-q/.open, onclick=faq) ---- */
.faq-section { max-width: 860px; margin: 0 auto; }
.faq-item {
  border-bottom: 1px solid var(--line); cursor: pointer;
}
.faq-q {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-4) 0; font-weight: 600; font-size: var(--t-18); color: var(--ink);
  width: 100%; background: none; border: none; font-family: inherit; text-align: left; cursor: pointer;
}
.faq-qt { font-size: var(--t-16); font-weight: 600; color: var(--ink); line-height: 1.4; }
.faq-ic {
  width: 28px; height: 28px; border-radius: 50%; background: var(--bg-soft);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--t-18); color: var(--ink-soft); flex: none; transition: transform 0.25s var(--ease);
}
.faq-item.open .faq-ic { transform: rotate(45deg); background: var(--accent); color: #fff; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
.faq-item.open .faq-a { max-height: 600px; }
.faq-ai { padding-bottom: var(--s-4); font-size: var(--t-16); color: var(--muted); line-height: 1.7; }
.faq-a:not(:has(.faq-ai)) { font-size: var(--t-16); color: var(--muted); line-height: 1.7; }
.faq-item.open .faq-a:not(:has(.faq-ai)) { padding-bottom: var(--s-4); }
.section-head { text-align: center; margin-bottom: var(--s-7); }
.section-head .eyebrow { margin-bottom: var(--s-3); }

/* ---- tool page chrome ---- */
.tool-brief { text-align: center; max-width: 720px; margin: 0 auto var(--s-7); padding-top: var(--s-8); }
.tool-hero { text-align: center; max-width: 720px; margin: 0 auto var(--s-7); padding-top: var(--s-8); }
.tool-hero-icon {
  width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: var(--s-4);
}
.tool-hero h1, .tool-brief h1 { margin-bottom: var(--s-4); }
.tool-hero > p, .tool-brief > p { font-size: var(--t-18); color: var(--muted); max-width: 60ch; margin-left: auto; margin-right: auto; }
.honest-note {
  display: inline-block; margin-top: var(--s-4); font-size: var(--t-14); font-weight: 600;
  color: var(--accent-deep); background: var(--accent-soft);
  padding: var(--s-2) var(--s-4); border-radius: 999px;
}
.breadcrumb { font-size: var(--t-14); color: var(--muted); padding-top: var(--s-5); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-deep); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s-6); align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

/* toolbox internals */
.toolbox-hd { margin-bottom: var(--s-5); }
.toolbox-title { font-family: var(--font-display); font-size: var(--t-24); font-weight: 600; color: var(--ink); }
.flabel { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); }
.fcount { font-size: var(--t-14); color: var(--muted); font-weight: 500; }
.ftextarea, .finput, .fselect {
  width: 100%; font: inherit; font-size: var(--t-16); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; background: var(--bg);
}
.ftextarea:focus, .finput:focus, .fselect:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.ftextarea { min-height: 140px; resize: vertical; font-family: ui-monospace, monospace; font-size: var(--t-14); }
.opts-row { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin-bottom: var(--s-5); }
.opt-check { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--t-16); color: var(--ink-soft); cursor: pointer; }
.opt-check input { width: 17px; height: 17px; accent-color: var(--accent); }

.run-btn { width: 100%; position: relative; }
.run-btn .spin {
  display: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  animation: legacy-spin 0.7s linear infinite;
}
.run-btn.busy { opacity: 0.75; pointer-events: none; }
.run-btn.busy .spin { display: inline-block; }
@keyframes legacy-spin { to { transform: rotate(360deg); } }

/* result box (JS hook: #result + .show) */
.result-box { display: none; margin-top: var(--s-5); }
.result-box.show { display: block; animation: legacy-fade 0.3s var(--ease); }
@keyframes legacy-fade { from { opacity: 0; transform: translateY(8px); } }
.result-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); margin-bottom: var(--s-5); }
.rcard { background: var(--bg-soft); border-radius: var(--radius-sm); padding: var(--s-4); text-align: center; }
.rcard-val { font-family: var(--font-display); font-size: var(--t-36); font-weight: 700; color: var(--accent-deep); line-height: 1; }
.rcard-label { font-size: var(--t-12); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: var(--s-2); }
.share-label { font-size: var(--t-14); color: var(--muted); font-weight: 600; }
.result-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); margin: var(--s-5) 0 var(--s-3); flex-wrap: wrap; }
.result-stat { font-size: var(--t-16); color: var(--ink); }
.copy-btn {
  font-size: var(--t-14); font-weight: 600; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 18px; cursor: pointer;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent-deep); }
.result-output {
  width: 100%; min-height: 140px; resize: vertical; font-family: ui-monospace, monospace;
  font-size: var(--t-14); color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px;
}

/* upsell */
.upsell-box {
  margin-top: var(--s-6); padding: var(--s-5); border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid var(--line); text-align: center;
}
.upsell-title { font-weight: 700; font-size: var(--t-18); color: var(--ink); margin-bottom: var(--s-2); }
.upsell-text { font-size: var(--t-16); color: var(--muted); margin-bottom: var(--s-4); }
.upsell-btns { display: flex; gap: var(--s-3); justify-content: center; flex-wrap: wrap; }
.upsell-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--t-16); font-weight: 700; text-decoration: none;
  padding: 12px 24px; border-radius: 999px; border: 1px solid transparent;
}
.upsell-btn.primary { background: var(--accent); color: #fff; }
.upsell-btn.primary:hover { background: var(--accent-deep); color: #fff; }
.upsell-btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.upsell-btn.ghost:hover { border-color: var(--accent); color: var(--accent-deep); }

/* content + sidebar */
.content-sec { margin-top: var(--s-8); }
.content-sec .card { margin-bottom: var(--s-5); }
.content-sec h2 { margin-bottom: var(--s-4); }
.content-sec p { color: var(--ink-soft); }
.sidebar { display: flex; flex-direction: column; gap: var(--s-5); }
.scard { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.scard-hd { font-weight: 700; font-size: var(--t-16); color: var(--ink); padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line); }
.scard-bd { padding: var(--s-3) var(--s-5) var(--s-4); }
.related-link { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) 0; text-decoration: none; color: var(--ink-soft); font-size: var(--t-16); border-bottom: 1px solid var(--line); }
.related-link:last-child { border-bottom: none; }
.related-link:hover { color: var(--accent-deep); }
.related-icon { font-size: var(--t-18); }

/* banners */
.cta-banner, .cta-band {
  background: var(--ink); color: #fff; border-radius: var(--radius);
  padding: var(--s-7) var(--s-6); text-align: center; margin-top: var(--s-8);
}
.cta-banner h3, .cta-band h2 { color: #fff; margin-bottom: var(--s-3); }
.cta-banner p, .cta-band p { color: rgba(255,255,255,0.75); max-width: 56ch; margin-left: auto; margin-right: auto; }
.cta-banner a:not(.btn), .cta-band a:not(.btn) { color: #fff; font-weight: 600; }
.cta-band .btn { margin-top: var(--s-4); }

/* newsletter (JS hook: #email-input) */
.email-section { padding: var(--s-9) 0; }
.email-card {
  background: var(--ink); border-radius: 20px; padding: var(--s-8) var(--s-6);
  text-align: center; max-width: 860px; margin: 0 auto;
}
.email-h { color: #fff; margin-bottom: var(--s-3); }
.email-sub { color: rgba(255,255,255,0.75); max-width: 480px; margin: 0 auto var(--s-5); }
.email-form { display: flex; gap: var(--s-3); max-width: 440px; margin: 0 auto; flex-wrap: wrap; }
.email-input {
  flex: 1; min-width: 200px; height: 50px; padding: 0 18px; border: none;
  border-radius: var(--radius-sm); font-size: var(--t-16); font-family: inherit;
}
.email-note { font-size: var(--t-14); color: rgba(255,255,255,0.6); margin-top: var(--s-4); margin-bottom: 0; }

/* articles */
.article-main { max-width: 760px; margin: 0 auto; padding-top: var(--s-7); }
.article-main h1 { margin: var(--s-4) 0 var(--s-4); }
.article-meta { font-size: var(--t-14); color: var(--muted); margin-bottom: var(--s-6); padding-bottom: var(--s-5); border-bottom: 1px solid var(--line); }
.article-main h2 { margin: var(--s-7) 0 var(--s-4); }
.article-main p, .article-main li { color: var(--ink-soft); }
.article-main .cta-banner p { color: rgba(255,255,255,0.8); }
.article-main ul, .article-main ol { margin: 0 0 var(--s-4); padding-left: var(--s-5); }
.article-main li { margin-bottom: var(--s-2); }
.recommended-reading { max-width: 760px; margin: var(--s-8) auto 0; }
.recommended-reading h2 { font-size: var(--t-24); margin-bottom: var(--s-4); }
.recommended-reading ul { list-style: none; margin: 0; padding: 0; }
.recommended-reading li { margin-bottom: var(--s-3); }
.recommended-reading a { font-weight: 600; }

/* legal pages */
.legal-main { max-width: 760px; margin: 0 auto; padding: var(--s-8) var(--s-5); }
.legal-main h1 { margin-bottom: var(--s-5); }
.legal-main h2 { font-size: var(--t-24); margin: var(--s-7) 0 var(--s-3); }
.legal-main p, .legal-main li { color: var(--ink-soft); }
.legal-main ul { padding-left: var(--s-5); }
.legal-updated { font-size: var(--t-14); color: var(--muted); }

/* comparison / versus */
.verified-bar {
  display: flex; gap: var(--s-3); align-items: flex-start;
  background: var(--accent-soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s-4) var(--s-5); font-size: var(--t-16); margin-bottom: var(--s-5);
}
.affiliate-disclosure {
  font-size: var(--t-14); color: var(--muted); background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: var(--s-3) var(--s-4); margin-bottom: var(--s-6);
}
.compare-table-wrap { overflow-x: auto; margin-bottom: var(--s-7); border: 1px solid var(--line); border-radius: var(--radius); }
.compare-table { width: 100%; border-collapse: collapse; font-size: var(--t-16); min-width: 640px; }
.compare-table th, .compare-table td { text-align: left; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); vertical-align: top; }
.compare-table thead th { background: var(--bg-soft); font-size: var(--t-14); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.compare-table tbody tr:last-child th, .compare-table tbody tr:last-child td { border-bottom: none; }
.versus-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s-6); margin-bottom: var(--s-5); }
.versus-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-2); }
.versus-name { font-family: var(--font-display); font-size: var(--t-24); font-weight: 600; color: var(--ink); }
.versus-price { font-weight: 700; color: var(--accent-deep); }
.versus-meta { font-size: var(--t-14); color: var(--muted); margin-bottom: var(--s-4); }
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); margin-bottom: var(--s-4); }
@media (max-width: 640px) { .pros-cons { grid-template-columns: 1fr; } }
.pros strong, .cons strong { display: block; margin-bottom: var(--s-2); font-size: var(--t-16); }
.pros ul, .cons ul { margin: 0; padding-left: var(--s-4); font-size: var(--t-16); color: var(--ink-soft); }
.pros li, .cons li { margin-bottom: var(--s-2); }
.best-for { font-size: var(--t-16); background: var(--bg-soft); border-radius: var(--radius-sm); padding: var(--s-3) var(--s-4); margin-bottom: var(--s-4); }
.aff-cta { margin-top: var(--s-2); }
.aff-cta a { font-weight: 700; }

/* generic content table */
.table-wrap { overflow-x: auto; margin-bottom: var(--s-5); }
table.cmp { width: 100%; border-collapse: collapse; font-size: var(--t-16); min-width: 560px; }
table.cmp th, table.cmp td { text-align: left; padding: var(--s-3) var(--s-4); border: 1px solid var(--line); }
table.cmp thead th { background: var(--bg-soft); }
.highlight { background: var(--accent-soft); }
.warn { background: #fef6e7; }
.verdict-box { border-left: 4px solid var(--accent); background: var(--bg-soft); padding: var(--s-4) var(--s-5); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: var(--s-5) 0; }
.demo-note { font-size: var(--t-14); color: var(--muted); background: var(--bg-soft); border-radius: var(--radius-sm); padding: var(--s-3) var(--s-4); }

/* data-health-score gauge (JS hooks: #gauge-fg, .issue-fill injected) */
.score-wrap { display: flex; gap: var(--s-6); align-items: center; flex-wrap: wrap; margin-bottom: var(--s-5); }
.gauge { position: relative; width: 150px; flex: none; }
.gauge svg { width: 150px; height: 150px; transform: rotate(-90deg); }
.gauge-bg { fill: none; stroke: var(--line); stroke-width: 12; }
.gauge-fg { fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round; }
.gauge-num { font-family: var(--font-display); font-size: 30px; font-weight: 700; fill: var(--ink); text-anchor: middle; transform: rotate(90deg); transform-origin: center; }
.gauge-sub { font-size: 12px; fill: var(--muted); text-anchor: middle; transform: rotate(90deg); transform-origin: center; }
.grade-badge {
  position: absolute; top: -8px; right: -8px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; font-size: var(--t-18);
}
.score-side { flex: 1; min-width: 220px; }
.verdict { font-family: var(--font-display); font-size: var(--t-24); font-weight: 600; color: var(--ink); margin-bottom: var(--s-2); }
.score-meta { font-size: var(--t-16); color: var(--muted); }
.issue-list { margin: var(--s-5) 0; display: flex; flex-direction: column; gap: var(--s-3); }
.issue-row { display: grid; grid-template-columns: 160px 1fr 48px; gap: var(--s-3); align-items: center; font-size: var(--t-14); }
.issue-bar { height: 8px; background: var(--bg-soft); border-radius: 99px; overflow: hidden; }
.issue-fill { height: 100%; border-radius: 99px; background: var(--accent); transition: width 0.8s var(--ease); }
.embed-box { margin-top: var(--s-5); }
.embed-title { font-weight: 700; font-size: var(--t-16); color: var(--ink); margin-bottom: var(--s-2); }
.embed-row { display: flex; gap: var(--s-3); }
.embed-code { flex: 1; font-family: ui-monospace, monospace; font-size: var(--t-14); }

/* steps / features (service pages) */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-5); }
.step { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s-6); }
.step-num {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-deep);
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-bottom: var(--s-4);
}
.step h3 { margin-bottom: var(--s-2); font-size: var(--t-18); }
.step p { font-size: var(--t-16); color: var(--muted); margin: 0; }

/* pricing (data-care-plan) */
.price-wrap {
  max-width: 560px; margin: 0 auto; text-align: center;
  background: var(--bg-card); border: 2px solid var(--accent); border-radius: 20px;
  padding: var(--s-8) var(--s-6); box-shadow: var(--shadow-pop);
}
.price-badge { font-size: var(--t-12); font-weight: 700; letter-spacing: 0.18em; color: var(--accent-deep); margin-bottom: var(--s-3); }
.price-amount { font-family: var(--font-display); font-size: var(--t-60); font-weight: 700; color: var(--ink); line-height: 1; }
.price-amount small { font-size: var(--t-24); font-weight: 400; color: var(--muted); }
.price-note { color: var(--muted); margin: var(--s-3) 0 var(--s-5); }
.price-list { list-style: none; margin: 0 0 var(--s-6); padding: 0; text-align: left; }
.price-list li { padding: var(--s-2) 0; border-bottom: 1px solid var(--line); font-size: var(--t-16); }
.price-list li:last-child { border-bottom: none; }
.ck { color: var(--accent-deep); font-weight: 700; margin-right: var(--s-2); }

/* tool cards (index / blog index) */
.card .tool-badge {
  display: inline-block; font-size: var(--t-12); font-weight: 700; letter-spacing: 0.06em;
  color: var(--accent-deep); background: var(--accent-soft);
  padding: 3px 10px; border-radius: 999px; margin-bottom: var(--s-3);
}
a.card .tool-badge { position: static; }
.card-cat {
  display: inline-block; font-size: var(--t-12); font-weight: 700;
  color: var(--accent-deep); background: var(--accent-soft);
  padding: 3px 10px; border-radius: 999px; margin-bottom: var(--s-2);
}
.tool-link { font-size: var(--t-14); font-weight: 600; color: var(--accent-deep); display: inline-flex; align-items: center; gap: 6px; margin-top: var(--s-3); }
a.card:hover .tool-link { text-decoration: underline; }
.card h3 { margin: var(--s-3) 0 var(--s-2); }

/* index hero trust handled by design hero-badges; keep pill-dot removal safe */
.hero .lede strong { color: var(--ink); }

/* reveal helper on sections */
@media (prefers-reduced-motion: reduce) {
  .run-btn .spin { animation: none; }
}

/* run button label + toolbox body */
.run-btn .btn-label { display: inline-flex; align-items: center; gap: var(--s-2); }
.toolbox-bd { display: block; }
