/* Day/night theme overlay */
:root,
html[data-neo-theme='light'] {
  color-scheme: light;
  --neo-text: var(--neo-ink);
  --neo-muted: rgba(17, 17, 17, 0.68);
  --neo-muted-strong: rgba(17, 17, 17, 0.82);
  --neo-soft-border: rgba(17, 17, 17, 0.16);
  --neo-soft-border-strong: rgba(17, 17, 17, 0.34);
  --neo-card-bg: #ffffff;
  --neo-card-bg-soft: rgba(255, 255, 255, 0.74);
  --neo-card-bg-muted: #fffdf3;
  --neo-card-bg-warning: #fff5c5;
  --neo-card-bg-ready: #dffcc1;
  --neo-field-bg: #ffffff;
  --neo-overlay-bg: rgba(17, 17, 17, 0.45);
}

html[data-neo-theme='dark'] {
  color-scheme: dark;
  --neo-bg: #0b111b;
  --neo-surface: #151d2b;
  --neo-surface-alt: #1c2636;
  --neo-panel-muted: #111925;
  --neo-ink: #e7edf6;
  --neo-border: #586982;
  --neo-text: #e7edf6;
  --neo-muted: rgba(231, 237, 246, 0.68);
  --neo-muted-strong: rgba(231, 237, 246, 0.84);
  --neo-soft-border: rgba(138, 157, 184, 0.2);
  --neo-soft-border-strong: rgba(138, 157, 184, 0.38);
  --neo-card-bg: #182232;
  --neo-card-bg-soft: rgba(24, 34, 50, 0.9);
  --neo-card-bg-muted: #131d2b;
  --neo-card-bg-warning: #2f2a1d;
  --neo-card-bg-ready: #1f3024;
  --neo-field-bg: #0f1724;
  --neo-overlay-bg: rgba(3, 6, 12, 0.72);
  --neo-yellow: #8f6f2c;
  --neo-red: #88423f;
  --neo-blue: #285f82;
  --neo-green: #456f3d;
  --neo-peach: #794c3f;
  --neo-shadow: 6px 6px 0 rgba(3, 6, 12, 0.72);
  --neo-shadow-sm: 4px 4px 0 rgba(3, 6, 12, 0.72);
  --neo-shadow-lg: 10px 10px 0 rgba(3, 6, 12, 0.76);
  --neo-shadow-btn-default: 4px 4px 0 rgba(3, 6, 12, 0.72);
  --neo-shadow-btn-reading: 2px 2px 0 rgba(3, 6, 12, 0.72);
  --neo-shadow-btn-toolbar: 2px 2px 0 rgba(3, 6, 12, 0.72);
}

html[data-neo-theme='dark'] body {
  background:
    radial-gradient(circle at 16% 18%, rgba(69, 120, 162, 0.16), transparent 24%),
    radial-gradient(circle at 84% 12%, rgba(136, 66, 63, 0.14), transparent 20%),
    linear-gradient(135deg, rgba(143, 111, 44, 0.08) 0 12%, transparent 12% 100%),
    var(--neo-bg);
  color: var(--neo-ink);
}

html[data-neo-theme='dark'] body.neo-embedded,
html[data-neo-theme='dark'] body.page-user-recharge {
  background: var(--neo-bg);
}

html[data-neo-theme='dark'] body::before,
html[data-neo-theme='dark'] body::after {
  opacity: 0.08;
  border-color: var(--neo-soft-border-strong);
  box-shadow: none;
}

html[data-neo-theme='dark'] body::before {
  background: #5f4b21;
}

html[data-neo-theme='dark'] body::after {
  background: #214d69;
}

html[data-neo-theme='dark'] .neo-subtitle,
html[data-neo-theme='dark'] .neo-summary-meta,
html[data-neo-theme='dark'] .neo-ip-access-meta,
html[data-neo-theme='dark'] .neo-ip-access-empty,
html[data-neo-theme='dark'] .neo-ip-limit-last,
html[data-neo-theme='dark'] .neo-note-subtle,
html[data-neo-theme='dark'] small,
html[data-neo-theme='dark'] .neo-caption {
  color: var(--neo-muted);
}

html[data-neo-theme='dark'] .neo-panel,
html[data-neo-theme='dark'] .neo-card,
html[data-neo-theme='dark'] .card,
html[data-neo-theme='dark'] .login-container,
html[data-neo-theme='dark'] .content-box {
  background: var(--neo-surface);
}

html[data-neo-theme='dark'] .neo-card--accent,
html[data-neo-theme='dark'] .card:nth-of-type(odd) {
  background: var(--neo-surface-alt);
}

html[data-neo-theme='dark'] .neo-panel--muted {
  background: var(--neo-panel-muted);
}

html[data-neo-theme='dark'] .neo-kicker,
html[data-neo-theme='dark'] .neo-badge,
html[data-neo-theme='dark'] .badge {
  color: #fff4d0;
}

html[data-neo-theme='dark'] .neo-note-block,
html[data-neo-theme='dark'] .neo-static,
html[data-neo-theme='dark'] .locked,
html[data-neo-theme='dark'] .border-box {
  background: var(--neo-card-bg-muted);
}

html[data-neo-theme='dark'] .neo-note-block,
html[data-neo-theme='dark'] .neo-note-block--subtle,
html[data-neo-theme='dark'] .neo-note-block[data-status='loading'],
html[data-neo-theme='dark'] .neo-static,
html[data-neo-theme='dark'] .locked {
  background: var(--neo-card-bg-warning);
}

html[data-neo-theme='dark'] .neo-note-block[data-status='ready'] {
  background: var(--neo-card-bg-ready);
}

html[data-neo-theme='dark'] .neo-stat-item,
html[data-neo-theme='dark'] .neo-summary-card,
html[data-neo-theme='dark'] .neo-copy-value,
html[data-neo-theme='dark'] .neo-info-list li,
html[data-neo-theme='dark'] .list-group-item,
html[data-neo-theme='dark'] .code-item,
html[data-neo-theme='dark'] .neo-info-row,
html[data-neo-theme='dark'] .neo-credential-value,
html[data-neo-theme='dark'] .neo-select-option,
html[data-neo-theme='dark'] #description-info li,
html[data-neo-theme='dark'] .button-container img,
html[data-neo-theme='dark'] .neo-choice-image,
html[data-neo-theme='dark'] body.page-tutorial .border-box,
html[data-neo-theme='dark'] .page-user .neo-user-summary-card,
html[data-neo-theme='dark'] .page-user .neo-copy-row .neo-copy-value {
  background: var(--neo-card-bg);
}

html[data-neo-theme='dark'] .neo-summary-item + .neo-summary-item,
html[data-neo-theme='dark'] .page-user .neo-user-summary-item + .neo-user-summary-item {
  border-top-color: var(--neo-soft-border);
}

html[data-neo-theme='dark'] .neo-input,
html[data-neo-theme='dark'] .form-control,
html[data-neo-theme='dark'] textarea,
html[data-neo-theme='dark'] select,
html[data-neo-theme='dark'] input[type='text'],
html[data-neo-theme='dark'] input[type='password'],
html[data-neo-theme='dark'] input[type='email'],
html[data-neo-theme='dark'] input[type='url'],
html[data-neo-theme='dark'] .neo-select-trigger {
  background: var(--neo-field-bg);
  color: var(--neo-ink);
  box-shadow: inset 0 0 0 1px rgba(231, 237, 246, 0.045);
}

html[data-neo-theme='dark'] .neo-input::placeholder,
html[data-neo-theme='dark'] .form-control::placeholder,
html[data-neo-theme='dark'] textarea::placeholder,
html[data-neo-theme='dark'] select::placeholder,
html[data-neo-theme='dark'] input[type='text']::placeholder,
html[data-neo-theme='dark'] input[type='password']::placeholder,
html[data-neo-theme='dark'] input[type='email']::placeholder,
html[data-neo-theme='dark'] input[type='url']::placeholder {
  color: rgba(231, 237, 246, 0.42);
}

html[data-neo-theme='dark'] .neo-field--floating .neo-input:focus + .neo-label--floating,
html[data-neo-theme='dark'] .neo-field--floating .neo-input:not(:placeholder-shown) + .neo-label--floating,
html[data-neo-theme='dark'] .neo-field--floating .form-control:focus + .neo-label--floating,
html[data-neo-theme='dark'] .neo-field--floating .form-control:not(:placeholder-shown) + .neo-label--floating,
html[data-neo-theme='dark'] .neo-field--floating textarea:focus + .neo-label--floating,
html[data-neo-theme='dark'] .neo-field--floating textarea:not(:placeholder-shown) + .neo-label--floating,
html[data-neo-theme='dark'] .neo-field--floating input:-webkit-autofill + .neo-label--floating,
html[data-neo-theme='dark'] .neo-field--dropdown .neo-label--floating {
  background: var(--neo-surface);
}

html[data-neo-theme='dark'] .neo-select-trigger:hover,
html[data-neo-theme='dark'] .neo-field--dropdown.is-open .neo-select-trigger {
  background: var(--neo-surface-alt);
}

html[data-neo-theme='dark'] .neo-select-menu {
  background: var(--neo-panel-muted);
}

html[data-neo-theme='dark'] .neo-btn,
html[data-neo-theme='dark'] .btn {
  color: #f4f7fb;
}

html[data-neo-theme='dark'] .neo-btn--ghost,
html[data-neo-theme='dark'] .btn-secondary,
html[data-neo-theme='dark'] .btn-link {
  background: var(--neo-card-bg);
  color: var(--neo-ink);
}

html[data-neo-theme='dark'] .neo-alert,
html[data-neo-theme='dark'] .alert,
html[data-neo-theme='dark'] .text-danger,
html[data-neo-theme='dark'] .text-success {
  color: #f7f2e8;
}

html[data-neo-theme='dark'] .neo-modal {
  background: var(--neo-overlay-bg);
}

html[data-neo-theme='dark'] .page-check-user .neo-ip-limit-lines {
  border-color: var(--neo-soft-border-strong);
  background: linear-gradient(180deg, rgba(24, 34, 50, 0.96), rgba(138, 157, 184, 0.06));
}

html[data-neo-theme='dark'] .page-check-user .neo-ip-limit-line--wide,
html[data-neo-theme='dark'] .page-check-user .neo-ip-access-footer {
  border-top-color: var(--neo-soft-border);
}

html[data-neo-theme='dark'] .page-check-user .neo-ip-access-item {
  border-color: var(--neo-soft-border);
  background: var(--neo-card-bg-soft);
}

html[data-neo-theme='dark'] .page-check-user .neo-ip-access-item--last {
  background: rgba(138, 157, 184, 0.08);
}

html[data-neo-theme='dark'] .page-check-user .neo-ip-access-title span {
  background: rgba(138, 157, 184, 0.15);
  color: var(--neo-muted);
}

html[data-neo-theme='dark'] .page-check-user .neo-ip-section-separator {
  border-top-color: rgba(138, 157, 184, 0.58) !important;
}

html[data-neo-theme='dark'] .page-check-user .neo-ip-access-separator {
  border-top-color: rgba(138, 157, 184, 0.42) !important;
}

html[data-neo-theme='dark'] .page-user .neo-reset-wrap {
  border-top-color: var(--neo-soft-border-strong);
}

html[data-neo-theme='dark'] body.page-tutorial .neo-tutorial-content {
  background:
    linear-gradient(140deg, rgba(143, 111, 44, 0.08), transparent 26%),
    var(--neo-surface);
}

html[data-neo-theme='dark'] .neo-tutorial-card,
html[data-neo-theme='dark'] .neo-tutorial-panel {
  background: var(--neo-surface);
}

html[data-neo-theme='dark'] .neo-theme-toggle {
  background: var(--neo-card-bg);
}

.neo-theme-toggle {
  position: fixed;
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  z-index: 10020;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.55rem;
  padding: 0.42rem 0.68rem;
  border: 3px solid var(--neo-border);
  border-radius: 999px;
  background: var(--neo-surface);
  color: var(--neo-ink);
  box-shadow: var(--neo-shadow-btn-toolbar);
  font-family: var(--neo-font-body);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.neo-theme-toggle:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--neo-border);
}

.neo-theme-toggle:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--neo-border);
}

.neo-theme-toggle__icon {
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--neo-border);
  border-radius: 50%;
  background: var(--neo-yellow);
  color: #111111;
  font-size: 0.82rem;
  line-height: 1;
}

html[data-neo-theme='dark'] .neo-theme-toggle__icon {
  background: #244a64;
  color: #e7edf6;
}

@media (max-width: 719px) {
  .neo-theme-toggle {
    top: max(0.55rem, env(safe-area-inset-top));
    right: max(0.55rem, env(safe-area-inset-right));
    min-height: 2.25rem;
    padding: 0.34rem 0.5rem;
    font-size: 0.68rem;
  }

  .neo-theme-toggle__text {
    display: none;
  }
}
