/* SMS Panel — Aurora Glass (auto bundle) */

/* SMS Panel — Aurora Glass */
:root {
  --bg: #07060f;
  --bg-elevated: #0d0b1c;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.09);
  --glass: rgba(18, 16, 34, 0.66);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-strong: rgba(180, 160, 255, 0.35);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(167, 139, 250, 0.4);
  --text: #f4f2ff;
  --text-secondary: #a7a2c8;
  --accent: #b79bff;
  --accent-2: #5eead4;
  --accent-gradient: linear-gradient(120deg, #a855f7 0%, #6366f1 42%, #22d3ee 100%);
  --accent-glow: rgba(139, 92, 246, 0.5);
  --steam-green: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  --steam-green-glow: rgba(16, 185, 129, 0.45);
  --ok: #34d399;
  --err: #fb7185;
  --warn: #fbbf24;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow: 0 24px 60px -22px rgba(0, 0, 0, 0.85);
  --shadow-sm: 0 12px 32px -14px rgba(0, 0, 0, 0.6);
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: "Space Grotesk", "Inter", "Segoe UI", sans-serif;
  --nav-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --content-max: 1200px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: #050409;
  background-image: radial-gradient(ellipse 120% 90% at 50% -10%, #100c24 0%, #080614 45%, #050409 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* Ambient background */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(40% 50% at 18% 22%, rgba(168, 85, 247, 0.2), transparent 64%),
    radial-gradient(44% 54% at 82% 16%, rgba(34, 211, 238, 0.15), transparent 64%),
    radial-gradient(48% 52% at 64% 90%, rgba(236, 72, 153, 0.13), transparent 64%),
    radial-gradient(42% 48% at 12% 84%, rgba(45, 212, 191, 0.12), transparent 64%);
  filter: blur(90px) saturate(125%);
  opacity: 0.4;
  animation: auroraDrift 60s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes auroraDrift {
  0%   { transform: translate3d(-1%, -0.5%, 0) scale(1.01); }
  100% { transform: translate3d(1.2%, 1%, 0) scale(1.04); }
}
.ambient-grid {
  background-image:
    linear-gradient(rgba(167, 139, 250, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 139, 250, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 10%, black, transparent 80%);
  opacity: 0.16;
}
.ambient-2 {
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.18;
}
@media (prefers-reduced-motion: reduce) {
  .ambient { animation: none; }
}
.app-root {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}
h1, h2, h3, .brand, .integ-title, .auth-card h2 {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

a {
  color: var(--accent-2);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
a:hover { color: #67e8f9; }

.wrap,
.wrap-wide {
  position: relative;
  z-index: 1;

  max-width: 1120px;
  margin: 0 auto;

  padding: 1.25rem 1.5rem 3rem;
}

.wrap-wide { max-width: 1280px; }



/* ——— Top navigation (Steam) ——— */
header.site {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--nav-h);
  margin: -0.25rem -0.5rem 1.75rem;
  padding: 0.6rem 1.1rem;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}
.brand-mark {
  width: 37px;
  height: 37px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: transparent;
  box-shadow: none;
  border: none;
  border-radius: 0;
  overflow: hidden;
}
.brand-logo {
  width: 37px;
  height: 37px;
  max-width: 37px;
  max-height: 37px;
  display: block;
  object-fit: contain;
  transform: none;
  filter: saturate(1.1) contrast(1.08);
}
.brand-sub {
  font-size: 0.7rem;
  font-weight: 400;
  color: rgba(155, 214, 255, 0.95);
  display: block;
  margin-top: 0.1rem;
  text-transform: none;
  letter-spacing: 0.02em;
}
.brand-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
}
.brand-tag {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(199, 230, 255, 0.95);
  text-transform: none;
  letter-spacing: 0.02em;
  line-height: 1.1;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(102, 192, 244, 0.32);
  background: linear-gradient(180deg, rgba(102, 192, 244, 0.14), rgba(45, 115, 255, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  margin-left: 0.1rem;
}
.gate-banner {
  margin: -1rem 0 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.45;
  border: 1px solid transparent;
  animation: fadeUp 0.35s var(--ease);
}
.gate-banner--gate-day-start {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.38);
  color: #a7f3d0;
}
.gate-banner--gate-sim-replace {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.42);
  color: #fde68a;
}
.gate-banner--gate-sim-replaced {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.42);
  color: #a7f3d0;
}
.gate-banner--gate-day-end {
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.35);
  color: #e9d5ff;
}
.gate-banner--warn {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fde68a;
}
.gate-banner--broadcast-red {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.42);
  color: #fecaca;
}
.gate-banner--broadcast-yellow {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fde68a;
}
.gate-banner--broadcast-green {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.4);
  color: #a7f3d0;
}
.gate-banner--broadcast-purple {
  background: rgba(167, 139, 250, 0.14);
  border-color: rgba(167, 139, 250, 0.4);
  color: #e9d5ff;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;

  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);

  white-space: nowrap;
  border: 0;
}


nav.site-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav.site-nav a {
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #b8c4ce;
  text-decoration: none;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
nav.site-nav a:hover {
  color: #fff;
  background: var(--surface-hover);
  text-decoration: none;
}
nav.site-nav a.active {
  color: #fff;
  background: linear-gradient(180deg, rgba(102, 192, 244, 0.25), rgba(45, 115, 255, 0.18));
  border: 1px solid rgba(102, 192, 244, 0.35);
}

nav.site-nav form { margin: 0; margin-left: 0.35rem; }

.site-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.site-nav-toggle svg { display: block; }
header.site .site-nav-panel {
  display: contents;
}
@media (max-width: 900px) {
  header.site {
    flex-wrap: wrap;
    align-items: center;
  }
  .site-nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }
  header.site .site-nav-panel {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding-top: 0.5rem;
  }
  header.site.site--nav-open .site-nav-panel {
    display: flex;
  }
  header.site .site-nav-panel a,
  header.site .site-nav-panel form {
    width: 100%;
  }
  header.site .site-nav-panel form button {
    width: 100%;
  }
}



/* ——— Cards ——— */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(20px) saturate(155%);
  -webkit-backdrop-filter: blur(20px) saturate(155%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.65rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  animation: fadeUp 0.45s var(--ease) both;
}
.card h2 {
  margin: 0 0 1.15rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.card-compact {
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.card-compact h2 {
  margin-bottom: 0.35rem;
}
.card-compact p {
  margin: 0;
}

/* ——— Team summary bar ——— */
.team-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.35rem;
  margin-bottom: 1.25rem;
}

/* ——— Send workspace ——— */
.send-workspace {
  padding: 1.35rem 1.5rem 1.5rem;
}
.send-panel-title {
  font-weight: 600;
}
.send-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr);
  grid-template-areas:
    "title-left title-right"
    "body-left body-right";
  column-gap: 1.5rem;
  row-gap: 1rem;
  align-items: stretch;
}
.send-layout__title-left {
  grid-area: title-left;
}
.send-layout__title-right {
  grid-area: title-right;
}
.send-status-headbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
  min-height: 1.35rem;
}
.send-status-headbar .send-panel-title {
  flex: 0 1 auto;
  min-width: 0;
  line-height: 1.2;
  white-space: nowrap;
}
.notify-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  cursor: pointer;
  font-size: 0.9rem;
}
.notify-toggle input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent, #6366f1);
}
.send-export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
  color: var(--text-secondary);
  text-decoration: none;
  flex-shrink: 0;
  transition: all 0.15s;
}
.send-export-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border-color: rgba(255,255,255,0.2);
}
.send-status-search {
  position: relative;
  display: block;
  flex: 0 1 11rem;
  width: 11rem;
  max-width: 11rem;
  min-width: 0;
  margin: 0;
  margin-bottom: 0;
  height: 1.85rem;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  letter-spacing: normal;
}
.send-status-search__icon {
  position: absolute;
  left: 0.4rem;
  top: 0;
  bottom: 0;
  margin: auto 0;
  width: 12px;
  height: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}
.send-status-search__icon svg {
  width: 12px;
  height: 12px;
  display: block;
}
.send-status-search__input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0 1.6rem 0 1.55rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.85rem;
  outline: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.send-status-search__clear {
  position: absolute;
  right: 0.3rem;
  top: 0;
  bottom: 0;
  margin: auto 0;
  display: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  z-index: 2;
  transition: background 0.15s, color 0.15s;
}
.send-status-search__clear.is-visible {
  display: flex;
}
.send-status-search__clear:hover {
  background: rgba(255, 255, 255, 0.22);
  color: var(--text);
}
.send-status-search__input::-webkit-search-decoration,
.send-status-search__input::-webkit-search-cancel-button,
.send-status-search__input::-webkit-search-results-button,
.send-status-search__input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
.send-status-search__input::placeholder {
  color: var(--text-secondary);
  opacity: 0.85;
  line-height: 1.85rem;
}
.send-status-search__input:focus {
  border-color: rgba(102, 192, 244, 0.55);
  box-shadow: 0 0 0 1px rgba(102, 192, 244, 0.25);
}
.send-status-item.is-filtered-out {
  display: none;
}
.send-status-search-empty {
  display: none;
  margin: 0;
  padding: 1.25rem 0.75rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.send-status-search-empty.is-visible {
  display: block;
}
.send-layout__left {
  grid-area: body-left;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}
.send-layout__right {
  grid-area: body-right;
  min-width: 0;
  min-height: 0;
  align-self: start;
  width: 100%;
}
.send-workspace .send-panel-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
}
.send-form .send-label {
  margin-bottom: 0.45rem;
  color: var(--text);
  font-size: 0.8125rem;
}
.send-input-wrap {
  position: relative;
  margin-bottom: 0.35rem;
}
.send-input-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
  display: flex;
}
.send-input--icon {
  padding-left: 2.65rem !important;
  margin-bottom: 0 !important;
}
.send-hint {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.send-hint--error {
  color: #ff6b7a;
}
.send-input-wrap--invalid .send-input,
.send-input.send-input--invalid {
  border-color: #e5484d !important;
  box-shadow: 0 0 0 1px rgba(229, 72, 77, 0.45);
}
.send-input-wrap--invalid .send-input-icon {
  color: #ff6b7a;
}
#send-submit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.25);
}
.send-textarea {
  min-height: 120px;
  resize: vertical;
  margin-bottom: 0.45rem !important;
}
.send-text-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.send-select {
  margin-bottom: 0.35rem !important;
}
.btn-send-gradient {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  margin-top: 0.15rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--steam-green);
  box-shadow: 0 6px 20px var(--steam-green-glow);
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s;
}
.btn-send-gradient:hover {
  filter: brightness(1.12);
  box-shadow: 0 8px 26px var(--steam-green-glow);
  transform: translateY(-1px);
}
.btn-send-gradient:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.send-form-error {
  margin-top: 0.75rem;
  margin-bottom: 0;
}
.send-status-list {
  --send-status-card-est: 10.75rem;
  --send-status-visible: 3;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: calc(
    var(--send-status-visible) * var(--send-status-card-est)
    + (var(--send-status-visible) - 1) * 0.65rem
  );
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.15rem 0.5rem 0.15rem 0;
  margin: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(102, 192, 244, 0.45) transparent;
}
.send-status-list::-webkit-scrollbar {
  width: 6px;
}
.send-status-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(102, 192, 244, 0.35);
}
.send-status-list::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 192, 244, 0.55);
}
.send-status-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem;
  flex: 1;
  min-height: 0;
}
.send-status-legend--form {
  margin-top: 1rem;
  margin-bottom: 0;
  flex-shrink: 0;
}
.send-status-placeholder-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  color: #66c0f4;
  background: rgba(102, 192, 244, 0.15);
  border: 1px solid rgba(102, 192, 244, 0.3);
}
.send-status-placeholder-title {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.send-status-placeholder-hint {
  margin: 0;
  max-width: 220px;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-secondary);
}
.send-status-legend {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
}
.send-status-legend-title {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}
.send-status-legend ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.send-status-legend li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-secondary);
}
.send-status-legend li:last-child { margin-bottom: 0; }
.send-status-legend li strong {
  color: var(--text);
  font-weight: 600;
}
.legend-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 0.35rem;
}
.legend-dot--queue { background: #9ca3af; }
.legend-dot--sent { background: #34d399; }
.legend-dot--fail { background: #f87171; }
.send-status-empty {
  margin: 0;
  font-size: 0.875rem;
}
.send-status-item {
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.28);
  animation: fadeUp 0.35s var(--ease) both;
}
.send-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}
.send-status-id {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
}
.send-status-item {
  cursor: pointer;
}
.send-status-phone {
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  margin: -0.1rem -0.35rem;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.send-status-phone:hover,
.send-status-item.is-selected .send-status-phone {
  color: #bfdbfe;
  background: rgba(96, 165, 250, 0.12);
}
.send-status-item.is-selected {
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.2);
}
.send-status-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.send-status-pill {
  flex-shrink: 0;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.send-status-pill--queue {
  color: #d1d5db;
  background: rgba(156, 163, 175, 0.15);
  border: 1px solid rgba(156, 163, 175, 0.35);
}
.send-status-pill--sending {
  color: #bfdbfe;
  background: rgba(96, 165, 250, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.4);
  animation: send-pill-pulse 1.4s ease-in-out infinite;
}
.send-status-pill--cancelled {
  color: #d4d4d8;
  background: rgba(161, 161, 170, 0.12);
  border: 1px solid rgba(161, 161, 170, 0.3);
}
@keyframes send-pill-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}
.send-status-actions {
  margin-top: 0.45rem;
}
.send-status-cancel {
  appearance: none;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.1);
  color: #fecaca;
  border-radius: 8px;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}
.send-status-cancel:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.18);
}
.send-status-cancel:disabled {
  opacity: 0.45;
  cursor: default;
}
.send-status-pill--sent {
  color: #a7f3d0;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.35);
}
.send-status-pill--fail {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
}
.send-status-text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary);
  word-break: break-word;
}
.send-status-note {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.send-status-note--err {
  color: #fca5a5;
}
@media (max-width: 900px) {
  .send-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title-left"
      "body-left"
      "title-right"
      "body-right";
  }
  .send-status-search {
    max-width: 8.5rem;
    width: 8.5rem;
  }
  .send-status-list {
    max-height: calc(
      var(--send-status-visible) * var(--send-status-card-est)
      + (var(--send-status-visible) - 1) * 0.65rem
    );
  }
  .send-status-legend--form {
    margin-top: 1rem;
  }
  .team-summary {
    flex-direction: column;
    align-items: flex-start;
  }
}
.card h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}



/* ——— Forms ——— */
label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

label.send-status-search,
div.send-status-search {
  display: block;
  margin: 0;
  margin-bottom: 0;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  letter-spacing: normal;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-width: 1rem;
  height: 1rem;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
  width: 100%;
  padding: 0.7rem 0.95rem;
  margin-bottom: 1.1rem;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:not([type="checkbox"]):not([type="radio"]):focus,
textarea:focus,
select:focus {
  border-color: var(--border-strong) !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.22) !important;
  outline: none;
}

/* Компактный поиск в «Статус отправки» — выше глобальных input */
.send-status-search input.send-status-search__input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 1.85rem;
  min-height: 1.85rem;
  max-height: 1.85rem;
  box-sizing: border-box;
  margin: 0;
  padding: 0 1.6rem 0 1.55rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.85rem;
  outline: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.send-status-search input.send-status-search__input:focus {
  border-color: rgba(102, 192, 244, 0.55) !important;
  box-shadow: 0 0 0 1px rgba(102, 192, 244, 0.25) !important;
}
textarea { min-height: 130px; resize: vertical; }
select { cursor: pointer; }

/* ——— Buttons ——— */
.btn,
.btn-send-gradient {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.62rem 1.3rem;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent-gradient);
  box-shadow: 0 8px 26px -8px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), filter 0.18s var(--ease);
}
.btn:hover,
.btn-send-gradient:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 12px 34px -8px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  text-decoration: none;
  color: #fff;
}
.btn:active { filter: brightness(0.95); transform: none; }

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border-strong);
  box-shadow: none;
  color: #fff;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
  color: #fff;
  transform: none;
  filter: none;
}

.btn-danger {
  background: linear-gradient(180deg, #e35453 0%, #a72c2b 100%);
  box-shadow: 0 3px 12px rgba(199, 62, 60, 0.3);
}
.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

/* ——— Alerts ——— */
.flash {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
  animation: fadeUp 0.35s var(--ease);
}
.flash.ok {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.35);
  color: #a7f3d0;
}
.flash.err {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}
.flash.warn {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fde68a;
}

/* ——— Stats bento ——— */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.stat {
  padding: 1.15rem 1rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.stat:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.stat b {
  display: block;
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.03em;

  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat .muted { display: block; margin-top: 0.35rem; font-size: 0.8rem; }


/* ——— Tables ——— */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);

}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.2);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface); }

code {
  font-size: 0.85em;
  padding: 0.15em 0.45em;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
}

pre.result {
  white-space: pre-wrap;
  margin: 0;
  padding: 1rem 1.15rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.muted { color: var(--text-secondary); font-size: 0.875rem; }
.split { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }

/* Templates header (title + auto-templates toggle) */
.tpl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}
.tpl-head h2 {
  margin: 0;
}
.tpl-head-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
}
.tpl-quick-toggle {
  flex-shrink: 0;
}
.quick-tpl-panel {
  margin: 0.65rem 0 0.9rem;
  padding: 0.7rem 0.85rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid rgba(102, 192, 244, 0.28);
  background: rgba(102, 192, 244, 0.06);
}
.quick-tpl-hint {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
}
.quick-tpl-form .send-label {
  display: block;
  margin: 0.35rem 0 0.2rem !important;
  font-size: 0.78rem;
}
.quick-tpl-slot {
  margin-bottom: 0.55rem;
}
.quick-tpl-slot:last-of-type {
  margin-bottom: 0.2rem;
}
.quick-tpl-name {
  width: 100%;
  max-width: 16rem;
  height: 2rem !important;
  min-height: 2rem !important;
  max-height: 2rem !important;
  padding: 0.2rem 0.55rem !important;
  margin-bottom: 0.35rem !important;
  font-size: 0.85rem !important;
  line-height: 1.2 !important;
  box-sizing: border-box;
}
.quick-tpl-form textarea {
  width: 100%;
  min-height: 3.25rem !important;
  height: auto;
  padding: 0.4rem 0.6rem !important;
  margin-bottom: 0 !important;
  font-size: 0.85rem;
  line-height: 1.35;
  resize: vertical;
  box-sizing: border-box;
}
.send-title-with-quick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  min-width: 0;
}
.send-title-with-quick .send-panel-title {
  margin: 0;
}
.send-quick-btns {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  min-width: 0;
}
.send-quick-btn {
  max-width: 9.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Auto-templates switch */
.tpl-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
  margin: 0;
}
.tpl-switch-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}
.tpl-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.tpl-switch-slider {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.tpl-switch-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(102, 192, 244, 0.95), rgba(45, 115, 255, 0.75));
  box-shadow: 0 6px 16px rgba(102, 192, 244, 0.25);
  transition: transform 0.18s var(--ease), filter 0.18s var(--ease);
}
.tpl-switch input:checked + .tpl-switch-slider {
  background: rgba(102, 192, 244, 0.18);
  border-color: rgba(102, 192, 244, 0.45);
}
.tpl-switch input:checked + .tpl-switch-slider::before {
  transform: translateX(20px);
  filter: brightness(1.15);
}
.tpl-switch input:disabled + .tpl-switch-slider {
  opacity: 0.55;
  cursor: not-allowed;
}
.tpl-switch input:disabled + .tpl-switch-slider::before {
  filter: grayscale(0.35) brightness(0.9);
}
.tpl-switch input:disabled ~ .tpl-switch-label {
  opacity: 0.7;
}

.tpl-history {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}
.tpl-history-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}
.tpl-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 320px;
  overflow-y: auto;
}
.tpl-history-item {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.tpl-history-meta {
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}
.tpl-history-tpls {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.88rem;
  line-height: 1.45;
}
.tpl-history-tpls li {
  margin: 0.15rem 0;
  word-break: break-word;
}



/* ——— Auth pages ——— */
body.page-auth .wrap.auth-box {
  min-height: calc(100vh - 3rem);
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 440px;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

body.page-auth .card.auth-card {
  position: relative;
  width: 100%;
  padding: 2.25rem 2rem 2rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.auth-card-glow {
  position: absolute;
  inset: -40% -20% auto;
  height: 60%;
  background: radial-gradient(ellipse at 50% 0%, rgba(102, 192, 244, 0.25), transparent 70%);
  pointer-events: none;
}

body.page-auth .auth-logo {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;

  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 1.35rem;
  overflow: visible;
}

.auth-title {
  position: relative;
  margin: 0 0 0.3rem;
  font-size: 1.65rem;
  font-weight: 700;
}
.auth-subtitle {
  margin: 0 0 1.5rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
}
.auth-steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.35rem;
}
.auth-step {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.86rem;
  color: var(--text-secondary);
}
.auth-step span {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(102, 192, 244, 0.2);
  color: #c7e5ff;
  border: 1px solid rgba(102, 192, 244, 0.35);
}
.auth-cta {
  width: 100%;
  text-align: center;
  margin-top: 0.25rem;
}
.auth-cta--secondary {
  margin-top: 0.65rem;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 1rem;
  color: var(--text-secondary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-hint {
  margin: 0.85rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
}
.auth-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.auth-code-input {
  font-size: 1.35rem;
  letter-spacing: 0.35em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.auth-form label {
  font-size: 0.82rem;
  font-weight: 600;
}
.flash-dismiss {
  float: right;

  margin: -0.15rem -0.25rem 0 0.5rem;
  padding: 0 0.35rem;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;

  opacity: 0.7;
}
.flash-dismiss:hover { opacity: 1; }
.auth-footer {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center;

}

/* ——— Page headers ——— */
.page-head {
  margin-bottom: 1.35rem;
}
.page-head-title {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  font-weight: 700;
}
.page-head-lead {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.pay-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1.35rem 1.5rem;
  border-left: 3px solid rgba(102, 192, 244, 0.6);
}
.pay-hero-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}
.pay-hero-alert {
  margin: 0;
  flex: 1 1 100%;
}
.pending-card {
  max-width: 520px;
  margin: 2rem auto;
  text-align: center;
  padding: 2.5rem 2rem;
}
.pending-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}
.pending-title {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
}
.pending-lead {
  margin: 0 0 1rem;
  line-height: 1.55;
}
.pending-id .mono {
  font-family: ui-monospace, monospace;
  letter-spacing: 0.06em;
}



/* ——— Pay page ——— */
.pay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 860px) {
  .pay-grid { grid-template-columns: 1fr; }
}
.pay-card { padding: 1.5rem 1.75rem; }
.pay-label {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}
.pay-balance {
  margin: 0.35rem 0 0;
  font-size: 2.25rem;
  font-weight: 600;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pay-balance-unit { font-size: 1rem; color: var(--text-secondary); }
.pay-balance-sub { margin: 0.25rem 0 1.25rem; font-size: 0.9rem; }
.pay-section-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}
.pay-hint { font-size: 0.88rem; margin-bottom: 1rem; }
.pay-form > label:not(.pay-method-card) { display: block; margin-top: 0.75rem; }
.pay-form > input:not([type="radio"]):not([type="hidden"]) { width: 100%; margin-top: 0.35rem; }
.pay-form .btn { width: 100%; margin-top: 1.15rem; }
.pay-timer {
  color: var(--warn);
  font-weight: 600;
  margin: 0 0 0.75rem;
}
.pay-timer-expired { color: var(--err); }
.pay-due { font-size: 1.1rem; margin: 0 0 0.5rem; }
.pay-due strong {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pay-meta { font-size: 0.88rem; margin-bottom: 1rem; }
.pay-label + .pay-copy-field { margin-top: 0.35rem; }
.pay-copy-field {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.65rem;
  padding: 0.12rem 0.12rem 0.12rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.28);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.pay-copy-field:focus-within {
  border-color: rgba(139, 92, 246, 0.42);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.1);
}
.pay-copy-field input:not([type="checkbox"]):not([type="radio"]) {
  flex: 1;
  min-width: 0;
  width: auto;
  margin: 0;
  padding: 0.45rem 0;
  border: none;
  border-radius: 0;
  background: transparent;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  box-shadow: none;
}
.pay-copy-field input:not([type="checkbox"]):not([type="radio"]):focus {
  border: none;
  outline: none;
  box-shadow: none;
}
.pay-copy-btn {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(199, 210, 254, 0.85);
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.pay-copy-btn svg {
  width: 14px;
  height: 14px;
}
.pay-copy-btn:hover {
  background: rgba(168, 85, 247, 0.18);
  border-color: rgba(168, 85, 247, 0.32);
  color: #f3e8ff;
}
.pay-copy-btn:active {
  background: rgba(168, 85, 247, 0.28);
}
.pay-copy-btn.is-copied {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.35);
  color: #86efac;
}
.pay-wallet-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  margin-bottom: 0.5rem;
}
.pay-wallet-row input {
  flex: 1;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
}
.pay-cancel-form { margin-top: 1rem; text-align: center; }
.pay-cancel-link {
  background: none;
  border: none;
  color: var(--err);

  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: underline;
  padding: 0;
}
.pay-empty { padding: 1.5rem 0; text-align: center; }
.pay-method-badge {
  display: inline-block;
  font-size: 0.75rem;

  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-2);
  margin-bottom: 0.5rem;
}
.pay-methods { margin-top: 1.25rem; }
.pay-methods-label {
  display: block;
  margin: 0 0 0.5rem;

  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.pay-method-seg {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0.25rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
}
.pay-method-seg__btn {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0.65rem 0.5rem;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}
.pay-method-seg__btn:hover:not(:disabled):not(.is-disabled) { color: var(--text); }
.pay-method-seg__btn.is-active:not(:disabled):not(.is-disabled) { color: #fff; }
.pay-method-seg__btn:disabled,
.pay-method-seg__btn.is-disabled {
  opacity: 0.38;
  cursor: not-allowed;
  color: var(--text-secondary);
}
.pay-method-seg__btn:disabled:hover,
.pay-method-seg__btn.is-disabled:hover {
  color: var(--text-secondary);
}
.pay-method-seg__thumb {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  height: calc(100% - 0.5rem);
  border-radius: 9px;
  background: var(--accent-gradient);
  box-shadow: 0 4px 16px -4px rgba(139, 92, 246, 0.55);
  transition: transform 0.22s var(--ease), width 0.22s var(--ease);
  pointer-events: none;
}
.pay-auto-hint { margin: 0.75rem 0; }
.pay-history-card { margin-top: 0; }
.pay-history {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.82rem;
  line-height: 1.7;
}
.pay-history li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}
.pay-history li:last-child { border-bottom: none; }
.pay-history-ts { color: var(--text-secondary); margin-right: 0.5rem; }
.pay-history-kind { color: var(--accent-2); margin-right: 0.5rem; }
.pay-history-qty { color: var(--ok); margin-right: 0.5rem; }
.mono { font-family: ui-monospace, monospace; }



/* ——— Line toggle grid (GoIP) ——— */
.line-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 0.5rem;
}
.line-grid .btn { width: 100%; min-width: 0; }

/* ——— Admin home: GoIP monitor + SMS feed ——— */
.admin-home-wrap { max-width: 1400px; }
.admin-home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}
@media (max-width: 1024px) {
  .admin-home-layout { grid-template-columns: 1fr; }
}
.admin-home-lines-head { margin-bottom: 1rem; }
.admin-home-lines-head h2 { margin: 0 0 0.25rem; }
.admin-home-gate { margin: 0; font-size: 0.875rem; }
.admin-lines-load-hint { margin: 0.65rem 0 0; font-size: 0.78rem; }
.goip-devices-stack { display: flex; flex-direction: column; gap: 1.25rem; }
.goip-device-block {
  padding: 0.85rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.goip-device-block:first-child { border-top: 0; padding-top: 0; }
.goip-device-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.goip-device-head h3 { margin: 0 0 0.15rem; font-size: 1rem; }
.goip-device-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.admin-net-err { margin: 0 0 0.5rem; font-size: 0.8rem; color: var(--warn, #e8b84a); }
.admin-lines-grid {
  display: grid;
  gap: 0.45rem;
}
.admin-lines-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin-lines-grid--8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.admin-lines-grid--16 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.admin-line-cell {
  position: relative;
  aspect-ratio: 1;
  min-height: 2.5rem;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.25s ease, border-color 0.2s ease, background 0.2s ease;
}
.admin-line-num {
  font-weight: 600;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.admin-line-cell--off {
  opacity: 0.45;
  background: rgba(0, 0, 0, 0.25);
}
.admin-line-cell--ok {
  border-color: rgba(72, 199, 116, 0.55);
  background: rgba(72, 199, 116, 0.22);
  color: #b8f0c8;
}
.admin-line-cell--sending {
  border-color: rgba(72, 199, 116, 0.7);
  background: rgba(72, 199, 116, 0.28);
  box-shadow: 0 0 0 2px rgba(232, 184, 74, 0.35), 0 0 14px rgba(232, 184, 74, 0.45);
  animation: admin-line-pulse 1.2s ease-in-out infinite;
}
@keyframes admin-line-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(232, 184, 74, 0.3), 0 0 10px rgba(232, 184, 74, 0.35); }
  50% { box-shadow: 0 0 0 3px rgba(232, 184, 74, 0.55), 0 0 18px rgba(232, 184, 74, 0.6); }
}
.admin-line-cell--warn {
  border-color: rgba(232, 184, 74, 0.65);
  background: rgba(232, 184, 74, 0.28);
  color: #ffe9a8;
}
.admin-line-cell--bad {
  border-color: rgba(255, 92, 92, 0.75);
  background: rgba(255, 92, 92, 0.2);
  color: #ffc8c8;
}
.admin-line-tip {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  z-index: 20;
  min-width: 10rem;
  max-width: 14rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: rgba(12, 12, 24, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font-size: 0.72rem;
  line-height: 1.35;
  pointer-events: none;
  text-align: left;
}
.admin-line-cell:hover .admin-line-tip {
  display: block;
}
.admin-line-tip-row { margin: 0.15rem 0; }
.admin-line-tip-row span { color: var(--text-secondary); margin-right: 0.35rem; }
.admin-line-tip-err { color: var(--warn, #e8b84a); word-break: break-word; }
button.admin-line-cell--clickable {
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0;
  width: 100%;
}
button.admin-line-cell--clickable:hover {
  filter: brightness(1.08);
}
button.admin-line-cell--clickable:focus-visible {
  outline: 2px solid rgba(102, 192, 244, 0.75);
  outline-offset: 2px;
}
.goip-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.goip-tabs__link {
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}
.goip-tabs__link:hover { color: #fff; text-decoration: none; }
.goip-tabs__link.is-active {
  color: #fff;
  border-color: rgba(102, 192, 244, 0.45);
  background: rgba(102, 192, 244, 0.16);
}
.goip-line-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.goip-line-modal[hidden] { display: none !important; }
.goip-line-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.goip-line-modal__panel {
  position: relative;
  width: min(100%, 22rem);
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius, 12px);
  background: var(--card, #12121f);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}
.goip-line-modal__title { margin: 0 0 0.35rem; font-size: 1.05rem; }
.goip-line-modal__meta { margin: 0 0 0.85rem; font-size: 0.82rem; }
.goip-line-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.85rem;
}
.goip-line-modal__err { margin: 0.5rem 0 0; font-size: 0.85rem; }
.goip-errors-table-wrap { overflow-x: auto; margin-top: 0.5rem; }
.goip-errors-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.goip-errors-table th,
.goip-errors-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: top;
}
.goip-errors-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}
.goip-errors-err {
  max-width: 18rem;
  word-break: break-word;
  color: #ffc8c8;
  font-size: 0.8rem;

}
.goip-settings-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 28rem;
  margin-top: 0.5rem;
}
.goip-settings-form .field-label { display: block; margin-bottom: 0.35rem; font-weight: 500; }
.goip-settings-form input[type="text"],
.goip-settings-form input[type="number"] {
  width: 100%;
}
.admin-infra-settings-header {
  margin-bottom: 1rem;
}
.admin-infra-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.admin-infra-settings-card {
  margin: 0;
  padding: 1.1rem 1.15rem 1.2rem;
}
.admin-infra-settings-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}
.admin-infra-settings-card__desc,
.admin-infra-settings-card__hint {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
}
.admin-infra-settings-card__hint {
  margin: 0.55rem 0 0;
}
.admin-infra-settings-card .field {
  display: block;
  margin-bottom: 0.75rem;
}
.admin-infra-settings-card .field:last-child {
  margin-bottom: 0;
}
.admin-infra-settings-card .field-label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 500;
  font-size: 0.82rem;
}
.admin-infra-settings-card input[type="text"],
.admin-infra-settings-card input[type="number"] {
  width: 100%;
  margin-bottom: 0;
  padding: 0.55rem 0.75rem;
}
.admin-infra-settings-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
}
.admin-infra-settings-meta {
  margin: 0;
  display: grid;
  gap: 0.45rem;
}
.admin-infra-settings-meta > div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
}
.admin-infra-settings-meta dt {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.admin-infra-settings-meta dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.admin-infra-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

/* Dense infra settings (reference-like grid) */
.infra-set-header {
  margin: 0 0 1.1rem;
}
.infra-set-title {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.infra-set-lead {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: 46rem;
}
.infra-set-lead a {
  color: #9fd6ff;
}
.infra-set-form {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  max-width: 1100px;
}
.infra-set-section {
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
}
.infra-set-section__title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.infra-set-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem 1rem;
}
.infra-set-grid--checks {
  grid-template-columns: 1fr;
}
.infra-set-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
  min-width: 0;
}
.infra-set-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}
.infra-set-field input[type="text"],
.infra-set-field input[type="number"] {
  width: 100%;
  margin: 0 !important;
  padding: 0.48rem 0.65rem !important;
  min-height: 2.15rem;
  font-size: 0.88rem;
  box-sizing: border-box;
}
.infra-set-hint {
  display: block;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text-secondary);
  opacity: 0.92;
}
.infra-set-hint strong,
.infra-set-hint code {
  color: #c9d4e0;
  font-weight: 600;
}
.infra-set-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
  cursor: pointer;
}
.infra-set-check input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}
.infra-set-check strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.88rem;
}
.infra-set-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}
.infra-set-status > div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
}
.infra-set-status .muted {
  font-size: 0.72rem;
}
.infra-set-status strong {
  font-size: 0.95rem;
}
.infra-set-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-top: 0.25rem;
}
@media (max-width: 1100px) {
  .infra-set-grid,
  .infra-set-status {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .infra-set-grid,
  .infra-set-status {
    grid-template-columns: 1fr;
  }
}
.goip-lines-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.75rem, 1fr));
  gap: 0.45rem;
  margin-top: 0.75rem;
}
.admin-home-feed h2 { margin: 0 0 0.25rem; }

.admin-feed-hint { margin: 0 0 0.75rem; font-size: 0.8rem; }
.admin-sms-feed {
  max-height: min(70vh, 640px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-right: 0.25rem;
}
.admin-sms-feed-item {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.admin-sms-feed-item--ok { border-left: 3px solid rgba(72, 199, 116, 0.75); }
.admin-sms-feed-item--fail { border-left: 3px solid rgba(255, 92, 92, 0.75); }
.admin-sms-feed-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
}
.admin-sms-feed-time { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.admin-sms-feed-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
}
.admin-sms-feed-item--ok .admin-sms-feed-badge {
  background: rgba(72, 199, 116, 0.2);
  color: #8ee4a8;
}
.admin-sms-feed-item--fail .admin-sms-feed-badge {
  background: rgba(255, 92, 92, 0.2);
  color: #ffb0b0;
}
.admin-sms-feed-user { color: var(--accent-2, #66c0f4); font-weight: 500; }
.admin-sms-feed-user-link {
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
}
.admin-sms-feed-user-link:hover {
  text-decoration: underline;
}
.admin-sms-feed-route {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.72rem;
  margin-bottom: 0.2rem;
}
.admin-sms-feed-goip { color: var(--text-secondary); }
.admin-sms-feed-phone { font-size: 0.85rem; font-weight: 500; }
.admin-sms-feed-text { font-size: 0.78rem; margin-top: 0.15rem; word-break: break-word; color: var(--text-secondary); }
.admin-sms-feed-error {
  font-size: 0.75rem;
  margin-top: 0.35rem;
  color: #ffb0b0;
  word-break: break-word;
}
.admin-home-secondary {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.72fr) minmax(0, 1.15fr);
  gap: 0.65rem;
  align-items: stretch;
}
@media (max-width: 1080px) {
  .admin-home-secondary {
    grid-template-columns: 1fr 1fr;
  }
  .admin-control-card--broadcast {
    grid-column: 1 / -1;
  }
}
@media (max-width: 640px) {
  .admin-home-secondary { grid-template-columns: 1fr; }
  .admin-control-card--broadcast { grid-column: auto; }
}
.admin-control-card {
  padding: 0.75rem 0.85rem !important;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
}
.admin-control-title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.admin-control-hint {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
}
.admin-control-flash {
  margin: 0;
  font-size: 0.72rem;
  color: #86efac;
}
.admin-control-toggle-form { margin: 0; }
.admin-control-toggle {
  width: 100%;
  justify-content: center;
}
.admin-control-toggle.is-on {
  box-shadow: 0 0 0 1px rgba(102, 192, 244, 0.35);
}

/* ——— Gate pills (admin) ——— */
.gate-pills { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.gate-pills--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}
.gate-pills form { margin: 0; min-width: 0; }
.gate-pills--grid .btn {
  width: 100%;
  padding: 0.36rem 0.45rem;
  font-size: 0.74rem;
  white-space: nowrap;
}
.gate-pills form.gate-pill--active .btn {
  box-shadow: 0 0 0 2px rgba(102, 192, 244, 0.55), 0 0 12px rgba(102, 192, 244, 0.25);
}
.admin-gate-status {
  margin: 0;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  line-height: 1.35;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}
.admin-gate-status--compact { margin-top: auto; }
.admin-gate-status--ok {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.08);
}
.admin-gate-status--off {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
}
.admin-gate-status-label {
  color: var(--text-secondary);
  margin-right: 0.35rem;
}

/* ——— Admin broadcast compact ——— */
.admin-broadcast-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
  flex: 1;
}
.admin-broadcast-form textarea {
  width: 100%;
  min-height: 2.6rem;
  max-height: 4.5rem;
  margin: 0;
  padding: 0.45rem 0.55rem;
  font-size: 0.8rem;
  line-height: 1.35;
  resize: vertical;
}
.admin-broadcast-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.admin-broadcast-colors {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.admin-broadcast-colors-row {
  display: flex;
  gap: 0.35rem;
}
.admin-broadcast-swatch-btn {
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.admin-broadcast-swatch-btn input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.admin-broadcast-swatch-btn.is-selected,
.admin-broadcast-swatch-btn:has(input:checked) {
  border-color: rgba(255, 255, 255, 0.85);
  transform: scale(1.06);
}
.admin-broadcast-swatch {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  pointer-events: none;
}
.admin-broadcast-swatch--red { background: #f87171; }
.admin-broadcast-swatch--yellow { background: #fbbf24; }
.admin-broadcast-swatch--green { background: #34d399; }
.admin-broadcast-swatch--purple { background: #a78bfa; }
.admin-control-card .gate-banner.admin-broadcast-preview {
  margin: 0;
  padding: 0.45rem 0.6rem;
  font-size: 0.78rem;
  line-height: 1.35;
  animation: none;
}
.admin-broadcast-clear { margin: 0; }
.admin-broadcast-clear .btn { font-size: 0.72rem; padding: 0.28rem 0.55rem; }
.admin-control-card--errors {
  justify-content: flex-start;
}
.admin-control-card--errors .admin-control-toggle-form {
  flex: 1;
  display: flex;
  align-items: center;
}
.admin-control-card--broadcast .admin-broadcast-clear + .admin-broadcast-form,
.admin-control-card--broadcast > .admin-broadcast-form {
  margin-top: 0;
}



/* ——— Rank badge ——— */
.rank-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  background: rgba(102, 192, 244, 0.15);
  border: 1px solid rgba(102, 192, 244, 0.3);
}

/* ——— Stats tabs ——— */
.stats-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.35rem;
  border-radius: var(--radius-lg);
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.stats-tab {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.stats-tab:hover {
  color: var(--text);
  background: var(--surface-hover);
  text-decoration: none;
}
.stats-tab.active {
  color: #fff;
  background: rgba(102, 192, 244, 0.28);
  border: 1px solid rgba(102, 192, 244, 0.4);
}
.stats-tab .muted { font-weight: 400; font-size: 0.8rem; }

/* ——— Achievements ——— */
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.ach-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s var(--ease), background 0.2s;
}
.ach-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}
.ach-card.earned {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.06);
}
.ach-card.selected {
  border-color: rgba(102, 192, 244, 0.55);
  box-shadow: 0 0 0 1px rgba(102, 192, 244, 0.3);
}
.ach-icon { font-size: 1.1rem; opacity: 0.9; }
.ach-title { font-size: 0.875rem; font-weight: 600; line-height: 1.3; }
.ach-prog { font-size: 0.75rem; color: var(--text-secondary); }
.ach-detail {
  margin: 1rem 0;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  background: rgba(102, 192, 244, 0.08);
  border: 1px solid rgba(102, 192, 244, 0.25);
}
.ach-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.ach-badge.earned { background: rgba(52, 211, 153, 0.15); color: #a7f3d0; }
.ach-badge.locked { background: rgba(255, 255, 255, 0.06); color: var(--text-secondary); }

.ach-grid--compact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.75rem;
}
.ach-item {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;

  padding: 0.45rem 0.9rem 0.45rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.12);
  color: #a7f3d0;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.25;
  max-width: 100%;
}
.ach-item .ach-svg {

  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: #c9b6ff;
  filter: drop-shadow(0 0 4px rgba(168, 85, 247, 0.35));
}
.ach-item-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}



/* ——— Ranks ladder ——— */
.rank-hero { margin: 0.5rem 0 1rem; }
.rank-hero-badge { font-size: 1rem; padding: 0.5rem 1rem; }
.rank-progress-wrap { margin: 1rem 0 0.5rem; }
.rank-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}
.progress-bar {
  height: 8px;

  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent-gradient);
  transition: width 0.4s var(--ease);
}
.rank-ladder {

  max-height: 420px;
  overflow-y: auto;
  margin-top: 1rem;
  padding-right: 0.25rem;
}
.rank-row {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.rank-row.earned {
  background: rgba(102, 192, 244, 0.08);
}
.rank-row.earned .rank-row-icon { color: #66c0f4; }
.rank-row-threshold { font-size: 0.8rem; white-space: nowrap; }
.rank-row.locked {
  grid-template-columns: 2rem;
  justify-items: start;
}
.rank-row.locked .rank-row-icon { opacity: 0.65; }

/* ——— Steam-style achievements ——— */
.steam-ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 0.85rem;
  margin-top: 1.25rem;
}
.steam-ach-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s var(--ease), filter 0.25s, opacity 0.25s;
}
.steam-ach-tile:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}
.steam-ach-tile.selected {
  border-color: rgba(102, 192, 244, 0.55);
  box-shadow: 0 0 0 1px rgba(102, 192, 244, 0.35);
}
.steam-badge,
.steam-badge-preview {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.35));
  border: 1px solid var(--border);
  overflow: hidden;
}
.steam-badge-preview { flex-shrink: 0; }
.steam-emoji {
  font-size: 2.25rem;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}
.steam-ach-tile.locked .steam-badge {
  filter: grayscale(1) brightness(0.55);
}
.steam-ach-tile.locked .steam-emoji {
  opacity: 0.75;
}
.steam-ach-tile.locked .steam-ach-label,
.steam-ach-tile.locked .steam-ach-prog {
  color: var(--text-secondary);
}
.steam-ach-tile.locked {
  opacity: 0.82;
}
.steam-ach-tile.locked::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.steam-ach-tile.unlocked .steam-badge {
  border-color: rgba(52, 211, 153, 0.35);
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.12);
}
.steam-lock-overlay {
  position: absolute;
  right: 4px;
  bottom: 4px;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.15rem 0.25rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.steam-ach-label {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.steam-ach-prog {
  font-size: 0.68rem;
  color: var(--text-secondary);
}
.steam-detail {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.steam-badge-preview.locked {
  filter: grayscale(1) brightness(0.6);
}
.steam-badge-preview.unlocked {
  border-color: rgba(52, 211, 153, 0.4);
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.15);
}

/* ——— Alert list ——— */
.alert-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.alert-item:last-child { border-bottom: none; }
.alert-item strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}



/* ——— Admin integrations page ——— */
body.page-integrations .integ-flash {
  margin-bottom: 1rem;
}
.integ-flash-note {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.88rem;
  opacity: 0.95;
}

.integ-header {
  margin-bottom: 1.5rem;
}
.integ-title {
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.integ-lead {
  margin: 0;
  max-width: 52rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.integ-lead code {
  font-size: 0.85em;
  padding: 0.1em 0.4em;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.integ-status-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.integ-status-card {
  display: flex;
  align-items: center;

  gap: 0.85rem;
  padding: 1rem 1.1rem;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s var(--ease);
}
.integ-status-card--on {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.06);
}
.integ-status-card--off {
  border-color: var(--border);

  opacity: 0.92;
}
.integ-status-icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;

  border: 1px solid rgba(56, 189, 248, 0.25);
}
.integ-status-icon--pay {
  background: rgba(102, 192, 244, 0.15);
  color: #66c0f4;
  border-color: rgba(102, 192, 244, 0.3);
}
.integ-status-icon--hook {
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.28);
}
.integ-status-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 0.15rem;
}
.integ-status-value {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
}

.integ-form {
  width: 100%;
}
.integ-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
.integ-grid > * {
  min-width: 0;
}
.integ-panel {
  min-width: 0;
  overflow: hidden;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem 1.5rem;
  box-shadow: var(--shadow);
}
.integ-panel--tg {
  border-top: 3px solid rgba(56, 189, 248, 0.55);
}
.integ-panel--pay {
  border-top: 3px solid rgba(102, 192, 244, 0.55);
}


.integ-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.integ-panel-title-wrap {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}
.integ-panel-badge {
  flex-shrink: 0;

  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}
.integ-panel-badge--tg {
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
}
.integ-panel-badge--pay {
  background: var(--accent-gradient);

}
.integ-panel-title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.integ-panel-desc {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.integ-pill {
  flex-shrink: 0;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.integ-pill--ok {
  background: rgba(52, 211, 153, 0.15);
  color: var(--ok);
  border: 1px solid rgba(52, 211, 153, 0.35);
}
.integ-pill--warn {
  background: rgba(251, 191, 36, 0.12);
  color: var(--warn);
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.integ-pill--muted {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.integ-steps {
  margin: 0 0 1.15rem;
  padding-left: 1.2rem;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.55;
}
.integ-steps li {
  margin-bottom: 0.35rem;
}
.integ-steps strong {
  color: var(--text);
  font-weight: 600;
}

.integ-field-group {
  margin-bottom: 1rem;
}
.integ-field-group:last-child {
  margin-bottom: 0;
}
.integ-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.integ-hint {
  margin: -0.15rem 0 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.integ-input {
  width: 100%;
  margin-bottom: 0.5rem;
}
label.integ-check {
  display: flex !important;
  align-items: flex-start;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-secondary);
  cursor: pointer;
  margin: 0.35rem 0 0;
}
label.integ-check span {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}
label.integ-check input[type="checkbox"] {
  margin-top: 0.15rem;
}

.integ-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
}
.integ-switch input[type="checkbox"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.integ-switch-slider {
  position: relative;
  z-index: 1;
  display: block;
  width: 2.75rem;
  height: 1.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
  pointer-events: none;
}
.integ-switch-slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s var(--ease);
}
.integ-switch input:checked + .integ-switch-slider {
  background: linear-gradient(120deg, #a855f7, #6366f1);
  border-color: transparent;
}
.integ-switch input:checked + .integ-switch-slider::before {
  transform: translateX(1.25rem);
}

.integ-current {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.65rem;
  margin-bottom: 0.55rem;
  padding: 0.55rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}
.integ-current--warn {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
}
.integ-current-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ok);
  font-weight: 600;
}
.integ-tag {
  font-size: 0.72rem;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  background: var(--surface-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.integ-tag--accent {
  color: #a5f3fc;
  border-color: rgba(102, 192, 244, 0.25);
  background: rgba(102, 192, 244, 0.08);
}

.integ-subsection {
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px dashed var(--border);
}
.integ-subsection-title {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.integ-callout {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.84rem;
}
.integ-callout--info {
  background: rgba(56, 189, 248, 0.06);
  border-color: rgba(56, 189, 248, 0.2);
}
.integ-callout--warn {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.25);
  color: var(--warn);
}
.integ-callout--copy {
  background: rgba(102, 192, 244, 0.08);
  border-color: rgba(102, 192, 244, 0.25);
}
.integ-callout-title {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.integ-callout-code {
  word-break: break-all;
  font-size: 0.88rem;
}
.integ-copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}
.integ-copy-target {
  flex: 1;
  min-width: 0;
  word-break: break-all;
  font-size: 0.78rem;
  padding: 0.45rem 0.6rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.integ-save-bar {
  position: sticky;
  bottom: 1rem;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.integ-save-hint {
  margin: 0;
  font-size: 0.82rem;
  max-width: 28rem;
}
.integ-save-btn {
  flex-shrink: 0;
  min-width: 12rem;
}

@media (max-width: 960px) {
  .integ-grid {
    grid-template-columns: 1fr;
  }
  .integ-status-row {
    grid-template-columns: 1fr;
  }
}



/* ——— Responsive ——— */
@media (max-width: 768px) {
  header.site {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  nav.site-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
  }
  nav.site-nav a { flex-shrink: 0; }
  .wrap, .wrap-wide { padding-left: 1rem; padding-right: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}



/* ——— Brand as link ——— */
.brand-link { text-decoration: none; color: inherit; }
.brand-link:hover { color: inherit; text-decoration: none; }

/* ——— Profile dropdown (Steam account menu) ——— */
.profile-menu {
  position: relative;
  z-index: 2;
  margin-left: auto;
}
.profile-menu summary {
  list-style: none;
  cursor: pointer;
}
.profile-menu summary::-webkit-details-marker { display: none; }
.profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.6rem 0.35rem 0.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.profile-menu[open] .profile-trigger,
.profile-trigger:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}
.profile-avatar,
.sp-avatar,
.profile-head-avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  background: var(--accent-gradient);
  box-shadow: 0 0 22px var(--accent-glow);
}
.profile-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: left;
}
.profile-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}
.profile-wallet {
  font-size: 0.75rem;
  color: var(--accent);
}
.profile-caret {
  color: var(--text-secondary);
  transition: transform 0.2s var(--ease);
}
.profile-menu[open] .profile-caret { transform: rotate(180deg); }

.profile-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 200;
  min-width: 230px;
  padding: 0.4rem;
  background: #14122a;
  background-image: linear-gradient(180deg, rgba(168, 85, 247, 0.08), transparent 60%);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.85);
  animation: fadeUp 0.18s var(--ease) both;
}
header.site:has(.profile-menu[open]) {
  z-index: 250;
  overflow: visible;
}
.profile-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: #c6d4df;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.profile-item:hover {
  background: linear-gradient(90deg, rgba(102, 192, 244, 0.18), rgba(45, 115, 255, 0.1));
  color: #fff;
  text-decoration: none;
}
.profile-item.active {
  color: #fff;
  background: var(--surface-hover);
}
.profile-item-ico {
  width: 1.2rem;
  text-align: center;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: rgba(155, 214, 255, 0.9);
}
.nav-svg-ico {
  display: grid;
  place-items: center;
  line-height: 0;
}
.nav-svg-ico svg {
  display: block;
}
.profile-item-ico .nav-svg-ico svg {
  width: 1.125rem;
  height: 1.125rem;
}
.mobile-bottom-nav__ico .nav-svg-ico svg {
  width: 1.25rem;
  height: 1.25rem;
}
.profile-item-val {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--accent);
}
.profile-item-badge {
  margin-left: auto;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35rem;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(26, 22, 46, 0.9);
}
.chat-list-unread.is-hidden {
  display: none;
}
.chat-list-unread {
  margin-left: auto;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35rem;
  text-align: center;
  flex-shrink: 0;
}
.profile-item--logout { color: #ff8a80; }
.profile-item--logout:hover {
  background: rgba(199, 62, 60, 0.18);
  color: #ffb3aa;
}
.profile-logout-form { margin: 0; }
.profile-sep {
  height: 1px;
  margin: 0.35rem 0.5rem;
  background: var(--border);
}

/* ——— Main screen send/templates switch ——— */
.view-switch-tabs {
  display: inline-flex;
  gap: 0.25rem;
  margin-bottom: 1.1rem;
  padding: 0.3rem;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #171a21 0%, #1b2838 100%);
  border: 1px solid var(--border);
}
.view-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #b8c4ce;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.view-tab:hover { color: #fff; }
.view-tab.is-active {
  color: #fff;
  background: linear-gradient(180deg, rgba(102, 192, 244, 0.28), rgba(45, 115, 255, 0.2));
  box-shadow: inset 0 0 0 1px rgba(102, 192, 244, 0.35);
}
.view-panel--tpl,
.view-panel--gen { display: none; }
.view-switch[data-view="tpl"] .view-panel--send,
.view-switch[data-view="tpl"] .view-panel--gen { display: none; }
.view-switch[data-view="tpl"] .view-panel--tpl { display: block; }
.view-switch[data-view="gen"] .view-panel--send,
.view-switch[data-view="gen"] .view-panel--tpl { display: none; }
.view-switch[data-view="gen"] .view-panel--gen { display: block; }

/* ——— Template generator (invisible symbols) ——— */
.tpl-gen {
  display: grid;
  gap: 0.75rem;
}
.tpl-gen__intro .tpl-gen__head h2 {
  margin: 0 0 0.35rem;
}
.tpl-gen__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.tpl-gen__toolbar-hint { font-size: 0.8rem; }
.tpl-gen__card { min-width: 0; }
.tpl-gen__title {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  font-weight: 700;
}
.tpl-gen__hint {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
}
.tpl-gen__hint--tight { margin-top: 0.25rem; margin-bottom: 0; font-size: 0.72rem; line-height: 1.3; }
.tpl-gen__hint--inline { margin: 0; display: inline; font-size: 0.75rem; }
.tpl-gen__mt { margin-top: 0.5rem; }
.tpl-gen textarea,
.tpl-gen input[type="text"],
.tpl-gen input[type="number"],
.tpl-gen select {
  width: 100%;
  font-size: 0.88rem;
  margin-bottom: 0;
}
.tpl-gen select {
  padding-right: 1.65rem;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b8c4ce' d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.45rem center;
  background-size: 0.65rem;
}
.tpl-gen textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  min-height: 5rem;
}
.tpl-gen__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}
.tpl-gen__field {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  white-space: nowrap;
  margin: 0;
}
.tpl-gen__field--ctrl {
  min-height: 1.85rem;
}
.tpl-gen__field--ctrl select,
.tpl-gen__field--ctrl input[type="number"] {
  min-width: 0;
  max-width: 100%;
  padding: 0.28rem 0.45rem;
  font-size: 0.78rem;
}
.tpl-gen__field--block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  white-space: normal;
}
.tpl-gen__field select,
.tpl-gen__field input[type="number"] {
  width: auto;
  min-width: 5.5rem;
}
.tpl-gen__select--sep { min-width: 7.5rem; max-width: 9rem; }
.tpl-gen__input--num {
  width: 3.1rem !important;
  min-width: 3.1rem !important;
  padding: 0.28rem 0.35rem;
  text-align: center;
}
.tpl-gen__inline-btn {
  align-self: center;
  padding: 0.28rem 0.55rem;
  font-size: 0.75rem;
}
.tpl-gen__switch { flex-shrink: 0; }
.tpl-gen .tpl-switch-slider {
  width: 34px;
  height: 18px;
}
.tpl-gen .tpl-switch-slider::before {
  width: 12px;
  height: 12px;
  top: 2px;
  left: 2px;
}
.tpl-gen .tpl-switch input:checked + .tpl-switch-slider::before {
  transform: translateX(16px);
}
.tpl-gen__grid-2 {
  display: grid;
  gap: 1rem;
}
@media (min-width: 960px) {
  .tpl-gen__grid-2 { grid-template-columns: 1fr 1fr; }
}
.tpl-gen__symbol-layout { display: flex; flex-direction: column; gap: 0.85rem; }
.tpl-gen__symbols-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.tpl-gen__symbols-host {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 0.5rem;
  min-width: 0;
}
@media (max-width: 900px) {
  .tpl-gen__symbols-host { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .tpl-gen__symbols-host { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.tpl-gen .symbol-grid-cell {
  display: grid;
  gap: 0.25rem;
  padding: 0.4rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  min-width: 0;
}
.tpl-gen .symbol-grid-cell__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  min-width: 0;
}
.tpl-gen .sym-hex {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--text-secondary);
  font-size: 0.62rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tpl-gen .symChar,
.tpl-gen .symComment {
  width: 100%;
  min-width: 0;
  font-size: 0.72rem;
  padding: 0.25rem 0.35rem;
}
.tpl-gen .symComment { font-size: 0.62rem; }
.tpl-gen .switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
  flex-shrink: 0;
}
.tpl-gen .switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.tpl-gen .switch .slider {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background 0.15s var(--ease);
}
.tpl-gen .switch .slider::before {
  content: "";
  position: absolute;
  height: 12px;
  width: 12px;

  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s var(--ease);
}
.tpl-gen .switch input:checked + .slider {
  background: linear-gradient(120deg, rgba(168, 85, 247, 0.55), rgba(99, 102, 241, 0.55));
  border-color: rgba(102, 192, 244, 0.45);
}
.tpl-gen .switch input:checked + .slider::before { transform: translateX(16px); }
.tpl-gen__side-stack {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.5rem;

  border-top: 1px solid var(--border);
  align-items: stretch;
}
@media (min-width: 900px) {
  .tpl-gen__side-stack {
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem 0.55rem;
  }
  .tpl-gen__mini-card--wide { grid-column: 1 / -1; }
}
.tpl-gen__mini-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);

  padding: 0.5rem 0.6rem;
  background: rgba(255, 255, 255, 0.02);
  min-width: 0;
}
.tpl-gen__mini-title {
  margin: 0 0 0.35rem;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 700;
}
.tpl-gen__mini-card .tpl-gen__hint--tight {
  margin-top: auto;
  padding-top: 0.3rem;
}

/* Unified control cells: label + control on one baseline */
.tpl-gen__ctrl-row {
  display: grid;
  align-items: center;
  gap: 0.4rem 0.55rem;
}
.tpl-gen__ctrl-row--range {
  grid-template-columns: auto minmax(5.5rem, 1fr) auto auto;
}
.tpl-gen__ctrl-row--range .tpl-gen__ctrl--grow select {
  min-width: 5.5rem;
}
.tpl-gen__ctrl-row--phones {
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.55rem;
}
.tpl-gen__ctrl-row--replace {
  grid-template-columns: auto auto 1fr;
}
@media (max-width: 719px) {
  .tpl-gen__ctrl-row--range {
    grid-template-columns: 1fr 1fr;
  }
  .tpl-gen__ctrl-row--replace {
    grid-template-columns: 1fr 1fr;
  }
  .tpl-gen__ctrl-row--replace .tpl-gen__ctrl--pills {
    grid-column: 1 / -1;
  }
}
.tpl-gen__ctrl {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.35rem 0.45rem;
  align-items: center;
  min-height: 1.9rem;
  min-width: 0;
}
.tpl-gen__ctrl select,
.tpl-gen__ctrl input[type="text"],
.tpl-gen__ctrl input[type="number"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-size: 0.78rem;
  margin: 0;
  line-height: 1.25;
  box-sizing: border-box;
}
.tpl-gen__ctrl select {
  min-width: 3.25rem;
  padding: 0.32rem 1.65rem 0.32rem 0.45rem;
}
.tpl-gen__ctrl input[type="text"],
.tpl-gen__ctrl input[type="number"] {
  padding: 0.32rem 0.45rem;
}
.tpl-gen__select-sep {
  min-width: 5.5rem;
}
.tpl-gen__ctrl--grow {
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
}
.tpl-gen__ctrl--solo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 1.9rem;
}
.tpl-gen__ctrl--stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  min-height: 0;
  margin: 0;
}
.tpl-gen__ctrl--pills {
  grid-template-columns: auto 1fr;
  align-items: center;
}
.tpl-gen__ctrl-lbl {
  font-size: 0.74rem;
  color: var(--text-secondary);
  white-space: nowrap;
  line-height: 1.2;
}
.tpl-gen__ctrl--stack input {
  width: 100%;
}
.tpl-gen__input--num {
  width: 2.75rem !important;
  min-width: 2.75rem !important;
  padding: 0.3rem 0.25rem !important;
  text-align: center;
}
.tpl-gen__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}
.tpl-gen__pill {
  padding: 0.2rem 0.48rem;
  font-size: 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  line-height: 1.2;
}
.tpl-gen__pill.active,
.tpl-gen__pill:hover {
  border-color: rgba(102, 192, 244, 0.45);
  background: rgba(102, 192, 244, 0.12);
}
.tpl-gen__file-btn { cursor: pointer; margin: 0; }
.tpl-gen__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.tpl-gen__section-head--inline {
  justify-content: flex-start;
  gap: 0.55rem 0.75rem;
}
.tpl-gen__mt-sm { margin-top: 0.35rem; }
.tpl-gen__section-head .tpl-gen__title { margin: 0; }
.tpl-gen__variant-meta { font-size: 0.75rem; white-space: nowrap; }
.tpl-gen__head-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}
.tpl-gen__tool-panel {
  display: grid;
  grid-template-columns: 1fr;
  margin-bottom: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}
@media (min-width: 900px) {
  .tpl-gen__tool-panel {
    grid-template-columns: 1fr 1fr;
  }
}
.tpl-gen__tool-section {
  display: grid;
  grid-template-columns: 3.1rem minmax(0, 1fr);
  gap: 0.45rem 0.55rem;
  align-items: center;
  padding: 0.45rem 0.55rem;
  min-height: 2.75rem;
}
.tpl-gen__tool-section + .tpl-gen__tool-section {
  border-top: 1px solid var(--border);
}
@media (min-width: 900px) {
  .tpl-gen__tool-section + .tpl-gen__tool-section {
    border-top: none;
    border-left: 1px solid var(--border);
  }
}
.tpl-gen__tool-kicker {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  line-height: 1.25;
  align-self: center;
}
.tpl-gen__tool-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
  min-width: 0;
}
.tpl-gen__tool-grid--run .tpl-gen__ctrl--qty {
  flex: 0 0 auto;
}
.tpl-gen__tool-grid--run .tpl-gen__ctrl--qty select {
  width: 3.4rem;
  min-width: 3.4rem;
  padding-right: 1.45rem;
}
.tpl-gen__tool-grid--run .tpl-gen__ctrl--grow {
  flex: 1 1 6.5rem;
  min-width: 6.5rem;
  max-width: 100%;
}
.tpl-gen__tool-grid--out {
  flex-wrap: wrap;
}
.tpl-gen__tool-grid--out .tpl-gen__ctrl {
  flex: 0 0 auto;
}
.tpl-gen__tool-grid .btn-sm {
  padding: 0.32rem 0.55rem;
  font-size: 0.75rem;
  min-height: 1.9rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.tpl-gen__tool-grid .tpl-gen__ctrl {
  grid-template-columns: auto minmax(0, 1fr);
  flex: 0 1 auto;
}
@media (max-width: 899px) {
  .tpl-gen__tool-grid--run .tpl-gen__ctrl--grow {
    flex: 1 1 100%;
  }
}
@media (max-width: 520px) {
  .tpl-gen__tool-section {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .tpl-gen__tool-kicker {
    padding-bottom: 0.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
}
.tpl-gen__result-marked {
  white-space: pre-wrap;
  border: 1px solid var(--border);
  padding: 0.55rem 0.65rem;
  min-height: 2.5rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  margin-top: 0.35rem;
}
.tpl-gen__result-marked .invisible {
  color: #f87171;
  font-weight: 700;
}
.tpl-gen__result-marked .latin {
  background: rgba(250, 204, 21, 0.35);
  color: #fff;
  border-radius: 2px;
}
.tpl-gen__stats {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  margin-top: 0.5rem;
}
.tpl-gen__stat {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.65rem;
  background: rgba(255, 255, 255, 0.02);
}
.tpl-gen__stat b {
  display: block;
  font-size: 1.1rem;
  margin-top: 0.2rem;
}
.tpl-gen__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.78rem;
  font-weight: 700;
}
.tpl-gen__toast-stack {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 1200;
  display: grid;
  gap: 0.5rem;
  width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}
.tpl-gen__toast-stack .toast {
  pointer-events: auto;
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  background: var(--card, #1b2838);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  font-size: 0.82rem;
  line-height: 1.4;
  animation: tpl-gen-toast-in 0.2s ease;
}
.tpl-gen__toast-stack .toast.success {
  border-color: rgba(52, 211, 153, 0.45);
}
.tpl-gen__toast-stack .toast.error {
  border-color: rgba(248, 113, 113, 0.45);
}
@keyframes tpl-gen-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 540px) {
  .tpl-gen textarea { font-size: 16px; }
  .tpl-gen__tool-grid .btn-sm { justify-content: center; }
}
@media (max-width: 720px) {
  .view-switch-tabs {
    flex-wrap: wrap;
    width: 100%;
  }
  .view-tab {
    flex: 1 1 auto;
    justify-content: center;
    font-size: 0.78rem;
    padding: 0.45rem 0.65rem;
  }
}



/* ——— Profile hero ——— */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
}
.profile-hero-avatar {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent-gradient);
  box-shadow: 0 0 24px var(--accent-glow);
}
.profile-hero-main { flex: 1; min-width: 0; }
.profile-hero-name {
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
  font-weight: 700;
}
.profile-hero-tags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.profile-trigger--compact {
  padding: 0.2rem 0.45rem 0.2rem 0.25rem;
  gap: 0.45rem;
  align-items: center;
}
.profile-trigger--brand {
  padding: 0.35rem 0.55rem 0.35rem 0.35rem;
  gap: 0.55rem;
}
.profile-meta--nav {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
  min-width: 0;
}
.profile-meta--nav .profile-name {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9rem;
}
.profile-meta--nav .profile-sub {
  font-size: 0.68rem;
  font-weight: 400;
  color: rgba(155, 214, 255, 0.95);
  text-transform: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9rem;
}
.profile-avatar--admin {
  font-family: var(--font-display, inherit);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
}
.profile-avatar--logo {
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}
.profile-avatar--logo .profile-avatar-img {
  object-fit: contain;
}


/* ——— Admin sidebar ——— */
:root {
  --admin-sidebar-w: 15.5rem;
}
.wrap-wide:has(> .admin-sidebar) {
  max-width: none;
  margin: 0;
  padding: 1.25rem 1.5rem 3rem calc(var(--admin-sidebar-w) + 1.5rem);
  min-height: 100vh;
  box-sizing: border-box;
}
.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  width: var(--admin-sidebar-w);
  height: 100vh;
  height: 100dvh;
  padding: 1rem 0.75rem 1rem;
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(12, 16, 28, 0.97), rgba(8, 10, 18, 0.98));
  border-right: 1px solid rgba(102, 192, 244, 0.14);

  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.admin-sidebar__brand {
  flex-shrink: 0;
  padding: 0.25rem 0.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 0.75rem;
}
.admin-sidebar__brand-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}

.admin-sidebar__brand-link:hover { text-decoration: none; }
.admin-sidebar__brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: 0;
  display: grid;
  place-items: center;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.admin-sidebar__brand-logo {
  width: 100%;
  height: 100%;
  display: block;

  object-fit: contain;
  filter: saturate(1.1) contrast(1.08);
}
.admin-sidebar__brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.admin-sidebar__brand-name {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
}
.admin-sidebar__brand-sub {
  font-size: 0.68rem;
  color: rgba(155, 214, 255, 0.85);
  margin-top: 0.1rem;
}
.admin-sidebar__nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(102, 192, 244, 0.35) transparent;
}
.admin-sidebar__group + .admin-sidebar__group {
  margin-top: 1rem;
}
.admin-sidebar__label {
  padding: 0 0.65rem 0.4rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(155, 214, 255, 0.55);
}
.admin-sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 500;
  color: #b8c4ce;
  text-decoration: none;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
  border: 1px solid transparent;
}
.admin-sidebar__link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}
.admin-sidebar__link.is-active {
  color: #fff;
  background: linear-gradient(180deg, rgba(102, 192, 244, 0.22), rgba(45, 115, 255, 0.14));
  border-color: rgba(102, 192, 244, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.admin-sidebar__ico {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  color: rgba(102, 192, 244, 0.9);
}
.admin-sidebar__link.is-active .admin-sidebar__ico {
  color: #9bd6ff;
}
.admin-sidebar__link-text {
  flex: 1 1 auto;
  min-width: 0;
}
.admin-sidebar__badge {
  flex-shrink: 0;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: #ef4444;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.admin-sidebar__badge.is-hidden {
  display: none;
}
.admin-support-chat-list {
  margin: 0;
}
.admin-chats-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.admin-chats-search-wrap {
  width: 100%;
  min-width: 0;
  margin: 0;
}
.admin-chats-search {
  width: 100%;
  margin-bottom: 0;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(102, 192, 244, 0.2);
  background: rgba(0, 0, 0, 0.32);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
}
.admin-chats-search:focus {
  outline: none;
  border-color: rgba(102, 192, 244, 0.45);
  box-shadow: 0 0 0 2px rgba(102, 192, 244, 0.15);
}
.admin-chats-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.ui-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: rgba(12, 10, 24, 0.85);
  color: #e8f0ff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), opacity 0.18s var(--ease);
}
.ui-pill:hover:not(:disabled) {
  color: #fff;
  background: rgba(102, 192, 244, 0.12);
  border-color: rgba(102, 192, 244, 0.42);
}
.ui-pill.is-active,
.ui-pill[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(180deg, rgba(102, 192, 244, 0.24), rgba(45, 115, 255, 0.16));
  border-color: rgba(102, 192, 244, 0.5);
  box-shadow: 0 0 0 1px rgba(102, 192, 244, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.ui-pill:disabled,
.ui-pill.is-busy {
  opacity: 0.55;
  cursor: wait;
}
.admin-chats-sort-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}
.admin-chats-sort-label {
  font-size: 0.78rem;
  color: rgba(155, 214, 255, 0.65);
  white-space: nowrap;
}
.ui-dropdown {
  position: relative;
}
.ui-dropdown__trigger {
  min-width: 9.5rem;
  justify-content: space-between;
}
.ui-dropdown__caret {
  flex-shrink: 0;
  color: rgba(155, 214, 255, 0.85);
  transition: transform 0.18s var(--ease);
}
.ui-dropdown.is-open .ui-dropdown__caret {
  transform: rotate(180deg);
}
.ui-dropdown__menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  left: 0;
  z-index: 30;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: #10121c;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}
.ui-dropdown__option {
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  color: #c5d0db;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.ui-dropdown__option:hover {
  background: rgba(102, 192, 244, 0.16);
  color: #fff;
}
.ui-dropdown__option.is-selected {
  background: rgba(102, 192, 244, 0.22);
  color: #fff;
}
.admin-chats-no-match {
  margin: 0.75rem 0 0.25rem;
  text-align: center;
  font-size: 0.88rem;
}
.chat-list-sub {
  display: block;
  font-size: 0.74rem;
  margin-top: 0.12rem;
}
.admin-stats-card {
  padding: 1.5rem 1.75rem;
}
.admin-stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.admin-stats-title {
  margin: 0;
  font-size: 1.15rem;
}
.admin-stats-daynav {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
}
.admin-stats-daynav__btn {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.admin-stats-daynav__btn:hover {
  background: rgba(168, 85, 247, 0.18);
  color: #fff;
  text-decoration: none;
}
.admin-stats-daynav__btn.is-disabled {
  opacity: 0.28;
  pointer-events: none;
}
.admin-stats-daynav__date {
  min-width: 5.5rem;
  padding: 0 0.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  text-align: center;
  white-space: nowrap;
}
.admin-stats-date {
  margin: 0.35rem 0 1.25rem;
  font-size: 0.88rem;
}
.admin-stats-list {
  display: flex;
  flex-direction: column;

  gap: 0;
}
.admin-stats-team {
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.admin-stats-team:last-child {
  border-bottom: none;
}
.admin-stats-team-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
  line-height: 1.3;
}
.admin-stats-team-name {

  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}
.admin-stats-team-sep {
  color: rgba(255, 255, 255, 0.28);
  font-weight: 400;
}
.admin-stats-team-tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.admin-stats-team-line {
  margin: 0.3rem 0 0;

  font-size: 0.92rem;
  color: var(--text-secondary);
}
.admin-stats-total {
  margin: 1.35rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}
.admin-stats-empty {
  margin: 0;
  padding: 1.5rem 0;
}
.admin-sidebar__footer {
  flex-shrink: 0;
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.profile-menu--sidebar {
  position: relative;
  margin: 0;
  width: 100%;
}
.profile-trigger--sidebar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  list-style: none;
  border: 1px solid transparent;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.profile-trigger--sidebar:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}
.profile-trigger--sidebar::-webkit-details-marker { display: none; }
.profile-meta--sidebar {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.profile-dropdown--sidebar {
  left: 0;
  right: auto;
  bottom: calc(100% + 0.35rem);
  top: auto;
  min-width: 100%;
}
.admin-mobile-bar,
.admin-sidebar-backdrop {
  display: none;
}
@media (min-width: 961px) {
  .admin-mobile-bar,
  .admin-mobile-bar__toggle,
  .admin-sidebar-backdrop {
    display: none !important;
  }
}
@media (max-width: 960px) {
  .wrap-wide:has(> .admin-sidebar) {
    padding: 3.75rem 1rem 2.5rem;
  }
  .admin-mobile-bar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 130;
    height: 3.25rem;
    padding: 0 1rem;
    background: rgba(10, 12, 20, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(102, 192, 244, 0.12);
    box-sizing: border-box;
  }
  .admin-mobile-bar__title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
  }
  .admin-mobile-bar__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid rgba(102, 192, 244, 0.25);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    cursor: pointer;
  }
  .admin-sidebar {
    top: 3.25rem;
    height: calc(100vh - 3.25rem);
    height: calc(100dvh - 3.25rem);
    transform: translateX(-105%);
    transition: transform 0.24s var(--ease);
    pointer-events: none;
  }
  body.admin-sidebar-open .admin-sidebar {
    transform: translateX(0);
    pointer-events: auto;
  }
  .admin-mobile-bar__toggle {
    position: relative;
    z-index: 140;
  }
  .admin-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 115;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s var(--ease);
  }
  body.admin-sidebar-open .admin-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  body.admin-sidebar-open .admin-sidebar-backdrop[hidden] {
    display: block;
  }
}

.profile-menu--admin {
  margin-left: auto;
  flex-shrink: 0;
}
.admin-users-avatar-col {
  width: 2.75rem;
  padding-right: 0.25rem !important;
}
.admin-user-avatar-link {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-decoration: none;
  background: linear-gradient(135deg, rgba(45, 115, 255, 0.35), rgba(102, 192, 244, 0.25));
  border: 1px solid rgba(102, 192, 244, 0.28);

  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), border-color 0.15s var(--ease);
}
.admin-user-avatar-link:hover {
  transform: scale(1.06);
  border-color: rgba(102, 192, 244, 0.55);
  box-shadow: 0 0 0 3px rgba(102, 192, 244, 0.12);
  text-decoration: none;
}
.admin-user-avatar-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.admin-user-avatar-letter {
  display: grid;
  place-items: center;
  width: 100%;

  height: 100%;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}
.admin-user-profile-card .sp-top {
  margin-bottom: 1rem;
}
.page-admin-user-profile .admin-profile-toolbar {
  margin: 0 0 1.15rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.page-admin-user-profile .admin-profile-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.18s var(--ease);
}
.page-admin-user-profile .admin-profile-back:hover {
  color: var(--text);
  text-decoration: none;
}
.page-admin-user-profile .profile-back-icon {
  font-size: 1rem;
  line-height: 1;
}
.admin-profile-message {
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.admin-profile-message-title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
}
.admin-profile-message-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: flex-start;
}
.admin-profile-message-form textarea {
  width: 100%;
  min-height: 5.5rem;
  resize: vertical;
  box-sizing: border-box;
}
.admin-profile-message-hint {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
}
.sp-level-chat {
  margin-top: 0.95rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.admin-profile-chat-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  box-sizing: border-box;
}
.admin-profile-chat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
}
.admin-support-chat-page {
  max-width: 720px;
  flex: 1;
  min-height: calc(100vh - 7rem);
}
.page-admin-support-chat .chat-panel {
  flex: 1 1 auto;
  max-height: none;
}
.admin-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.admin-user-admin-badge {
  border-color: rgba(167, 139, 250, 0.45);
  color: #e9d5ff;
}
.admin-team-link {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.admin-team-link:hover {
  color: #9bd6ff;
  text-decoration: underline;
}
.admin-team-detail-card {
  margin-bottom: 1rem;
}
.admin-team-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-top: 0.5rem;
}
.admin-team-detail-title {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
}
.admin-team-detail-sub {
  margin: 0.15rem 0 0;
  font-size: 0.84rem;
}
.admin-team-detail-balance {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(42, 71, 94, 0.5) 0%, rgba(23, 33, 43, 0.85) 100%);
  border: 1px solid var(--border);
  min-width: 200px;
}
.admin-team-detail-balance-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-team-detail-balance-val {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.35rem;
  font-weight: 700;
}
.admin-team-balance-form {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
}
.admin-team-balance-form--inline {
  margin-top: 0;
  display: inline-flex;
  flex-wrap: nowrap;
}
.admin-team-balance-form input {
  width: 5.5rem;
  margin: 0;
}
.admin-team-balance-actions {
  display: flex;
  gap: 0.35rem;
}
.admin-balance-btn {
  min-width: 2.35rem;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.admin-balance-btn--sub {
  border-color: rgba(248, 113, 113, 0.35);
}
.admin-balance-btn--sub:hover {
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecaca;
}
.admin-team-detail-strip {
  margin-top: 1.15rem;
}
.admin-team-member-link {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.admin-team-member-link:hover {
  color: #9bd6ff;
  text-decoration: underline;
}
.admin-team-member-tg {
  display: block;
  font-size: 0.76rem;
  margin-top: 0.1rem;
}
.admin-team-detail-actions {
  margin-top: 1rem;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.admin-users-actions-col {
  width: 6.5rem;
  white-space: nowrap;
  position: sticky;
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(12, 14, 22, 0.92) 24%);
}
.admin-users-delete-form {
  margin: 0;
}
.table-wrap:has(.admin-users-actions-col) {
  overflow-x: auto;
}
@media (max-width: 520px) {
  .profile-trigger--brand .profile-caret {
    display: none;
  }
}
.profile-avatar-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}
.profile-trigger--compact .profile-avatar {
  width: 37px;
  height: 37px;
  font-size: 1rem;
  border-radius: var(--radius);
}
.profile-trigger-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
  box-shadow: 0 0 0 2px #171a21;
  pointer-events: none;
}
.profile-trigger-badge.is-hidden {
  display: none;
}
.profile-trigger-badge--support {
  top: auto;
  bottom: -4px;
  left: -4px;
  right: auto;
  background: #ef4444;
}
.profile-item-badge.is-hidden {
  display: none;
}
.profile-avatar-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}
.profile-avatar-img--lg {
  border-radius: inherit;
}

.settings-avatar {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 1rem;
}
.settings-avatar-preview {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent-gradient);
  box-shadow: 0 0 24px var(--accent-glow);
  overflow: hidden;
}
.settings-avatar-form {
  flex: 1;
  min-width: 0;
}
.profile-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.profile-head-avatar {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  background: var(--accent-gradient);
}
.profile-head-meta { display: flex; flex-direction: column; min-width: 0; }
.profile-head-name { font-weight: 600; font-size: 0.92rem; }
.profile-head-wallet { font-size: 0.78rem; color: var(--accent); }

@media (max-width: 600px) {
  .profile-meta { display: none; }
  .profile-dropdown { min-width: 200px; }
}



/* ——— Steam-style profile page ——— */
.sp-top {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: stretch;
  margin-bottom: 1.25rem;
}
.sp-id {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex: 1 1 320px;
  min-width: 0;
}
.sp-avatar {
  width: 184px;
  height: 184px;
  flex-shrink: 0;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 3.85rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent-gradient);
  box-shadow: 0 0 28px var(--accent-glow);
  border: 1px solid rgba(102, 192, 244, 0.4);
}
.sp-avatar .profile-avatar-img {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.sp-avatar-letter {
  position: relative;
  z-index: 0;
  line-height: 1;
}
.sp-avatar--has-img .sp-avatar-letter {
  display: none;
}
.sp-id-meta { min-width: 0; }
.sp-name {
  margin: 0 0 0.2rem;
  font-size: 2.85rem;
  font-weight: 700;
  line-height: 1.1;
}
.sp-login {
  display: block;
  font-size: 1.12rem;
  color: var(--text-secondary);
}
.sp-tg {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 1.02rem;
  color: var(--accent);
}

@media (max-width: 900px) {
  .sp-avatar {
    width: 132px;
    height: 132px;
    font-size: 3rem;
  }
  .sp-name { font-size: 2.15rem; }
  .sp-login { font-size: 0.98rem; }
  .sp-tg { font-size: 0.9rem; }
}
.sp-level {
  flex: 1 1 300px;
  min-width: 0;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(42, 71, 94, 0.5) 0%, rgba(23, 33, 43, 0.85) 100%);
  border: 1px solid var(--border);
  border-top: 1px solid rgba(102, 192, 244, 0.22);
}
.sp-level-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.sp-level-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sp-level-badge {
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: rgba(102, 192, 244, 0.18);
  border: 1px solid rgba(102, 192, 244, 0.4);
}
.sp-level-xp {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.sp-xp-ico {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #cfe8ff;
  background: linear-gradient(135deg, #2a475e, #1b2838);
  border: 1px solid rgba(102, 192, 244, 0.3);
}
.sp-xp-title { font-size: 0.95rem; font-weight: 600; }
.sp-xp-sub { font-size: 0.8rem; color: var(--text-secondary); }
.sp-edit {
  display: inline-flex;
  margin-top: 0.9rem;
}

.sp-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1.25rem;
  align-items: start;
}
.sp-activity-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.sp-activity-head h2 { margin: 0; }
.sp-feed {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.sp-feed-row {
  display: grid;
  grid-template-columns: 10px 130px 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}
.sp-feed-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.sp-feed-dot.is-ok { background: var(--ok); }
.sp-feed-dot.is-fail { background: var(--err); }
.sp-feed-dot.is-queue { background: #9ca3af; }
.sp-feed-phone { font-weight: 600; }
.sp-feed-text {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-feed-status {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.sp-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sp-side-card { margin-bottom: 0; padding: 1.1rem 1.2rem; }
.sp-status {
  display: inline-flex;
  align-items: center;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
}
.sp-status--ok { color: #6ee7b7; }
.sp-status--wait { color: #fde68a; }
.sp-status--off { color: var(--text-secondary); }
.sp-side-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  text-align: center;
}
.sp-side-stats b {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}
.sp-side-stats span {
  font-size: 0.72rem;
  color: var(--text-secondary);
}
.sp-side-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.sp-side-row-title {
  font-size: 1.05rem;
  font-weight: 600;
}
.sp-side-row-num { color: var(--accent); font-size: 0.9rem; }
.sp-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}
.sp-badge {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #2a475e, #1b2838);
  border: 1px solid rgba(102, 192, 244, 0.3);
}
.sp-side-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.82rem;
}
.sp-links { display: flex; flex-direction: column; gap: 0.15rem; }
.sp-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid var(--border);
  color: #c6d4df;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.15s var(--ease);
}
.sp-link:last-child { border-bottom: none; }
.sp-link:hover { color: var(--accent); text-decoration: none; }
.sp-link b { color: var(--text-secondary); font-weight: 600; font-size: 0.85rem; }
.sp-link:hover b { color: var(--accent); }
.sp-idcode {
  display: block;
  margin-top: 0.4rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
}
/* ——— SMS chart ——— */
.sp-chart { position: relative; }
.chart-radio { position: absolute; opacity: 0; pointer-events: none; }
.sp-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.sp-chart-head h2 { margin: 0; }
.chart-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
}
.chart-switch label {
  padding: 0.3rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  user-select: none;
}
.chart-switch label:hover { color: #fff; }
#cr-day:checked ~ .sp-chart-head .chart-switch label[for="cr-day"],
#cr-week:checked ~ .sp-chart-head .chart-switch label[for="cr-week"],
#cr-month:checked ~ .sp-chart-head .chart-switch label[for="cr-month"] {
  color: #fff;
  background: var(--accent-gradient);
  box-shadow: 0 0 12px var(--accent-glow);
}
.chart-panel { display: none; }
#cr-day:checked ~ .cp-day,
#cr-week:checked ~ .cp-week,
#cr-month:checked ~ .cp-month { display: block; }
.chart-sub { font-size: 0.78rem; margin: 0 0 0.6rem; }
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 180px;
  padding-top: 4px;
}
.chart-bars--dense { gap: 2px; }
.chart-col {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
}
.chart-bar {
  width: 100%;
  min-height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--accent-gradient);
  box-shadow: 0 0 8px var(--accent-glow);
  transition: filter 0.15s var(--ease);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}
.chart-bar.is-zero {
  min-height: 2px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: none;
}
.chart-bar-val {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s var(--ease);
  line-height: 1;
  z-index: 1;
}
.chart-bars--dense .chart-bar-val {
  font-size: 0.58rem;
}
.chart-col:hover .chart-bar:not(.is-zero) { filter: brightness(1.25); }
.chart-col:hover .chart-bar:not(.is-zero) .chart-bar-val { opacity: 1; }
.chart-xlabel {
  font-size: 0.62rem;
  color: var(--text-secondary);
  white-space: nowrap;
  height: 0.8em;
  line-height: 1;
}
.chart-bars--dense .chart-xlabel { font-size: 0.55rem; }

@media (max-width: 880px) {
  .sp-body { grid-template-columns: 1fr; }
  .sp-feed-row { grid-template-columns: 10px 110px 1fr; }
  .sp-feed-status { display: none; }
  .chart-bars { height: 150px; }
}

/* ── Профиль: выровненная раскладка ── */
.sp-top { align-items: stretch; gap: 1.5rem; margin-bottom: 1.5rem; }
.sp-id { flex: 1 1 340px; }
.sp-level { flex: 0 0 360px; max-width: 420px; }

.sp-status-pill {
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--glass-border);
}
.sp-status-pill.sp-status--ok { color: #6ee7b7; background: rgba(52, 211, 153, 0.12); }
.sp-status-pill.sp-status--wait { color: #fde68a; background: rgba(251, 191, 36, 0.12); }
.sp-status-pill.sp-status--off { color: var(--text-secondary); background: rgba(255, 255, 255, 0.05); }

/* Полоса статистики */
.sp-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}
.sp-tile {
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.sp-tile b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sp-tile span {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* График — на всю ширину */
.sp-body {
  display: block;
  margin-bottom: 1.5rem;
}
.sp-chart { margin-bottom: 0; }
.chart-bars { height: 240px; }

/* Нижний ряд из 3 равных карточек */
.sp-cards3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  align-items: stretch;
}
.sp-cards3 .sp-side-card { margin-bottom: 0; }

@media (max-width: 900px) {
  .sp-strip { grid-template-columns: repeat(3, 1fr); }
  .sp-cards3 { grid-template-columns: 1fr; }
  .sp-level { flex-basis: 100%; max-width: none; }
}
@media (max-width: 560px) {
  .sp-strip { grid-template-columns: repeat(2, 1fr); }
}

/* ── Нарисованные иконки ачивок ── */
.ach-svg {
  width: 40px;
  height: 40px;
  display: block;
  color: #c9b6ff;
}
.steam-badge .ach-svg { width: 40px; height: 40px; }
.steam-badge-preview .ach-svg { width: 50px; height: 50px; }
.steam-ach-tile.unlocked .ach-svg,
.steam-badge-preview.unlocked .ach-svg {
  color: #c7b2ff;
  filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.5));
}
.steam-ach-tile.locked .ach-svg,
.steam-badge-preview.locked .ach-svg { color: #8884ad; }
.sp-badge .ach-svg {
  width: 22px;
  height: 22px;
  color: #d7c9ff;
  filter: drop-shadow(0 0 5px rgba(168, 85, 247, 0.45));
}

/* ── Тарифная лестница ── */
.pay-tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.7rem;
  margin-top: 0.5rem;
}
.pay-tier {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.pay-tier.active {
  border-color: var(--border-strong);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.16), rgba(34, 211, 238, 0.1));
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.25);
}
.pay-tier-range { font-size: 0.78rem; color: var(--text-secondary); }
.pay-tier-price {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.pay-balance {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  margin: 0.1rem 0 0.2rem;
}
.pricing-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.pricing-table th {
  text-align: left;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.3rem 0.5rem;
}
.pricing-table td { padding: 0.3rem 0.5rem; }
.pricing-table input { width: 100%; }



/* Мобильная нижняя навигация */
.mobile-bottom-nav {
  display: none;
}
@media (max-width: 768px) {
  body:not(.page-auth) .app-root {
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  }
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    justify-content: space-around;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.35rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
    background: rgba(12, 12, 24, 0.92);
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
  }
  .mobile-bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.35rem 0.2rem;
    font-size: 0.68rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    transition: color 0.15s, background 0.15s;
  }
  .mobile-bottom-nav__item.active {
    color: var(--text);
    background: rgba(168, 85, 247, 0.12);
  }
  .mobile-bottom-nav__ico {
    font-size: 1.15rem;
    line-height: 1;
  }
}

.onboarding-card { max-width: 28rem; margin: 0 auto; }
.onboarding-steps {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}
.onboarding-step {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
}
.onboarding-step.active {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(168, 85, 247, 0.1);
}
.onboarding-step.done {
  opacity: 0.7;
}

.settings-header {
  margin-bottom: 1.25rem;
}
.settings-page-title {
  margin: 0 0 0.75rem;
}

/* ——— Settings Tabs (game-style) ——— */
.stabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding: 4px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.stabs__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
}
.stabs__btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}
.stabs__btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.45), rgba(88, 60, 196, 0.55));
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}
.stabs__ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}
.stabs__btn.is-active .stabs__ico {
  opacity: 1;
}
@media (max-width: 480px) {
  .stabs { gap: 0.2rem; padding: 3px; }
  .stabs__btn { padding: 0.4rem 0.65rem; font-size: 0.75rem; gap: 0.25rem; }
  .stabs__ico { width: 14px; height: 14px; }
}

/* Hide non-active tab panels */
.settings-panel[data-stab-panel] {
  display: none;
}
.settings-panel[data-stab-panel].is-active-tab {
  display: block;
}
.settings-alerts {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.settings-alerts:empty {
  display: none;
}
.settings-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  align-items: start;
}
.settings-panel {
  padding: 1.15rem 1.25rem;
}
.settings-panel-title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.settings-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.settings-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  font-size: 0.82rem;
}
.settings-chip-label {
  color: var(--text-secondary);
}
.settings-chip-value {
  font-weight: 600;
}
.settings-chip-copy {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0 0.15rem;
  font-size: 1rem;
  line-height: 1;
  border-radius: 4px;
}
.settings-chip-copy:hover,
.settings-chip-copy.copied {
  color: var(--accent, #a855f7);
}
.settings-tip {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.settings-form {
  margin-top: 0.25rem;
}
.settings-fields {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1rem;
}
@media (min-width: 520px) {
  .settings-panel--account .settings-fields {
    grid-template-columns: 1fr 1fr;
  }
}
.settings-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.settings-field input[type="text"],
.settings-field input[type="password"] {
  width: 100%;
}
.settings-field-hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.settings-submit {
  width: 100%;
  margin-top: 0.25rem;
}
.settings-panel--account .settings-submit {
  max-width: 16rem;
}
@media (min-width: 520px) {
  .settings-panel--account .settings-submit {
    width: auto;
    min-width: 14rem;
  }
}
.settings-avatar-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.settings-panel--avatar .settings-avatar-preview {
  width: 72px;
  height: 72px;
  margin-top: 0;
}
.settings-avatar-controls {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.settings-file-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  cursor: pointer;
}
.settings-file-btn {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius);
  border: 1px dashed var(--glass-border);
  font-size: 0.85rem;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.settings-file-label:hover .settings-file-btn {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
}
.settings-file-name {
  font-size: 0.78rem;
  word-break: break-all;
}
.settings-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.settings-sound-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.settings-sound-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 2.75rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
}
.settings-sound-row.is-muted {
  opacity: 0.72;
}
.settings-sound-icon {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.settings-sound-icon:hover {
  color: var(--text);
  border-color: rgba(102, 192, 244, 0.45);
  background: rgba(102, 192, 244, 0.08);
}
.settings-sound-row.is-muted .settings-sound-icon {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.35);
}
.settings-sound-ico {
  display: none !important;
  width: 18px;
  height: 18px;
}
.settings-sound-row:not(.is-muted) .settings-sound-ico--on,
.settings-sound-row.is-muted .settings-sound-ico--off {
  display: block !important;
}
.settings-sound-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.settings-sound-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: normal;
}
.settings-sound-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 0.35rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
}
.settings-sound-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  background: #66c0f4;
  border: 2px solid rgba(7, 6, 15, 0.9);
  box-shadow: 0 0 0 1px rgba(102, 192, 244, 0.35);
  cursor: pointer;
}
.settings-sound-range::-moz-range-thumb {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  background: #66c0f4;
  border: 2px solid rgba(7, 6, 15, 0.9);
  cursor: pointer;
}
.settings-sound-range::-moz-range-track {
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}
.settings-panel--sounds .settings-sound-range,
.settings-panel--sounds input.settings-sound-range {
  width: 100%;
  height: 0.35rem;
  min-height: 0.35rem;
  max-height: 1.25rem;
  margin: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 999px;
  box-shadow: none;
}
.settings-panel--sounds .settings-sound-range:focus,
.settings-panel--sounds input.settings-sound-range:focus {
  border: none !important;
  box-shadow: 0 0 0 2px rgba(102, 192, 244, 0.25) !important;
}
.settings-sound-pct {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  text-align: right;
}
.settings-sound-row.is-muted .settings-sound-pct {
  color: #fca5a5;
}
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.78rem; }

/* ——— API key section ——— */
.api-key-box {
  margin-top: 0.75rem;
}
.api-key-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.75rem;
}
.api-key-value {
  flex: 1;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  color: var(--text);
  word-break: break-all;
  user-select: all;
}
.api-key-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.api-key-action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}
.api-key-actions {
  display: flex;
  gap: 0.5rem;
}
.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #fff;
}

/* ——— API docs ——— */
.api-docs {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}
.api-docs__title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.api-docs__desc {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.api-docs__desc code {
  background: rgba(255,255,255,0.07);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.8rem;
}
.api-docs__section {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.api-docs__method {
  margin: 0 0 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.api-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.api-badge--post { background: rgba(34,197,94,0.2); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.api-badge--get { background: rgba(59,130,246,0.2); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.api-docs__params {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0.4rem 0;
}
.api-docs__param {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding-left: 0.5rem;
}
.api-docs__param code {
  background: rgba(255,255,255,0.07);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.78rem;
  color: var(--text);
}
.api-req {
  font-size: 0.7rem;
  color: #f87171;
  font-weight: 600;
  text-transform: uppercase;
}
.api-docs__label {
  margin: 0.5rem 0 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.api-docs__code {
  display: block;
  margin: 0.4rem 0 0;
  padding: 0.75rem 0.85rem;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  color: #e2e8f0;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}
.api-docs__codeblock[hidden] { display: none; }
.api-docs__example {
  margin-top: 0.75rem;
}
.api-docs__example-header {
  display: flex;
  gap: 0.25rem;
  margin-bottom: -1px;
  position: relative;
  z-index: 1;
}
.api-docs__tab {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: rgba(0,0,0,0.2);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.api-docs__tab:hover { color: var(--text); background: rgba(0,0,0,0.3); }
.api-docs__tab.is-active {
  color: #fff;
  background: rgba(139,92,246,0.25);
  border-color: rgba(139,92,246,0.4);
}

.team-member-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.team-member-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
}
.team-member-main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1;
}
.team-member-avatar {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  background: var(--accent-gradient);
  overflow: hidden;
  position: relative;
}
.team-member-avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--accent-gradient);
}
.team-member-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.team-member-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.team-member-name {
  font-weight: 600;
  font-size: 1rem;
}
.team-member-tg {
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.team-member-meta {
  font-size: 0.78rem;
}
.team-member-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.team-member-remove-form {
  margin: 0;
}

.page-member-profile header.site {
  margin-bottom: 0.85rem;
}
.profile-back-bar {
  position: sticky;
  top: calc(var(--nav-h) + 0.65rem);
  z-index: 110;
  margin: 0 0 0.75rem;
  isolation: isolate;
}
.profile-back-bar .profile-back-btn {
  position: relative;
  z-index: 2;
  pointer-events: auto;
}
.page-member-profile .profile-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0.2rem 0;
  border: none;
  background: transparent;
  box-shadow: none;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.page-member-profile .profile-back-btn:hover,
.page-member-profile .profile-back-btn:focus-visible {
  color: var(--text);
  background: transparent;
  text-decoration: none;
}
.page-member-profile .profile-back-icon {
  font-size: 1rem;
  line-height: 1;
  opacity: 0.85;
}
.page-member-profile .member-profile-chat {
  margin-top: 0.75rem;
  padding-top: 0;
  border-top: none;
}
@media (max-width: 768px) {
  .page-member-profile .profile-back-bar {
    top: 8.25rem;
  }
}
.member-profile-id {
  display: block;
  font-size: 0.82rem;
  margin-top: 0.2rem;
}
.chat-list-toolbar {
  margin-bottom: 0.75rem;
}
.chat-list-search {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}
.chat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.chat-list-item {
  margin: 0;
}
.chat-list-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, background 0.2s;
}
.chat-list-link:hover {
  border-color: var(--border-strong);
  background: rgba(102, 192, 244, 0.06);
  text-decoration: none;
  color: inherit;
}
.chat-list-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--accent-gradient);
  font-weight: 700;
  color: #fff;
}
.chat-list-avatar .profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chat-list-avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}
.chat-list-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.chat-list-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.chat-list-time {
  font-size: 0.72rem;
  flex-shrink: 0;
}
.chat-list-item--unread .chat-list-phone {
  font-weight: 700;
}
.chat-list-phone {
  font-weight: 600;
  font-size: 0.95rem;
}
.chat-list-preview {
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.member-profile-chat {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.member-profile-chat-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
}
.member-profile-chat-form textarea {
  width: 100%;
  min-height: 4rem;
  resize: vertical;
}

.page-chat-thread .chat-page-wrap {
  max-width: 720px;
}
.page-chat-thread header.site {
  margin-bottom: 0.85rem;
}
.page-chat-thread:has(.profile-menu[open]) .chat-toolbar {
  z-index: 1;
}
.chat-page {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: calc(100vh - 5.5rem);
}
.chat-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  margin: 0;
  position: sticky;
  top: calc(var(--nav-h) + 0.65rem);
  z-index: 110;
  isolation: isolate;
  background: linear-gradient(180deg, rgba(20, 18, 38, 0.98), rgba(20, 18, 38, 0.92));
}
.chat-back-btn {
  grid-column: 1;
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.chat-back-btn:hover,
.chat-back-btn:focus-visible {
  color: #fff;
  background: rgba(102, 192, 244, 0.15);
  border-color: rgba(102, 192, 244, 0.35);
  text-decoration: none;
}
.chat-back-icon {
  font-size: 1.2rem;
  line-height: 1;
}
.chat-back-label {
  display: none;
}
@media (min-width: 420px) {
  .chat-back-label {
    display: inline;
  }
  .chat-back-btn {
    min-width: 5.5rem;
  }
}
@media (max-width: 768px) {
  .page-chat-thread .chat-toolbar {
    top: 8.25rem;
  }
}
.chat-delete-form {
  grid-column: 3;
  margin: 0;
  flex-shrink: 0;
}
.chat-delete-btn {
  white-space: nowrap;
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
}
.chat-peer-link {
  grid-column: 2;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s var(--ease);
}
.chat-peer-link:hover {
  background: rgba(102, 192, 244, 0.1);
  text-decoration: none;
  color: inherit;
}
.chat-peer-avatar {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--accent-gradient);
  font-weight: 700;
  color: #fff;
}
.chat-peer-avatar .profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chat-peer-avatar--logo {
  background: transparent;
  border-radius: var(--radius-sm);
}
.chat-peer-avatar--logo .brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: saturate(1.1) contrast(1.08);
}
.chat-peer-name--support {
  color: #ef4444;
}
.support-online-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.support-online-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.25);
  flex-shrink: 0;
}
.chat-peer-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.chat-peer-name {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-peer-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.chat-peer-chevron {
  flex-shrink: 0;
  font-size: 1.35rem;
  color: var(--accent);
  opacity: 0.85;
}
.chat-panel {
  flex: 1;
  min-height: 280px;
  max-height: min(58vh, 520px);
  overflow: hidden;
  padding: 0.65rem 0.75rem 0.5rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.chat-panel .chat-bubbles {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.5rem 0.35rem 0.35rem;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.5rem;
}
.chat-bubbles {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.chat-bubble {
  position: relative;
  max-width: min(82%, 440px);
  padding: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: default;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.chat-bubble:hover {
  border-color: var(--border-strong);
}
.chat-bubble--mine {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.38), rgba(102, 192, 244, 0.24));
  border-color: rgba(102, 192, 244, 0.42);
  border-bottom-right-radius: var(--radius-sm);
}
.chat-bubble--theirs {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.07);
  border-bottom-left-radius: var(--radius-sm);
}
@media (hover: none), (pointer: coarse) {
  .chat-bubble-reply-btn {
    opacity: 0.9;
  }
}
.chat-bubble-reply-btn {
  position: absolute;
  top: auto;
  bottom: 0.2rem;
  left: 0.25rem;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border: 1px solid rgba(196, 122, 255, 0.35);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #d8b4ff;
  font-size: 0.82rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s ease, background 0.15s ease, transform 0.12s ease;
  z-index: 2;
}
.chat-bubble--mine .chat-bubble-reply-btn {
  left: auto;
  right: 0.25rem;
}
.chat-bubble:hover .chat-bubble-reply-btn,
.chat-bubble--selected .chat-bubble-reply-btn {
  opacity: 1;
}
.chat-bubble-reply-btn:hover {
  background: rgba(102, 192, 244, 0.2);
  border-color: var(--border-strong);
}
.chat-bubble-inner {
  padding: 0.45rem 0.55rem 0.35rem 0.6rem;
}
.chat-bubble--has-reply {
  overflow: hidden;
}
.chat-bubble--has-reply .chat-bubble-inner {
  padding: 0;
}
.chat-bubble-content {
  display: block;
  min-width: 2.5rem;
}
.chat-bubble--has-reply .chat-bubble-content {
  padding: 0.35rem 0.55rem 0.3rem 0.55rem;
}
.chat-bubble--has-reply .chat-bubble-text {
  display: block;
}
.chat-bubble-text {
  display: inline;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
}
.chat-bubble-footer {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  float: right;
  position: relative;
  top: 0.45rem;
  margin-left: 0.5rem;
  margin-bottom: 0.05rem;
  vertical-align: bottom;
  user-select: none;
}
.chat-bubble-footer-pad {
  display: inline-block;
  width: 0;
  height: 0.95rem;
}
.chat-bubble-time {
  font-size: 0.68rem;
  line-height: 1;
  color: var(--text-secondary);
  white-space: nowrap;
}
.chat-bubble-status {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.chat-ticks {
  display: inline-flex;
  align-items: center;
  font-style: normal;
  font-size: 1.05rem;
  line-height: 1;
}
.chat-ticks--sent {
  color: rgba(155, 214, 255, 0.85);
}
.chat-tick {
  font-style: normal;
  font-weight: 700;
}
.chat-tick--2 {
  margin-left: -0.34em;
}
.chat-ticks--read {
  color: var(--ok);
}
.chat-ticks--read .chat-tick--2 {
  color: #c8e86a;
}
.chat-ticks--pending {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.75rem;
}
.chat-ticks--fail {
  color: #ff8a8a;
  font-weight: 700;
}


/* Цитата ответа (как в Telegram: полоска + имя + текст внутри пузыря) */
.chat-bubble-reply {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0;
  padding: 0.28rem 0.5rem 0.32rem 0.4rem;
  min-height: 2.15rem;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.22);
  cursor: pointer;
  overflow: hidden;
  transition: background 0.12s ease;
}
.chat-bubble-reply:hover {
  background: rgba(0, 0, 0, 0.3);
}
.chat-bubble--mine .chat-bubble-reply {
  background: rgba(0, 0, 0, 0.16);
  border-bottom-color: rgba(255, 255, 255, 0.09);
}
.chat-bubble--theirs .chat-bubble-reply {
  background: rgba(0, 0, 0, 0.26);
}
.chat-bubble-reply-bar {
  flex-shrink: 0;
  width: 2px;
  border-radius: 2px;
  margin-right: 0.45rem;
  align-self: stretch;
}
.chat-bubble-reply--quote-theirs .chat-bubble-reply-bar {
  background: #c47aff;
}
.chat-bubble-reply--quote-mine .chat-bubble-reply-bar {
  background: #6bcbef;
}
.chat-bubble-reply-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.06rem;
}
.chat-bubble-reply-author {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-bubble-reply--quote-theirs .chat-bubble-reply-author {
  color: #c47aff;
}
.chat-bubble-reply--quote-mine .chat-bubble-reply-author {
  color: #6bcbef;
}
.chat-bubble-reply-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.78rem;
  line-height: 1.32;
  color: rgba(255, 255, 255, 0.62);
  word-break: break-word;
}
.chat-bubble--has-reply.chat-bubble--mine {
  border-color: rgba(102, 192, 244, 0.5);
}
.chat-bubble--selected {
  outline: 2px solid rgba(102, 192, 244, 0.55);
  outline-offset: 2px;
  box-shadow: 0 0 0 1px rgba(102, 192, 244, 0.25);
}
.chat-bubble--flash {
  animation: chat-bubble-flash 1.4s ease;
}
@keyframes chat-bubble-flash {
  0%, 100% { filter: brightness(1); }
  35% { filter: brightness(1.35); }
}
.chat-panel .chat-typing-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.35rem 0 0;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(102, 192, 244, 0.12);
  border: 1px solid var(--border-strong);
  font-size: 0.84rem;
  color: var(--accent);
  font-weight: 500;
}
.chat-typing-bar[hidden],
.chat-typing-compose[hidden] {
  display: none !important;
}
.chat-typing-dots {
  width: 1.25rem;
  height: 0.35rem;
  background: radial-gradient(circle, var(--accent) 38%, transparent 42%) 0 50% / 0.42rem 100%,
    radial-gradient(circle, var(--accent) 38%, transparent 42%) 50% 50% / 0.42rem 100%,
    radial-gradient(circle, var(--accent) 38%, transparent 42%) 100% 50% / 0.42rem 100%;
  animation: chat-typing-pulse 1s ease-in-out infinite;
}
@keyframes chat-typing-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
.chat-bubble--pending {
  opacity: 0.82;
}
.chat-bubble--failed {
  border-color: rgba(248, 113, 113, 0.45);
}
.chat-bubble-retry {
  margin-top: 0.35rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
}
.chat-peer-sub--typing {
  color: var(--accent) !important;
  font-style: italic;
}
/* Панель ответа над полем ввода (цитата как в Telegram) */
.chat-reply-preview {
  display: none;
  align-items: stretch;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  padding: 0.45rem 0.5rem 0.45rem 0.45rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(196, 122, 255, 0.35);
  border-left: 3px solid #c47aff;
}
.chat-reply-preview.is-visible {
  display: flex;
}
.chat-reply-preview-tag {
  flex-shrink: 0;
  align-self: center;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #d8b4ff;
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-sm);
  background: rgba(196, 122, 255, 0.15);
}
.chat-reply-preview-bar {
  display: none;
}
.chat-reply-preview--to-theirs {
  border-left-color: #c47aff;
}
.chat-reply-preview--to-mine {
  border-left-color: #6bcbef;
}
.chat-compose-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
}
.chat-compose-top.is-hidden {
  display: none;
}
.chat-compose-top.is-disabled {
  opacity: 0.55;
}
.chat-auto-reply {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  flex: 1;
  min-width: 0;
}
.chat-auto-reply input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.chat-auto-reply-box {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.12rem;
  border-radius: 0.25rem;
  border: 2px solid rgba(196, 122, 255, 0.55);
  background: rgba(0, 0, 0, 0.25);
  transition: background 0.12s ease, border-color 0.12s ease;
}
.chat-auto-reply input:checked + .chat-auto-reply-box {
  background: #c47aff;
  border-color: #c47aff;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35);
}
.chat-auto-reply-label {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}
.chat-auto-reply-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}
.chat-auto-reply-sub {
  font-size: 0.75rem;
}
.chat-pick-reply-btn {
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 0.28rem 0.5rem;
}
.chat-reply-preview-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}
.chat-reply-preview-author {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-reply-preview--to-theirs .chat-reply-preview-author {
  color: #c47aff;
}
.chat-reply-preview--to-mine .chat-reply-preview-author {
  color: #6bcbef;
}
.chat-reply-preview-text {
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-reply-preview-cancel {
  flex-shrink: 0;
  align-self: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-left: 0.35rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.55);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.chat-reply-preview-cancel:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.chat-compose-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
  line-height: 1.35;
}
.chat-hint-item::before {
  content: "·";
  margin-right: 0.35rem;
  opacity: 0.45;
}
.chat-hint-item:first-child::before {
  content: none;
  margin: 0;
}
.page-chat-thread .chat-compose-bar {
  position: sticky;
  bottom: 0.5rem;
  z-index: 100;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
}
.chat-send-btn {
  min-width: 2.75rem;
  min-height: 2.75rem;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chat-send-icon {
  font-size: 1.15rem;
  line-height: 1;
}
.chat-typing-compose {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  background: rgba(102, 192, 244, 0.1);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--accent);
  font-weight: 500;
}
.page-chat-thread .chat-compose-bar.card {
  background: var(--glass);
  border: 1px solid var(--border);
}
.mobile-bottom-nav__badge {
  position: absolute;
  top: 0.1rem;
  right: 0.15rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1rem;
  text-align: center;
}
.mobile-bottom-nav__badge.is-hidden {
  display: none;
}
.mobile-bottom-nav__item {
  position: relative;
}
@media (max-width: 768px) {
  .mobile-bottom-nav__item {
    font-size: 0.62rem;
  }
  .mobile-bottom-nav__ico {
    font-size: 1rem;
  }
}
.chat-thread-empty {
  margin: auto 0;
  text-align: center;
  font-size: 0.88rem;
}
.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}
.chat-quick-replies .ui-pill:active:not(:disabled) {
  transform: scale(0.98);
}
.page-chat-thread .chat-compose-bar {
  margin: 0;
  padding: 0.5rem 0.75rem 0.65rem;
}
.page-chat-thread .chat-compose-inner {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
}
.page-chat-thread .chat-compose-inner textarea {
  flex: 1;
  min-height: 2.75rem;
  max-height: 8rem;
  resize: none;
  margin: 0;
  padding: 0.65rem 0.95rem;
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.4;
}
.chat-send-btn {
  flex-shrink: 0;
  width: 2.65rem;
  height: 2.65rem;
  padding: 0;
  border-radius: 50%;
  font-size: 1.15rem;
  line-height: 1;
}
.chat-compose-hint {
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
}
.btn-block {
  display: block;
  width: 100%;
  text-align: center;
}
.chat-empty-title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.team-stats-strip {
  margin-top: 1rem;
}
.sp-tile--balance b {
  color: var(--accent);
}
.team-balance-value {
  color: var(--accent);
}
@media (max-width: 520px) {
  .team-member-card {
    flex-direction: column;
    align-items: stretch;
  }
  .team-member-actions {
    justify-content: flex-end;
  }
}

/* ——— Reward FX: ранг / ачивка ——— */
.reward-fx-root {
  position: fixed;
  inset: 0;
  z-index: 12000;
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.25rem;
}
.reward-fx {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}
.reward-fx.is-in {
  animation: reward-fx-fade-in 0.35s ease forwards;
}
.reward-fx.is-out {
  animation: reward-fx-fade-out 0.35s ease forwards;
}
.reward-fx--achievement {
  align-items: flex-start;
  padding-top: max(1.25rem, env(safe-area-inset-top, 0px));
}
.reward-fx__backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(88, 60, 180, 0.22), rgba(7, 6, 15, 0.45) 62%);
}
.reward-fx__card {
  position: relative;
  z-index: 1;
  overflow: hidden;
}
.reward-fx__card--rank {
  min-width: min(320px, 92vw);
  max-width: 420px;
  padding: 1.35rem 1.6rem 1.45rem;
  border-radius: 18px;
  text-align: center;
  background: linear-gradient(160deg, rgba(36, 28, 68, 0.96), rgba(14, 12, 28, 0.98));
  border: 1px solid rgba(168, 130, 255, 0.45);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 18px 50px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(124, 58, 237, 0.28);
  transform: translateY(18px) scale(0.92);
}
.reward-fx--rank.is-in .reward-fx__card--rank {
  animation: reward-fx-rank-pop 0.55s cubic-bezier(0.2, 0.9, 0.25, 1.15) forwards;
}
.reward-fx--rank.is-out .reward-fx__card--rank {
  animation: reward-fx-rank-out 0.35s ease forwards;
}
.reward-fx__burst {
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(circle at 50% 40%, rgba(250, 204, 21, 0.28), transparent 42%),
    radial-gradient(circle at 30% 70%, rgba(168, 85, 247, 0.2), transparent 40%),
    radial-gradient(circle at 70% 65%, rgba(56, 189, 248, 0.16), transparent 38%);
  opacity: 0;
  pointer-events: none;
}
.reward-fx--rank.is-in .reward-fx__burst {
  animation: reward-fx-burst 1.1s ease-out forwards;
}
.reward-fx__card--achievement {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: min(420px, 94vw);
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: linear-gradient(120deg, rgba(28, 36, 52, 0.98), rgba(18, 22, 34, 0.98));
  border: 1px solid rgba(102, 192, 244, 0.35);
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.4),
    0 0 24px rgba(56, 189, 248, 0.15);
  transform: translateY(-24px);
}
.reward-fx--achievement.is-in .reward-fx__card--achievement {
  animation: reward-fx-ach-in 0.45s cubic-bezier(0.2, 0.85, 0.25, 1) forwards;
}
.reward-fx--achievement.is-out .reward-fx__card--achievement {
  animation: reward-fx-ach-out 0.35s ease forwards;
}
.reward-fx__ach-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fbbf24;
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.22), rgba(168, 85, 247, 0.18));
  border: 1px solid rgba(251, 191, 36, 0.35);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.25);
}
.reward-fx__ach-body {
  min-width: 0;
  flex: 1;
}
.reward-fx__eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(196, 181, 253, 0.85);
}
.reward-fx--achievement .reward-fx__eyebrow {
  color: rgba(125, 211, 252, 0.9);
}
.reward-fx__title {
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
  color: #f5f3ff;
  word-break: break-word;
}
.reward-fx--achievement .reward-fx__title {
  font-size: 0.98rem;
}
.reward-fx__shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.12) 48%,
    transparent 62%
  );
  transform: translateX(-120%);
  pointer-events: none;
}
.reward-fx--achievement.is-in .reward-fx__shimmer {
  animation: reward-fx-shimmer 1.2s 0.25s ease forwards;
}

@keyframes reward-fx-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes reward-fx-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes reward-fx-rank-pop {
  from { transform: translateY(22px) scale(0.88); opacity: 0.4; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes reward-fx-rank-out {
  from { transform: translateY(0) scale(1); opacity: 1; }
  to { transform: translateY(-10px) scale(0.96); opacity: 0; }
}
@keyframes reward-fx-burst {
  0% { opacity: 0; transform: scale(0.7); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.15); }
}
@keyframes reward-fx-ach-in {
  from { transform: translateY(-28px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes reward-fx-ach-out {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-16px); opacity: 0; }
}
@keyframes reward-fx-shimmer {
  to { transform: translateX(120%); }
}

