/* SMM TG customer panel.
   Every logged-in page uses this file on its own, without the old rental-panel
   stylesheets. Layout is phone first: a top bar, a bottom bar, and a sidebar that
   slides in. From 992px the sidebar stays open and the bottom bar goes away. */

/* ---------- Tokens ---------- */
body.tg-app,
.tg-scope {
  --tg-bg: #eef3f8;
  --tg-surface: #ffffff;
  --tg-surface-2: #f4f7fb;
  --tg-surface-3: #e9f0f7;
  --tg-border: #dbe4ee;
  --tg-border-strong: #c3d1df;
  --tg-text: #122033;
  --tg-muted: #5b6e83;
  --tg-faint: #8a9bb0;
  --tg-accent: #0b86d8;
  --tg-accent-strong: #0670b8;
  --tg-accent-soft: rgba(11, 134, 216, 0.1);
  --tg-accent-text: #0a6fb5;
  --tg-grad: linear-gradient(180deg, #3dcbff, #0b86d8);
  --tg-success: #15803d;
  --tg-success-soft: rgba(22, 163, 74, 0.12);
  --tg-warning: #b45309;
  --tg-warning-soft: rgba(217, 119, 6, 0.13);
  --tg-danger: #c62828;
  --tg-danger-soft: rgba(220, 38, 38, 0.11);
  --tg-info: #0a6fb5;
  --tg-info-soft: rgba(11, 134, 216, 0.11);
  --tg-purple: #7c3aed;
  --tg-purple-soft: rgba(124, 58, 237, 0.11);
  --tg-shadow: 0 1px 2px rgba(18, 32, 51, 0.04), 0 6px 20px rgba(18, 32, 51, 0.05);
  --tg-shadow-pop: 0 12px 40px rgba(10, 22, 40, 0.18);
  --tg-topbar-bg: rgba(255, 255, 255, 0.92);
  --tg-radius: 16px;
  --tg-radius-sm: 12px;
  --tg-topbar-h: 60px;
  --tg-bottomnav-h: 64px;
  --tg-sidebar-w: 264px;
  --tg-font: Outfit, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body.tg-app.dark,
body.dark .tg-scope {
  --tg-bg: #05070e;
  --tg-surface: #0a1424;
  --tg-surface-2: #0d192c;
  --tg-surface-3: #12223a;
  --tg-border: rgba(120, 190, 220, 0.16);
  --tg-border-strong: rgba(120, 190, 220, 0.3);
  --tg-text: #e9f3fb;
  --tg-muted: #9db1c5;
  --tg-faint: #6f849a;
  --tg-accent: #3dcbff;
  --tg-accent-strong: #7ad9ff;
  --tg-accent-soft: rgba(61, 203, 255, 0.12);
  --tg-accent-text: #6fd6ff;
  --tg-success: #4ade80;
  --tg-success-soft: rgba(74, 222, 128, 0.13);
  --tg-warning: #fbbf24;
  --tg-warning-soft: rgba(251, 191, 36, 0.13);
  --tg-danger: #f87171;
  --tg-danger-soft: rgba(248, 113, 113, 0.14);
  --tg-info: #6fd6ff;
  --tg-info-soft: rgba(61, 203, 255, 0.13);
  --tg-purple: #c4a5ff;
  --tg-purple-soft: rgba(167, 139, 250, 0.15);
  --tg-shadow: none;
  --tg-shadow-pop: 0 16px 48px rgba(0, 0, 0, 0.55);
  --tg-topbar-bg: rgba(6, 12, 24, 0.9);
}

/* ---------- Base ---------- */
body.tg-app {
  margin: 0;
  padding: 0 !important;
  min-height: 100vh;
  background:
    radial-gradient(800px 360px at 100% -10%, rgba(61, 203, 255, 0.08), transparent 60%),
    var(--tg-bg) !important;
  color: var(--tg-text) !important;
  font-family: var(--tg-font) !important;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
body.tg-app.dark {
  background:
    radial-gradient(900px 420px at 90% 0%, rgba(34, 211, 238, 0.12), transparent 60%),
    radial-gradient(700px 420px at 0% 20%, rgba(14, 116, 214, 0.12), transparent 62%),
    var(--tg-bg) !important;
}
body.tg-app *,
body.tg-app *::before,
body.tg-app *::after,
.tg-scope *,
.tg-scope *::before,
.tg-scope *::after {
  box-sizing: border-box;
}
body.tg-app.tg-lock {
  overflow: hidden;
}
.tg-scope {
  color: var(--tg-text);
  font-family: var(--tg-font);
}
.tg-scope h1,
.tg-scope h2,
.tg-scope h3,
.tg-scope h4,
.tg-scope h5,
.tg-scope h6 {
  margin: 0;
  color: var(--tg-text);
  font-family: var(--tg-font);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.tg-scope p {
  margin: 0 0 10px;
  color: var(--tg-muted);
}
.tg-scope p:last-child {
  margin-bottom: 0;
}
.tg-scope a {
  color: var(--tg-accent-text);
  text-decoration: none;
}
.tg-scope a:hover {
  text-decoration: underline;
}
.tg-scope img {
  max-width: 100%;
}
.tg-app .hidden,
.tg-scope .hidden,
.tg-scope [hidden] {
  display: none !important;
}
.tg-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Brand ---------- */
.tg-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--tg-text) !important;
  text-decoration: none !important;
}
.tg-brand img {
  width: 34px;
  height: 26px;
  object-fit: contain;
  flex: none;
}
.tg-brand-name {
  font-family: var(--tg-font);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.tg-brand-name em {
  font-style: normal;
  color: var(--tg-accent);
}

/* ---------- Top bar ---------- */
body.tg-app > header.tg-topbar {
  position: fixed !important;
  top: 0;
  left: 0 !important;
  right: 0;
  z-index: 40;
  display: flex !important;
  align-items: center;
  gap: 10px;
  width: auto !important;
  height: calc(var(--tg-topbar-h) + env(safe-area-inset-top, 0px)) !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: env(safe-area-inset-top, 0px) 14px 0 !important;
  background: var(--tg-topbar-bg) !important;
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--tg-border) !important;
  box-shadow: none !important;
  color: var(--tg-text) !important;
  transition: left 0.2s ease;
}
.tg-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--tg-border);
  border-radius: 12px;
  background: var(--tg-surface);
  color: var(--tg-text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.tg-icon-btn:hover,
.tg-icon-btn:focus-visible {
  border-color: var(--tg-accent);
  color: var(--tg-accent);
}
.tg-topbar-brand {
  flex: 0 1 auto;
}
.tg-topbar-title {
  display: none;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  color: var(--tg-text);
  font-family: var(--tg-font);
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tg-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
}
.tg-balance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 150px;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--tg-accent-soft);
  color: var(--tg-accent-text) !important;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none !important;
}
.tg-balance i {
  font-size: 17px;
}
.tg-balance span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.tg-user {
  position: relative;
  flex: none;
}
.tg-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--tg-grad);
  color: #fff;
  font-family: var(--tg-font);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}
.tg-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  width: 240px;
  padding: 8px;
  border: 1px solid var(--tg-border);
  border-radius: 14px;
  background: var(--tg-surface);
  box-shadow: var(--tg-shadow-pop);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.tg-user.is-open .tg-user-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.tg-user-menu-head {
  padding: 8px 10px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--tg-border);
}
.tg-user-menu-head strong {
  display: block;
  overflow: hidden;
  color: var(--tg-text);
  font-size: 15px;
  text-overflow: ellipsis;
}
.tg-user-menu-head span {
  display: block;
  overflow: hidden;
  color: var(--tg-muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tg-user-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  color: var(--tg-text) !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
}
.tg-user-menu a:hover {
  background: var(--tg-surface-2);
}
.tg-user-menu a i {
  color: var(--tg-muted);
  font-size: 18px;
}
.tg-user-menu a.is-danger,
.tg-user-menu a.is-danger i {
  color: var(--tg-danger) !important;
}

/* ---------- Sidebar ---------- */
body.tg-app > aside.tg-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: min(var(--tg-sidebar-w), 86vw);
  padding: calc(14px + env(safe-area-inset-top, 0px)) 12px calc(14px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--tg-surface);
  border-right: 1px solid var(--tg-border);
  transform: translateX(-102%);
  transition: transform 0.22s ease;
  scrollbar-width: none;
}
body.tg-app > aside.tg-sidebar::-webkit-scrollbar {
  display: none;
}
body.tg-app.tg-sidebar-open > aside.tg-sidebar {
  transform: none;
  box-shadow: var(--tg-shadow-pop);
}
.tg-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 14px;
}
.tg-sidebar-close {
  width: 36px;
  height: 36px;
  font-size: 18px;
}
.tg-sidebar-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 4px 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--tg-accent-soft);
  color: var(--tg-text) !important;
  text-decoration: none !important;
}
.tg-sidebar-balance small {
  display: block;
  color: var(--tg-muted);
  font-size: 12px;
  font-weight: 600;
}
.tg-sidebar-balance strong {
  display: block;
  color: var(--tg-text);
  font-size: 18px;
  font-weight: 700;
}
.tg-sidebar-balance .tg-pill {
  flex: none;
}
.tg-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tg-nav-label {
  margin: 14px 12px 6px;
  color: var(--tg-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tg-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--tg-text) !important;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.15s ease;
}
.tg-nav a i {
  width: 22px;
  color: var(--tg-muted);
  font-size: 20px;
  text-align: center;
}
.tg-nav a:hover {
  background: var(--tg-surface-2);
}
.tg-nav a.is-active {
  background: var(--tg-grad);
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(11, 134, 216, 0.25);
}
.tg-nav a.is-active i {
  color: #fff;
}
.tg-sidebar-foot {
  margin-top: auto;
  padding: 16px 4px 0;
}
.tg-theme {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--tg-border);
  border-radius: 12px;
  background: var(--tg-surface-2);
}
.tg-theme input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.tg-theme label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  margin: 0;
  border-radius: 9px;
  color: var(--tg-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
body.tg-app:not(.dark) .tg-theme .tg-theme-light,
body.tg-app.dark .tg-theme .tg-theme-dark {
  background: var(--tg-surface);
  color: var(--tg-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.tg-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(3, 8, 18, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
}
body.tg-app.tg-sidebar-open .tg-backdrop {
  opacity: 1;
  visibility: visible;
}

/* ---------- Bottom bar ---------- */
.tg-bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tg-bottomnav-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 4px env(safe-area-inset-bottom, 0px);
  background: var(--tg-topbar-bg);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  backdrop-filter: saturate(150%) blur(14px);
  border-top: 1px solid var(--tg-border);
}
.tg-bottomnav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  color: var(--tg-muted) !important;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none !important;
}
.tg-bottomnav a i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 28px;
  border-radius: 14px;
  font-size: 20px;
  transition: background 0.15s ease;
}
.tg-bottomnav a span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tg-bottomnav a.is-active {
  color: var(--tg-accent-text) !important;
}
.tg-bottomnav a.is-active i {
  background: var(--tg-accent-soft);
}

/* ---------- Main area ---------- */
body.tg-app > main.tg-main {
  display: block;
  width: auto !important;
  max-width: none;
  min-height: 100vh;
  margin: 0 !important;
  padding:
    calc(var(--tg-topbar-h) + env(safe-area-inset-top, 0px) + 16px)
    16px
    calc(var(--tg-bottomnav-h) + env(safe-area-inset-bottom, 0px) + 24px) !important;
}
.tg-container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}
.tg-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tg-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.tg-page-head {
  margin: 2px 2px 16px;
}
.tg-page-head h1 {
  font-size: 22px;
}
.tg-page-head p {
  margin: 4px 0 0;
  font-size: 14px;
}

/* ---------- Cards ---------- */
.tg-scope .tg-card {
  position: relative;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--tg-border);
  border-radius: var(--tg-radius);
  background: var(--tg-surface);
  box-shadow: var(--tg-shadow);
}
.tg-scope .tg-card + .tg-card {
  margin-top: 0;
}
.tg-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.tg-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--tg-accent-soft);
  color: var(--tg-accent);
  font-size: 20px;
}
.tg-card-titles {
  min-width: 0;
  flex: 1;
}
.tg-scope .tg-card-title {
  font-size: 17px;
  font-weight: 700;
}
.tg-scope .tg-card-sub {
  margin: 2px 0 0;
  color: var(--tg-muted);
  font-size: 13px;
}
.tg-card-head .tg-card-action {
  flex: none;
  margin-left: auto;
}
.tg-divider {
  height: 1px;
  margin: 16px 0;
  border: 0;
  background: var(--tg-border);
}

/* ---------- Hero / stats ---------- */
.tg-scope .tg-hero {
  overflow: hidden;
  background:
    radial-gradient(420px 200px at 100% 0%, rgba(61, 203, 255, 0.18), transparent 70%),
    var(--tg-surface);
}
.tg-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.tg-scope .tg-hero h1 {
  font-size: 20px;
}
.tg-scope .tg-hero h1 span {
  color: var(--tg-accent-text);
}
.tg-scope .tg-hero p {
  margin: 2px 0 0;
  font-size: 14px;
}
.tg-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.tg-stat {
  min-width: 0;
  padding: 12px 10px;
  border-radius: 14px;
  background: var(--tg-surface-2);
}
.tg-stat i {
  display: block;
  margin-bottom: 6px;
  color: var(--tg-accent);
  font-size: 18px;
  line-height: 1;
}
.tg-stat strong {
  display: block;
  overflow: hidden;
  color: var(--tg-text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tg-stat span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--tg-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Buttons ---------- */
.tg-scope .tg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  margin: 0;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--tg-radius-sm);
  background: var(--tg-surface-2);
  color: var(--tg-text) !important;
  -webkit-text-fill-color: currentColor;
  font-family: var(--tg-font);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.tg-scope .tg-btn i {
  font-size: 18px;
}
.tg-scope .tg-btn-primary {
  background: var(--tg-grad);
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(11, 134, 216, 0.22);
}
.tg-scope .tg-btn-primary:hover {
  filter: brightness(1.06);
}
.tg-scope .tg-btn-ghost {
  border-color: var(--tg-border-strong);
  background: transparent;
}
.tg-scope .tg-btn-ghost:hover {
  border-color: var(--tg-accent);
  color: var(--tg-accent-text) !important;
}
.tg-scope .tg-btn-soft {
  background: var(--tg-accent-soft);
  color: var(--tg-accent-text) !important;
}
.tg-scope .tg-btn-danger {
  background: var(--tg-danger-soft);
  color: var(--tg-danger) !important;
}
.tg-scope .tg-btn-success {
  background: var(--tg-success-soft);
  color: var(--tg-success) !important;
}
.tg-scope .tg-btn-sm {
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13px;
}
.tg-scope .tg-btn-block {
  display: flex;
  width: 100%;
}
.tg-scope .tg-btn[disabled],
.tg-scope .tg-btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}
.tg-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Forms (also covers fields the server builds) ---------- */
.tg-scope .form-group,
.tg-scope .tg-field {
  margin: 0 0 14px;
}
.tg-scope label,
.tg-scope .control-label,
.tg-scope .form-label {
  display: block;
  margin: 0 0 6px;
  color: var(--tg-text) !important;
  font-family: var(--tg-font);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}
.tg-scope input[type="text"],
.tg-scope input[type="email"],
.tg-scope input[type="number"],
.tg-scope input[type="password"],
.tg-scope input[type="search"],
.tg-scope input[type="tel"],
.tg-scope input[type="url"],
.tg-scope input:not([type]),
.tg-scope select,
.tg-scope textarea,
.tg-scope .form-control {
  display: block;
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--tg-border-strong) !important;
  border-radius: var(--tg-radius-sm) !important;
  background: var(--tg-surface-2) !important;
  color: var(--tg-text) !important;
  -webkit-text-fill-color: var(--tg-text);
  font-family: var(--tg-font);
  font-size: 16px;
  line-height: 1.3;
  box-shadow: none !important;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tg-scope textarea,
.tg-scope textarea.form-control {
  height: auto;
  min-height: 120px;
  padding: 12px 14px;
  resize: vertical;
}
.tg-scope select,
.tg-scope select.form-control {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238a9bb0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 18px !important;
}
.tg-scope input:focus,
.tg-scope select:focus,
.tg-scope textarea:focus,
.tg-scope .form-control:focus {
  border-color: var(--tg-accent) !important;
  box-shadow: 0 0 0 3px var(--tg-accent-soft) !important;
}
.tg-scope input[readonly],
.tg-scope .form-control[readonly],
.tg-scope input:disabled {
  background: var(--tg-surface-3) !important;
  color: var(--tg-text) !important;
  font-weight: 700;
}
.tg-scope input::placeholder,
.tg-scope textarea::placeholder {
  color: var(--tg-faint) !important;
  -webkit-text-fill-color: var(--tg-faint);
  opacity: 1;
}
.tg-scope input[type="checkbox"],
.tg-scope input[type="radio"] {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin: 0 8px 0 0;
  padding: 0;
  vertical-align: -3px;
  accent-color: var(--tg-accent);
  -webkit-appearance: auto;
  appearance: auto;
}
.tg-scope label.has-depends,
.tg-scope #dripfeed > .form-group > label {
  display: flex;
  align-items: center;
  font-weight: 600;
}
.tg-scope .help-block,
.tg-scope .tg-hint {
  display: block;
  margin: 6px 2px 0;
  color: var(--tg-muted);
  font-size: 13px;
}
.tg-scope .help-block.min-max {
  margin: -6px 2px 14px;
}
.tg-scope .row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 12px;
  margin: 0;
}
.tg-scope .row > [class*="col-"] {
  flex: 1 1 140px;
  min-width: 0;
  padding: 0;
}
.tg-scope .input-group {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.tg-scope .input-group > .form-control,
.tg-scope .input-group > input {
  flex: 1;
  min-width: 0;
  width: auto !important;
}
.tg-scope .input-group-btn,
.tg-scope .input-group-append {
  display: flex;
}
.tg-scope .input-group-text,
.tg-scope .input-group-btn .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--tg-border-strong);
  border-radius: var(--tg-radius-sm);
  background: var(--tg-surface-2);
  color: var(--tg-text);
  cursor: pointer;
}
.tg-scope .panel-body,
.tg-scope .tg-callout {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--tg-border);
  border-radius: var(--tg-radius-sm);
  background: var(--tg-surface-2);
  color: var(--tg-text);
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}
.tg-scope .tg-callout {
  display: flex;
  gap: 10px;
  border-color: transparent;
  background: var(--tg-info-soft);
}
.tg-scope .tg-callout > i {
  flex: none;
  color: var(--tg-info);
  font-size: 20px;
  line-height: 1.2;
}
.tg-scope .tg-callout.is-warning {
  background: var(--tg-warning-soft);
}
.tg-scope .tg-callout.is-warning > i {
  color: var(--tg-warning);
}
/* Method instructions are written by staff in the admin panel. Keep their
   bold and links, but drop pasted highlight colours that clash with the theme. */
.tg-scope .tg-instructions .panel-body,
.tg-scope .tg-instructions .panel-body * {
  background: transparent !important;
  color: inherit !important;
}
.tg-scope .tg-instructions .panel-body {
  border: 0;
  background: var(--tg-warning-soft) !important;
  color: var(--tg-text) !important;
  font-weight: 600;
}
.tg-scope .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--tg-radius-sm);
  background: var(--tg-surface-2);
  color: var(--tg-text);
  font-family: var(--tg-font);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.tg-scope .btn-primary,
.tg-scope .btn-big-primary,
.tg-scope button[type="submit"]:not(.tg-btn):not(.tg-chip) {
  background: var(--tg-grad) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff;
}
.tg-scope .btn-block {
  display: flex;
  width: 100%;
}

/* ---------- Alerts ---------- */
.tg-scope .alert {
  position: relative;
  margin: 0 0 14px;
  padding: 12px 40px 12px 14px;
  border: 0;
  border-radius: var(--tg-radius-sm);
  background: var(--tg-info-soft);
  color: var(--tg-text);
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.tg-scope .alert h4 {
  margin-bottom: 4px;
  font-size: 15px;
}
.tg-scope .alert-success {
  background: var(--tg-success-soft) !important;
}
.tg-scope .alert-danger {
  background: var(--tg-danger-soft) !important;
}
.tg-scope .alert-warning {
  background: var(--tg-warning-soft) !important;
}
.tg-scope .alert .close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--tg-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Chips, badges, pills ---------- */
.tg-chips {
  display: flex;
  gap: 8px;
  margin: 0 -16px;
  padding: 2px 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tg-chips::-webkit-scrollbar {
  display: none;
}
.tg-scope .tg-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--tg-border-strong);
  border-radius: 999px;
  background: var(--tg-surface);
  color: var(--tg-text) !important;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none !important;
}
.tg-scope .tg-chip.is-active {
  border-color: transparent;
  background: var(--tg-grad);
  color: #fff !important;
}
.tg-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--tg-surface-3);
  color: var(--tg-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.tg-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.tg-badge.is-plain::before {
  display: none;
}
.tg-badge.is-success {
  background: var(--tg-success-soft);
  color: var(--tg-success);
}
.tg-badge.is-warning {
  background: var(--tg-warning-soft);
  color: var(--tg-warning);
}
.tg-badge.is-danger {
  background: var(--tg-danger-soft);
  color: var(--tg-danger);
}
.tg-badge.is-info {
  background: var(--tg-info-soft);
  color: var(--tg-info);
}
.tg-badge.is-purple {
  background: var(--tg-purple-soft);
  color: var(--tg-purple);
}
.tg-pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--tg-accent-soft);
  color: var(--tg-accent-text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.tg-id {
  color: var(--tg-faint);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- Tabs (segmented) ---------- */
.tg-tabs {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 14px;
  background: var(--tg-surface-2);
}
.tg-scope .tg-tabs a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  border-radius: 10px;
  color: var(--tg-muted) !important;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
}
.tg-scope .tg-tabs a.is-active {
  background: var(--tg-surface);
  color: var(--tg-text) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ---------- Search ---------- */
.tg-search {
  position: relative;
}
.tg-search > i {
  position: absolute;
  top: 50%;
  left: 14px;
  color: var(--tg-faint);
  font-size: 18px;
  transform: translateY(-50%);
  pointer-events: none;
}
.tg-scope .tg-search input {
  padding-left: 42px;
}

/* ---------- Lists ---------- */
.tg-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tg-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--tg-border);
}
.tg-list-item:first-child {
  border-top: 0;
  padding-top: 0;
}
.tg-list-item:last-child {
  padding-bottom: 0;
}
.tg-scope a.tg-list-item {
  color: inherit;
  text-decoration: none !important;
}
.tg-list-main {
  flex: 1;
  min-width: 0;
}
.tg-list-title {
  display: block;
  overflow: hidden;
  color: var(--tg-text);
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tg-list-meta {
  display: block;
  margin-top: 2px;
  color: var(--tg-muted);
  font-size: 13px;
}
.tg-list-end {
  flex: none;
  text-align: right;
}
.tg-list-end strong {
  display: block;
  color: var(--tg-text);
  font-size: 15px;
}
.tg-list-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--tg-surface-2);
  color: var(--tg-accent);
  font-size: 19px;
}

/* ---------- Key/value grid ---------- */
.tg-kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.tg-kv > div {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--tg-surface-2);
}
.tg-kv dt,
.tg-kv .tg-kv-label {
  overflow: hidden;
  color: var(--tg-muted);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tg-kv dd,
.tg-kv .tg-kv-value {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--tg-text);
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tg-kv .is-wide {
  grid-column: 1 / -1;
}

/* ---------- Copy box ---------- */
.tg-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 4px 4px 4px 14px;
  border: 1px dashed var(--tg-border-strong);
  border-radius: var(--tg-radius-sm);
  background: var(--tg-surface-2);
}
.tg-copy code,
.tg-copy span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--tg-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: none;
}
.tg-copy .tg-btn {
  flex: none;
}

/* ---------- Empty state ---------- */
.tg-empty {
  padding: 28px 12px;
  text-align: center;
}
.tg-empty > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  border-radius: 18px;
  background: var(--tg-accent-soft);
  color: var(--tg-accent);
  font-size: 26px;
}
.tg-scope .tg-empty h3 {
  margin-bottom: 6px;
  font-size: 17px;
}
.tg-scope .tg-empty p {
  max-width: 320px;
  margin: 0 auto 16px;
  font-size: 14px;
}

/* ---------- Orders ---------- */
.tg-order-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.tg-scope .tg-order-name {
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}
.tg-scope .tg-order-link {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  overflow: hidden;
  color: var(--tg-accent-text);
  font-size: 13px;
  white-space: nowrap;
}
.tg-order-link span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.tg-order-date {
  color: var(--tg-muted);
  font-size: 12px;
  white-space: nowrap;
}
.tg-order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.tg-order-actions .tg-btn {
  flex: 1 1 auto;
}

/* ---------- Pagination ---------- */
.tg-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}
.tg-scope .tg-pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--tg-border);
  border-radius: 10px;
  background: var(--tg-surface);
  color: var(--tg-text) !important;
  font-weight: 600;
  text-decoration: none !important;
}
.tg-scope .tg-pagination .is-active a {
  border-color: transparent;
  background: var(--tg-grad);
  color: #fff !important;
}

/* ---------- Tickets ---------- */
.tg-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tg-msg {
  max-width: 88%;
}
.tg-msg.is-mine {
  align-self: flex-end;
}
.tg-msg-bubble {
  padding: 10px 14px;
  border-radius: 16px 16px 16px 6px;
  background: var(--tg-surface-2);
  color: var(--tg-text);
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-line;
  word-break: break-word;
}
.tg-msg.is-mine .tg-msg-bubble {
  border-radius: 16px 16px 6px 16px;
  background: var(--tg-grad);
  color: #fff;
}
.tg-msg-meta {
  margin: 4px 6px 0;
  color: var(--tg-faint);
  font-size: 12px;
}
.tg-msg.is-mine .tg-msg-meta {
  text-align: right;
}

/* ---------- Services list ---------- */
.tg-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.tg-cat {
  margin-top: 8px;
}
.tg-scope .tg-cat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 2px 10px;
  font-size: 16px;
}
.tg-cat-title .tg-pill {
  margin-left: auto;
}
.tg-services {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.tg-scope .tg-service {
  padding: 14px;
}
.tg-service-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.tg-scope .tg-service-name {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}
.tg-service .tg-kv {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.tg-service .tg-kv > div {
  padding: 8px 10px;
}
.tg-service-desc {
  margin-top: 10px;
}
.tg-service-desc summary {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--tg-accent-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.tg-service-desc summary::-webkit-details-marker {
  display: none;
}
.tg-service-desc[open] summary i {
  transform: rotate(180deg);
}
.tg-service-desc-body {
  margin-top: 8px;
  padding: 12px;
  border-radius: 12px;
  background: var(--tg-surface-2);
  color: var(--tg-muted);
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}
.tg-service-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.tg-service-actions .tg-btn {
  flex: 1;
}

/* ---------- Tables (API docs and anything left over) ---------- */
.tg-table-wrap {
  margin: 0 -16px;
  padding: 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tg-scope table {
  width: 100%;
  border-collapse: collapse;
  color: var(--tg-text);
  font-size: 14px;
}
.tg-scope th,
.tg-scope td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--tg-border);
  color: var(--tg-text);
  text-align: left;
  vertical-align: top;
}
.tg-scope th {
  color: var(--tg-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tg-scope pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  border-radius: 12px;
  background: var(--tg-surface-2);
  color: var(--tg-text);
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- Select2 (search dropdowns on New order) ---------- */
.select2-hidden-accessible {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  border: 0 !important;
}
.tg-scope .select2-container {
  position: relative;
  display: block;
  width: 100% !important;
  margin: 0;
  vertical-align: middle;
}
.tg-scope .select2-container .select2-selection--single {
  display: flex !important;
  align-items: center;
  height: auto !important;
  min-height: 48px;
  padding: 0 !important;
  border: 1px solid var(--tg-border-strong) !important;
  border-radius: var(--tg-radius-sm) !important;
  background: var(--tg-surface-2) !important;
  cursor: pointer;
  user-select: none;
}
.tg-scope .select2-container--open .select2-selection--single,
.tg-scope .select2-container--focus .select2-selection--single {
  border-color: var(--tg-accent) !important;
  box-shadow: 0 0 0 3px var(--tg-accent-soft) !important;
}
.tg-scope .select2-selection__rendered {
  display: block;
  flex: 1;
  min-width: 0;
  padding: 11px 40px 11px 14px !important;
  color: var(--tg-text) !important;
  font-size: 15px;
  line-height: 1.4 !important;
  white-space: normal !important;
  word-break: break-word;
}
.tg-scope .select2-selection__arrow {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238a9bb0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / 18px no-repeat;
}
.tg-scope .select2-selection__arrow b {
  display: none;
}
.tg-scope .select2-selection__icon,
.select2-results__option .select2-selection__icon {
  display: inline-flex;
  margin-right: 8px;
  color: var(--tg-accent);
}
.select2-container .badge,
.tg-scope .badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  margin-right: 6px;
  padding: 0 7px;
  border-radius: 7px;
  background: var(--tg-accent-soft, rgba(11, 134, 216, 0.12));
  color: var(--tg-accent-text, #0a6fb5);
  font-size: 12px;
  font-weight: 700;
  vertical-align: 1px;
}
.select2-dropdown {
  position: absolute;
  left: -100000px;
  z-index: 1051;
  display: block;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--tg-border-strong, #c3d1df);
  border-radius: 14px;
  background: var(--tg-surface, #fff);
  box-shadow: var(--tg-shadow-pop, 0 12px 40px rgba(10, 22, 40, 0.18));
  font-family: var(--tg-font, Outfit, sans-serif);
}
.select2-container--open .select2-dropdown {
  left: 0;
}
.select2-container--open .select2-dropdown--below {
  margin-top: 6px;
}
.select2-container--open .select2-dropdown--above {
  margin-top: -6px;
}
.select2-search--dropdown {
  display: block;
  padding: 8px;
}
.select2-search--dropdown.select2-search--hide {
  display: none;
}
.select2-search--dropdown .select2-search__field {
  width: 100% !important;
  height: 44px !important;
  padding: 0 12px !important;
  border: 1px solid var(--tg-border-strong, #c3d1df) !important;
  border-radius: 10px !important;
  background: var(--tg-surface-2, #f4f7fb) !important;
  color: var(--tg-text, #122033) !important;
  font-size: 16px !important;
  outline: none;
}
.select2-results {
  display: block;
}
.select2-results__options {
  max-height: min(320px, 50vh);
  margin: 0;
  padding: 4px 6px 6px;
  overflow-y: auto;
  list-style: none;
}
.select2-results__option {
  padding: 10px 10px;
  border-radius: 10px;
  color: var(--tg-text, #122033);
  font-size: 15px;
  line-height: 1.4;
  word-break: break-word;
  cursor: pointer;
  user-select: none;
}
.select2-results__option[aria-selected="true"] {
  background: var(--tg-surface-2, #f4f7fb);
  font-weight: 600;
}
.select2-results__option--highlighted[aria-selected],
.select2-results__option--highlighted {
  background: var(--tg-accent-soft, rgba(11, 134, 216, 0.1)) !important;
  color: var(--tg-text, #122033) !important;
}
.select2-results__message {
  color: var(--tg-muted, #5b6e83);
}
.select2-close-mask {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99;
  display: block;
  width: auto;
  min-width: 100%;
  height: auto;
  min-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  background: #fff;
}
/* Select2 puts its dropdown at the end of <body>, outside .tg-scope. */
body.tg-app > .select2-container {
  z-index: 1060;
}

/* Bootstrap datepicker used by subscription expiry fields */
.datepicker.dropdown-menu {
  position: absolute;
  z-index: 1070;
  padding: 8px;
  border: 1px solid var(--tg-border, #dbe4ee);
  border-radius: 12px;
  background: var(--tg-surface, #fff);
  color: var(--tg-text, #122033);
  box-shadow: var(--tg-shadow-pop);
  font-family: var(--tg-font);
}
.datepicker table td,
.datepicker table th {
  width: 34px;
  height: 34px;
  border: 0 !important;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
}
.datepicker table td.active,
.datepicker table td.active:hover {
  background: var(--tg-accent) !important;
  color: #fff !important;
}

/* Small toast shown after copying */
.tg-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tg-bottomnav-h) + env(safe-area-inset-bottom, 0px) + 16px);
  z-index: 90;
  padding: 10px 16px;
  border-radius: 12px;
  background: #0b1628;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--tg-shadow-pop);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
}
.tg-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* Old floating WhatsApp / Telegram buttons sit above the bottom bar */
body.tg-app .integration-fixed {
  z-index: 44 !important;
}
body.tg-app .integration-fixed__bottom-left,
body.tg-app .integration-fixed__bottom-right {
  bottom: calc(var(--tg-bottomnav-h) + env(safe-area-inset-bottom, 0px)) !important;
}
body.tg-app .whatsapp-container,
body.tg-app .telegram-container {
  padding: 12px !important;
}
body.tg-app .whatsapp-button,
body.tg-app .telegram-button {
  width: 52px !important;
  height: 52px !important;
  font-size: 26px !important;
}

/* ---------- Tablet ---------- */
@media (min-width: 576px) {
  body.tg-app > main.tg-main {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
  .tg-chips {
    margin: 0;
    padding: 2px 0 4px;
    flex-wrap: wrap;
  }
  .tg-scope .tg-card {
    padding: 20px;
  }
  .tg-filters {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
  .tg-table-wrap {
    margin: 0 -20px;
    padding: 0 20px;
  }
  .tg-services {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Desktop ---------- */
@media (min-width: 992px) {
  body.tg-app > aside.tg-sidebar {
    width: var(--tg-sidebar-w);
    transform: none;
    box-shadow: none !important;
  }
  body.tg-app.sidebar-closed > aside.tg-sidebar {
    transform: translateX(-102%);
  }
  .tg-sidebar-close,
  .tg-backdrop,
  .tg-bottomnav,
  .tg-topbar-brand {
    display: none !important;
  }
  .tg-topbar-title {
    display: block;
  }
  body.tg-app > header.tg-topbar {
    left: var(--tg-sidebar-w) !important;
    padding: 0 28px !important;
  }
  body.tg-app.sidebar-closed > header.tg-topbar {
    left: 0 !important;
  }
  body.tg-app > main.tg-main {
    margin-left: var(--tg-sidebar-w) !important;
    padding: calc(var(--tg-topbar-h) + 24px) 28px 40px !important;
    transition: margin-left 0.2s ease;
  }
  body.tg-app.sidebar-closed > main.tg-main {
    margin-left: 0 !important;
  }
  .tg-toast {
    bottom: 24px;
  }
  body.tg-app .integration-fixed__bottom-left,
  body.tg-app .integration-fixed__bottom-right {
    bottom: 0 !important;
  }
  .tg-grid-main {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  }
  .tg-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tg-span-all {
    grid-column: 1 / -1;
  }
  .tg-stat {
    padding: 14px;
  }
  .tg-stat strong {
    font-size: 19px;
  }
  .tg-services {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .tg-balance {
    display: none;
  }
  .tg-stat strong {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.tg-app *,
  .tg-scope * {
    transition: none !important;
  }
}

/* ---------- Small page pieces ---------- */
.tg-scope a.tg-stat {
  color: inherit;
  text-decoration: none !important;
}
.tg-news .tg-list-item {
  align-items: flex-start;
}
.tg-news img.tg-list-icon {
  padding: 8px;
  object-fit: contain;
}
.tg-news .tg-list-title {
  white-space: normal;
}
.tg-news-body {
  margin-top: 6px;
  color: var(--tg-text);
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}
.particle-snow,
.christmas-garland {
  display: none !important;
}

/* Services list for visitors who are not signed in (old guest header above it) */
.tg-scope.tg-guest-main {
  display: block;
  min-height: 60vh;
  padding: 96px 16px 48px;
  font-size: 15px;
  line-height: 1.5;
}
@media (min-width: 992px) {
  .tg-scope.tg-guest-main {
    padding: 120px 28px 64px;
  }
}

/* ---------- API docs (content kept from the old page) ---------- */
.tg-api .api-section {
  display: block;
  margin: 0;
}
.tg-api .row {
  display: block;
}
.tg-api .card.card-border {
  padding: 16px;
  border: 1px solid var(--tg-border);
  border-radius: var(--tg-radius);
  background: var(--tg-surface);
  box-shadow: var(--tg-shadow);
}
.tg-api .card-header,
.tg-api .card-body {
  padding: 0;
  border: 0;
  background: none;
}
.tg-scope.tg-api .api-title,
.tg-api .api-title {
  margin: 0 0 12px !important;
  font-size: 17px;
}
.tg-api h6 {
  margin: 0 2px 8px;
  padding: 0 !important;
  color: var(--tg-muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tg-api table {
  table-layout: fixed;
}
.tg-api td,
.tg-api th {
  padding: 9px 10px;
  word-break: break-word;
}
.tg-api td:first-child,
.tg-api th:first-child {
  width: 38%;
}
.tg-api td:first-child {
  color: var(--tg-accent-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}
.tg-api pre.code {
  padding: 14px;
  border: 1px solid var(--tg-border);
  border-radius: var(--tg-radius-sm);
  background: var(--tg-surface-2);
  white-space: pre;
}
.tg-api .form-inline .form-group {
  margin-bottom: 12px;
}
.tg-api p:empty {
  display: none;
}

/* Select2 renders each option as a link; keep it looking like a list row */
.select2-results__option a,
.tg-scope .select2-results__option a,
.tg-scope .select2-selection__rendered a {
  display: block;
  color: inherit !important;
  text-decoration: none !important;
}
