:root {
  color: #14343c;
  background: #e7f4f6;
  font-family: "Segoe UI", system-ui, sans-serif;
  --brand: #0f7f96;
  --line: #d7e7ea;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--brand);
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: white;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #0f6f86;
  font-weight: 700;
  font-size: 19px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #14a3bd, #0c6c80);
  color: white;
}

.brand-mark svg {
  width: 19px;
  height: 19px;
}

.brand-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-admin-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 4px;
}

.header-admin-links a {
  color: #0f6f86;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  opacity: 0.85;
}

.header-admin-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

.wallet-chip {
  display: inline-flex;
  align-items: stretch;
  border-radius: 999px;
  background: #e3f4f7;
}

.wallet-chip .balance {
  background: none;
}

.topup {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  background: var(--brand);
  color: white;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.topup svg {
  width: 16px;
  height: 16px;
}

.topup:hover,
.topup.active {
  background: #0c6c80;
}

.top-right form {
  display: flex;
}

.logout-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #4d6670;
  cursor: pointer;
}

.logout-button svg {
  width: 18px;
  height: 18px;
}

.logout-button:hover {
  background: #fff1f2;
  color: #be123c;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.balance {
  background: #e3f4f7;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  text-decoration: none;
}

.who {
  color: #4d6670;
  font-size: 14px;
}

.link-button {
  background: none;
  border: 0;
  color: var(--brand);
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.layout {
  display: flex;
  gap: 24px;
  padding: 24px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.layout.is-wide,
html[data-layout-wide="1"] .layout {
  max-width: 100%;
}

.layout-toggle:hover {
  background: #e8f4f7;
  color: var(--brand);
}

.announce {
  --a-bg: #e0f2f5;
  --a-line: #b5dfe7;
  --a-ink: #0b5566;
  --a-icon: var(--brand);
  background: var(--a-bg);
  border-bottom: 1px solid var(--a-line);
  color: var(--a-ink);
  animation: announce-in 0.25s ease-out;
  transition: opacity 0.2s, transform 0.2s;
}

.announce.is-success { --a-bg: #dcf5ec; --a-line: #a7e3cb; --a-ink: #065f46; --a-icon: #059669; }
.announce.is-warning { --a-bg: #fef3c7; --a-line: #fcd97d; --a-ink: #7c4a03; --a-icon: #d97706; }
.announce.is-danger { --a-bg: #ffe4e6; --a-line: #fda4af; --a-ink: #881337; --a-icon: #e11d48; }

.announce.is-closing {
  opacity: 0;
  transform: translateY(-4px);
}

.announce-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 24px;
}

.announce-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  color: var(--a-icon);
}

.announce-icon svg {
  width: 16px;
  height: 16px;
}

.announce-text {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.announce-text a {
  color: inherit;
  font-weight: 700;
  white-space: nowrap;
}

.announce-close {
  flex: none;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}

.announce-close:hover {
  background: rgba(255, 255, 255, 0.6);
  opacity: 1;
}

.layout ~ .announce {
  border-top: 1px solid var(--a-line);
  border-bottom: 0;
}

.layout + .announce {
  margin-top: auto;
}

.announce + .site-footer {
  margin-top: 0;
}

@keyframes announce-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.announce-preview {
  --a-bg: #e0f2f5;
  --a-ink: #0b5566;
  --a-icon: var(--brand);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 420px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--a-bg);
  color: var(--a-ink);
  font-size: 13.5px;
  line-height: 1.45;
}

.announce-preview .announce-icon {
  width: 22px;
  height: 22px;
}

.announce-preview .announce-icon svg {
  width: 13px;
  height: 13px;
}

.announce-preview.is-success { --a-bg: #dcf5ec; --a-ink: #065f46; --a-icon: #059669; }
.announce-preview.is-warning { --a-bg: #fef3c7; --a-ink: #7c4a03; --a-icon: #d97706; }
.announce-preview.is-danger { --a-bg: #ffe4e6; --a-ink: #881337; --a-icon: #e11d48; }

.notice-positions {
  grid-column: 1 / -1;
}

.notice-positions .check {
  display: flex;
}

main > .announce {
  margin: 0 0 14px;
  border-radius: 12px;
}

.notice-cell .link-url {
  margin-top: 4px;
  overflow-wrap: anywhere;
}

#form-thong-bao > label {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
}

#form-thong-bao textarea {
  width: 100%;
  background: white;
  resize: vertical;
}

.tone-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: -1px;
  background: var(--brand);
}

.tone-dot.is-success { background: #059669; }
.tone-dot.is-warning { background: #f59e0b; }
.tone-dot.is-danger { background: #e11d48; }

body.screen-full .announce {
  display: none;
}

@media (max-width: 560px) {
  .announce-inner {
    align-items: flex-start;
    padding: 9px 14px;
  }

  .announce-text {
    font-size: 14px;
  }
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: #f4fafb;
  font-size: 14px;
  color: #4d6670;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
}

.footer-brand {
  margin: 0;
}

.footer-brand a {
  font-weight: 600;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.footer-links a {
  color: #4d6670;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--brand);
  text-decoration: underline;
}

body.screen-full .site-footer {
  display: none;
}

@media (max-width: 560px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
  }
}

.signed-out .layout {
  justify-content: center;
}

.side {
  flex: 0 0 200px;
}

.side-title {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b8790;
}

.side nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 20px;
}

.side nav a {
  color: #14343c;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 10px;
}

.side nav a:hover {
  background: #d6edf1;
}

.side nav a.active {
  background: var(--brand);
  color: white;
}

main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.signed-out main {
  align-items: center;
}

.landing {
  width: 100%;
  max-width: 1080px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: 32px;
  padding: 40px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 85% 20%, rgba(56, 189, 248, 0.22), transparent 45%),
    linear-gradient(135deg, #ffffff 0%, #f1fafb 100%);
  box-shadow: 0 18px 50px rgba(15, 52, 60, 0.1);
}

.hero h1 {
  margin: 8px 0 14px;
  font-size: 42px;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.hero-lead {
  margin: 0 0 22px;
  font-size: 17px;
  line-height: 1.6;
  color: #3f5b64;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-cta .button {
  padding: 12px 22px;
  font-size: 16px;
}

.google-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.google-button svg {
  width: 20px;
  height: 20px;
  padding: 2px;
  border-radius: 50%;
  background: white;
}

.hero-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 16px 0 0;
  font-size: 14px;
  color: #4d6670;
}

.hero-note svg {
  width: 16px;
  height: 16px;
  color: #10b981;
}

.hero-art {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 10px 0;
}

.mock-phone {
  width: 210px;
  padding: 18px 16px 16px;
  border-radius: 34px;
  background: linear-gradient(160deg, #23414a, #142b31);
  box-shadow: 0 24px 50px rgba(15, 52, 60, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform: rotate(-4deg);
}

.mock-screen {
  position: relative;
  height: 210px;
  border-radius: 10px;
  overflow: hidden;
  background: #0b1f24;
}

.mock-screen span {
  position: absolute;
  display: block;
}

.mock-sky {
  inset: 0;
  background: linear-gradient(180deg, #38bdf8 0%, #7dd3fc 60%, #bae6fd 100%);
}

.mock-hill {
  left: -20%;
  right: -20%;
  bottom: -40px;
  height: 110px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: inset 0 10px 0 #4ade80;
}

.mock-hero {
  left: 46%;
  bottom: 62px;
  width: 22px;
  height: 30px;
  border-radius: 6px 6px 3px 3px;
  background: #f97316;
  box-shadow: inset 0 8px 0 #fed7aa;
  animation: mock-jump 1.6s ease-in-out infinite;
}

.mock-coin {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #facc15;
  box-shadow: inset -2px -2px 0 #ca8a04;
  animation: mock-float 2.4s ease-in-out infinite;
}

.mock-coin.c1 { left: 18%; top: 34%; }
.mock-coin.c2 { left: 70%; top: 24%; animation-delay: 0.6s; }
.mock-coin.c3 { left: 82%; top: 48%; animation-delay: 1.2s; }

.mock-bar {
  left: 10px;
  right: 10px;
  top: 10px;
  height: 8px;
  border-radius: 99px;
  background: rgba(15, 52, 60, 0.35);
}

.mock-bar i {
  display: block;
  width: 72%;
  height: 100%;
  border-radius: inherit;
  background: #f43f5e;
}

.mock-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.mock-keys span {
  height: 18px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
}

.mock-badge {
  position: absolute;
  right: 6%;
  bottom: 18%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: white;
  font-size: 14px;
  font-weight: 600;
  color: #14343c;
  box-shadow: 0 10px 26px rgba(15, 52, 60, 0.18);
}

.mock-badge i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

@keyframes mock-jump {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-26px); }
}

@keyframes mock-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) {
  .mock-hero,
  .mock-coin {
    animation: none;
  }
}

.not-found {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 40px;
  max-width: 820px;
  padding: 40px;
}

.not-found h1 {
  margin: 6px 0 10px;
  font-size: 32px;
}

.not-found code {
  padding: 1px 6px;
  border-radius: 6px;
  background: #eef6f8;
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

.not-found .muted {
  margin: 0 0 20px;
}

.not-found-art .mock-phone {
  width: 170px;
}

.not-found-art .mock-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 150px;
  background: linear-gradient(180deg, #0f3b45, #0b2a31);
}

.not-found-art .mock-screen span {
  position: static;
}

.nf-code,
.nf-blink {
  font: 700 44px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #7dd3fc;
}

.nf-code {
  letter-spacing: 0.06em;
  text-shadow: 0 0 14px rgba(125, 211, 252, 0.55);
}

.nf-blink {
  animation: nf-blink 1s steps(1) infinite;
}

@keyframes nf-blink {
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .nf-blink {
    animation: none;
  }
}

@media (max-width: 640px) {
  .not-found {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 24px;
    padding: 28px 20px;
    text-align: center;
  }

  .not-found .hero-cta {
    justify-content: center;
  }

  .not-found h1 {
    font-size: 26px;
  }
}

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

.feature {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.feature h2 {
  margin: 14px 0 6px;
  font-size: 17px;
}

.feature p {
  margin: 0;
  color: #4d6670;
  line-height: 1.55;
  font-size: 15px;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #e0f2f5;
  color: var(--brand);
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.steps-card h2,
.price-card h2 {
  margin-bottom: 16px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  font-weight: 700;
}

.steps span {
  color: #4d6670;
  font-size: 14px;
  line-height: 1.5;
}

.price-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 24px;
}

.price-head h2 {
  margin-bottom: 4px;
}

.price-head .muted {
  margin: 0;
}

.price-from {
  margin: 0;
  font-size: 15px;
  color: #4d6670;
}

.price-from strong {
  font-size: 28px;
  color: var(--brand);
}

.price-tiers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.price-tiers li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f6fbfc;
}

.price-tiers span {
  font-size: 14px;
  color: #4d6670;
}

.price-tiers strong {
  font-size: 22px;
}

.price-tiers small {
  font-size: 14px;
  font-weight: 400;
  color: #6b8790;
}

.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding: 28px 32px;
  border-radius: 20px;
  background: linear-gradient(120deg, #0f7f96, #0e5f73);
  color: white;
}

.cta-band h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.cta-band p {
  margin: 0;
  opacity: 0.85;
}

.cta-band .google-button {
  background: white;
  color: #0f6f86;
  padding: 12px 22px;
  font-size: 16px;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 28px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .landing {
    gap: 20px;
  }

  .hero {
    padding: 22px 18px;
    gap: 20px;
  }

  .hero h1 {
    font-size: 27px;
  }

  .hero-lead {
    font-size: 15px;
  }

  .hero-cta .button {
    flex: 1 1 100%;
    justify-content: center;
    text-align: center;
  }

  .mock-phone {
    width: 170px;
  }

  .mock-screen {
    height: 160px;
  }

  .feature-grid,
  .steps {
    grid-template-columns: 1fr;
  }

  .feature {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 14px;
    padding: 16px;
  }

  .feature-icon {
    grid-row: span 2;
  }

  .feature h2 {
    margin-top: 0;
  }

  .cta-band {
    padding: 22px 18px;
  }

  .cta-band .google-button {
    width: 100%;
    justify-content: center;
  }
}

.card {
  width: 100%;
  background: white;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 12px 32px rgba(20, 70, 80, 0.07);
  overflow-x: auto;
}

.card.narrow {
  max-width: 440px;
}

h1 {
  margin: 0 0 12px;
  font-size: 26px;
}

h2 {
  margin: 0 0 12px;
  font-size: 19px;
}

.eyebrow {
  margin: 0;
  color: #0f6f86;
  font-weight: 700;
}

.muted {
  color: #4d6670;
  line-height: 1.5;
}

.small {
  font-size: 13px;
}

.error,
.notice,
.caution {
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0;
}

.error {
  color: #9f1239;
  background: #fff1f2;
}

.notice {
  color: #065f46;
  background: #ecfdf5;
}

.caution {
  color: #92400e;
  background: #fffbeb;
}

main > .error,
main > .notice {
  width: 100%;
}

.toasts {
  position: fixed;
  top: 56px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  border-radius: 12px;
  background: white;
  border: 1px solid var(--line);
  border-left: 4px solid #10b981;
  box-shadow: 0 10px 30px rgba(15, 52, 60, 0.18);
  pointer-events: auto;
  animation: toast-in 0.25s ease-out;
  transition: opacity 0.25s, transform 0.25s;
}

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

.toast.toast-leaving {
  opacity: 0;
  transform: translateX(24px);
}

.toast-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  color: white;
  background: #10b981;
}

.toast-error .toast-icon {
  background: #e11d48;
}

.toast-text {
  flex: 1;
  margin: 1px 0 0;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

code.ip-lookup,
[data-ip-lookup] {
  cursor: pointer;
  border-bottom: 1px dashed #8fb3bc;
}

code.ip-lookup:hover,
[data-ip-lookup]:hover {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.toast-close {
  flex: none;
  border: 0;
  background: none;
  color: #7c949a;
  font-size: 20px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}

.toast-close:hover {
  color: #14343c;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
}

@media (max-width: 560px) {
  .top {
    padding: 12px 14px;
    flex-wrap: wrap;
  }

  .brand {
    font-size: 15px;
    gap: 8px;
  }

  .brand-text {
    white-space: normal;
    line-height: 1.15;
  }

  .header-admin-links {
    order: 3;
    flex: 1 1 100%;
    margin: 0;
    padding-top: 2px;
    gap: 6px 10px;
  }

  .header-admin-links a {
    font-size: 12px;
  }

  .top-right {
    flex-wrap: nowrap;
    gap: 10px;
    margin-left: auto;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .topup {
    padding: 6px 9px;
  }

  .topup span {
    display: none;
  }
}

@media (max-width: 370px) {
  .brand-text {
    display: none;
  }
}

@media (max-width: 640px) {
  .toasts {
    top: auto;
    bottom: 12px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none;
    transition: none;
  }
}

.button {
  display: inline-block;
  background: var(--brand);
  color: white;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font: inherit;
  cursor: pointer;
}

.button.secondary {
  background: #e3f4f7;
  color: var(--brand);
}

.button.danger {
  background: #be123c;
}

.button.small {
  padding: 6px 12px;
  font-size: 14px;
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button.is-busy {
  position: relative;
  opacity: 0.85;
  cursor: wait;
  padding-left: 2.4em;
}

.button.is-busy::before {
  content: "";
  position: absolute;
  left: 0.85em;
  top: 50%;
  width: 0.85em;
  height: 0.85em;
  margin-top: -0.425em;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: button-spin 0.7s linear infinite;
}

@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 460px;
}

.stack .button {
  align-self: flex-start;
  margin-top: 6px;
}

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

.row.tight {
  margin: 6px 0 0;
}

.row.wrap {
  flex-wrap: wrap;
}

.stack .stack {
  max-width: none;
}

label {
  font-weight: 600;
  font-size: 14px;
}

input,
select,
textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #c8dde1;
  border-radius: 10px;
  background: #f6fbfc;
  min-width: 0;
}

textarea.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}

.row input {
  flex: 1;
}

.stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #c8dde1;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
  width: 160px;
  max-width: 100%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.stepper:focus-within {
  border-color: var(--brand, #0f7f96);
  box-shadow: 0 0 0 2px rgba(15, 127, 150, 0.18);
}

.stepper-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 42px;
  background: #f6fbfc;
  border: none;
  color: #14343c;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  padding: 0;
  margin: 0;
  transition: background 0.15s, color 0.15s;
}

.stepper-btn:hover:not(:disabled) {
  background: #e2f1f4;
  color: var(--brand, #0f7f96);
}

.stepper-btn:active:not(:disabled) {
  background: #cce7eb;
}

.stepper-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: #f6fbfc;
}

.stepper-input {
  flex: 1;
  width: 100%;
  min-width: 48px;
  text-align: center;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  font-size: 16px;
  font-weight: 700;
  color: #14343c;
  padding: 6px 4px !important;
  outline: none !important;
  box-shadow: none !important;
  -moz-appearance: textfield;
}

.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  font: inherit;
  font-size: 13px;
  border: 1px solid #c8dde1;
  background: white;
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--brand);
}

.auto-renew-chips .chip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.auto-renew-chips .chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.auto-renew-chips .chip.is-on,
.auto-renew-chips .chip:has(:checked) {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.slot-switch {
  margin-left: auto;
}

.slot-switch .chip {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.slot-switch .chip:hover {
  border-color: var(--brand);
}

.slot-switch .chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
  cursor: default;
}

.slot-switch .chip.paused,
.slot-switch .chip.empty {
  color: #7c949a;
}

.play-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 14px;
}

.play-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 15px;
}

.play-admin {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #d7e7ea;
  border-radius: 12px;
  background: #f4fafb;
}

.play-admin-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0;
  font-size: 13px;
  color: #4d6670;
}

.play-admin-meta a {
  color: inherit;
}

.play-admin-meta a:hover {
  color: var(--brand);
}

.play-admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.play-admin-actions form {
  margin: 0;
}

.play-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 14px;
}

.play-head h1 {
  margin: 0;
  min-width: 0;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.play-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.play-actions form {
  margin: 0;
}

.play-actions .icon-button svg {
  width: 15px;
  height: 15px;
}

.play-actions [data-play-state] {
  white-space: nowrap;
}

@media (max-width: 560px) {
  .play-top {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .play-top .slot-switch {
    margin-left: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .play-top .slot-switch::-webkit-scrollbar {
    display: none;
  }

  .play-top .slot-switch .chip {
    flex: none;
  }

  .play-head {
    flex-direction: column;
    align-items: stretch;
  }

  .play-head h1 {
    font-size: 22px;
  }

  .play-actions [data-play-state] {
    margin-left: auto;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 9px 8px;
  border-bottom: 1px solid #edf4f5;
  vertical-align: top;
}

th {
  color: #4d6670;
  font-weight: 600;
}

.user-row {
  cursor: pointer;
}

.user-row:hover,
.user-row.open {
  background: #f4f9fa;
}

.user-row .caret {
  width: 14px;
  color: #4d6670;
  transition: transform 0.2s ease;
}

.user-row.open .caret {
  transform: rotate(90deg);
}

.user-slots > td {
  padding: 0;
  border-bottom: 0;
}

.user-slots.open > td {
  border-bottom: 1px solid #edf4f5;
}

.user-slots .slide {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}

.user-slots.open .slide {
  grid-template-rows: 1fr;
}

.user-slots .slide > div {
  overflow: hidden;
  padding: 0 8px 0 30px;
  background: #f8fbfc;
}

.user-slots.open .slide > div {
  padding-top: 6px;
  padding-bottom: 10px;
}

.egress-slots .slide > div {
  padding-left: 12px;
}

.egress-slots-btn {
  margin-top: 8px;
}

.egress-slots-btn.open {
  background: #e8f2f4;
}

.inner-table {
  font-size: 13px;
}

.inner-table th,
.inner-table td {
  padding: 6px 8px;
}

.inner-table td:nth-child(n + 3) {
  white-space: nowrap;
}

td.clip {
  max-width: 280px;
  overflow-wrap: anywhere;
}

.plus {
  color: #047857;
}

.minus {
  color: #be123c;
}

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  background: #eef3f4;
  color: #4d6670;
  white-space: nowrap;
}

.pill.paid,
.pill.credited,
.pill.assigned {
  background: #dcfce7;
  color: #166534;
}

.pill.pending {
  background: #fef9c3;
  color: #854d0e;
}

.pill.unmatched {
  background: #ffe4e6;
  color: #9f1239;
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  margin: 0 0 16px;
}

.facts dt {
  color: #4d6670;
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.code {
  font-size: 20px;
  letter-spacing: 0.05em;
}

.deposit-grid {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin: 16px 0;
}

.qr {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.panel-head h1,
.panel-head h2 {
  margin: 0;
}

.group-title {
  margin: 22px 0 10px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #6b8790;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.tiles + .tiles {
  margin-top: 12px;
}

.tiles-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.head-meta {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  color: #6b8790;
  font-size: 13px;
}

.head-meta strong {
  color: #14343c;
  font-weight: 600;
}

.tile {
  --tone: var(--brand);
  --tone-soft: #e3f4f7;
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-content: start;
  column-gap: 10px;
  row-gap: 6px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #fbfdfd 100%);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

a.tile:hover {
  border-color: var(--tone);
  box-shadow: 0 8px 20px rgba(20, 70, 80, 0.08);
  transform: translateY(-1px);
}

.tile-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--tone-soft);
  color: var(--tone);
  flex: none;
}

.tile-icon svg {
  width: 17px;
  height: 17px;
}

.tile-label {
  align-self: center;
  color: #4d6670;
  font-size: 13px;
  font-weight: 500;
}

.tile-value,
.tile .meter,
.tile-note {
  grid-column: 1 / -1;
}

.tile-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.tile-value small {
  font-size: 15px;
  font-weight: 600;
  color: #8aa2a9;
}

.tile-note {
  color: #6b8790;
  font-size: 12.5px;
  line-height: 1.4;
}

.meter {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: #e6eff1;
  overflow: hidden;
}

.meter i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--tone);
  transition: width 0.6s ease, background-color 0.3s;
}

.tone-teal { --tone: #0f7f96; --tone-soft: #e0f3f6; }
.tone-blue { --tone: #2563eb; --tone-soft: #e6eeff; }
.tone-violet { --tone: #7c3aed; --tone-soft: #f0e9ff; }
.tone-green { --tone: #059669; --tone-soft: #dcf5ec; }
.tone-amber { --tone: #d97706; --tone-soft: #fdf1dc; }

.tile.is-bad,
.gauge[data-level="high"] {
  --tone: #e11d48;
  --tone-soft: #ffe4e9;
  border-color: #fda4af;
  background: #fff7f8;
}

.tile.is-warn {
  border-color: #fcd34d;
  background: #fffbeb;
}

.wallet-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.wallet-grid .card {
  height: 100%;
}

.wallet-form {
  max-width: none;
}

.wallet-direction {
  grid-template-columns: 1fr 1fr;
}

.pick-plus:has(input:checked) {
  border-color: #059669;
  background: #ecfdf5;
  box-shadow: inset 0 0 0 1px #059669;
}

.pick-minus:has(input:checked) {
  border-color: #e11d48;
  background: #fff1f2;
  box-shadow: inset 0 0 0 1px #e11d48;
}

.pick-plus strong { color: #047857; }
.pick-minus strong { color: #be123c; }

.wallet-holder {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #f0f8f9;
  font-size: 14px;
}

.pending-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pending-list li {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pending-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-size: 14px;
}

.pending-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.pending-actions form.row {
  flex: 1;
  margin: 0;
}

.pending-actions input {
  width: 100%;
  padding: 7px 10px;
}

.code-chip {
  padding: 2px 8px;
  border-radius: 8px;
  background: #eef6f7;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.empty-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #047857;
}

.empty-note svg {
  width: 18px;
  height: 18px;
}

.search-row {
  margin: 0;
}

.search-row input {
  padding: 7px 10px;
  min-width: 200px;
}

th.num,
td.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pill.kind-deposit { background: #dcfce7; color: #166534; }
.pill.kind-admin_adjust { background: #ede9fe; color: #5b21b6; }
.pill.kind-rent { background: #e0f2fe; color: #075985; }
.pill.kind-refund { background: #fef3c7; color: #92400e; }
.pill.kind-bonus { background: #fce7f3; color: #9d174d; }
.pill.cancelled { background: #f1f5f9; color: #64748b; }

td.ledger-note {
  min-width: 200px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

@media (max-width: 900px) {
  .wallet-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.gauge[data-level="ok"] { --tone: #059669; --tone-soft: #dcf5ec; }
.gauge[data-level="mid"] { --tone: #d97706; --tone-soft: #fdf1dc; }

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

.todo-item {
  --tone: #059669;
  --tone-soft: #dcf5ec;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  font-size: 14px;
}

.todo-item + .todo-item {
  --tone: #2563eb;
  --tone-soft: #e6eeff;
}

.todo-item.is-bad {
  --tone: #e11d48;
  --tone-soft: #ffe4e9;
  border-color: #fda4af;
  background: #fff7f8;
}

.todo-item:hover {
  border-color: var(--tone);
}

.todo-go {
  margin-left: auto;
  color: var(--tone);
  font-weight: 600;
  white-space: nowrap;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #6b8790;
  font-size: 13px;
}

.live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.live.is-on i {
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  animation: live-pulse 2s infinite;
}

@keyframes live-pulse {
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.tile.net {
  grid-column: span 2;
  grid-template-columns: 1fr 1fr;
  column-gap: 20px;
}

.net-half {
  display: grid;
  row-gap: 6px;
  min-width: 0;
}

.net-half .tile-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.net-up { --tone: #7c3aed; --tone-soft: #f0e9ff; }
.net-down { --tone: #0f7f96; --tone-soft: #e0f3f6; }

.net-up + .net-down {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.spark {
  width: 100%;
  height: 40px;
  overflow: visible;
}

.spark polyline {
  fill: none;
  stroke: var(--tone);
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}

.spark polygon {
  fill: var(--tone-soft);
}

@media (max-width: 900px) {
  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tile.net {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .tiles,
  .tiles-3 {
    gap: 10px;
  }

  .tile {
    padding: 12px;
  }

  .tile-value {
    font-size: 22px;
  }

  .todo,
  .tile.net {
    grid-template-columns: minmax(0, 1fr);
  }

  .net-up + .net-down {
    padding: 14px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.tabs a {
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eef6f7;
  color: #14343c;
}

.tabs a.active {
  background: var(--brand);
  color: white;
}

.subtabs {
  margin-bottom: 16px;
}

.subtabs a {
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.subtabs a:hover:not(.active) {
  background: #deedf0;
  color: #0b4550;
}

.subtab-pane {
  display: none;
}

.subtab-pane.active {
  display: block;
  animation: subtabFadeIn 0.15s ease-out;
}

@keyframes subtabFadeIn {
  from {
    opacity: 0.6;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.head-row h1 {
  margin: 0;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.slot-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
}

.slot-card:hover {
  border-color: var(--brand);
}

.slot-card.expired {
  opacity: 0.6;
}

.slot-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slot-id {
  color: #4d6670;
  font-size: 13px;
}

.slot-name {
  font-size: 17px;
  overflow-wrap: anywhere;
}

.pill.running {
  background: #dcfce7;
  color: #166534;
}

.pill.paused {
  background: #e0f2fe;
  color: #075985;
}

.pill.expired,
.pill.net_error,
.pill.dead {
  background: #ffe4e6;
  color: #9f1239;
}

.pill.alive {
  background: #dcfce7;
  color: #166534;
}

.progress-box {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f6fbfc;
}

.progress-box p {
  margin: 0;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 0.25s ease;
}

.progress-log {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: ui-monospace, Menlo, monospace;
  overflow-wrap: anywhere;
}

.progress-log:empty {
  display: none;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 400;
}

.danger-text {
  color: #be123c;
  margin-top: 12px;
}

input.tiny {
  width: 70px;
}

code {
  background: #eef6f7;
  border-radius: 6px;
  padding: 2px 6px;
  overflow-wrap: anywhere;
}

.card form.stack + form {
  margin-top: 18px;
}

.worker-box {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 0 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.worker-box p {
  margin: 0;
  flex: 1 1 240px;
}

.play {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.play > .play-tip {
  flex: 1 1 100%;
  width: 100%;
  margin: 0;
  border-radius: 12px;
}

.phone {
  width: min(100%, calc(var(--screen-w) * 1.5 + 36px));
  min-width: 260px;
  background: #1d2a30;
  border-radius: 28px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  user-select: none;
  -webkit-user-select: none;
}

.screen {
  position: relative;
  background: black;
  border-radius: 8px;
  overflow: hidden;
}

.screen canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  touch-action: none;
  cursor: pointer;
}

.screen-note {
  position: absolute;
  inset: auto 10px 10px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15, 30, 36, 0.85);
  color: white;
  font-size: 14px;
  text-align: center;
}

.screen.full {
  position: fixed;
  inset: 0;
  z-index: 1000;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen.full canvas {
  width: min(100vw, calc(100dvh * var(--ratio)));
  height: auto;
}

.screen-exit {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: rgba(15, 30, 36, 0.6);
  color: white;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

body.screen-full {
  overflow: hidden;
}

.keypad {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.keys.digits {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.keys.extras {
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.keys.extras .char-key {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: #2a3c44;
}

.keys button {
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  padding: 10px 0;
  border: 0;
  border-radius: 12px;
  background: #33464e;
  color: white;
  cursor: pointer;
  touch-action: none;
}

.keys.digits button {
  padding: 6px 0 5px;
  line-height: 1.15;
}

.keys .letters {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.6;
}

.keys button.small-label {
  font-size: 13px;
  background: #26363d;
}

.keys button.soft {
  font-size: 13px;
  background: #26363d;
  border-top: 3px solid #5fb4c4;
}

.keys button.fire {
  background: var(--brand);
}

.keys button.down {
  background: #5fb4c4;
  color: #10262c;
}

.watch-only .keys button {
  opacity: 0.45;
  cursor: not-allowed;
}

.play-side {
  flex: 1 1 260px;
  max-width: 420px;
}

.play-side h2 {
  margin-top: 18px;
}

.play-expiry {
  margin: 0 0 10px;
}

.play-auto {
  margin: 0 0 4px;
  padding: 12px;
  border: 1px solid var(--line, #e2ecef);
  border-radius: 12px;
  background: #f8fbfc;
}

.play-auto-switch {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px 12px;
  margin: 0;
  cursor: pointer;
  user-select: none;
}

.play-auto-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.play-auto-track {
  position: relative;
  width: 40px;
  height: 24px;
  margin-top: 1px;
  border-radius: 999px;
  background: #c5d5da;
  transition: background 0.2s ease;
}

.play-auto-track i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 52, 60, 0.25);
  transition: transform 0.2s ease;
}

.play-auto-switch input:checked + .play-auto-track {
  background: var(--brand, #0f7f96);
}

.play-auto-switch input:checked + .play-auto-track i {
  transform: translateX(16px);
}

.play-auto-switch input:disabled + .play-auto-track {
  opacity: 0.5;
}

.play-auto-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  line-height: 1.35;
}

.play-auto-text strong {
  color: #14343c;
  font-size: 0.95rem;
}

.play-auto-panel {
  display: block;
  max-height: 160px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e2ecef;
  overflow: hidden;
  opacity: 1;
  transition: max-height 0.28s ease, opacity 0.2s ease, margin 0.28s ease, padding 0.28s ease, border-color 0.2s ease;
}

.play-auto-panel[hidden] {
  display: block;
  max-height: 0;
  margin-top: 0;
  padding-top: 0;
  border-top-color: transparent;
  opacity: 0;
  pointer-events: none;
}

.play-auto-panel .chips {
  margin-top: 6px;
}

.saved-games {
  list-style: none;
  margin: 8px 0;
  padding: 0;
}

.saved-games li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line, #e2ecef);
}

.saved-games li > div:first-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.saved-games li > div:first-child span {
  overflow-wrap: anywhere;
}

.saved-games select {
  width: auto;
  max-width: 220px;
  padding: 6px 10px;
}

.saved-games .button {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .saved-games li {
    flex-direction: column;
    align-items: stretch;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
  margin: 8px 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.pick-grid.pick-list {
  grid-template-columns: 1fr;
}

.pick {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.pick:hover {
  border-color: #9fcbd5;
}

.pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pick:has(input:checked) {
  border-color: var(--brand);
  background: #e9f6f8;
  box-shadow: inset 0 0 0 1px var(--brand);
}

.pick:has(input:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.pick .pill {
  margin-left: auto;
  flex: none;
}

.screen-shape {
  flex: none;
  width: calc(var(--w) / 640 * 36px);
  height: calc(var(--h) / 640 * 36px);
  min-width: 8px;
  min-height: 8px;
  border: 2px solid #8fb3bc;
  border-radius: 3px;
}

.pick:has(input:checked) .screen-shape {
  border-color: var(--brand);
  background: rgba(15, 127, 150, 0.15);
}

.pick-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.pick-text strong {
  font-size: 14px;
}

.pick-text span {
  font-size: 11px;
  color: #5d7b83;
  overflow-wrap: anywhere;
}

.rent-months-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin: 6px 0 14px 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.rent-months-grid legend {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  padding: 0;
}

.pick.rent-month-pick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 14px;
  min-height: 84px;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid var(--line, #d7e7ea);
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.pick.rent-month-pick:hover {
  border-color: #9fcbd5;
}

.pick.rent-month-pick:has(input:checked) {
  border-color: var(--brand, #0f7f96);
  background: #e9f6f8;
  box-shadow: inset 0 0 0 1.5px var(--brand, #0f7f96);
}

.rent-month-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  width: 100%;
}

.rent-month-title {
  font-size: 15px;
  font-weight: 700;
  color: #14343c;
  line-height: 1.2;
}

.rent-month-days {
  font-size: 12px;
  color: #5d7b83;
  line-height: 1.2;
}

.rent-month-price {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--brand, #0f7f96);
  line-height: 1.2;
}

.rent-month-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}

.rent-discount-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #c2410c;
  background: #ffedd5;
  border: 1px solid #fed7aa;
  padding: 1px 6px;
  border-radius: 6px;
  line-height: 1.3;
}

.rent-month-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.rent-month-old-price {
  font-size: 11.5px;
  color: #8fa6ad;
  text-decoration: line-through;
  line-height: 1.2;
}

.month-discounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin: 4px 0 6px 0;
}

.month-discount-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.month-discount-item label {
  font-size: 13px;
  font-weight: 600;
  color: #14343c;
}

.input-with-suffix {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-suffix input {
  width: 100%;
  padding-right: 28px;
}

.input-with-suffix .suffix {
  position: absolute;
  right: 10px;
  color: #5d7b83;
  font-weight: 600;
  font-size: 13px;
  pointer-events: none;
}

.auto-submit-busy .pick-grid {
  opacity: 0.6;
  pointer-events: none;
}

.slots-card {
  overflow: visible;
}

.price-form {
  max-width: 560px;
}

.key-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6em;
  margin: 0 4px 4px 0;
  padding: 2px 8px;
  border-radius: 6px;
  background: #e8f2f4;
  border: 1px solid var(--line);
  font: inherit;
  font-weight: 700;
}

.trial-settings {
  margin: 8px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.trial-settings legend {
  padding: 0 4px;
  font-weight: 700;
}

.trial-settings .check {
  margin: 4px 0 12px;
}

.trial-card {
  border-color: #b7e4c7;
  background: linear-gradient(180deg, #f3fdf6 0%, #fff 48px);
}

.file-name {
  overflow-wrap: anywhere;
}

.file-table .owner {
  white-space: nowrap;
}

.file-table .pills a.pill {
  text-decoration: none;
}

.rule-list {
  margin: 4px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.offer-table td {
  vertical-align: middle;
}

.offer-table td > .sub,
.offer-table td > .period {
  display: block;
}

.offer-value {
  font-size: 15px;
  color: #9d174d;
}

.icon-only {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.icon-only svg {
  width: 16px;
  height: 16px;
}

.danger-icon {
  color: #be123c;
}

.danger-icon:hover {
  background: #fff1f2;
}

.offer-form {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbfc;
  scroll-margin-top: 20px;
}

.offer-form h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.offer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px 16px;
}

.offer-grid > label {
  display: grid;
  align-content: start;
  gap: 5px;
}

.offer-grid input:not([type="radio"]) {
  width: 100%;
  background: white;
}

.offer-kind .check {
  margin: 0;
  font-size: 14px;
}

.offer-kind {
  display: grid;
  align-content: start;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}

.offer-kind legend {
  margin-bottom: 5px;
  padding: 0;
  font-weight: 600;
  font-size: 14px;
}

input.upper {
  text-transform: uppercase;
}

input.upper::placeholder {
  text-transform: none;
}

.offer-form .check {
  margin: 4px 0 12px;
}

.offer-form .row.tight {
  margin: 0;
}

.lixi-box {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #fbcfe8;
  border-radius: 14px;
  background: #fdf2f8;
}

.lixi-box p {
  margin: 0 0 6px;
  font-weight: 700;
  color: #9d174d;
}

.lixi-box ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 3px;
  font-size: 14px;
}

.bonus-note {
  margin: 0;
  color: #9d174d;
  font-weight: 600;
}

.tier-editor {
  display: grid;
  gap: 8px;
}

.tier-edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #4d6670;
}

.tier-edit-row input {
  width: 110px;
  padding: 8px 10px;
}

.tier-edit-row input[name="tier_from"] {
  width: 70px;
}

.tier-remove {
  margin: 0 0 0 4px;
  font-size: 13px;
}

.stack .tier-add {
  margin-top: 0;
}

.tier-box {
  max-width: 460px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f6fbfc;
}

.tier-title {
  margin: 0 0 8px;
  font-weight: 700;
}

.tier-list {
  display: grid;
  gap: 4px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.tier-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 10px;
  transition: background 0.15s;
}

.tier-list li.active {
  background: #dff3f6;
  box-shadow: inset 3px 0 0 var(--brand);
}

.tier-list small {
  color: #6b8790;
  font-weight: 400;
}

.tier-box .muted {
  margin: 0;
}

.danger-inline {
  color: #be123c;
}

.head-meta .danger-inline strong {
  color: #be123c;
}

.capacity-bar {
  height: 6px;
  margin: 10px 0 4px;
  border-radius: 999px;
  background: #e6f0f2;
  overflow: hidden;
}

.capacity-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.capacity-bar.is-full span {
  background: #d97706;
}

.slot-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0 6px;
}

.slot-toolbar .tabs {
  margin: 0;
}

.slot-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.slot-toolbar .search-row {
  margin: 0;
}

.slot-toolbar .search-row input {
  min-width: 250px;
}

.node-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.node-filter a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f7fbfc;
  color: #3d5660;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.node-filter a:hover {
  border-color: #b7d0d6;
  background: #eef6f7;
}

.node-filter a.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.node-filter a.active .tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.node-filter a.is-dead:not(.active) {
  border-color: #fecdd3;
  color: #9f1239;
  background: #fff1f2;
}

.wall-size-line {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.wall-size-toggle {
  width: 28px;
  height: 28px;
  color: var(--brand);
}

.wall-size-toggle:hover {
  background: #e8f5f7;
}

.wall-size-toggle svg {
  width: 15px;
  height: 15px;
}

.wall-view-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  background: #eef5f7;
  border: 1px solid var(--line);
  border-radius: 999px;
  gap: 2px;
  flex-shrink: 0;
}

.wall-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #55727d;
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.wall-view-btn svg {
  width: 14px;
  height: 14px;
}

.wall-view-btn:hover {
  color: var(--brand);
}

.wall-view-btn.is-active {
  background: #fff;
  color: var(--brand);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Chế độ thu gọn cho tường xem màn hình */
.wall-grid.is-compact .wall-tile-title span,
html.wall-compact-mode .wall-grid .wall-tile-title span {
  display: none !important;
}

.wall-grid.is-compact .wall-tile-meta,
html.wall-compact-mode .wall-grid .wall-tile-meta {
  display: none !important;
}

.wall-grid.is-compact .wall-tile-head,
html.wall-compact-mode .wall-grid .wall-tile-head {
  align-items: center;
}

.wall-grid.is-compact .wall-tile,
html.wall-compact-mode .wall-grid .wall-tile {
  padding: 8px;
  gap: 6px;
}

.wall-grid {
  display: grid;
  grid-template-columns: repeat(var(--wall-cols, 3), minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.wall-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbfc;
}

.wall-tile.is-clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wall-tile.is-clickable:hover {
  border-color: #9ec9d2;
  box-shadow: 0 0 0 1px #c5e0e6;
}

.wall-tile.is-clickable:hover .wall-tile-title {
  color: var(--brand);
}

.wall-tile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.wall-tile-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  font-size: 14px;
}

.wall-tile-title:hover {
  color: var(--brand);
}

.wall-tile-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #4d6670;
  font-weight: 500;
}

.wall-tile-meta {
  margin: 0;
  font-size: 13px;
  color: #6b8790;
}

.wall-tile-meta a {
  color: inherit;
}

.wall-tile-meta a:hover {
  color: var(--brand);
}

.wall-screen {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ratio, 3 / 4);
  border-radius: 10px;
  overflow: hidden;
  background: #0b1f24;
}

.wall-screen canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.wall-note {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 12px;
  color: #9ec8d2;
  font-size: 13px;
  text-align: center;
  background: rgba(11, 31, 36, 0.72);
}

.wall-note[hidden] {
  display: none;
}

@media (max-width: 960px) {
  .wall-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .wall-grid {
    grid-template-columns: 1fr;
  }

  .slot-toolbar .search-row input {
    min-width: 0;
    width: 100%;
  }
}

.tab-count {
  display: inline-block;
  min-width: 20px;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(15, 127, 150, 0.12);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.tabs a.active .tab-count {
  background: rgba(255, 255, 255, 0.25);
}

.slot-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b8790;
  border-bottom-color: var(--line);
}

.slot-table td {
  padding: 14px 10px;
  vertical-align: middle;
}

.slot-table-compact td {
  padding: 8px 8px;
  vertical-align: top;
}

.slot-table-compact .slot-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
}

.slot-table-compact .slot-no {
  font-size: 14px;
}

.slot-table-compact .game-name {
  font-size: 13px;
}

.slot-table-compact .owner {
  margin-top: 1px;
  font-size: 12px;
}

.slot-table-compact .worker-line {
  margin-top: 3px;
}

.slot-table-compact .screen-link {
  margin-top: 2px;
}

.slot-table-compact .node-move {
  margin-top: 6px;
}

.place-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.place-stack .node-tag {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  margin-top: 0;
  padding: 2px 8px;
  border-radius: 8px;
  background: #eef4f8;
  font-size: 12px;
}

.place-stack .node-tag svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.proxy-tag {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 8px;
  background: #eef6f7;
  font-size: 12px;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.proxy-tag svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.proxy-tag.is-dead {
  background: #ffe4e6;
  color: #9f1239;
}

.slot-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.slot-bulk-bar:has([data-slot-bulk]:not([hidden])) {
  border-color: #b7e4c7;
  background: #f0fdf4;
}

.slot-bulk-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.slot-bulk-all input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--brand, #0f766e);
  cursor: pointer;
}

.slot-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-left: auto;
}

.slot-bulk-actions[hidden] {
  display: none;
}

.slot-bulk-count {
  font-size: 0.95rem;
}

.slot-check-spacer {
  display: inline-block;
  width: 16px;
  height: 16px;
}

.slot-table .check-col {
  width: 36px;
  padding-right: 0;
  vertical-align: middle;
}

.slot-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
}

.slot-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--brand, #0f766e);
  cursor: pointer;
}

.slot-row.is-checked {
  background: #f0fdfa;
}

.slot-row {
  transition: background 0.15s;
}

.slot-row:hover {
  background: #f7fbfc;
}

.slot-row.is-checked:hover {
  background: #e6fffa;
}

.slot-row.is-banned {
  background: #fff7f8;
}

.slot-row.is-banned td:first-child {
  box-shadow: inset 3px 0 0 #e11d48;
}

.slot-row.is-ended {
  opacity: 0.6;
}

.slot-cell,
.game-cell,
.state-cell,
.expiry-cell {
  line-height: 1.35;
}

.auto-renew-tag {
  margin-top: 2px;
  color: var(--brand);
  font-weight: 600;
}

.node-log {
  margin: 0;
  padding: 12px;
  max-height: 280px;
  overflow: auto;
  border-radius: 10px;
  background: #0b1f24;
  color: #9ec8d2;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.node-table .actions-col {
  width: auto;
  min-width: 220px;
}

.node-hw {
  display: block;
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--muted, #64748b);
  max-width: 220px;
}

.node-hw.is-fresh {
  color: inherit;
}

.node-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 380px;
  margin-left: auto;
}

.node-actions form {
  margin: 0;
}

.node-actions .button {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .node-actions {
    justify-content: flex-start;
    max-width: none;
    margin-left: 0;
  }
}

.ui-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
}

.ui-modal[hidden] {
  display: none;
}

.ui-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.ui-modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(640px, 100%);
  max-height: min(90vh, 920px);
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
}

.ui-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.ui-modal-head h2 {
  margin: 4px 0 0;
  font-size: 16px;
  line-height: 1.35;
  word-break: break-word;
}

.ui-modal-body {
  padding: 16px;
  overflow: auto;
}

.node-edit-form.stack {
  max-width: none;
  gap: 12px;
}

.node-edit-field {
  display: grid;
  gap: 5px;
  font-weight: 600;
  font-size: 14px;
}

.node-edit-field input {
  width: 100%;
  max-width: none;
  font-weight: 400;
}

.node-edit-remote {
  display: grid;
  gap: 12px;
}

.node-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 520px) {
  .node-edit-grid {
    grid-template-columns: 1fr;
  }
}

.node-edit-log-wrap {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.node-edit-log-wrap h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.node-edit-log-wrap .node-log {
  max-height: 220px;
}

.node-edit-log-wrap .node-log:empty::before {
  content: "Chưa có log cài đặt.";
  color: #7aa0a8;
}

.node-edit-modal .ui-modal-panel {
  width: min(560px, 100%);
}

.pill.installing {
  background: linear-gradient(90deg, #e0f2fe, #fef3c7, #e0f2fe);
  background-size: 200% 100%;
  color: #075985;
  animation: node-pill-shine 1.4s linear infinite;
}

.node-status {
  display: grid;
  gap: 4px;
  align-content: start;
}

.node-status .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 24px;
  padding: 3px 10px;
  font-weight: 600;
  white-space: nowrap;
}

.node-status-spin {
  width: 0.7em;
  height: 0.7em;
  border: 2px solid rgba(7, 89, 133, 0.25);
  border-top-color: #0369a1;
  border-radius: 50%;
  animation: button-spin 0.7s linear infinite;
}

.node-install-track {
  margin-top: 8px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.node-install-track span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #0ea5e9, #38bdf8);
  background-size: 200% 100%;
  animation: node-install-slide 1.1s ease-in-out infinite;
}

.node-row.is-installing {
  background: linear-gradient(90deg, rgba(224, 242, 254, 0.55), transparent 70%);
}

.node-table .node-id-cell {
  min-width: 9.5rem;
}

.node-name {
  display: inline;
  margin-right: 6px;
  font-size: 14px;
}

.node-local-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 600;
  vertical-align: 1px;
}

.node-cap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 6.5rem;
}

.node-cap-text {
  font-size: 13px;
}

.node-cap-track {
  max-width: 7rem;
}

.node-hw-meters {
  min-width: 11.5rem;
  max-width: 14rem;
}

.node-hw-empty {
  color: #8aa2a8;
  font-size: 12px;
  font-style: italic;
}

.node-hw-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hw-meter {
  display: grid;
  grid-template-columns: 2.1rem 1fr 2.4rem;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.hw-meter-name {
  color: #6b8790;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hw-meter-track,
.node-cap-track {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8f0f2;
}

.hw-meter-track i,
.node-cap-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #0ea5e9;
  transition: width 0.35s ease, background 0.2s ease;
}

.hw-meter[data-tone="ok"] .hw-meter-track i,
.node-cap-track[data-tone="ok"] i {
  background: linear-gradient(90deg, #38bdf8, #0284c7);
}

.hw-meter[data-tone="warn"] .hw-meter-track i,
.node-cap-track[data-tone="warn"] i {
  background: linear-gradient(90deg, #fbbf24, #d97706);
}

.hw-meter[data-tone="hot"] .hw-meter-track i,
.node-cap-track[data-tone="hot"] i {
  background: linear-gradient(90deg, #fb7185, #e11d48);
}

.hw-meter-val {
  text-align: right;
  color: #3d5660;
  font-weight: 600;
}

.hw-net {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin-top: 2px;
  font-size: 11px;
  color: #6b8790;
  font-variant-numeric: tabular-nums;
}

.slot-node-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: #eef4f8;
  color: #3d5660;
  font-weight: 600;
  width: fit-content;
}

.node-log-row td {
  padding-top: 0;
}

.node-log-panel {
  margin: 0 0 10px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #f8fbff;
  overflow: hidden;
}

.node-log-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
}

.node-log-panel .node-log {
  max-height: 200px;
  margin: 0;
  border-radius: 0;
}

/* Terminal popup khi cài thư viện */
.node-term {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 16px;
}

.node-term[hidden] {
  display: none;
}

.node-term-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 12, 18, 0.55);
}

.node-term-window {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(820px, 100%);
  height: min(70vh, 560px);
  overflow: hidden;
  border-radius: 12px;
  background: #0b1620;
  border: 1px solid #1e3344;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.node-term-chrome {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #1a2a36, #13222d);
  border-bottom: 1px solid #243848;
}

.node-term-dots {
  display: flex;
  gap: 6px;
}

.node-term-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4b5563;
}

.node-term-dots i:nth-child(1) { background: #ff5f57; }
.node-term-dots i:nth-child(2) { background: #febc2e; }
.node-term-dots i:nth-child(3) { background: #28c840; }

.node-term-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #9fb3c0;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
}

.node-term-live {
  color: #4ade80;
  font-size: 11px;
  animation: node-term-blink 1.2s step-end infinite;
}

.node-term-x {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9fb3c0;
  font-size: 18px;
  cursor: pointer;
}

.node-term-x:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.node-term-body {
  margin: 0;
  padding: 14px 16px 18px;
  overflow: auto;
  background: #0b1620;
  color: #d7f7e3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.node-term-body::after {
  content: "▋";
  margin-left: 2px;
  color: #4ade80;
  animation: node-term-blink 1s step-end infinite;
}

.node-term.is-done .node-term-body::after {
  display: none;
}

.node-term-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #10202b;
  border-top: 1px solid #243848;
}

.node-term-foot .muted {
  color: #8aa0ae;
}

@keyframes node-term-blink {
  50% {
    opacity: 0;
  }
}

@keyframes node-pill-shine {
  to {
    background-position: -200% 0;
  }
}

@keyframes node-install-slide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

.button.secondary.is-busy::before {
  border-color: rgba(15, 23, 42, 0.15);
  border-top-color: #0f766e;
}

.menu-list .menu-link {
  display: block;
  padding: 8px 12px;
  color: inherit;
  text-decoration: none;
  font-size: 13px;
}

.menu-list .menu-link:hover {
  background: #eef5f6;
}

.slot-cell > *,
.game-cell > *,
.state-cell > *,
.expiry-cell > * {
  display: block;
}

.slot-no {
  font-size: 16px;
  font-weight: 700;
}

.ip-tag {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  padding: 2px 8px;
  border-radius: 8px;
  background: #eef6f7;
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.ip-tag svg {
  width: 12px;
  height: 12px;
}

.ip-tag.is-dead {
  background: #ffe4e6;
  color: #9f1239;
}

.node-tag {
  display: inline-block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.node-tag.is-dead,
.place-stack .node-tag.is-dead {
  color: #9f1239;
  background: #ffe4e6;
}

.usage-line {
  display: block;
  font-variant-numeric: tabular-nums;
}

.node-move {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}

.node-move select {
  max-width: 11rem;
  font-size: 12px;
  padding: 4px 6px;
}

.game-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.game-name.is-empty {
  color: #8aa2a8;
  font-weight: 400;
  font-style: italic;
}

.owner {
  margin-top: 2px;
  font-size: 13px;
  color: #4d6670;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.owner:hover {
  color: var(--brand);
  text-decoration: underline;
}

.pills {
  display: flex !important;
  gap: 4px;
  flex-wrap: wrap;
}

.pill svg {
  width: 11px;
  height: 11px;
  margin: 0 3px -1px 0;
}

.sub {
  margin-top: 3px;
  font-size: 12px;
  color: #6b8790;
}

.worker-line {
  display: flex !important;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
}

.worker-line i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.worker-line.tone-ok { color: #047857; }
.worker-line.tone-wait { color: #b45309; }
.worker-line.tone-bad { color: #be123c; }

.screen-link {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.screen-link svg {
  width: 13px;
  height: 13px;
}

.screen-link:hover {
  text-decoration: underline;
}

.expiry-date {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.expiry-near .sub { color: #b45309; }
.expiry-soon .sub,
.expiry-over .sub { color: #be123c; font-weight: 600; }

.actions-col {
  text-align: right;
  width: 1%;
}

.slot-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.slot-actions form {
  margin: 0;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.icon-button svg {
  width: 13px;
  height: 13px;
}

.add-days {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #c8dde1;
  border-radius: 999px;
  overflow: hidden;
  background: white;
}

.add-days input {
  width: 46px;
  padding: 5px 4px 5px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 14px;
  text-align: center;
}

.add-days button {
  border: 0;
  padding: 0 12px;
  background: var(--brand);
  color: white;
  font: inherit;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}

.add-days button:hover {
  background: #0c6c80;
}

.menu {
  position: relative;
}

.menu-toggle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #4d6670;
  cursor: pointer;
  list-style: none;
}

.menu-toggle::-webkit-details-marker {
  display: none;
}

.menu-toggle:hover,
.menu[open] .menu-toggle {
  background: #e3f4f7;
  color: var(--brand);
}

.menu-toggle svg {
  width: 18px;
  height: 18px;
}

.menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  min-width: 170px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 12px 30px rgba(15, 52, 60, 0.16);
  text-align: left;
}

.menu-list button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #14343c;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.menu-list button:hover {
  background: #eef6f7;
}

.menu-list button svg {
  width: 15px;
  height: 15px;
  color: #6b8790;
}

.menu-list button.is-danger,
.menu-list button.is-danger svg {
  color: #be123c;
}

.menu-list button.is-danger:hover {
  background: #fff1f2;
}

.menu-list form + form:has(.is-danger) {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid #edf4f5;
}

@media (max-width: 760px) {
  .slot-table thead {
    display: none;
  }

  .slot-table,
  .slot-table tbody,
  .slot-table tr,
  .slot-table td {
    display: block;
    width: auto;
  }

  .slot-table tr {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 14px;
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
  }

  .slot-table.has-select tr {
    grid-template-columns: 28px auto 1fr;
  }

  .slot-table td {
    padding: 0;
    border: 0;
  }

  .slot-table .check-col {
    grid-row: 1 / span 2;
    grid-column: 1;
    align-self: start;
    padding-top: 2px;
  }

  .slot-table.has-select .slot-cell {
    grid-column: 2 / -1;
  }

  .slot-row.is-banned td:first-child {
    box-shadow: none;
  }

  .slot-row.is-banned {
    border-color: #fecdd3;
  }

  .slot-table .state-cell,
  .slot-table .node-cell,
  .slot-table .expiry-cell {
    grid-column: span 1;
  }

  .slot-table.has-select .state-cell,
  .slot-table.has-select .node-cell,
  .slot-table.has-select .expiry-cell {
    grid-column: 2 / -1;
  }

  .slot-table-compact tr {
    padding: 10px 12px;
    gap: 6px 12px;
  }

  .slot-table-compact .node-cell {
    grid-column: 1 / -1;
  }

  .slot-table.has-select .node-cell {
    grid-column: 2 / -1;
  }

  .slot-table .actions-col {
    grid-column: 1 / -1;
    padding-top: 10px;
    border-top: 1px solid #edf4f5;
  }

  .slot-bulk-bar[data-slot-bulk-bar] {
    position: sticky;
    top: 8px;
    z-index: 5;
  }

  .slot-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .menu {
    margin-left: auto;
  }
}

@media (max-width: 800px) {
  .layout {
    flex-direction: column;
    padding: 16px;
  }

  .side {
    flex: none;
  }

  .side nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .who {
    display: none;
  }
}

/* HUD tài nguyên máy chủ + node (admin) — góc dưới trái */
.sys-hud {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 900;
  width: 228px;
  max-height: min(78vh, 640px);
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border: 1px solid rgba(215, 231, 234, 0.95);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(15, 52, 60, 0.14);
  backdrop-filter: blur(8px);
  font-size: 12px;
  color: #4d6670;
}

.sys-hud-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  flex: none;
}

.sys-hud-scroll {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 -4px;
  padding: 0 4px;
  scrollbar-width: thin;
}

.sys-hud-section-title {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8aa3ab;
}

.sys-hud-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.sys-hud-section-head .sys-hud-section-title {
  margin: 0;
}

.sys-hud-section-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}

.sys-hud-section-link:hover {
  text-decoration: underline;
}

.sys-hud-section.is-nodes {
  padding-top: 8px;
  border-top: 1px solid #e6eff1;
}

.sys-hud-nodes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sys-hud-node {
  display: block;
  padding: 8px;
  border: 1px solid #e6eff1;
  border-radius: 10px;
  background: #f8fbfc;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.sys-hud-node:hover {
  border-color: #c5dde3;
  background: #f0f7f9;
}

.sys-hud-node.is-bad {
  border-color: #fecdd3;
  background: #fff7f8;
}

.sys-hud-node-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  min-width: 0;
}

.sys-hud-node-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: #14343c;
}

.sys-hud-node-tag {
  flex: none;
  padding: 1px 5px;
  border-radius: 999px;
  background: #e6eff1;
  color: #4d6670;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.sys-hud-node .sys-hud-row {
  grid-template-columns: 1fr;
  gap: 0;
}

.sys-hud-node .sys-hud-row + .sys-hud-row {
  margin-top: 4px;
}

.sys-hud-node-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 8px;
  margin-top: 6px;
  font-size: 11px;
  color: #6b8790;
}

.sys-hud-node-net {
  font-variant-numeric: tabular-nums;
}

.sys-hud-node-empty {
  margin: 0;
  font-size: 11px;
  color: #8aa3ab;
}

.sys-hud-node-dense {
  display: none;
}

.sys-hud-node-full {
  display: block;
}

/* Dạng gọn: web rút gọn + mỗi node một dòng */
.sys-hud.is-dense {
  width: 248px;
}

.sys-hud.is-dense .sys-hud-section-title {
  margin-bottom: 4px;
}

.sys-hud.is-dense [data-sys-hud-host] .sys-hud-rows {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 8px;
}

.sys-hud.is-dense [data-sys-hud-host] .sys-hud-row {
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 4px;
  min-width: 0;
}

.sys-hud.is-dense [data-sys-hud-host] .sys-hud-body {
  display: contents;
}

.sys-hud.is-dense [data-sys-hud-host] .sys-hud-top {
  display: contents;
}

.sys-hud.is-dense [data-sys-hud-host] .sys-hud-label,
.sys-hud.is-dense [data-sys-hud-host] .sys-hud-size,
.sys-hud.is-dense [data-sys-hud-host] .sys-hud-meter {
  display: none;
}

.sys-hud.is-dense [data-sys-hud-host] .sys-hud-value {
  font-size: 11px;
}

.sys-hud.is-dense [data-sys-hud-host] .sys-hud-icon svg {
  width: 11px;
  height: 11px;
}

.sys-hud.is-dense [data-sys-hud-host] .sys-hud-row.is-plain {
  grid-column: 1 / -1;
  grid-template-columns: 12px auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 6px;
}

.sys-hud.is-dense [data-sys-hud-host] .sys-hud-row.is-plain .sys-hud-label,
.sys-hud.is-dense [data-sys-hud-host] .sys-hud-row.is-plain .sys-hud-size {
  display: inline;
  font-size: 11px;
}

.sys-hud.is-dense [data-sys-hud-host] .sys-hud-row.is-plain .sys-hud-label {
  font-weight: 700;
  color: #14343c;
}

.sys-hud.is-dense [data-sys-hud-host] .sys-hud-row.is-plain .sys-hud-size {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.sys-hud.is-dense [data-sys-hud-host] .sys-hud-net {
  grid-column: 1 / -1;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding-top: 2px;
  border-top: none;
}

.sys-hud.is-dense [data-sys-hud-host] .sys-hud-net-item .sys-hud-label {
  display: none;
}

.sys-hud.is-dense .sys-hud-nodes {
  gap: 4px;
}

.sys-hud.is-dense .sys-hud-node {
  padding: 6px 8px;
}

.sys-hud.is-dense .sys-hud-node-head {
  margin-bottom: 0;
  gap: 6px;
}

.sys-hud.is-dense .sys-hud-node-name {
  flex: 0 1 auto;
  max-width: 42%;
}

.sys-hud.is-dense .sys-hud-node-dense {
  display: block;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: #6b8790;
}

.sys-hud.is-dense .sys-hud-node.is-warm .sys-hud-node-dense {
  color: #b45309;
}

.sys-hud.is-dense .sys-hud-node.is-hot .sys-hud-node-dense {
  color: #be123c;
  font-weight: 700;
}

.sys-hud.is-dense .sys-hud-node-full {
  display: none;
}

.sys-hud.is-dense .sys-hud-node-tag {
  display: none;
}

.sys-hud-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  color: #14343c;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sys-hud-head:hover {
  color: var(--brand);
}

.sys-hud-tool,
.sys-hud-close {
  flex: none;
  width: 22px;
  height: 22px;
  margin: -4px 0 -4px 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8aa3ab;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.sys-hud-close {
  margin-right: -4px;
}

.sys-hud-tool svg {
  width: 14px;
  height: 14px;
}

.sys-hud-tool:hover,
.sys-hud-close:hover {
  background: #eef5f6;
  color: #14343c;
}

.sys-hud-tool[aria-pressed="true"] {
  color: var(--brand, #0f7f96);
  background: #e8f6f8;
}

.sys-hud-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c8dde1;
  box-shadow: none;
}

.sys-hud-dot.is-on {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.sys-hud.is-offline .sys-hud-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.sys-hud-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sys-hud-row {
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: center;
  gap: 8px;
}

.sys-hud-icon {
  display: grid;
  place-items: center;
  color: var(--brand);
}

.sys-hud-icon svg {
  width: 13px;
  height: 13px;
}

.sys-hud-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sys-hud-top {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.sys-hud-label {
  flex: none;
  font-weight: 700;
  color: #14343c;
}

.sys-hud-size {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #6b8790;
  font-weight: 500;
}

.sys-hud-meter {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: #e6eff1;
  overflow: hidden;
}

.sys-hud-meter i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--brand);
  transition: width 0.5s ease, background-color 0.3s;
}

.sys-hud-row[data-level="mid"] .sys-hud-meter i {
  background: #d97706;
}

.sys-hud-row[data-level="high"] .sys-hud-meter i {
  background: #e11d48;
}

.sys-hud-value {
  flex: none;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 700;
  color: #14343c;
}

.sys-hud-row[data-level="mid"] .sys-hud-value {
  color: #b45309;
}

.sys-hud-row[data-level="high"] .sys-hud-value {
  color: #be123c;
}

.sys-hud-row.is-plain {
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
  margin: 0 -2px;
  padding: 2px;
}

.sys-hud-row.is-plain:hover {
  background: #f0f7f9;
}

.sys-hud-net {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 4px;
  border-top: 1px solid #e6eff1;
}

.sys-hud-net-item {
  display: grid;
  grid-template-columns: 12px 28px 1fr;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.sys-hud-net-item .sys-hud-icon {
  color: inherit;
}

.sys-hud-net-item .sys-hud-icon svg {
  width: 11px;
  height: 11px;
}

.sys-hud-net-item .sys-hud-label {
  font-size: 11px;
  font-weight: 600;
  color: inherit;
}

.sys-hud-net-item .sys-hud-value {
  font-size: 11px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sys-hud-net-item.is-up {
  color: #7c3aed;
}

.sys-hud-net-item.is-down {
  color: #0f7f96;
}

.sys-hud-net-item.is-up .sys-hud-value,
.sys-hud-net-item.is-down .sys-hud-value {
  color: inherit;
}

body.screen-full .sys-hud {
  display: none;
}

/* Dưới 500px: dạng gọn; thêm .is-expanded (bấm đúp) để xem đủ như desktop */
@media (max-width: 499px) {
  .sys-hud {
    left: 10px;
    bottom: 10px;
  }

  .sys-hud.is-narrow:not(.is-expanded) {
    width: auto;
    max-width: calc(100vw - 20px);
    max-height: none;
    padding: 8px 10px;
  }

  .sys-hud.is-narrow:not(.is-expanded) .sys-hud-bar {
    margin-bottom: 6px;
  }

  .sys-hud.is-narrow:not(.is-expanded) .sys-hud-section-title,
  .sys-hud.is-narrow:not(.is-expanded) .sys-hud-section.is-nodes {
    display: none;
  }

  .sys-hud.is-narrow:not(.is-expanded) .sys-hud-scroll {
    overflow: visible;
    margin: 0;
    padding: 0;
    gap: 0;
  }

  .sys-hud.is-narrow:not(.is-expanded) .sys-hud-rows {
    display: grid;
    grid-template-columns: repeat(3, auto);
    align-items: center;
    column-gap: 10px;
    row-gap: 4px;
  }

  .sys-hud.is-narrow:not(.is-expanded) .sys-hud-row {
    grid-template-columns: 14px auto;
    gap: 4px;
  }

  .sys-hud.is-narrow:not(.is-expanded) .sys-hud-body {
    display: contents;
  }

  .sys-hud.is-narrow:not(.is-expanded) .sys-hud-top {
    display: contents;
  }

  .sys-hud.is-narrow:not(.is-expanded) .sys-hud-label,
  .sys-hud.is-narrow:not(.is-expanded) .sys-hud-size,
  .sys-hud.is-narrow:not(.is-expanded) .sys-hud-meter {
    display: none;
  }

  .sys-hud.is-narrow:not(.is-expanded) .sys-hud-value {
    font-size: 11px;
  }

  .sys-hud.is-narrow:not(.is-expanded) .sys-hud-net {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding-top: 2px;
    border-top: none;
  }

  .sys-hud.is-narrow:not(.is-expanded) .sys-hud-net-item {
    grid-template-columns: 12px 1fr;
    gap: 4px;
  }

  .sys-hud.is-narrow:not(.is-expanded) .sys-hud-net-item .sys-hud-label {
    display: none;
  }

  .sys-hud.is-narrow.is-expanded {
    width: min(248px, calc(100vw - 20px));
    max-height: min(78vh, 640px);
    padding: 8px 10px;
  }
}

/* Liên hệ góc màn hình */
.contact-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.contact-toggle {
  position: relative;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #1294ad, #0f7f96);
  color: white;
  box-shadow: 0 10px 28px rgba(15, 127, 150, 0.42), 0 0 0 6px rgba(15, 127, 150, 0.12);
  cursor: pointer;
  animation: contact-wiggle 2.8s ease-in-out infinite;
}

.contact-toggle:hover {
  transform: scale(1.05);
}

.contact-toggle svg {
  width: 26px;
  height: 26px;
}

.contact-toggle-icon,
.contact-toggle-close {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: opacity 0.2s, transform 0.2s;
}

.contact-toggle-close {
  opacity: 0;
  font-size: 28px;
  line-height: 1;
  transform: rotate(-40deg) scale(0.6);
}

.contact-fab.is-open .contact-toggle {
  animation: none;
  background: #14343c;
  box-shadow: 0 10px 24px rgba(20, 52, 60, 0.35);
}

.contact-fab.is-open .contact-toggle-icon {
  opacity: 0;
  transform: rotate(40deg) scale(0.6);
}

.contact-fab.is-open .contact-toggle-close {
  opacity: 1;
  transform: none;
}

.contact-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 210px;
  padding: 14px;
  border-radius: 18px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(15, 52, 60, 0.18);
  transform-origin: bottom right;
  animation: contact-panel-in 0.22s ease-out;
}

.contact-panel-title {
  margin: 0 0 2px;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b8790;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: #14343c;
  font-weight: 600;
  background: #f4fafb;
  transition: background 0.15s, transform 0.15s;
}

.contact-link:hover {
  background: #e5f3f6;
  transform: translateX(-2px);
}

.contact-link-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: white;
  background: var(--brand);
  flex: none;
}

.contact-link-icon svg {
  width: 18px;
  height: 18px;
}

.contact-link.is-facebook .contact-link-icon { background: #1877f2; }
.contact-link.is-zalo .contact-link-icon { background: #0068ff; }
.contact-link.is-telegram .contact-link-icon { background: #229ed9; }
.contact-link.is-phone .contact-link-icon { background: #059669; }
.contact-link.is-chat .contact-link-icon { background: #7c3aed; }
.contact-link.is-link .contact-link-icon { background: #0f7f96; }

@keyframes contact-wiggle {
  0%, 82%, 100% { transform: rotate(0); }
  86% { transform: rotate(-8deg); }
  90% { transform: rotate(7deg); }
  94% { transform: rotate(-5deg); }
  97% { transform: rotate(3deg); }
}

@keyframes contact-panel-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .contact-toggle,
  .contact-panel {
    animation: none;
  }
}

body.screen-full .contact-fab {
  display: none;
}

@media (max-width: 560px) {
  .contact-fab {
    right: 14px;
    bottom: 14px;
  }

  .contact-toggle {
    width: 52px;
    height: 52px;
  }
}

/* Form quản lý liên hệ */
.contact-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f0f9fb;
}

.contact-switch .check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  font-size: 15px;
}

.contact-switch .check input {
  margin-top: 3px;
}

.contact-switch .sub {
  display: block;
  margin-top: 2px;
  font-weight: 400;
  color: #6b8790;
}

.contact-form .row .button svg {
  width: 15px;
  height: 15px;
  vertical-align: -2px;
}

.contact-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.contact-row {
  display: grid;
  grid-template-columns: 150px minmax(120px, 0.8fr) minmax(180px, 1.4fr) 40px;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbfc;
}

.contact-row label {
  display: grid;
  gap: 4px;
  margin: 0;
}

.contact-row input,
.contact-row select {
  width: 100%;
  background: white;
}

.contact-kind-fixed {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  background: white;
  border: 1px solid #c8dde1;
  font-weight: 600;
}

.contact-kind-fixed svg {
  width: 16px;
  height: 16px;
}

.contact-kind-fixed.is-facebook { color: #1877f2; }
.contact-kind-fixed.is-zalo { color: #0068ff; }
.contact-kind-fixed.is-telegram { color: #229ed9; }

.contact-spacer {
  width: 36px;
  height: 36px;
}

.contact-url em {
  color: #d97706;
  font-style: normal;
}

@media (max-width: 800px) {
  .contact-row {
    grid-template-columns: 1fr 1fr 40px;
  }

  .contact-url {
    grid-column: 1 / -2;
  }
}

@media (max-width: 560px) {
  .contact-row {
    grid-template-columns: 1fr 40px;
  }

  .contact-kind,
  .contact-url,
  .contact-row label {
    grid-column: 1 / -2;
  }
}

/* Admin email — gửi tay: chọn nhiều + gợi ý */
.email-send.stack {
  max-width: 720px;
}

.email-pick {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.email-pick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.email-pick-chips:empty {
  display: none;
}

.email-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 8px 4px 10px;
  border-radius: 999px;
  background: #eef6f8;
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.3;
}

.email-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-chip button {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.email-chip button:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.email-pick-field {
  position: relative;
}

.email-pick-field input {
  width: 100%;
  max-width: none;
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 4px 0;
}

.email-pick-field input:focus {
  outline: none;
}

.email-suggest {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 4px;
  list-style: none;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.email-suggest li {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.email-suggest li:hover,
.email-suggest li.is-active {
  background: #f0f9fb;
}

.email-suggest li strong {
  font-weight: 600;
  word-break: break-all;
}

.email-suggest li span {
  color: #64748b;
  font-size: 12px;
}

.email-compose {
  display: grid;
  gap: 8px;
}

.email-compose-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.email-compose-label {
  font-weight: 600;
  font-size: 14px;
}

.email-compose-modes {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: #eef4f6;
  gap: 2px;
}

.email-compose-modes button {
  border: 0;
  background: transparent;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: #64748b;
  cursor: pointer;
}

.email-compose-modes button.is-on {
  background: #fff;
  color: #0f766e;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.email-compose-visual {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.email-compose-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.email-compose-toolbar button {
  min-width: 32px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  cursor: pointer;
}

.email-compose-toolbar button:hover {
  border-color: #99c5ce;
  color: #0f766e;
}

.email-compose-sep {
  width: 1px;
  align-self: stretch;
  margin: 2px 4px;
  background: var(--line);
}

.email-compose-editor {
  min-height: 180px;
  max-height: 420px;
  overflow: auto;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.55;
  outline: none;
}

.email-compose-editor:empty::before {
  content: attr(data-placeholder);
  white-space: pre-line;
  color: #94a3b8;
  pointer-events: none;
}

.email-compose-editor p {
  margin: 0 0 0.6em;
}

.email-compose-editor h2 {
  margin: 0 0 0.5em;
  font-size: 1.15em;
}

.email-compose-html textarea {
  width: 100%;
  max-width: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
}

button.linkish.email-log-subject {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand, #0f766e);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

button.linkish.email-log-subject:hover {
  color: #0d9488;
}

.email-log-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
}

.email-log-modal[hidden] {
  display: none;
}

.email-log-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.email-log-modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(720px, 100%);
  max-height: min(86vh, 900px);
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
}

.email-log-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.email-log-modal-head h2 {
  margin: 4px 0 0;
  font-size: 16px;
  line-height: 1.35;
  word-break: break-word;
}

.email-log-modal-body {
  padding: 18px 16px;
  overflow: auto;
  font-size: 14px;
  line-height: 1.5;
}

.email-log-modal-body p {
  margin: 0 0 12px;
}

.email-log-modal-body p:last-child {
  margin-bottom: 0;
}

.email-log-modal-empty {
  color: #64748b;
}

/* Admin email — tab Template: form rộng + xem trước cạnh bên */
.email-tpl {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px 20px;
  align-items: start;
}

.email-tpl.is-previewing {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.email-tpl .stack {
  max-width: none;
  width: 100%;
}

.email-tpl .stack label {
  display: grid;
  gap: 5px;
}

.email-tpl .stack input,
.email-tpl .stack textarea {
  width: 100%;
  max-width: none;
}

.email-tpl-preview {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  min-height: 200px;
  overflow: hidden;
}

.email-tpl-preview-head {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.email-tpl-preview-head strong {
  font-size: 14px;
  font-weight: 600;
  word-break: break-word;
}

.email-tpl-preview-body {
  padding: 16px 14px;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.email-tpl-preview-body p {
  margin: 0 0 12px;
}

.email-tpl-preview-body p:last-child {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .email-tpl.is-previewing {
    grid-template-columns: 1fr;
  }
}

/* --- Landing page enhancements --- */
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 127, 150, 0.08);
  border: 1px solid rgba(15, 127, 150, 0.2);
  color: #0f7f96;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.hero-tag .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.stats-ribbon {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 18px 24px;
  border-radius: 18px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(15, 52, 60, 0.04);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.stat-item strong {
  font-size: 22px;
  font-weight: 800;
  color: #0f7f96;
  letter-spacing: -0.02em;
}

.stat-item span {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.feature {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.feature:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 10px 24px rgba(15, 52, 60, 0.06);
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  font-size: 13px;
  color: #475569;
}

.hero-trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-trust-item svg {
  width: 15px;
  height: 15px;
  color: #10b981;
}

@media (max-width: 768px) {
  .stats-ribbon {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 16px;
  }
}

/* --- Nạp tiền hiện đại (Payment V2) --- */
.payment-card-wrap {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: flex-start;
  margin-top: 18px;
}

.payment-qr-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f8fafc;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  text-align: center;
}

.payment-qr-side img.qr {
  display: block;
  width: 100%;
  max-width: 240px;
  height: auto;
  border-radius: 12px;
  background: white;
  padding: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.payment-info-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.payment-pulse-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 13px;
  font-weight: 600;
  width: fit-content;
}

.payment-pulse-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.payment-table {
  display: grid;
  gap: 10px;
  background: white;
}

.payment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.payment-row .label {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.payment-row .val {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.payment-row.is-code {
  background: #fffbeb;
  border-color: #fde68a;
}

.payment-row.is-code .val strong {
  font-size: 17px;
  color: #b45309;
  letter-spacing: 0.05em;
}

.payment-row.is-amount .val strong {
  font-size: 18px;
  color: var(--brand, #0f7f96);
}

.payment-help-box {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #f1f5f9;
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
}

@media (max-width: 680px) {
  .payment-card-wrap {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Trang nạp tiền hiện đại (Deposit Portal) */
.deposit-card-wrap {
  max-width: 680px;
  margin: 0 auto;
}

.deposit-hero-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #f0fdfa 0%, #e6fffa 100%);
  border: 1px solid #99f6e4;
  border-radius: 14px;
  margin-bottom: 20px;
}

.deposit-hero-balance .balance-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.deposit-hero-balance .balance-label {
  font-size: 13px;
  font-weight: 600;
  color: #0f766e;
  display: flex;
  align-items: center;
  gap: 6px;
}

.deposit-hero-balance .balance-val {
  font-size: 24px;
  font-weight: 800;
  color: #115e59;
  letter-spacing: -0.02em;
}

.deposit-hero-balance .history-link {
  font-size: 13px;
  font-weight: 600;
  color: #0d9488;
  text-decoration: none;
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid #ccfbf1;
  border-radius: 8px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.deposit-hero-balance .history-link:hover {
  background: #0d9488;
  color: #ffffff;
  border-color: #0d9488;
}

/* Khối lì xì khuyến mãi */
.deposit-lixi-box {
  margin-bottom: 22px;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 14px 18px;
}

.deposit-lixi-box .lixi-title {
  margin: 0 0 6px 0;
  font-weight: 700;
  color: #b45309;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.deposit-lixi-box ul {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  color: #92400e;
  line-height: 1.6;
}

/* Form nạp tiền */
.deposit-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.deposit-form-group label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.deposit-form-group .field-hint {
  font-size: 12px;
  font-weight: 400;
  color: #64748b;
}

/* Input số tiền lớn */
.deposit-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.deposit-input-wrap input {
  width: 100%;
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  padding: 14px 58px 14px 16px;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.deposit-input-wrap input:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15);
}

.deposit-input-wrap .unit {
  position: absolute;
  right: 16px;
  font-size: 16px;
  font-weight: 700;
  color: #64748b;
  pointer-events: none;
}

/* Input thông thường toàn chiều rộng */
.deposit-text-input {
  width: 100%;
  font-size: 15px;
  padding: 12px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.deposit-text-input:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

/* Lưới nút chọn nhanh số tiền */
.deposit-presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 6px;
}

.deposit-presets-grid button {
  appearance: none;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 8px;
  font-size: 14px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.deposit-presets-grid button:hover {
  background: #f0fdfa;
  border-color: #14b8a6;
  color: #0f766e;
  transform: translateY(-1px);
}

.deposit-presets-grid button.is-active {
  background: #0f766e !important;
  border-color: #0f766e !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.25);
}

.deposit-presets-grid button:active {
  transform: translateY(0);
}

/* Ghi chú hạn mức */
.deposit-limit-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #64748b;
  margin: 6px 0 16px 0;
  line-height: 1.4;
}

/* Nút tạo QR */
.deposit-btn-submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 24px;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.28);
  transition: all 0.2s ease;
  margin-top: 6px;
}

.deposit-btn-submit:hover {
  background: linear-gradient(135deg, #115e59 0%, #0f766e 100%);
  box-shadow: 0 6px 18px rgba(13, 148, 136, 0.38);
  transform: translateY(-1px);
}

.deposit-btn-submit:active {
  transform: translateY(0);
}

/* Cam kết dịch vụ */
.deposit-trust-ribbon {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #e2e8f0;
}

.deposit-trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #475569;
  line-height: 1.35;
}

.deposit-trust-item span.icon {
  font-size: 18px;
  flex-shrink: 0;
}

@media (max-width: 580px) {
  .deposit-presets-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .deposit-presets-grid button {
    padding: 8px 4px;
    font-size: 13px;
  }
  .deposit-trust-ribbon {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}


