:root {
  --blue-950: #071633;
  --blue-900: #08245c;
  --blue-800: #073391;
  --blue-600: #0b5cff;
  --orange: #ff6b2c;
  --green: #00a86b;
  --yellow: #f5b82e;
  --red: #e34b4b;
  --surface: #ffffff;
  --muted: #63708a;
  --line: #dce5f5;
  --bg: #f4f7fb;
  --shadow: 0 18px 50px rgba(7, 22, 51, .14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; overflow-x: hidden; background: var(--bg); color: var(--blue-950); }
body { -webkit-text-size-adjust: 100%; }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { width: 100%; min-height: 100dvh; }
.hero { background: radial-gradient(circle at 20% 10%, rgba(11,92,255,.45), transparent 34%), linear-gradient(135deg, var(--blue-950), var(--blue-900) 54%, #0a3ca0); color: white; padding: 16px 16px 32px; border-bottom-left-radius: 28px; border-bottom-right-radius: 28px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1120px; margin: 0 auto 28px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 42px; height: 42px; border-radius: 14px; background: white; color: var(--blue-900); display: grid; place-items: center; font-weight: 900; box-shadow: 0 10px 30px rgba(0,0,0,.15); flex: 0 0 auto; }
.brand strong, .brand span { display: block; line-height: 1.1; }
.brand span { color: rgba(255,255,255,.72); font-size: 12px; margin-top: 3px; }
.ghost-btn { border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.1); color: inherit; padding: 10px 14px; border-radius: 999px; font-weight: 700; backdrop-filter: blur(10px); }
.main-content { max-width: 1120px; margin: -18px auto 0; padding: 0 16px 24px; }
.hero-content { max-width: 1120px; margin: 0 auto; display: grid; gap: 20px; }
.eyebrow { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; font-weight: 900; color: #ffcfb6; }
h1 { font-size: clamp(31px, 10vw, 64px); line-height: .98; margin: 0; letter-spacing: -.04em; }
.subtitle { color: rgba(255,255,255,.82); line-height: 1.62; margin: 16px 0 0; font-size: 15px; }
.trust-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.trust-badges span { padding: 8px 10px; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.12); font-size: 12px; font-weight: 800; }
.lookup-card { background: white; color: var(--blue-950); border-radius: 24px; padding: 18px; box-shadow: var(--shadow); }
.lookup-card label { font-weight: 800; font-size: 14px; }
.phone-field { margin-top: 9px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 18px; padding: 5px 12px; background: #f8fbff; }
.phone-field span { color: var(--blue-800); font-weight: 900; border-right: 1px solid var(--line); padding-right: 9px; }
.phone-field input { width: 100%; border: 0; outline: 0; background: transparent; min-height: 48px; font-size: 18px; font-weight: 800; color: var(--blue-950); }
.consent-box { margin: 12px 0; border: 1px dashed #c9d6eb; border-radius: 16px; padding: 11px; background: #fbfdff; }
.check-row { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 13px !important; font-weight: 600 !important; line-height: 1.45; }
.primary-btn { width: 100%; border: 0; border-radius: 17px; min-height: 52px; background: linear-gradient(135deg, var(--orange), #ff8d4f); color: white; font-weight: 900; box-shadow: 0 12px 26px rgba(255, 107, 44, .3); }
.helper-text { margin: 12px 0 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.summary-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 18px; }
.summary-grid article, .results-section, .footer { background: white; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 8px 28px rgba(7,22,51,.06); }
.summary-grid article { padding: 16px; }
.summary-grid strong { display: block; color: var(--blue-800); margin-bottom: 6px; }
.summary-grid span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.results-section { padding: 16px; }
.hidden { display: none !important; }
.result-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.result-header .eyebrow { color: var(--orange); }
h2, h3 { margin: 0; }
#resultSubtitle { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.result-header .ghost-btn { color: var(--blue-900); border-color: var(--line); background: #f8fbff; }
.risk-panel { display: grid; grid-template-columns: 108px 1fr; align-items: center; gap: 14px; padding: 14px; border-radius: 22px; background: linear-gradient(135deg, #eef5ff, #fff); border: 1px solid var(--line); margin-bottom: 14px; }
.score-ring { width: 96px; height: 96px; border-radius: 999px; display: grid; place-items: center; place-content: center; background: conic-gradient(var(--green) 0deg, var(--green) 250deg, #dbe6f5 250deg); box-shadow: inset 0 0 0 9px white; }
.score-ring span { font-size: 28px; font-weight: 950; line-height: 1; }
.score-ring small { color: var(--muted); font-size: 10px; font-weight: 900; }
.risk-copy p { margin: 7px 0 0; color: var(--muted); line-height: 1.5; font-size: 13px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 3px 0 12px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 1px solid var(--line); background: white; color: var(--blue-900); border-radius: 999px; padding: 10px 13px; white-space: nowrap; font-weight: 900; font-size: 13px; }
.tabs button[aria-selected="true"] { background: var(--blue-900); color: white; border-color: var(--blue-900); }
.tab-panel { display: grid; gap: 12px; }
.info-card { border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: #fff; }
.info-card h4 { margin: 0 0 12px; color: var(--blue-800); font-size: 15px; }
.kv { display: grid; grid-template-columns: minmax(92px, 38%) 1fr; gap: 9px 12px; font-size: 13px; align-items: start; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 800; min-width: 0; overflow-wrap: anywhere; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.status.good { background: #e8fff5; color: #08764e; }
.status.warn { background: #fff7dd; color: #8b6100; }
.status.bad { background: #fff0f0; color: #a72b2b; }
.signal-list { display: grid; gap: 10px; }
.signal { display: grid; gap: 7px; }
.signal-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 900; }
.bar { height: 9px; background: #e7edf7; border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--w); background: var(--blue-600); border-radius: inherit; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; background: #071633; color: #dceaff; padding: 14px; border-radius: 16px; font-size: 12px; line-height: 1.55; overflow-x: auto; }
.footer { max-width: 1120px; margin: 0 auto 20px; padding: 14px 16px; display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.footer strong { color: var(--blue-900); }
.catalog-dialog { width: min(94vw, 720px); border: 0; border-radius: 24px; padding: 0; box-shadow: var(--shadow); }
.catalog-dialog::backdrop { background: rgba(7,22,51,.48); backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.icon-btn { width: 38px; height: 38px; border: 0; border-radius: 999px; background: #f0f5ff; font-size: 24px; color: var(--blue-900); }
.catalog-list { padding: 16px; display: grid; gap: 10px; }
.catalog-list article { border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: grid; gap: 5px; }
.catalog-list b { color: var(--blue-800); }
.catalog-list span { color: var(--muted); font-size: 13px; line-height: 1.45; }
@media (min-width: 720px) {
  .hero { padding: 24px 28px 50px; }
  .hero-content { grid-template-columns: 1.05fr .95fr; align-items: end; }
  .lookup-card { padding: 22px; }
  .summary-grid { grid-template-columns: repeat(4, 1fr); }
  .results-section { padding: 22px; }
  .tab-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wide { grid-column: 1 / -1; }
}
/* SweetAlert2 custom theme */
.tl-swal-popup {
  width: min(92vw, 420px) !important;
  border-radius: 24px !important;
  padding: 26px 22px 22px !important;
  box-shadow: 0 24px 70px rgba(4, 15, 43, 0.28) !important;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

.tl-swal-title {
  color: var(--navy) !important;
  font-size: 1.15rem !important;
  line-height: 1.3 !important;
  letter-spacing: -0.02em !important;
}

.tl-swal-text {
  color: var(--muted) !important;
  font-size: 0.95rem !important;
  line-height: 1.55 !important;
  margin-top: 8px !important;
}

.tl-swal-confirm {
  border: 1px solid rgba(10, 37, 64, 0.14) !important;
  border-radius: 999px !important;
  padding: 12px 22px !important;
  color: #0a2540 !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  background: linear-gradient(135deg, #ffffff, #eaf2ff) !important;
  box-shadow: 0 14px 28px rgba(12, 74, 180, 0.18) !important;
}

.tl-swal-confirm:focus-visible {
  outline: 3px solid rgba(17, 105, 255, 0.25) !important;
  outline-offset: 3px !important;
}

/* Ensure all SweetAlert confirm labels, including “Kiểm tra lại”, remain readable */
.swal2-confirm.tl-swal-confirm,
.swal2-styled.tl-swal-confirm,
button.tl-swal-confirm {
  color: #0a2540 !important;
  background: linear-gradient(135deg, #ffffff, #eaf2ff) !important;
  border: 1px solid rgba(10, 37, 64, 0.16) !important;
  text-shadow: none !important;
}

.swal2-confirm.tl-swal-confirm:hover,
.swal2-styled.tl-swal-confirm:hover,
button.tl-swal-confirm:hover {
  color: #061a2e !important;
  background: linear-gradient(135deg, #f8fbff, #dbeafe) !important;
}
.purpose-label { display: block; margin-top: 12px; }
.purpose-select { width: 100%; min-height: 46px; margin-top: 8px; border: 1px solid var(--line); border-radius: 16px; padding: 0 12px; background: #f8fbff; color: var(--blue-950); font-weight: 800; outline: none; }
.primary-btn[disabled] { opacity: .72; cursor: progress; filter: grayscale(.15); }
.ai-report { background: linear-gradient(135deg, #ffffff, #f4f8ff); }
.report-summary { margin: 0 0 14px; color: var(--blue-950); font-size: 14px; line-height: 1.65; font-weight: 700; }
.report-list { margin: 0; padding-left: 18px; color: var(--blue-950); display: grid; gap: 8px; font-size: 13px; line-height: 1.55; }
.compliance-note { margin: 12px 0 0; border: 1px dashed #cbd7ea; border-radius: 14px; background: #fbfdff; padding: 12px; color: var(--muted); font-size: 12px; line-height: 1.55; }
