/**
 * Soi Cầu — Giao diện sáng, mobile-first
 */

:root {
  --c-red: #334155;
  --c-red-dark: #1e293b;
  --c-red-soft: #f1f5f9;
  --c-primary: #3b82f6;
  --c-text: #0f172a;
  --c-muted: #64748b;
  --c-border: #e2e8f0;
  --c-bg: #f8fafc;
  --c-surface: #ffffff;
  --c-header: #ffffff;
  --c-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --c-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --radius-sm: 8px;
  --container: 1180px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --header-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.portal-body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

body.nav-open {
  overflow: hidden;
}

a {
  color: var(--c-red);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(var(--container), 96vw);
  margin-inline: auto;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ========== HEADER (LIGHT) ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--c-header);
  box-shadow: var(--c-shadow);
}

.site-header__bar {
  border-bottom: 1px solid var(--c-border);
}

.site-header__bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--header-h);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  min-width: 0;
}

.site-brand__mark {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--c-red), var(--c-red-dark));
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  display: grid;
  place-items: center;
}

.site-brand__name {
  font-weight: 700;
  font-size: clamp(15px, 3.5vw, 18px);
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-link {
  display: none;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none !important;
}

.header-link--primary {
  background: var(--c-red);
  color: #fff !important;
}

@media (min-width: 480px) {
  .header-link {
    display: inline-flex;
  }
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-text);
  cursor: pointer;
}

.icon-btn:hover {
  border-color: var(--c-red);
  color: var(--c-red);
}

.site-header__tagline-wrap {
  background: var(--c-red-soft);
  border-bottom: 1px solid var(--c-border);
}

.site-tagline {
  margin: 0;
  padding: 8px 0;
  font-size: clamp(12px, 2.8vw, 14px);
  font-weight: 600;
  color: var(--c-red-dark);
  text-align: center;
  line-height: 1.4;
}

.site-header__accent {
  height: 3px;
  background: linear-gradient(90deg, var(--c-red), var(--c-primary));
}

/* Nav toggle */
.nav-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.nav-toggle__lines {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 20px;
}

.nav-toggle__lines span {
  display: block;
  height: 2px;
  background: var(--c-text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

body.nav-open .nav-toggle__lines span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.nav-open .nav-toggle__lines span:nth-child(2) {
  opacity: 0;
}

body.nav-open .nav-toggle__lines span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile drawer */
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.25s;
}

.nav-backdrop.is-visible {
  opacity: 1;
}

.site-nav-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(100%, 340px);
  height: 100%;
  height: 100dvh;
  background: var(--c-surface);
  z-index: 1002;
  display: flex;
  flex-direction: column;
  box-shadow: var(--c-shadow-lg);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  padding-bottom: var(--safe-bottom);
}

body.nav-open .site-nav-panel {
  transform: translateX(0);
}

.site-nav-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}

.site-nav-panel__close {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--c-bg);
  border-radius: var(--radius-sm);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--c-text);
}

.site-nav-panel__foot {
  padding: 16px;
  border-top: 1px solid var(--c-border);
  flex-shrink: 0;
}

.portal-nav {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
}

.portal-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.portal-menu > li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  color: var(--c-text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--c-border);
  min-height: 48px;
}

.portal-menu > li > a:hover,
.portal-menu > li.is-active > a {
  background: var(--c-red-soft);
  color: var(--c-red);
}

.menu-arrow {
  font-size: 12px;
  color: var(--c-muted);
  transition: transform 0.2s;
}

.portal-menu > li.is-expanded > a .menu-arrow {
  transform: rotate(180deg);
}

.portal-menu .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--c-bg);
  display: none;
}

.portal-menu > li.is-expanded > .sub-menu {
  display: block;
}

.portal-menu .sub-menu a {
  display: block;
  padding: 12px 16px 12px 24px;
  font-size: 13px;
  color: var(--c-muted);
  text-decoration: none;
  line-height: 1.45;
  border-bottom: 1px solid var(--c-border);
}

.portal-menu .sub-menu a:hover {
  color: var(--c-red);
  background: var(--c-surface);
}

/* Desktop horizontal nav */
@media (min-width: 1100px) {
  .nav-toggle,
  .site-nav-panel__head,
  .site-nav-panel__foot,
  .nav-backdrop {
    display: none !important;
  }

  .site-nav-panel {
    position: static;
    width: auto;
    height: auto;
    transform: none !important;
    box-shadow: none;
    background: transparent;
    flex-direction: row;
    border-top: 1px solid var(--c-border);
  }

  .portal-nav {
    overflow: visible;
    padding: 0;
    width: 100%;
  }

  .portal-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 12px;
  }

  .portal-menu > li {
    position: relative;
  }

  .portal-menu > li > a {
    border-bottom: none;
    padding: 12px 10px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    min-height: auto;
  }

  .portal-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 300px;
    max-width: min(380px, 90vw);
    max-height: 65vh;
    overflow-y: auto;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--c-shadow-lg);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }

  .portal-menu > li:hover > .sub-menu,
  .portal-menu > li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    display: block;
  }

  .portal-menu > li.is-expanded > .sub-menu {
    display: block;
  }

  .portal-menu .sub-menu a {
    padding: 10px 14px;
    border-bottom: 1px solid var(--c-border);
  }
}

.fab-chat {
  background: var(--c-red);
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  box-shadow: var(--c-shadow-lg);
}

/* ========== LAYOUT ========== */
.portal-main {
  padding: 16px 0 calc(40px + var(--safe-bottom));
  background: transparent;
}

@media (min-width: 768px) {
  .portal-main {
    padding: 24px 0 48px;
  }
}

.portal-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

@media (min-width: 992px) {
  .portal-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
  }
}

.portal-content {
  min-width: 0;
}

/* ========== SERVICE CARDS ========== */
.service-grid,
.post-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .service-grid,
  .post-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.service-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: auto;
  box-shadow: var(--c-shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

@media (min-width: 768px) {
  .service-card {
    min-height: 200px;
  }

  .service-card:hover {
    box-shadow: var(--c-shadow-lg);
    transform: translateY(-2px);
  }
}

.service-card__thumb img {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 10px;
}

.service-card__title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  text-transform: uppercase;
}

.service-card__title a {
  color: var(--c-text);
  text-decoration: none;
}

.service-card__title a:hover {
  color: var(--c-red);
}

.service-card__excerpt {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--c-muted);
  flex: 1;
}

.service-card__btn {
  display: inline-flex;
  align-self: center;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 28px;
  background: var(--c-red);
  color: #fff !important;
  font-weight: 600;
  font-size: 14px;
  border-radius: 999px;
  text-decoration: none !important;
}

.service-card__btn:hover {
  background: var(--c-red-dark);
}

/* ========== CTA BAR ========== */
.cta-bar {
  margin-top: 20px;
  background: linear-gradient(135deg, var(--c-red), var(--c-red-dark));
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--c-shadow);
}

.cta-bar__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 640px) {
  .cta-bar__form {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
}

.cta-bar__form input[type="tel"] {
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
}

@media (min-width: 640px) {
  .cta-bar__form input[type="tel"] {
    flex: 1;
    min-width: 180px;
    width: auto;
  }
}

.cta-bar__btn {
  width: 100%;
  min-height: 44px;
  padding: 12px 20px;
  background: var(--c-text);
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 14px;
  text-align: center;
}

@media (min-width: 640px) {
  .cta-bar__btn {
    width: auto;
  }
}

.cta-bar__btn--alt {
  background: var(--c-white);
  color: var(--c-red) !important;
}

/* ========== SIDEBAR ========== */
.portal-sidebar {
  font-size: 13px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--c-shadow);
}

@media (max-width: 991px) {
  .portal-layout {
    display: flex;
    flex-direction: column;
  }

  .portal-sidebar {
    order: 2;
  }

  .portal-content {
    order: 1;
  }
}

.portal-sidebar .widget {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--c-border);
}

.portal-sidebar .widget-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 800;
  color: var(--c-text);
  text-transform: uppercase;
}

.widget-search .search-form {
  display: flex;
  gap: 0;
}

.widget-search input[type="search"] {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--c-border);
  border-right: 0;
}

.widget-search .search-submit {
  padding: 8px 14px;
  background: #eee;
  border: 1px solid var(--c-border);
  cursor: pointer;
  font-size: 12px;
}

.sidebar-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-links li {
  margin-bottom: 6px;
  padding-left: 14px;
  position: relative;
}

.sidebar-links li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--c-red);
  font-weight: bold;
}

.sidebar-links a {
  color: var(--c-red);
  line-height: 1.35;
}

.sidebar-links--dense {
  font-size: 12px;
}

.sidebar-links--dense li {
  margin-bottom: 4px;
}

.widget-seo-block p {
  margin: 0;
  font-size: 12px;
  color: var(--c-muted);
  line-height: 1.5;
}

.widget-seo-block strong {
  color: var(--c-red);
}

/* ========== ARCHIVE / SINGLE ========== */
.archive-header {
  margin-bottom: 20px;
  text-align: center;
}

.archive-header__title {
  margin: 0 0 8px;
  font-size: clamp(18px, 3vw, 26px);
  font-weight: 800;
  text-transform: uppercase;
}

.breadcrumbs {
  font-size: 12px;
  margin-bottom: 16px;
  color: var(--c-muted);
}

.breadcrumbs a {
  color: var(--c-red);
  font-weight: 600;
  text-transform: uppercase;
}

.breadcrumbs .sep {
  margin: 0 4px;
  color: var(--c-muted);
}

.breadcrumbs .current {
  color: var(--c-text);
}

.single-article__header h1 {
  font-size: clamp(20px, 4vw, 28px);
  margin: 0 0 8px;
  line-height: 1.3;
}

.single-article__header time {
  font-size: 12px;
  color: var(--c-muted);
}

.single-article__thumb img {
  max-width: 100%;
  height: auto;
  margin: 16px 0;
}

.entry-content {
  font-size: 15px;
  line-height: 1.7;
}

.entry-content p {
  margin-bottom: 1em;
}

.related-posts {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--c-border);
}

.related-posts h2 {
  font-size: 16px;
  margin-bottom: 16px;
}

/* Pagination */
.pagination,
.nav-links {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 24px 0;
  flex-wrap: wrap;
}

.pagination a,
.pagination span,
.nav-links a,
.nav-links span {
  padding: 6px 12px;
  border: 1px solid var(--c-border);
  color: var(--c-text);
}

.pagination .current,
.nav-links .current {
  background: var(--c-red);
  color: var(--c-white);
  border-color: var(--c-red);
}

/* ========== PAGES (Nhận số, form) ========== */
.page-nhan-so .card-form,
.card-form {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--c-shadow);
}

@media (min-width: 640px) {
  .page-nhan-so .card-form,
  .card-form {
    padding: 24px;
  }
}

.form-grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .field--full {
    grid-column: 1 / -1;
  }
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 13px;
}

.field input,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  background: var(--c-surface);
  color: var(--c-text);
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--c-red);
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.15);
}

.btn-portal,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  background: var(--c-red);
  color: #fff !important;
  border: none;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  text-decoration: none !important;
}

.btn-portal:hover,
.btn:hover {
  background: var(--c-red-dark);
}

.btn--block {
  width: 100%;
  text-align: center;
}

.numbers-display {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.number-ball {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  background: linear-gradient(145deg, #ffd700, #e6b800);
  color: #1a1a1a;
  border: 2px solid var(--c-red);
}

.result-panel {
  border: 1px solid var(--c-border);
  padding: 16px;
  margin-top: 16px;
}

.service-info-box {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-red);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.service-info-box__label {
  margin: 0 0 8px;
  color: var(--c-red);
  font-size: 15px;
}

.service-info-box__desc,
.service-info-box__min {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--c-muted);
}

.card-form__hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--c-muted);
}

.number-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.number-row__label {
  min-width: 80px;
  font-weight: 600;
  font-size: 13px;
}

/* Stats / heatmap on thong-ke page */
.heatmap {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  margin: 16px 0;
}

.heatmap span {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: 10px;
  background: #f0f0f0;
  border: 1px solid var(--c-border);
}

.heatmap span.hot {
  background: var(--c-red);
  color: var(--c-white);
  font-weight: 700;
}

/* ========== FOOTER ========== */
.portal-footer {
  background: var(--c-surface);
  color: var(--c-muted);
  padding: 24px 0 calc(24px + var(--safe-bottom));
  font-size: 13px;
  text-align: center;
  border-top: 1px solid var(--c-border);
  margin-top: 24px;
}

.portal-footer a {
  color: var(--c-red);
}

.footer-menu {
  margin-top: 10px;
}

.footer-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ========== CHAT WIDGET (realtime) ========== */

/* FAB Button */
.fab-chat {
  position: fixed;
  bottom: calc(20px + var(--safe-bottom));
  right: 20px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-red), var(--c-red-soft));
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(211, 47, 47, 0.45);
  z-index: 900;
  transition: transform 0.2s, box-shadow 0.2s;
  position: fixed;
}

.fab-chat:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(211, 47, 47, 0.55);
}

.fab-chat__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--c-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  animation: sc-badge-pop 0.3s ease;
}

@keyframes sc-badge-pop {
  0%   { transform: scale(0); }
  70%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Chat Widget — hidden state must always win */
.chat-widget[hidden],
.chat-widget[style*="display: none"] {
  display: none !important;
}

/* Chat Widget */
.chat-widget {
  position: fixed;
  bottom: calc(90px + var(--safe-bottom));
  right: 20px;
  width: min(380px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 170px));
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(26, 35, 50, 0.22);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sc-widget-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes sc-widget-in {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.chat-widget__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--c-red), var(--c-red-dark));
  color: #fff;
  flex-shrink: 0;
}

.chat-widget__header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chat-widget__title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  opacity: 0.85;
}

.chat-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #aaa;
  flex-shrink: 0;
  transition: background 0.3s;
}

.chat-status__dot--online {
  background: #69f0ae;
  box-shadow: 0 0 0 2px rgba(105, 240, 174, 0.35);
  animation: sc-pulse-dot 2s ease infinite;
}

.chat-status__dot--offline {
  background: var(--c-primary);
}

@keyframes sc-pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.chat-widget__close {
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.chat-widget__close:hover {
  background: rgba(255, 255, 255, 0.32);
}

/* Messages area */
.chat-widget__messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8f9fa;
  min-height: 220px;
  max-height: 340px;
  scroll-behavior: smooth;
}

.chat-welcome {
  text-align: center;
  padding: 16px 8px;
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.6;
  margin: auto;
}

/* Bubble */
.chat-bubble-wrap {
  display: flex;
}

.chat-bubble-wrap--in  { justify-content: flex-start; }
.chat-bubble-wrap--out { justify-content: flex-end; }

.chat-bubble {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.chat-bubble--in {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.chat-bubble--out {
  background: linear-gradient(135deg, var(--c-red), var(--c-red-dark));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble__text {
  display: block;
  margin-bottom: 3px;
}

.chat-bubble__meta {
  display: block;
  font-size: 10px;
  opacity: 0.55;
  text-align: right;
}

.chat-bubble--in .chat-bubble__meta { text-align: left; }

/* New bubble animation */
.chat-bubble--new .chat-bubble {
  animation: sc-bubble-in 0.22s ease;
}

@keyframes sc-bubble-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Phone row */
.chat-widget__phone-row {
  padding: 8px 12px 4px;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.chat-input-phone {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--c-text);
  background: #fafafa;
}

.chat-input-phone:focus {
  outline: none;
  border-color: var(--c-red);
}

/* Form row */
.chat-widget__form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 12px 12px;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.chat-input-msg {
  flex: 1;
  resize: none;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: var(--font);
  line-height: 1.5;
  min-height: 40px;
  max-height: 100px;
  color: var(--c-text);
  background: #fafafa;
  transition: border-color 0.15s;
}

.chat-input-msg:focus {
  outline: none;
  border-color: var(--c-red);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.chat-send-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-red), var(--c-red-dark));
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(211, 47, 47, 0.35);
}

.chat-send-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 14px rgba(211, 47, 47, 0.5);
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.toast-container {
  position: fixed;
  top: 80px;
  right: 16px;
  z-index: 2000;
}

.toast {
  padding: 12px 16px;
  background: var(--c-surface);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-red);
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  box-shadow: var(--c-shadow-lg);
  font-size: 14px;
}

.toast--error {
  border-left-color: #ff4444;
}

/* Steps nhận số */
.steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

@media (min-width: 480px) {
  .steps {
    flex-direction: row;
  }
}

.steps li {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.steps li.active {
  border-color: var(--c-red);
  color: var(--c-red);
  font-weight: 700;
}

.history-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
}

.history-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--c-surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.history-table th,
.history-table td {
  border: 1px solid var(--c-border);
  padding: 10px 12px;
  text-align: left;
}

.history-table th {
  background: var(--c-bg);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-win {
  color: #0a7a0a;
  font-weight: 600;
}

.badge-lose {
  color: var(--c-red);
}

/* ==========================================
   HOMEPAGE PREMIUM STYLING
   ========================================== */

/* Hero Banner */
.hero-banner {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  padding: 48px 24px;
  border-radius: var(--radius);
  margin-bottom: 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--c-shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at top right, rgba(211, 47, 47, 0.15), transparent 60%);
  pointer-events: none;
}

.hero-banner__badge {
  display: inline-block;
  background: rgba(211, 47, 47, 0.2);
  color: #ff8a80;
  border: 1px solid rgba(211, 47, 47, 0.4);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.hero-banner__title {
  font-size: clamp(22px, 5vw, 36px);
  font-weight: 850;
  line-height: 1.25;
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.hero-banner__desc {
  font-size: clamp(14px, 2.5vw, 17px);
  color: #94a3b8;
  max-width: 600px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

.hero-banner__action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--c-red) 0%, var(--c-red-dark) 100%);
  color: #ffffff !important;
  font-weight: 700;
  padding: 14px 32px;
  font-size: 16px;
  border-radius: 999px;
  box-shadow: 0 4px 20px rgba(255, 23, 68, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none !important;
}

.hero-banner__action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255, 23, 68, 0.6);
}

/* Win Carousel */
.win-carousel-section {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin-bottom: 30px;
  box-shadow: var(--c-shadow);
}

.win-carousel-section__title {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.win-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

.win-carousel::-webkit-scrollbar {
  height: 5px;
}

.win-carousel::-webkit-scrollbar-track {
  background: transparent;
}

.win-carousel::-webkit-scrollbar-thumb {
  background: var(--c-border);
  border-radius: 99px;
}

.win-item {
  flex: 0 0 200px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid var(--c-border);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  color: var(--c-text);
}

.win-item strong {
  color: var(--c-red-dark);
}

.win-item small {
  color: var(--c-muted);
  display: block;
  margin-top: 4px;
}

/* Dynamic Stats */
.public-stats-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 30px;
}

@media (min-width: 580px) {
  .public-stats-wrap {
    grid-template-columns: 1fr 1fr;
  }
}

.public-stats-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--c-shadow);
}

.public-stats-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--c-red-soft);
  color: var(--c-red);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.public-stats-card__info {
  min-width: 0;
}

.public-stats-card__label {
  margin: 0;
  font-size: 13px;
  color: var(--c-muted);
}

.public-stats-card__value {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--c-text);
}

/* Floating CTA button for Mobile */
.floating-cta {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 80px; /* Leave space for chat fab */
  z-index: 999;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  animation: bounceUp 1s infinite alternate;
}

@media (min-width: 1100px) {
  .floating-cta {
    display: none !important;
  }
}

@keyframes bounceUp {
  from { transform: translateY(0); }
  to { transform: translateY(-4px); }
}

/* Custom Radio Group for Card Type & Amounts */
.radio-group,
.radio-grid {
  display: grid;
  gap: 10px;
  margin-top: 6px;
  margin-bottom: 8px;
}

.card-type-group {
  grid-template-columns: repeat(3, 1fr);
}

.amount-grid {
  grid-template-columns: repeat(3, 1fr);
}

@media (min-width: 640px) {
  .amount-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.radio-item {
  position: relative;
  cursor: pointer;
  display: block;
}

.radio-item input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.radio-item .radio-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s ease;
  user-select: none;
}

.radio-item:hover .radio-label {
  border-color: var(--c-red);
  color: var(--c-red);
}

.radio-item input[type="radio"]:checked + .radio-label {
  background: var(--c-red);
  color: #fff;
  border-color: var(--c-red);
  box-shadow: 0 4px 12px rgba(211, 47, 47, 0.2);
}


