/* ========================================
   CheckIP.me - giao diện kết quả (ProxyCheck.io V3)
   Bổ sung cho custom-bootstrap.css
   ======================================== */

:root {
  --ck-blue: #0d6efd;
  --ck-purple: #6f42c1;
  --ck-red: #dc3545;
  --ck-green: #198754;
  --ck-orange: #fd7e14;
  --ck-yellow: #ffc107;
  --ck-teal: #20c997;
  --ck-cyan: #0dcaf0;
  --ck-muted: #6c757d;
  --ck-border: #e3e8ef;
  --ck-card-bg: #ffffff;
  --ck-soft-bg: #f6f8fb;
}

/* Khung rộng hơn một chút để chia 2 cột */
.container,
.container-fluid,
.container-lg,
.container-md,
.container-sm,
.container-xl,
.container-xxl {
  max-width: 980px;
}

body {
  background-color: var(--ck-soft-bg);
}

.navbar.bg-light {
  box-shadow: 0 1px 0 var(--ck-border);
}

.navbar-brand {
  font-weight: 700;
  background: linear-gradient(90deg, var(--ck-blue), var(--ck-purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

main.container {
  padding-bottom: 24px;
}

.form-inline {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 2px 10px rgba(13, 110, 253, 0.08);
  border: 1px solid var(--ck-border);
}

.form-inline .form-control {
  width: auto;
  flex: 1;
  min-width: 0;
}

.mb-0 { margin-bottom: 0 !important; }
.muted { color: var(--ck-muted); }
.mono { font-family: SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 0.9em; word-break: break-all; }
.text-success { color: var(--ck-green) !important; }
.text-warning { color: #d97706 !important; }
.text-danger { color: var(--ck-red) !important; }

/* ---------- Hero ---------- */
.ip-hero {
  text-align: center;
  padding: 24px 16px 20px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 0% 0%, rgba(13, 110, 253, 0.14), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(111, 66, 193, 0.14), transparent 55%),
    #ffffff;
  border: 1px solid var(--ck-border);
  box-shadow: 0 4px 18px rgba(33, 37, 41, 0.06);
  margin-bottom: 16px;
}

.ip-hero-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ck-muted);
  font-weight: 600;
}

.ip-hero-ip {
  font-size: clamp(1.4rem, 5vw, 2.3rem);
  font-weight: 700;
  margin: 6px 0 6px;
  color: var(--ck-blue);
  line-height: 1.2;
}

.ip-hero-ip a { color: inherit; }

.ip-hero-place {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 1.05rem;
  font-weight: 500;
}

.ip-hero-place .flag-icon { display: block; }

/* Cờ trong bảng: căn giữa theo dòng chữ */
.info-table .flag-icon { vertical-align: middle; position: relative; top: -1px; }

.ip-hero-isp {
  color: var(--ck-muted);
  font-size: 0.92rem;
  margin-top: 2px;
}

.ip-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 12px;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px 7px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
}

.badge-success { background: #d1f2e0; color: #0f6b43; border-color: #a3e1c1; }
.badge-danger  { background: #fbd9dd; color: #a11d2b; border-color: #f4aab3; }
.badge-warning { background: #ffe8cc; color: #9a4b00; border-color: #ffcf99; }
.badge-info    { background: #d6ecff; color: #0b5394; border-color: #aed6fb; }
.badge-purple  { background: #e8dcfb; color: #4b2a8c; border-color: #cdb6f3; }
.badge-muted   { background: #eceff3; color: #495057; border-color: #dde2e8; }

.ip-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ip-hero-error .alert { margin-top: 10px; }

/* ---------- Risk ---------- */
.risk-panel {
  background: var(--ck-card-bg);
  border: 1px solid var(--ck-border);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.risk-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 600;
  margin-bottom: 8px;
  gap: 8px;
}

.risk-value { font-weight: 700; }

.risk-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(25, 135, 84, 0.15), rgba(255, 193, 7, 0.18), rgba(220, 53, 69, 0.18));
  overflow: hidden;
}

.risk-fill { height: 100%; border-radius: 999px; }
.risk-success { background: linear-gradient(90deg, #20c997, var(--ck-green)); }
.risk-warning { background: linear-gradient(90deg, var(--ck-yellow), var(--ck-orange)); }
.risk-danger  { background: linear-gradient(90deg, var(--ck-orange), var(--ck-red)); }

.risk-foot {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--ck-muted);
}

/* ---------- Grid & cards ---------- */
.ip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ip-card {
  background: var(--ck-card-bg);
  border: 1px solid var(--ck-border);
  border-top: 4px solid var(--ck-blue);
  border-radius: 12px;
  padding: 14px 16px 12px;
  box-shadow: 0 2px 10px rgba(33, 37, 41, 0.04);
  min-width: 0;
}

.ip-card-wide { grid-column: 1 / -1; }

.accent-blue   { border-top-color: var(--ck-blue); }
.accent-purple { border-top-color: var(--ck-purple); }
.accent-red    { border-top-color: var(--ck-red); }
.accent-green  { border-top-color: var(--ck-green); }
.accent-orange { border-top-color: var(--ck-orange); }
.accent-teal   { border-top-color: var(--ck-teal); }

.ip-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 10px;
}

/* Bảng thông tin dạng nhãn - giá trị */
.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.info-table th,
.info-table td {
  padding: 6px 4px;
  border-bottom: 1px solid #eef1f5;
  vertical-align: top;
  text-align: left;
  overflow-wrap: anywhere;
}

.info-table tr:last-child th,
.info-table tr:last-child td { border-bottom: 0; }

.info-table th {
  width: 38%;
  color: var(--ck-muted);
  font-weight: 500;
  white-space: nowrap;
  padding-right: 10px;
}

.info-table td { font-weight: 500; }

/* Vị trí + bản đồ */
.loc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.loc-layout.no-map { grid-template-columns: 1fr; }

.ip-map {
  width: 100%;
  height: 280px;
  border-radius: 10px;
  border: 1px solid var(--ck-border);
  background: #e9eef5;
  z-index: 0;
}

.map-note {
  font-size: 0.8rem;
  color: var(--ck-muted);
  margin-top: 6px;
}

/* Ô phát hiện proxy / VPN */
.det-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 8px;
}

.det-item {
  min-width: 0;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.det-icon { font-size: 0.85rem; }
.det-label { flex: 1; }
.det-val { font-size: 0.8rem; opacity: 0.85; }

.det-ok      { background: #e7f6ee; color: #0f6b43; border-color: #c4ead6; }
.det-bad     { background: #fde8ea; color: #a11d2b; border-color: #f7c1c7; }
.det-warn    { background: #fff1e0; color: #9a4b00; border-color: #ffd8a8; }
.det-neutral { background: #f1f3f5; color: #6c757d; border-color: #e3e6ea; }
.det-info    { background: #e7f1ff; color: #0b5394; border-color: #c2dcfb; }

.policy-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ck-muted);
  font-weight: 700;
  margin: 12px 0 6px;
}

.history-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.history-cols .policy-title { margin-top: 0; }

.chip {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  padding: 5px 9px 6px;
  margin: 0 4px 4px 0;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.82rem;
  font-weight: 600;
}

.kv-mini { margin: 0; }
.kv-mini dt { display: inline; color: var(--ck-muted); font-weight: 500; }
.kv-mini dt::after { content: ": "; }
.kv-mini dd { display: inline; margin: 0; }
.kv-mini dd::after { content: ""; display: block; }

.data-note {
  text-align: center;
  color: var(--ck-muted);
  font-size: 0.8rem;
  margin-top: 16px;
}

/* ---------- Mobile ---------- */
@media (max-width: 767.98px) {
  .ip-grid { grid-template-columns: 1fr; }
  .loc-layout { grid-template-columns: 1fr; }
  .ip-map { height: 230px; }
  .info-table th { width: 42%; white-space: normal; }
}

/* Cột trái xếp chồng Network + Time */
.ip-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.ip-stack .ip-card { flex: 0 0 auto; }
.ip-stack .ip-card:last-child { flex: 1 1 auto; }

/* Policies của operator: cho phép xuống dòng */
.ip-card-wide .det-item { white-space: normal; }

/* ========================================
   Trang API / tài liệu
   ======================================== */
.docs { padding-top: 24px; }

.docs-hero {
  text-align: center;
  padding: 28px 16px 24px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 0% 0%, rgba(13, 110, 253, 0.16), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(111, 66, 193, 0.16), transparent 55%),
    #ffffff;
  border: 1px solid var(--ck-border);
  box-shadow: 0 4px 18px rgba(33, 37, 41, 0.06);
  margin-bottom: 16px;
}

.docs-hero h1 {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(90deg, var(--ck-blue), var(--ck-purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.docs-hero p { color: #495057; margin-bottom: 16px; }

.docs-hero-cmd { max-width: 360px; margin: 0 auto; text-align: left; }
.docs-hero-cmd pre { font-size: 1.15rem; padding: 14px 18px; }

.docs-section { margin-bottom: 16px; }

.docs-sub { color: #495057; margin-bottom: 10px; }

.docs-note {
  color: var(--ck-muted);
  font-size: 0.88rem;
  margin-top: 10px;
}

.docs-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ck-muted);
  margin-bottom: 6px;
}

.docs-label code { text-transform: none; letter-spacing: 0; }

.docs-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.docs-grid-response { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }

/* Inline code */
.docs code,
.docs-sub code {
  font-family: SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.86em;
  color: #6f42c1;
  background: #f3effc;
  padding: 1px 5px;
  border-radius: 4px;
}

/* Code block */
.code-block {
  position: relative;
  margin: 0;
}

.code-block pre {
  margin: 0;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.55;
}

.code-block pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
  white-space: pre;
}

.code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
  opacity: 0.75;
}

.code-copy:hover { opacity: 1; background: rgba(255, 255, 255, 0.16); }

/* Tables */
.table-scroll { overflow-x: auto; }

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.docs-table th,
.docs-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid #eef1f5;
  vertical-align: top;
}

.docs-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ck-muted);
  border-bottom: 2px solid var(--ck-border);
}

.docs-table td:first-child { white-space: nowrap; }
.docs-fields td:first-child { white-space: normal; width: 48%; }
.docs-table tr:last-child td { border-bottom: 0; }

.docs-table code .var,
.docs code .var { color: var(--ck-orange); font-style: italic; }

.docs-row-sep td {
  padding-top: 16px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ck-muted);
}

/* Full response */
.docs-details { margin-top: 14px; }

.docs-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ck-blue);
  margin-bottom: 8px;
}

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.tab {
  border: 1px solid var(--ck-border);
  background: #f8f9fb;
  color: #495057;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.tab:hover { border-color: #b6c7e6; }

.tab.active {
  background: var(--ck-blue);
  border-color: var(--ck-blue);
  color: #fff;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

@media (max-width: 767.98px) {
  .docs-grid-2,
  .docs-grid-response { grid-template-columns: 1fr; }
  .docs-table td:first-child { white-space: normal; }
}

.docs-list { margin: 0; padding-left: 20px; color: #343a40; }
.docs-list li { margin-bottom: 6px; }

/* ---------- SEO headings & nội dung trang chủ ---------- */
.page-head { text-align: center; margin-top: 22px; }
.page-h1 {
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  font-weight: 800;
  margin: 0 0 4px;
}
.page-lead { color: var(--ck-muted); margin: 0; }
.page-head + .form-inline { margin-top: 14px !important; }

.ip-hero-h1 { margin: 0; font-weight: inherit; line-height: 1.2; }
.ip-hero-h1 .ip-hero-label { display: block; }
.ip-hero-h1 .ip-hero-ip { display: block; }

.home-guide {
  background: var(--ck-card-bg);
  border: 1px solid var(--ck-border);
  border-radius: 12px;
  padding: 18px 22px 8px;
  margin-top: 24px;
  color: #343a40;
  line-height: 1.65;
}
.home-guide h2 { font-size: 1.2rem; font-weight: 700; margin: 14px 0 6px; }
.home-guide h2:first-child { margin-top: 0; }
.home-guide p, .home-guide ul { margin: 0 0 10px; }
.home-guide ul { padding-left: 20px; }
.home-guide li { margin-bottom: 4px; }
.home-guide code {
  font-family: SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.88em; color: #6f42c1; background: #f3effc; padding: 1px 5px; border-radius: 4px;
}

/* ---------- Navbar: nút sáng/tối ---------- */
.nav-actions { display: flex; align-items: center; gap: 8px; }
@media (min-width: 992px) {
  .nav-actions { order: 3; margin-left: 12px; }
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--ck-border);
  border-radius: 999px;
  background: transparent;
  color: var(--bs-body-color);
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--ck-blue); color: var(--ck-blue); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- API: Quick start 3 cột đều nhau ---------- */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}
.quick-item { display: flex; flex-direction: column; min-width: 0; }
.quick-item .code-block { flex: 1; display: flex; }
.quick-item .code-block pre { flex: 1; padding-right: 60px; }
@media (max-width: 767.98px) {
  .quick-grid { grid-template-columns: 1fr; }
}

/* ---------- WebRTC leak test ---------- */
.webrtc-verdict { border-top: 4px solid var(--ck-muted); }
.webrtc-verdict[data-state="ok"]   { border-top-color: var(--ck-green); }
.webrtc-verdict[data-state="warn"] { border-top-color: var(--ck-orange); }
.webrtc-verdict[data-state="leak"] { border-top-color: var(--ck-red); }
.webrtc-verdict-title {
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  font-weight: 800;
  margin: 6px 0 4px;
}
.webrtc-verdict[data-state="ok"]   .webrtc-verdict-title { color: var(--ck-green); }
.webrtc-verdict[data-state="warn"] .webrtc-verdict-title { color: #d97706; }
.webrtc-verdict[data-state="leak"] .webrtc-verdict-title { color: var(--ck-red); }
.webrtc-verdict-text { color: var(--ck-muted); max-width: 620px; margin: 0 auto 12px; }
.rtc-status { font-size: 0.85rem; font-weight: 600; margin-top: 2px; }

/* ========================================
   Giao diện tối
   ======================================== */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ck-blue: #4d8dff;
  --ck-green: #3fbf7f;
  --ck-red: #f0616f;
  --ck-muted: #98a2b3;
  --ck-border: #2a3346;
  --ck-card-bg: #171e2c;
  --ck-soft-bg: #0f141f;
  --bs-body-bg: #111827;
  --bs-body-color: #e2e7ef;
  --bs-emphasis-color: #fff;
  --bs-emphasis-color-rgb: 255, 255, 255;
  --bs-border-color: #2a3346;
  --bs-secondary-color: #7d8798;
  --bs-light-rgb: 20, 26, 38;
  --bs-link-color: #6ea8fe;
  --bs-link-color-rgb: 110, 168, 254;
  --bs-link-hover-color-rgb: 158, 197, 254;
}

:root[data-theme="dark"] .navbar,
:root[data-theme="dark"] .navbar-light {
  --bs-navbar-color: rgba(226, 231, 239, 0.7);
  --bs-navbar-hover-color: rgba(226, 231, 239, 0.9);
  --bs-navbar-active-color: #fff;
  --bs-navbar-brand-color: #fff;
  --bs-navbar-brand-hover-color: #fff;
  --bs-navbar-toggler-border-color: rgba(255, 255, 255, 0.15);
  --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28226, 231, 239, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
:root[data-theme="dark"] .navbar-brand {
  background: linear-gradient(90deg, #6ea8fe, #b197fc);
  -webkit-background-clip: text;
  background-clip: text;
}
:root[data-theme="dark"] .footer { background-color: #141a26; color: var(--ck-muted); }
:root[data-theme="dark"] .form-inline { background-color: var(--ck-card-bg); box-shadow: none; }
:root[data-theme="dark"] .btn-outline-secondary {
  --bs-btn-color: #b3bccb;
  --bs-btn-border-color: #4a5568;
  --bs-btn-hover-bg: #4a5568;
  --bs-btn-hover-border-color: #4a5568;
}
:root[data-theme="dark"] .alert-danger {
  --bs-alert-color: #f5b5bc;
  --bs-alert-bg: #3a1c22;
  --bs-alert-border-color: #5c2a33;
}

:root[data-theme="dark"] .ip-hero,
:root[data-theme="dark"] .docs-hero {
  background:
    radial-gradient(circle at 0% 0%, rgba(77, 141, 255, 0.16), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(151, 117, 250, 0.16), transparent 55%),
    var(--ck-card-bg);
  box-shadow: none;
}
:root[data-theme="dark"] .ip-card { box-shadow: none; }
:root[data-theme="dark"] .text-warning { color: #f5a524 !important; }
:root[data-theme="dark"] .webrtc-verdict[data-state="warn"] .webrtc-verdict-title { color: #f5a524; }

:root[data-theme="dark"] .badge-success { background: rgba(63, 191, 127, 0.16); color: #7ddcaa; border-color: rgba(63, 191, 127, 0.4); }
:root[data-theme="dark"] .badge-danger  { background: rgba(240, 97, 111, 0.16); color: #f59aa4; border-color: rgba(240, 97, 111, 0.45); }
:root[data-theme="dark"] .badge-warning { background: rgba(253, 126, 20, 0.16); color: #ffb86b; border-color: rgba(253, 126, 20, 0.45); }
:root[data-theme="dark"] .badge-info    { background: rgba(77, 141, 255, 0.16); color: #93bbff; border-color: rgba(77, 141, 255, 0.45); }
:root[data-theme="dark"] .badge-purple  { background: rgba(151, 117, 250, 0.18); color: #c5b3fb; border-color: rgba(151, 117, 250, 0.5); }
:root[data-theme="dark"] .badge-muted   { background: rgba(255, 255, 255, 0.06); color: #b3bccb; border-color: rgba(255, 255, 255, 0.12); }

:root[data-theme="dark"] .det-ok      { background: rgba(63, 191, 127, 0.12); color: #7ddcaa; border-color: rgba(63, 191, 127, 0.3); }
:root[data-theme="dark"] .det-bad     { background: rgba(240, 97, 111, 0.12); color: #f59aa4; border-color: rgba(240, 97, 111, 0.35); }
:root[data-theme="dark"] .det-warn    { background: rgba(253, 126, 20, 0.12); color: #ffb86b; border-color: rgba(253, 126, 20, 0.35); }
:root[data-theme="dark"] .det-neutral { background: rgba(255, 255, 255, 0.04); color: #98a2b3; border-color: rgba(255, 255, 255, 0.1); }
:root[data-theme="dark"] .det-info    { background: rgba(77, 141, 255, 0.12); color: #93bbff; border-color: rgba(77, 141, 255, 0.35); }

:root[data-theme="dark"] .info-table th,
:root[data-theme="dark"] .info-table td,
:root[data-theme="dark"] .docs-table td { border-bottom-color: #232b3c; }
:root[data-theme="dark"] .docs-table th { border-bottom-color: var(--ck-border); }

:root[data-theme="dark"] .chip { background: rgba(129, 140, 248, 0.16); color: #c3c8fd; }
:root[data-theme="dark"] .docs code,
:root[data-theme="dark"] .docs-sub code,
:root[data-theme="dark"] .home-guide code { background: rgba(151, 117, 250, 0.16); color: #d2c2ff; }
:root[data-theme="dark"] .docs-hero p,
:root[data-theme="dark"] .docs-sub,
:root[data-theme="dark"] .docs-list,
:root[data-theme="dark"] .home-guide { color: #cfd6e1; }
:root[data-theme="dark"] .code-block pre { background: #0b1120; border: 1px solid var(--ck-border); }
:root[data-theme="dark"] .tab { background: #1c2436; color: #cfd6e1; }
:root[data-theme="dark"] .tab:hover { border-color: #3f4d6b; }
:root[data-theme="dark"] .tab.active { background: var(--ck-blue); color: #fff; border-color: var(--ck-blue); }

/* Bản đồ tối: đảo màu tile, giữ nguyên marker */
:root[data-theme="dark"] .ip-map { background: #1b2130; }
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9); }
:root[data-theme="dark"] .leaflet-bar a { background: var(--ck-card-bg); color: var(--bs-body-color); border-bottom-color: var(--ck-border); }
:root[data-theme="dark"] .leaflet-control-attribution { background: rgba(23, 30, 44, 0.85) !important; color: #98a2b3; }
:root[data-theme="dark"] .leaflet-control-attribution a { color: #6ea8fe; }
:root[data-theme="dark"] .leaflet-popup-content-wrapper,
:root[data-theme="dark"] .leaflet-popup-tip { background: var(--ck-card-bg); color: var(--bs-body-color); }

/* Danh sách IP của WebRTC: một cột, IP ở trên, mô tả ở dưới */
.rtc-list td { padding: 8px 4px; }
.rtc-ip { font-weight: 600; word-break: break-all; }
.rtc-label { color: var(--ck-muted); font-size: 0.9rem; }
:root[data-theme="dark"] .code-block pre code { background: none; color: inherit; padding: 0; }

/* Menu: giãn khoảng cách trên desktop */
@media (min-width: 992px) {
  .navbar-nav { gap: 6px; }
  .navbar-expand-lg .navbar-nav .nav-link { padding-left: 12px; padding-right: 12px; }
}

/* Trang liên hệ */
.contact-email {
  display: inline-block;
  font-size: clamp(1.4rem, 5vw, 2rem);
  font-weight: 700;
  color: var(--ck-blue);
  text-decoration: none;
  margin: 4px 0 12px;
  word-break: break-all;
}
.contact-email:hover { text-decoration: underline; }

.rtc-ip a { color: inherit; text-decoration: none; border-bottom: 1px dashed currentColor; }
.rtc-ip a:hover { color: var(--ck-blue); border-bottom-style: solid; }

/* Khung lệnh 1 dòng ở đầu trang API: nút Copy căn giữa theo chiều dọc */
.docs-hero-cmd .code-copy { top: 50%; transform: translateY(-50%); }
.docs-hero-cmd pre { padding-right: 72px; }
/* rev 2026-09-23l */
