/**
 * Takin Cyber - Scan Progress, Continuity & Teaser Conversion Styles
 * Mobile-First (375px zero-overflow), Light/Dark WCAG AA, RTL/LTR Logical
 */
:root {
  --tsp-bg: #ffffff; --tsp-surface: #f8fafc; --tsp-border: #e2e8f0; --tsp-text: #0f172a;
  --tsp-muted: #64748b; --tsp-primary: #0284c7; --tsp-primary-subtle: #e0f2fe;
  --tsp-done: #10b981; --tsp-done-bg: #ecfdf5; --tsp-amber: #b45309; --tsp-amber-bg: #fef3c7;
  --tsp-amber-border: #fde68a; --tsp-card-bg: #ffffff; --tsp-modal-bg: #ffffff;
}

html[data-theme="dark"], [data-hero-surface="obsidian"], .dark-theme, body.dark {
  --tsp-bg: #0f172a; --tsp-surface: #1e293b; --tsp-border: #334155; --tsp-text: #f8fafc;
  --tsp-muted: #94a3b8; --tsp-primary: #38bdf8; --tsp-primary-subtle: rgba(56, 189, 248, 0.15);
  --tsp-done: #34d399; --tsp-done-bg: rgba(52, 211, 153, 0.15); --tsp-amber: #fbbf24;
  --tsp-amber-bg: rgba(245, 158, 11, 0.15); --tsp-amber-border: #78350f; --tsp-card-bg: #1e293b; --tsp-modal-bg: #0f172a;
}

/* 1. Free Stepper Card & Scope Note */
.takin-scan-progress-card,
.takin-free-stepper {
  box-sizing: border-box; width: 100%; padding: 16px; margin: 10px 0;
  background: var(--tsp-card-bg); border: 1px solid var(--tsp-border); border-radius: 14px; text-align: start;
}
.teaser-score-scope-note {
  box-sizing: border-box; flex: 1 1 100%; width: 100%; margin-top: 6px; padding: 8px 12px;
  border-radius: 8px; background: #f0f9ff; border: 1px solid #bae6fd;
  border-inline-start: 3.5px solid #0284c7; color: #0c4a6e;
  font-size: 0.82rem; font-weight: 700; line-height: 1.42; text-align: start;
}
html[data-theme="dark"] .teaser-score-scope-note,
[data-hero-surface="obsidian"] .teaser-score-scope-note,
.dark-theme .teaser-score-scope-note,
body.dark .teaser-score-scope-note {
  background: #0f172a; border-color: rgba(56, 189, 248, 0.42);
  border-inline-start-color: #38bdf8; color: #e0f2fe;
}
.takin-stepper-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px;
  font-weight: 600; color: var(--tsp-text); font-size: 0.95rem;
}
.takin-stepper-bar {
  width: 100%; height: 6px; background: var(--tsp-surface); border-radius: 999px; overflow: hidden; margin-bottom: 14px;
}
.takin-stepper-fill {
  height: 100%; background: linear-gradient(90deg, var(--tsp-primary), #06b6d4); border-radius: 999px;
  transition: width 0.35s ease; width: 25%;
}
.takin-stepper-list {
  display: flex; flex-direction: column; gap: 10px; list-style: none; padding: 0; margin: 0;
}
.takin-step-item {
  display: flex; align-items: flex-start; gap: 10px; font-size: 0.88rem; color: var(--tsp-muted);
  line-height: 1.4; transition: color 0.25s ease;
}
.takin-step-dot {
  width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; background: var(--tsp-border);
}
.takin-step-item.is-active { color: var(--tsp-text); font-weight: 600; }
.takin-step-item.is-active .takin-step-dot {
  background: var(--tsp-primary); box-shadow: 0 0 0 4px var(--tsp-primary-subtle);
}
.takin-step-item.is-done { color: var(--tsp-done); }
.takin-step-item.is-done .takin-step-dot { background: var(--tsp-done); }
.takin-slow-site-note {
  margin-top: 12px; padding: 10px 12px; background: var(--tsp-amber-bg); border: 1px solid var(--tsp-amber-border);
  color: var(--tsp-amber); border-radius: 8px; font-size: 0.82rem; line-height: 1.35;
}

/* 2. Deep Scan Board */
.takin-deep-board {
  box-sizing: border-box; width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 12px; text-align: start;
}
.takin-deep-step {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px;
  background: var(--tsp-surface); border: 1px solid var(--tsp-border); font-size: 0.88rem; color: var(--tsp-muted);
}
.takin-deep-step.is-active {
  background: var(--tsp-primary-subtle); border-color: var(--tsp-primary); color: var(--tsp-text); font-weight: 600;
}
.takin-deep-step.is-done {
  background: var(--tsp-done-bg); border-color: var(--tsp-done); color: var(--tsp-done);
}
.takin-cloud-safe-badge {
  box-sizing: border-box; padding: 12px 14px; border-radius: 10px;
  background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.28);
  color: var(--tsp-text); font-size: 0.84rem; line-height: 1.45; margin-top: 12px;
}

/* 3. Resume Scan Continuity Banner */
#takinResumeScanBanner {
  box-sizing: border-box; display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; padding: 12px 16px; margin-bottom: 14px;
  background: var(--tsp-surface); border: 1px solid var(--tsp-primary); border-radius: 12px; text-align: start;
}
.takin-resume-info { display: flex; flex-direction: column; gap: 2px; flex: 1 1 200px; }
.takin-resume-title { font-weight: 600; font-size: 0.92rem; color: var(--tsp-text); }
.takin-resume-actions { display: flex; align-items: center; gap: 8px; }
#btnResumeActiveScan {
  min-height: 44px; padding: 8px 16px; background: var(--tsp-primary); color: #ffffff;
  border: none; border-radius: 8px; font-weight: 600; font-size: 0.88rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
#btnDismissContinuityBanner {
  min-width: 44px; min-height: 44px; background: transparent; border: 1px solid var(--tsp-border);
  color: var(--tsp-muted); border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem;
}

/* 4. Honest Neutral-Amber Unprobed Home Pill */
.teaser-locked-row { flex-wrap: wrap; }
.teaser-cat-right { flex-shrink: 1; min-width: 0; flex-wrap: wrap; }
.teaser-defect-count.is-unprobed-home {
  background: var(--tsp-amber-bg) !important; color: var(--tsp-amber) !important;
  border: 1px solid var(--tsp-amber-border) !important; font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 0.76rem; font-weight: 700; line-height: 1.3; padding: 3px 9px;
  border-radius: 8px; display: inline-flex; align-items: center;
  white-space: normal; word-break: break-word; max-width: 100%;
}

/* 5. In-App Browser Guidance Bar */
#takinInAppBrowserBar {
  box-sizing: border-box; display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; padding: 10px 14px; background: var(--tsp-amber-bg);
  border: 1px solid var(--tsp-amber-border); border-radius: 10px; margin-bottom: 12px;
  font-size: 0.84rem; color: var(--tsp-amber);
}
#btnOpenExternalBrowser {
  min-height: 44px; padding: 8px 14px; background: var(--tsp-card-bg); border: 1px solid var(--tsp-amber-border);
  border-radius: 8px; color: var(--tsp-amber); font-weight: 600; cursor: pointer;
}

/* 6. Teaser Action Strip */
#takinTeaserActionStrip {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; box-sizing: border-box; width: 100%;
}
#btnOpenSampleReportModal,
#btnShareTeaserWhatsapp,
#btnForceLiveRescan {
  min-height: 46px; padding: 10px 14px; border-radius: 10px; font-size: 0.88rem; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  cursor: pointer; box-sizing: border-box; border: 1px solid var(--tsp-border);
  background: var(--tsp-surface); color: var(--tsp-text); flex: 1 1 auto;
}
#teaserCachedBadge {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
  font-size: 0.8rem; background: var(--tsp-primary-subtle); color: var(--tsp-primary);
  border: 1px solid var(--tsp-primary);
}
@media (max-width: 480px) {
  .v3-hero-copy:has(#scannerProgressBox[style*="block"]) .v3-hero-kicker { margin-bottom: 6px; }
  .v3-hero-copy:has(#scannerProgressBox[style*="block"]) .v3-hero-title { font-size: 1.62rem; margin-bottom: 8px; }
  .v3-hero-copy:has(#scannerProgressBox[style*="block"]) .v3-hero-sub { font-size: 0.86rem; line-height: 1.36; margin-bottom: 10px; }
  .v3-hero-copy:has(#scannerProgressBox[style*="block"]) .v3-telemetry-pills-row,
  .v3-hero-copy:has(#scannerProgressBox[style*="block"]) .v3-hero-video-row { display: none; }
  .scanner-progress-box:has(.takin-free-stepper) { margin-top: 8px; padding: 6px; }
  .takin-scan-progress-card, .takin-free-stepper { padding: 10px 12px; margin: 4px 0; }
  .takin-stepper-head { margin-bottom: 6px; font-size: 0.84rem; }
  .takin-stepper-bar { margin-bottom: 8px; height: 5px; }
  .takin-stepper-list { gap: 5px; }
  .takin-step-item { gap: 8px; font-size: 0.78rem; line-height: 1.25; padding: 1px 0; }
  .takin-step-dot { width: 8px; height: 8px; margin-top: 4px; }
  .takin-slow-site-note { margin-top: 7px; padding: 6px 9px; font-size: 0.75rem; line-height: 1.25; }
  .teaser-score-scope-note { font-size: 0.78rem; padding: 7px 10px; line-height: 1.36; }
  #btnOpenSampleReportModal,
  #btnShareTeaserWhatsapp,
  #btnForceLiveRescan { width: 100%; flex: 1 1 100%; }
}

/* 7. Sample Report Modal */
#takinSampleReportModal {
  position: fixed; inset: 0; z-index: 10050; display: none; align-items: center; justify-content: center;
  padding: 12px; background: rgba(15, 23, 42, 0.72); box-sizing: border-box;
}
#takinSampleReportModal.active { display: flex; }
.takin-sample-dialog {
  box-sizing: border-box; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  border-radius: 16px; padding: 18px; background: var(--tsp-modal-bg);
  border: 1px solid var(--tsp-border); color: var(--tsp-text); text-align: start;
}
.takin-sample-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
#btnCloseSampleReportModal {
  min-width: 44px; min-height: 44px; background: transparent; border: none;
  font-size: 1.3rem; color: var(--tsp-muted); cursor: pointer;
}
.takin-sample-cards {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px;
}
.takin-sample-card {
  padding: 12px 14px; border-radius: 10px; background: var(--tsp-surface);
  border: 1px solid var(--tsp-border); font-size: 0.88rem; line-height: 1.45;
}
#takinSampleSec20Notice {
  padding: 10px 12px; border-radius: 8px; background: rgba(100, 116, 139, 0.08);
  font-size: 0.78rem; color: var(--tsp-muted); margin-bottom: 14px; line-height: 1.35;
}
#btnSampleUnlockMyReport {
  min-height: 48px; width: 100%; background: var(--tsp-primary); color: #ffffff;
  border: none; border-radius: 10px; font-weight: 700; font-size: 0.95rem; cursor: pointer;
}

/* 8. Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation: none !important; transition: none !important; }
}
.is-reduced-motion * {
  animation: none !important; transition: none !important;
}
