/* Takin Cyber — Flagship V3 Live Code Scanner HUD & Inspection Matrix Styles (<= 360L, <= 25KB) */
.v3-twin-explode-row { scroll-margin-top: 76px; }
.v3-explode-presets { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }

.v3-code-scanner-hud {
  position: relative; z-index: 16; width: 100%; border-radius: 13px; transform-origin: top center;
  background: linear-gradient(160deg, rgba(6, 12, 26, 0.98) 0%, rgba(11, 21, 40, 0.98) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.56);
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.72), 0 0 24px rgba(14, 165, 233, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  color: #f8fafc; display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 9px;
  transform-style: preserve-3d; transition: opacity 0.18s linear, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.v3-code-scanner-hud[data-scan-stage-active="false"],
.v3-code-scanner-hud[data-spotlight-compact="true"] {
  opacity: 0 !important; visibility: hidden !important; pointer-events: none !important;
}

.v3-code-hud-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 5px; border-bottom: 1px solid rgba(148, 163, 184, 0.18); }
.v3-code-hud-head-start { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.v3-code-hud-dots { display: inline-flex; gap: 4px; direction: ltr; flex-shrink: 0; }
.v3-code-hud-dots i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: #fb7185; }
.v3-code-hud-dots i:nth-child(2) { background: #fbbf24; }
.v3-code-hud-dots i:nth-child(3) { background: #34d399; }
.v3-code-hud-title { font-size: 0.72rem; font-weight: 900; color: #e0f2fe; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v3-code-hud-live-badge {
  font-size: 0.63rem; font-weight: 800; padding: 2px 8px; border-radius: 999px;
  background: rgba(16, 185, 129, 0.18); border: 1px solid rgba(52, 211, 153, 0.45); color: #6ee7b7; white-space: nowrap; flex-shrink: 0;
}

.v3-code-hud-viewport { position: relative; border-radius: 9px; background: rgba(2, 6, 23, 0.86); border: 1px solid rgba(56, 189, 248, 0.22); padding: 5px 6px; overflow: hidden; }
.v3-code-scan-beam {
  position: absolute; left: 0; right: 0; height: 2px; top: 12%; z-index: 4; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, #38bdf8 22%, #34d399 50%, #38bdf8 78%, transparent 100%);
  box-shadow: 0 0 12px 2px rgba(56, 189, 248, 0.65), 0 0 22px 3px rgba(16, 185, 129, 0.35);
  transition: top 0.14s linear;
}
.v3-code-scan-lines { display: flex; flex-direction: column; gap: 4px; position: relative; z-index: 2; }
.v3-code-scan-line {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 7px;
  padding: 4px 7px; border-radius: 6px; background: rgba(15, 23, 42, 0.66); border: 1px solid rgba(148, 163, 184, 0.14);
  transition: background 0.18s ease, border-color 0.18s ease;
}
.v3-code-scan-line[data-line-state="scanning"] { background: rgba(14, 165, 233, 0.18); border-color: rgba(56, 189, 248, 0.58); }
.v3-code-scan-line[data-line-state="flagged"] { background: rgba(136, 19, 55, 0.28); border-color: rgba(251, 113, 133, 0.52); }
.v3-code-scan-line[data-line-state="clean"] { background: rgba(6, 78, 59, 0.32); border-color: rgba(52, 211, 153, 0.52); }

.v3-code-line-num { font-family: var(--font-mono); font-size: 0.61rem; font-weight: 700; color: #94a3b8; text-align: center; }
.v3-code-line-src {
  font-family: var(--font-mono); font-size: 0.64rem; font-weight: 500;
  font-variant-ligatures: none; font-feature-settings: "calt" 0, "liga" 0;
  color: #e2e8f0; direction: ltr; unicode-bidi: isolate; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.v3-code-he-token {
  unicode-bidi: isolate; display: inline-block; padding-inline: 2px;
  font-family: var(--font-sans, 'Assistant', 'Rubik', sans-serif); font-weight: 600; letter-spacing: 0;
}
.v3-code-line-badge { font-size: 0.61rem; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: rgba(30, 41, 59, 0.9); border: 1px solid rgba(148, 163, 184, 0.25); color: #94a3b8; white-space: nowrap; }
.v3-code-scan-line[data-line-state="scanning"] .v3-code-line-badge { background: rgba(14, 165, 233, 0.24); border-color: #38bdf8; color: #bae6fd; }
.v3-code-scan-line[data-line-state="flagged"] .v3-code-line-badge { background: rgba(244, 63, 94, 0.22); border-color: rgba(251, 113, 133, 0.6); color: #fecdd3; }
.v3-code-scan-line[data-line-state="clean"] .v3-code-line-badge { background: rgba(16, 185, 129, 0.22); border-color: rgba(52, 211, 153, 0.6); color: #a7f3d0; }

.v3-code-scan-telemetry { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 5px; padding-top: 2px; }
.v3-code-tel-pill { font-size: 0.62rem; font-weight: 800; padding: 2px 8px; border-radius: 6px; background: rgba(15, 23, 42, 0.85); border: 1px solid rgba(148, 163, 184, 0.22); color: #cbd5e1; font-variant-numeric: tabular-nums; }
.v3-code-tel-pill.is-findings { border-color: rgba(251, 191, 36, 0.48); background: rgba(120, 53, 15, 0.34); color: #fde68a; }

/* Part 2: 5-Domain Inspection Map & 8-Dimension Free vs. Paid Comparison Matrix */
.v3-checks-matrix-section { padding: 84px 0 88px; position: relative; overflow-x: clip; }
.v3-checks-header { margin-bottom: 28px; }
.v3-inspection-topics-wrap { display: flex; flex-direction: column; gap: 18px; margin-bottom: 64px; min-width: 0; }
.v3-topics-tabbar, .v3-topics-tablist {
  display: none; padding: 6px; border-radius: 16px; background: var(--bg-subtle); border: 1px solid var(--v3-border-subtle);
}
.v3-topic-tab {
  min-height: 48px; padding: 10px 16px; border-radius: 12px; border: 1px solid transparent;
  background: transparent; color: var(--v3-text-secondary); font-family: var(--font-sans);
  font-size: 0.88rem; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; gap: 6px; text-align: center; line-height: 1.25;
  transition: background-color 0.24s cubic-bezier(0.16, 1, 0.3, 1), color 0.24s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.24s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.v3-topic-tab:hover { color: var(--v3-text-main); background: rgba(16, 185, 129, 0.08); }
.v3-topic-tab[data-active="true"] {
  background: var(--v3-bg-card); color: var(--v3-text-main); border-color: var(--accent-emerald-border);
  box-shadow: var(--shadow-sm);
}
html[data-theme="dark"] .v3-topic-tab[data-active="true"] {
  background: rgba(16, 185, 129, 0.16); border-color: rgba(52, 211, 153, 0.5); color: #f8fafc;
}

.v3-topics-cards-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; min-width: 0; }
.v3-topic-card {
  grid-column: span 2; min-width: 0; background: var(--v3-bg-card); border: 1px solid var(--v3-border-subtle);
  border-radius: 20px; padding: 22px 22px 20px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 12px; cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.v3-topic-card[hidden] { display: none !important; }
.v3-topic-card:nth-child(4), .v3-topic-card:nth-child(5) { grid-column: span 3; }
.v3-topic-card:hover { transform: translateY(-2px); border-color: var(--accent-emerald-border); }
.v3-topic-card[data-active="true"] {
  border-color: var(--v3-emerald);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.v3-topic-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.v3-topic-num-pill {
  font-family: var(--font-mono); font-size: 0.74rem; font-weight: 800; padding: 3px 9px; border-radius: 999px;
  background: var(--accent-emerald-light); border: 1px solid var(--accent-emerald-border);
  color: var(--v3-emerald-bright); font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.v3-topic-law-badge {
  font-size: 0.73rem; font-weight: 800; padding: 3px 9px; border-radius: 8px;
  background: var(--bg-subtle); border: 1px solid var(--v3-border-subtle); color: var(--v3-text-secondary);
  max-width: 100%; overflow-wrap: anywhere;
}
.v3-topic-card-title { font-family: var(--font-display); font-size: 1.08rem; font-weight: 900; line-height: 1.3; color: var(--v3-text-main); }
.v3-topic-list { list-style: none; display: flex; flex-direction: column; gap: 9px; margin: 0; padding: 0; }
.v3-topic-item { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; align-items: start; font-size: 0.9rem; line-height: 1.5; color: var(--v3-text-secondary); }
.v3-topic-check { color: var(--v3-emerald-bright); font-weight: 900; font-size: 0.86rem; line-height: 1.45; text-align: center; }

/* Part B: 8-Dimension Free vs. Paid Comparison Table */
.v3-compare-block {
  background: var(--v3-bg-card); border: 1px solid var(--v3-border-subtle); border-radius: 26px;
  padding: 36px 28px 32px; box-shadow: var(--shadow-md); min-width: 0;
}
.v3-compare-header { text-align: center; max-width: 800px; margin: 0 auto 28px; }
.v3-compare-title { font-size: clamp(1.6rem, 2.6vw, 2.25rem); }
.v3-compare-table { display: flex; flex-direction: column; border: 1px solid var(--v3-border-subtle); border-radius: 18px; overflow: hidden; background: var(--bg-subtle); }
.v3-compare-head-row, .v3-compare-row {
  display: grid; grid-template-columns: minmax(180px, 0.92fr) minmax(0, 1.05fr) minmax(0, 1.48fr);
  align-items: stretch; min-width: 0;
}
.v3-compare-head-row { background: var(--bg-elevated); border-bottom: 1.5px solid var(--border-strong); }
.v3-compare-th { padding: 16px 18px; display: flex; flex-direction: column; justify-content: center; gap: 5px; font-family: var(--font-display); font-size: 0.96rem; font-weight: 900; color: var(--v3-text-main); }
.v3-compare-th.is-paid { background: var(--accent-emerald-light); border-inline-start: 1px solid var(--accent-emerald-border); }
.v3-compare-price-chip {
  display: inline-flex; align-self: flex-start; font-family: var(--font-sans); font-size: 0.76rem; font-weight: 800;
  padding: 3px 10px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.v3-compare-price-chip.is-free { background: var(--v3-bg-card); border: 1px solid var(--v3-border-subtle); color: var(--v3-text-secondary); }
.v3-compare-price-chip.is-paid { background: #047857; color: #ffffff; }
html[data-theme="dark"] .v3-compare-price-chip.is-paid { background: #10b981; color: #02130c; }

.v3-compare-row { background: var(--v3-bg-card); border-bottom: 1px solid var(--v3-border-subtle); transition: background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
.v3-compare-row:last-child { border-bottom: none; }
.v3-compare-cell { padding: 16px 18px; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; font-size: 0.9rem; line-height: 1.52; }
.v3-compare-cell.is-topic { flex-direction: row; align-items: flex-start; justify-content: flex-start; gap: 10px; background: rgba(148, 163, 184, 0.04); }
.v3-compare-row-num {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 800; padding: 2px 7px; border-radius: 6px;
  background: var(--bg-subtle); border: 1px solid var(--v3-border-subtle); color: var(--v3-cyan);
  font-variant-numeric: tabular-nums; flex-shrink: 0; margin-top: 2px;
}
.v3-compare-topic-name { font-family: var(--font-display); font-size: 0.95rem; font-weight: 800; color: var(--v3-text-main); line-height: 1.35; }
.v3-compare-cell.is-free { color: var(--v3-text-secondary); border-inline-start: 1px solid var(--v3-border-subtle); }
.v3-compare-cell.is-paid {
  color: var(--v3-text-main); font-weight: 600;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.02) 100%);
  border-inline-start: 1px solid var(--accent-emerald-border);
}
html[data-theme="dark"] .v3-compare-cell.is-paid { background: linear-gradient(180deg, rgba(16, 185, 129, 0.11) 0%, rgba(14, 165, 233, 0.05) 100%); }
.v3-compare-paid-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.v3-compare-tech-badge {
  display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: 0.71rem; font-weight: 800;
  padding: 2px 9px; border-radius: 999px; background: var(--accent-emerald-light);
  border: 1px solid var(--accent-emerald-border); color: var(--v3-emerald-bright); max-width: 100%; overflow-wrap: anywhere;
}
.v3-compare-mob-lbl { display: none; font-size: 0.75rem; font-weight: 900; letter-spacing: 0.01em; }
.v3-compare-mob-lbl.is-free-lbl { color: var(--v3-text-muted); }
.v3-compare-mob-lbl.is-paid-lbl { color: var(--v3-emerald-bright); }

/* Bottom Dual CTA Bar */
.v3-compare-cta-wrap { margin-top: 26px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.v3-compare-cta-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; width: 100%; }
.v3-compare-cta-secondary, .v3-compare-cta-primary {
  min-height: 50px; padding: 12px 24px; border-radius: 12px; font-family: var(--font-display);
  font-size: 0.96rem; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; text-align: center; line-height: 1.25; font-variant-numeric: tabular-nums;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.v3-compare-cta-secondary {
  background: var(--bg-subtle); color: var(--v3-text-main); border: 1.5px solid var(--border-strong);
}
.v3-compare-cta-secondary:hover { border-color: var(--v3-emerald); transform: translateY(-1px); }
.v3-compare-cta-primary {
  background: linear-gradient(135deg, #34d399 0%, #10b981 60%, #059669 100%); color: #02130c;
  border: 1px solid rgba(167, 243, 208, 0.7); box-shadow: 0 10px 26px rgba(16, 185, 129, 0.3);
}
html[data-theme="light"] .v3-compare-cta-primary {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%); color: #ffffff; border-color: #047857;
  box-shadow: 0 10px 24px rgba(4, 120, 87, 0.24);
}
.v3-compare-cta-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(16, 185, 129, 0.42); }
.v3-compare-reassure { font-size: 0.82rem; font-weight: 700; color: var(--v3-text-muted); text-align: center; max-width: 780px; line-height: 1.5; }

@media (max-width: 959px) {
  .v3-topics-tabbar, .v3-topics-tablist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .v3-topic-tab:last-child { grid-column: 1 / -1; }
  .v3-topic-tab { min-height: 48px; padding: 8px 10px; font-size: 0.83rem; width: 100%; }
  .v3-topics-cards-grid { grid-template-columns: minmax(0, 1fr); }
  .v3-topic-card, .v3-topic-card:nth-child(4), .v3-topic-card:nth-child(5) { grid-column: 1 / -1; padding: 18px 16px; }
}

@media (max-width: 859px) {
  .v3-checks-matrix-section { padding: 56px 0 64px; }
  .v3-inspection-topics-wrap { margin-bottom: 42px; }
  .v3-compare-block { padding: 24px 14px 22px; border-radius: 20px; }
  .v3-compare-thead { display: none; }
  .v3-compare-table { background: transparent; border: none; gap: 12px; }
  .v3-compare-tbody { display: flex; flex-direction: column; gap: 12px; }
  .v3-compare-row {
    grid-template-columns: minmax(0, 1fr); border: 1px solid var(--v3-border-subtle);
    border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm);
  }
  .v3-compare-cell { padding: 12px 14px; font-size: 0.86rem; }
  .v3-compare-cell.is-topic { background: var(--bg-elevated); border-bottom: 1px solid var(--v3-border-subtle); }
  .v3-compare-cell.is-free { border-inline-start: none; border-bottom: 1px solid var(--v3-border-subtle); }
  .v3-compare-cell.is-paid { border-inline-start: none; }
  .v3-compare-mob-lbl { display: inline-block; }
  .v3-compare-cta-bar { flex-direction: column; align-items: stretch; }
  .v3-compare-cta-secondary, .v3-compare-cta-primary { width: 100%; min-height: 48px; padding: 12px 14px; font-size: 0.88rem; }
}

@media (max-width: 768px) {
  .v3-twin-explode-row .v3-explode-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px; width: 100%; }
  .v3-twin-explode-row .v3-explode-presets { order: 3; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 5px; width: 100%; }
  .v3-twin-explode-row [data-peel-preset] { min-height: 48px; height: 100%; padding: 5px 4px; border-radius: 10px; font-size: 0.71rem; line-height: 1.2; text-align: center; justify-content: center; white-space: normal; box-sizing: border-box; }
  .v3-code-scanner-hud { padding: 5px 7px 6px; gap: 4px; }
  .v3-code-hud-dots { display: none; }
  .v3-code-hud-header { flex-wrap: nowrap; gap: 5px; padding-bottom: 3px; }
  .v3-code-hud-title { font-size: 0.65rem; }
  .v3-code-hud-live-badge { font-size: 0.56rem; padding: 1px 6px; }
  .v3-code-hud-viewport { padding: 4px 5px; }
  .v3-code-scan-lines { gap: 3px; }
  .v3-code-scan-line { grid-template-columns: 16px minmax(0, 1fr); gap: 1px 4px; padding: 2.5px 5px; }
  .v3-code-line-num { font-size: 0.56rem; }
  .v3-code-line-src { font-size: 0.56rem; line-height: 1.15; }
  .v3-code-line-badge { grid-column: 1 / -1; justify-self: start; font-size: 0.54rem; padding: 1px 6px; white-space: normal; line-height: 1.15; }
  .v3-code-scan-telemetry { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding-top: 1px; }
  .v3-code-tel-pill { font-size: 0.53rem; padding: 3px 4px; line-height: 1.15; text-align: center; white-space: normal; }
}

@media (max-width: 520px) {
  .v3-twin-explode-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; width: 100%; }
  .v3-twin-explode-row .v3-explode-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; width: 100%; }
  .v3-twin-explode-row [data-peel-preset] { min-height: 48px; padding: 5px 4px; font-size: 0.71rem; line-height: 1.2; text-align: center; justify-content: center; white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .v3-code-scan-beam, .v3-topic-tab, .v3-topic-card, .v3-compare-row,
  .v3-compare-cta-secondary, .v3-compare-cta-primary { transition: none !important; animation: none !important; }
}
