html {
  color: rgba(255, 255, 255, 0.92);
}

.page {
  padding-top: 86px;
  padding-bottom: 40px;
}

.container {
  width: min(1100px, calc(100% - 36px));
  margin: 0 auto;
}

.titlebar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 8px 0 18px;
}

.titlebar h1 {
  font-size: 30px;
  line-height: 1.1;
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.titlebar p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 500;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.86);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}

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

  .titlebar {
    align-items: flex-start;
    flex-direction: column;
  }
}

.card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.card .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card .head .h {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.card .head .h i {
  opacity: 0.9;
}

.card .body {
  padding: 16px;
}

.row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
}

.row:last-child {
  border-bottom: none;
}

.label {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 650;
}

.value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.value .muted {
  color: rgba(255, 255, 255, 0.68);
  font-weight: 550;
}

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

.btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  padding: 9px 12px;
  border-radius: 14px;
  font-family: var(--main-font);
  font-weight: 750;
  cursor: pointer;
  transition: 0.18s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0px) scale(0.98);
}

.btn.primary {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

.btn.danger {
  background: rgba(255, 60, 60, 0.12);
  border-color: rgba(255, 80, 80, 0.3);
}

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

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

.stat {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.14);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 6px;
  min-height: 76px;
}

.stat .k {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 650;
  font-size: 13px;
}

.stat .v {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 24px;
}

.stat-value {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.3px;
}

.stat-value[hidden] {
  display: none;
}

.skeleton {
  display: inline-block;
  border-radius: 999px;
  height: 12px;
  width: 140px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.14),
    rgba(255, 255, 255, 0.06)
  );
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

.skeleton.big {
  height: 22px;
  width: 110px;
  border-radius: 12px;
}

.skeleton.wide {
  width: 220px;
}

@keyframes shimmer {
  0% {
    background-position: 0% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 14px 0;
}

.note {
  color: rgba(255, 255, 255, 0.68);
  font-weight: 550;
  font-size: 13px;
  line-height: 1.45;
  margin: 10px 0 0;
}

.theme-slot {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.theme-slot .slot-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 850;
}

.theme-slot .slot-box {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  min-height: 0;
  padding: 0;
  display: block;
}

.danger-zone {
  border: 1px solid rgba(255, 80, 80, 0.3);
  background: rgba(255, 50, 50, 0.08);
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.tiny {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
  font-weight: 550;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: radial-gradient(
      18px 18px at 30% 30%,
      rgba(255, 255, 255, 0.22),
      transparent 65%
    ),
    radial-gradient(
      24px 24px at 70% 60%,
      rgba(255, 255, 255, 0.1),
      transparent 70%
    ),
    rgba(0, 0, 0, 0.18);
  display: grid;
  place-items: center;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.88);
  user-select: none;
}

.profileTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.who {
  display: flex;
  align-items: center;
  gap: 12px;
}

.who .names {
  display: grid;
  gap: 2px;
}

.who .names .nick {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.who .names .sub {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 650;
  font-size: 13px;
}

.kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.82);
  font-weight: 650;
}

footer {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-weight: 600;
}

#themeWidgetSlot .themeWidget {
  --bg-body: #020617;
  --border-subtle: rgba(148, 163, 184, 0.2);
  --text-main: #f9fafb;
  --text-muted: rgba(226, 232, 240, 0.72);
  --radius-lg: 18px;
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.55);

  --transition-fast: 160ms ease-out;
  --transition-normal: 260ms cubic-bezier(0.22, 0.61, 0.36, 1);

  --btn-primary: rgba(99, 102, 241, 0.92);
  --btn-primary-hover: rgba(99, 102, 241, 1);
  --btn-primary-border: rgba(129, 140, 248, 0.55);

  --btn-secondary: rgba(2, 6, 23, 0.85);
  --btn-secondary-border: rgba(148, 163, 184, 0.32);

  --glass: rgba(2, 6, 23, 0.62);
  --stroke: rgba(148, 163, 184, 0.2);
  --glow: 0 18px 55px rgba(79, 70, 229, 0.2);

  --pink: rgba(236, 72, 153, 0.9);
  --blue: rgba(129, 140, 248, 0.95);

  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    sans-serif;
}

#themeWidgetSlot .themeWidget,
#themeWidgetSlot .themeWidget * {
  box-sizing: border-box;
}

#site-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.site-bg-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 900ms cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 1200ms cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}

.site-bg-layer.active {
  opacity: 1;
  transform: scale(1);
}

.gradient-modal {
  width: 100%;
  max-width: 100%;
  height: 560px;
  max-height: 560px;

  display: flex;
  flex-direction: column;
  gap: 14px;

  padding: 18px 20px 16px;

  border-radius: 24px;
  border: 1.5px solid var(--stroke);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.55), var(--glow);

  backdrop-filter: blur(10px);
  overflow: hidden;
}

@media (max-width: 420px) {
  .gradient-modal {
    height: 520px;
    max-height: 520px;
  }
}

.gradient-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 2px;
  flex: 0 0 auto;
}

.gradient-modal-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.gradient-modal-title h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.02em;
  font-weight: 700;
}

.gradient-modal-title span {
  font-size: 12px;
  color: var(--text-muted);
}

.gradient-preview-wrapper {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);

  background: radial-gradient(
      circle at 0 0,
      rgba(30, 64, 175, 0.35),
      transparent 55%
    ),
    radial-gradient(
      circle at 100% 100%,
      rgba(190, 24, 93, 0.25),
      transparent 55%
    );
  flex: 0 0 auto;
}

.gradient-preview {
  position: relative;
  height: 210px;
  border-radius: 17px;
  overflow: hidden;
  background: #020617;
  isolation: isolate;
}

.gradient-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 420ms cubic-bezier(0.22, 0.61, 0.36, 1);
  transform: scale(1.01);
  will-change: opacity, transform;
}

.gradient-layer.active {
  opacity: 1;
  transform: scale(1);
}

.gradient-layer.entering {
  opacity: 0;
}

.gradient-layer.leaving {
  opacity: 0;
  transform: scale(1.02);
}

.preview-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(
      900px 380px at 25% 20%,
      rgba(255, 255, 255, 0.06),
      transparent 60%
    ),
    linear-gradient(to top, rgba(2, 6, 23, 0.72), rgba(2, 6, 23, 0.06));
  pointer-events: none;
}

.preview-meta {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;

  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
}

.preview-meta-left {
  max-width: 90%;
}

.preview-meta-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;

  padding: 10px 12px;
  border-radius: 14px;

  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);

  max-width: 100%;
}

#preview-name {
  font-weight: 700;
  letter-spacing: 0.01em;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.preview-meta-pill {
  padding: 3px 8px;
  font-size: 10px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.16);
  border: 1px solid rgba(129, 140, 248, 0.5);
  color: rgba(226, 232, 240, 0.95);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
  user-select: none;
  white-space: nowrap;
}

.presets-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
}

.presets-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 2px;
  flex: 0 0 auto;
}

.presets-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.presets-title {
  font-size: 13px;
  font-weight: 650;
  color: rgba(229, 231, 235, 0.95);
}

.presets-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.presets-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;

  padding: 6px 2px 2px;

  overflow-y: auto;
  min-height: 0;
  flex: 1 1 auto;

  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.presets-grid::-webkit-scrollbar {
  width: 6px;
}

.presets-grid::-webkit-scrollbar-track {
  background: transparent;
}

.presets-grid::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

.preset-card {
  position: relative;
  border-radius: 14px;
  padding: 1px;

  cursor: pointer;
  outline: none;

  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(2, 6, 23, 0.65);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);

  transition: transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.preset-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
}

.preset-card.pressed {
  transform: translateY(0) scale(0.985);
}

.preset-card-inner {
  border-radius: 13px;
  background: rgba(2, 6, 23, 0.82);
  padding: 8px;

  display: flex;
  flex-direction: column;
  gap: 8px;

  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.preset-swatch {
  border-radius: 10px;
  height: 54px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.preset-swatch-layer {
  position: absolute;
  inset: 0;
  transform: scale(1.03);
  transition: transform 320ms cubic-bezier(0.19, 1, 0.22, 1);
  will-change: transform;
}

.preset-card:hover .preset-swatch-layer {
  transform: scale(1.06) translateY(-1px);
}

.preset-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.preset-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: flex-start;
}

.preset-name {
  font-size: 12px;
  font-weight: 650;
  color: rgba(229, 231, 235, 0.95);
  line-height: 1.1;
}

.preset-tag {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.2;
}

.preset-indicator {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(2, 6, 23, 0.7);
}

.preset-indicator::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.55);
  opacity: 0.75;
}

.preset-card.active .preset-indicator {
  border-color: rgba(129, 140, 248, 0.75);
  background: rgba(79, 70, 229, 0.12);
}

.preset-card.active .preset-indicator::before {
  background: var(--blue);
  opacity: 1;
}

.preset-card.selected:not(.active) .preset-indicator {
  border-color: rgba(236, 72, 153, 0.55);
  background: rgba(236, 72, 153, 0.08);
}

.preset-card.selected:not(.active) .preset-indicator::before {
  background: var(--pink);
  opacity: 0.95;
  animation: pendingPulse 1.15s ease-in-out infinite;
}

@keyframes pendingPulse {
  0% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(236, 72, 153, 0);
  }

  50% {
    transform: scale(1);
    box-shadow: 0 0 0 7px rgba(236, 72, 153, 0.12);
  }

  100% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(236, 72, 153, 0);
  }
}

.gradient-modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;

  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);

  flex: 0 0 auto;
}

.footer-buttons {
  display: flex;
  gap: 10px;
}

#themeWidgetSlot .themeWidget .btn {
  border-radius: 999px;
  font-size: 13px;
  padding: 10px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  transition: transform var(--transition-fast),
    box-shadow var(--transition-fast), background var(--transition-fast),
    border-color var(--transition-fast), opacity var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

#themeWidgetSlot .themeWidget .btn:active {
  transform: scale(0.985);
}

#themeWidgetSlot .themeWidget .btn-secondary {
  background: var(--btn-secondary);
  border-color: var(--btn-secondary-border);
  color: rgba(226, 232, 240, 0.92);
}

#themeWidgetSlot .themeWidget .btn-primary {
  background: var(--btn-primary);
  border: 1px solid var(--btn-primary-border);
  color: #f9fafb;
  box-shadow: 0 14px 34px rgba(99, 102, 241, 0.18);
}

.v3x-footer {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.v3x-footer .v3x-btn {
  width: auto !important;
  flex: 0 0 auto !important;
}

.v3x-btn {
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;

  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;

  cursor: pointer;
  user-select: none;
  white-space: nowrap;

  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);

  transition: opacity 220ms ease, filter 220ms ease, transform 220ms ease,
    box-shadow 220ms ease;
}

.v3x-btn.is-disabled {
  opacity: 0.45;
  filter: grayscale(0.25);
  pointer-events: none;
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.v3x-btn--apply:not(.is-disabled) {
  box-shadow: 0 18px 54px rgba(34, 193, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.v3x-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.v3x-btn:active {
  transform: scale(0.985);
}

.v3x-btn__content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.v3x-btn__icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 18px;
}

.v3x-btn__icon svg {
  width: 18px;
  height: 18px;
  display: block;
  transform: translateY(0.4px);
}

.v3x-btn__label {
  line-height: 1;
  transform: translateY(0.2px);
}

.v3x-spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: white;
  display: none;
  animation: v3x-spin 700ms linear infinite;
}

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

.v3x-btn.is-loading .v3x-spinner {
  display: inline-block;
}

.v3x-btn.is-loading .v3x-btn__icon {
  display: none;
}

.v3x-btn--reset {
  background: rgba(0, 0, 0, 0.28);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 10px 22px rgba(0, 0, 0, 0.35),
    0 10px 26px rgba(0, 0, 0, 0.35);
}

.v3x-btn--reset:hover {
  background: rgba(255, 255, 255, 0.06);
}

.v3x-btn--apply {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.16),
    rgba(255, 255, 255, 0.06)
  );
  border-color: rgba(255, 255, 255, 0.22);

  box-shadow: 0 18px 44px rgba(34, 193, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -12px 22px rgba(0, 0, 0, 0.25);
}

.v3x-btn--apply:hover {
  box-shadow: 0 22px 56px rgba(34, 193, 255, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -14px 26px rgba(0, 0, 0, 0.3);
}

@media (max-height: 560px) {
  .gradient-preview {
    height: 180px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-bg-layer,
  .gradient-layer,
  .preset-swatch-layer,
  .preset-card,
  .v3x-btn {
    transition: none !important;
    animation: none !important;
  }

  .preset-card.selected:not(.active) .preset-indicator::before {
    animation: none !important;
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;

  /* “стеклянный” фон + лёгкие свечения */
  background: radial-gradient(
      900px 520px at 50% 10%,
      rgba(109, 118, 255, 0.14),
      transparent 62%
    ),
    radial-gradient(
      760px 480px at 70% 25%,
      rgba(30, 209, 255, 0.06),
      transparent 60%
    ),
    rgba(0, 0, 0, 0.42);

  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);

  display: grid;
  place-items: center;
  z-index: 999;

  /* чтобы модалка не “вылазила” на маленьких экранах */
  padding: 18px;
  overflow-y: auto;

  animation: overlayFade 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

.modal {
  width: min(460px, calc(100% - 0px));
  border-radius: 22px;
  padding: 18px;

  background: rgba(12, 16, 40, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.14);

  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.55),
    0 1px 0 rgba(255, 255, 255, 0.06) inset;

  backdrop-filter: blur(14px) saturate(125%);
  -webkit-backdrop-filter: blur(14px) saturate(125%);

  /* ограничение по высоте + скролл внутри */
  max-height: calc(100vh - 120px);
  overflow: auto;

  position: relative;

  /* анимация открытия из основной версии */
  transform: translateY(24px) scale(0.96);
  opacity: 0;
  animation: modalAppear 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.modal-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.modal-desc {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
  line-height: 1.35;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;

  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;

  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);

  cursor: pointer;
  transition: 0.18s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-1px);
}

.modal-close:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25) inset;
}

.modal-field {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.modal-field input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: white;
  font-family: var(--main-font);

  outline: none;
  transition: 0.18s ease;
}

.modal-field input:focus {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 4px rgba(109, 118, 255, 0.12);
}

.modal-action {
  width: 44px;
  border-radius: 12px;

  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);

  cursor: pointer;
  transition: 0.18s ease;
}

.modal-action:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;

  /* визуально отделяем кнопки от контента (и без “схлопывания” отступов) */
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);

  gap: 12px;
  flex-wrap: wrap;
}

.modal-error {
  color: rgba(255, 90, 90, 0.95);
}

.modal.is-closing {
  animation: modalDisappear 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.modal-overlay.is-closing {
  animation: overlayFadeOut 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes modalDisappear {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
}

@keyframes overlayFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes modalAppear {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  60% {
    opacity: 1;
    transform: translateY(-2px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes overlayFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.sessions-list::-webkit-scrollbar {
  width: 6px;
}
.sessions-list::-webkit-scrollbar-track {
  background: transparent;
}
.sessions-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

.sessions-item {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px 12px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  user-select: none;
}

.sessions-item .left {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.sessions-item .title {
  font-weight: 850;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.2;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sessions-item .meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.68);
  font-weight: 650;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sessions-item .right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.sessions-pill {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.8);
  font-weight: 850;
  font-size: 12px;
}

.sessions-pill.current {
  border-color: rgba(120, 255, 180, 0.28);
  background: rgba(120, 255, 180, 0.1);
  color: rgba(160, 255, 210, 0.95);
}

.sessions-skeleton .skeleton-line {
  height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0.05)
  );
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

/* =========================
   Mobile polish for Account page
   (desktop untouched)
========================= */

@media (max-width: 560px) {
  .page {
    padding-top: 78px; /* чуть компактнее, но не лезем в navbar */
    padding-bottom: 28px;
  }

  .container {
    width: min(
      1100px,
      calc(100% - 20px)
    ); /* было 36px -> на телефоне комфортнее */
  }

  /* Заголовок и плашки */
  .titlebar {
    gap: 12px;
    margin: 6px 0 14px;
    align-items: flex-start;
  }

  .titlebar h1 {
    font-size: 24px;
  }

  .titlebar p {
    font-size: 13px;
    line-height: 1.35;
  }

  .pill {
    white-space: normal; /* чтобы не разъезжалось */
    line-height: 1.2;
  }

  /* Карточки */
  .card .head {
    padding: 12px 12px;
    /* align-items: flex-start; */
  }

  .card .body {
    padding: 12px;
  }

  /* Главное: строки “Label / Value” превращаем в вертикаль */
  .row {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
    padding: 12px 0;
  }

  .label {
    font-size: 13px;
  }

  .value {
    width: 100%;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
  }

  /* Длинная почта/текст — не вылазит, красиво переносится */
  .value .muted,
  #emailValue,
  #roleValue,
  #languageValue {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Кнопки в строках — не “плывут”, становятся нормальными */
  .inline {
    width: 100%;
  }

  .btn {
    width: 100%;
    justify-content: center;
    padding: 11px 12px;
    border-radius: 16px;
  }

  /* Чтобы “пиллы” и кнопки не давили друг друга */
  .value .pill {
    width: fit-content;
    max-width: 100%;
  }

  /* Профильный верх — компактнее */
  .profileTop {
    gap: 10px;
  }

  .who .names .nick {
    font-size: 16px;
  }

  .avatar {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  /* Тема/градиент: на телефоне делаем высоту адекватной и уменьшаем “перегруз” */
  .gradient-modal {
    height: auto;
    max-height: none;
    padding: 14px 14px 12px;
    border-radius: 20px;
  }

  .gradient-preview {
    height: 170px;
  }

  #preview-name {
    max-width: 100%;
  }

  .presets-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    max-height: 44vh; /* чтобы не выталкивало всё вниз */
  }

  .gradient-modal-footer {
    justify-content: stretch;
  }

  .footer-buttons,
  .v3x-footer {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .v3x-footer .v3x-btn {
    flex: 1 1 auto !important;
    width: auto !important;
    justify-content: center;
  }

  /* Модалки: чтобы всё влезало по высоте, и было удобно тыкать */
  .modal-overlay {
    padding: 12px;
    place-items: center;
  }

  .modal {
    width: 100%;
    max-width: 520px; /* пусть ограничивает на больших телефонах */
    max-height: calc(100vh - 110px);
    overflow: auto;
    padding: 16px;
    border-radius: 18px;

    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .modal-title {
    font-size: 16px;
  }

  .modal-desc {
    font-size: 12.5px;
    line-height: 1.35;
  }

  .modal-field {
    gap: 8px;
  }

  .modal-field input {
    padding: 12px 12px;
    border-radius: 14px;
  }

  .modal-action {
    width: 46px;
    border-radius: 14px;
  }

  .modal-actions {
    justify-content: stretch;
  }

  .modal-actions .btn {
    width: 100%;
  }

  /* Чтобы список сессий/строки не рвали модалку */
  #sessionsList > div {
    max-width: 100%;
  }
}

/* =========================================================
   MERGED IN: modal-overrides.v2.css
   (language / tags / large modals)
========================================================= */

/* =========================
   LANGUAGE MODAL (красиво, без “вылазит за рамку”)
   Поддерживает оба варианта: label + radio и button[data-lang]
========================= */

.lang-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 8px;
}

.lang-option {
  width: 100%;
  box-sizing: border-box;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 14px 14px;
  border-radius: 16px;

  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.92);

  cursor: pointer;
  font-family: var(--main-font);
  font-weight: 750;

  transition: transform 0.18s ease, background 0.18s ease,
    border-color 0.18s ease, box-shadow 0.18s ease;
  user-select: none;

  position: relative; /* чтобы спрятать radio + псевдо-эффекты */
  overflow: hidden;
}

/* подсветка-подложка */
.lang-option::before {
  content: "";
  position: absolute;
  inset: -48px;
  background: radial-gradient(
      320px 180px at 25% 15%,
      rgba(109, 118, 255, 0.22),
      transparent 62%
    ),
    radial-gradient(
      260px 160px at 80% 55%,
      rgba(30, 209, 255, 0.1),
      transparent 62%
    );
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

/* индикатор выбора слева */
.lang-option::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.34);
  background: rgba(0, 0, 0, 0.1);
  transition: 0.18s ease;
  pointer-events: none;
}

/* контент поверх подложки */
.lang-option > * {
  position: relative;
  z-index: 1;
}

.lang-option:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.26);
}

.lang-option:hover::before {
  opacity: 1;
}

.lang-option:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.26) inset;
}

.lang-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;

  /* отступ под левый индикатор выбора */
  padding-left: 22px;

  flex: 1 1 auto;
  min-width: 0;
}

.lang-main > * {
  min-width: 0;
}

.lang-option span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-chip {
  flex: 0 0 auto;

  min-width: 42px;
  text-align: center;

  padding: 5px 10px;
  border-radius: 999px;

  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.82);

  font-weight: 850;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;

  transition: 0.18s ease;
}

.lang-option:has(input[type="radio"]:checked) .lang-chip,
.lang-option.is-active .lang-chip {
  background: rgba(109, 118, 255, 0.22);
  border-color: rgba(109, 118, 255, 0.5);
  color: rgba(255, 255, 255, 0.96);
}

/* radio скрываем визуально, но логика остаётся */
.lang-option input[type="radio"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

/* активное состояние:
   - если у тебя label+radio: подсветится через :has()
   - если у тебя button: можно в JS ставить класс .is-active
*/
.lang-option:has(input[type="radio"]:checked),
.lang-option.is-active {
  border-color: rgba(109, 118, 255, 0.55);
  background: rgba(109, 118, 255, 0.1);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.3);
}

.lang-option:has(input[type="radio"]:checked)::before,
.lang-option.is-active::before {
  opacity: 1;
}

.lang-option:has(input[type="radio"]:checked)::after,
.lang-option.is-active::after {
  background: rgba(109, 118, 255, 0.95);
  border-color: rgba(109, 118, 255, 0.95);
  box-shadow: 0 0 0 6px rgba(109, 118, 255, 0.18);
}

/* клавиатурная навигация */
.lang-option:has(input[type="radio"]:focus-visible) {
  outline: 2px solid rgba(255, 255, 255, 0.38);
  outline-offset: 4px;
}

/* =========================
   “Большие” модалки (витрина/сессии) — просто расширяем контейнер
   (если у тебя другие data-modal, добавь ещё строки по аналогии)
========================= */
.modal[data-modal="sessions"],
.modal[data-modal="showcase"],
.modal[data-modal="vitrine"],
.modal[data-modal="gallery"] {
  width: min(720px, calc(100% - 0px));
}

/* чтобы длинные списки (например сессии) не ломали высоту */
.modal [data-scroll],
.modal .scroll,
.modal .list,
.modal .sessions-list {
  max-height: min(52vh, 520px);
  overflow: auto;
  padding-right: 2px;
}

/* =========================
   TAGS (если у тебя есть модалка выбора тегов)
   Сетка в несколько рядов + нормальные “галочки”
   Классы: .tags-grid / .tag-grid / .tag-list + label.tag-option
========================= */
.tags-grid,
.tag-grid,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.tags-grid label,
.tag-grid label,
.tag-list label,
.tag-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;

  padding: 10px 12px;
  border-radius: 999px;

  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);

  cursor: pointer;
  user-select: none;
  transition: 0.18s ease;
}

.tags-grid label:hover,
.tag-grid label:hover,
.tag-list label:hover,
.tag-option:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
}

/* скрываем checkbox/radio внутри и рисуем “галочку” сами */
.tags-grid input[type="checkbox"],
.tag-grid input[type="checkbox"],
.tag-list input[type="checkbox"],
.tags-grid input[type="radio"],
.tag-grid input[type="radio"],
.tag-list input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tags-grid label::before,
.tag-grid label::before,
.tag-list label::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.16);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
  flex: 0 0 18px;
}

.tags-grid label:has(input:checked),
.tag-grid label:has(input:checked),
.tag-list label:has(input:checked) {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
}

.tags-grid label:has(input:checked)::before,
.tag-grid label:has(input:checked)::before,
.tag-list label:has(input:checked)::before {
  background: rgba(109, 118, 255, 0.28);
  border-color: rgba(129, 140, 248, 0.55);
  box-shadow: 0 0 0 4px rgba(109, 118, 255, 0.12);
}

/* на очень узких экранах чуть уменьшим отступы */
@media (max-width: 420px) {
  .modal {
    padding: 16px;
  }
  .lang-option {
    padding: 11px 11px;
  }
}
/* =========================================================
   TAGS MODAL (ABOUT ME / INTERESTS) — pills with icons
   How to enable with minimal changes:
   1) Add class "tags-modal" to the tag modal container:
      <div class="modal tags-modal"> ... </div>

   2) Put tags into a wrapper:
      <div class="tag-grid"> ... </div>

   3) Each tag as a label with a hidden checkbox (logic stays):
      <label class="tag-pill">
        <input type="checkbox" name="tags[]" value="builder">
        <i class="fa-solid fa-hammer"></i>
        <span>Строитель</span>
      </label>

   If you can’t/don’t want to change wrapper names, you can also
   add class "tag-grid" to your current container and "tag-pill"
   to each option element.
========================================================= */

.tags-modal .tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  align-items: flex-start;
  padding-top: 3px;   /* было 0 — из-за этого резало */
  padding-bottom: 2px;
}

.tags-modal .tag-pill {
  position: relative;

  display: inline-flex;
  align-items: center;
  gap: 10px;

  width: auto; /* grows with text */
  max-width: 100%;
  padding: 10px 12px;

  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);

  color: rgba(255, 255, 255, 0.92);
  font-family: var(--main-font);
  font-weight: 800;
  font-size: 13px;
  line-height: 1;

  cursor: pointer;
  user-select: none;

  transition: transform 0.18s ease, background 0.18s ease,
    border-color 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

.tags-modal .tag-pill:hover {
  transform: translateY(-1px);
  opacity: 0.96;
  background: rgba(255, 255, 255, 0.08);
}

.tags-modal .tag-pill:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25) inset;
}

.tags-modal .tag-pill i {
  font-size: 14px;
  opacity: 0.92;
  transform: translateY(0.5px);
}

.tags-modal .tag-pill span {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

/* Hide the checkbox visually (logic stays) */
.tags-modal .tag-pill input[type="checkbox"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

/* Selected state — "lighter" pill, no checkmarks */
.tags-modal .tag-pill:has(input[type="checkbox"]:checked),
.tags-modal .tag-pill.is-selected {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06),
    0 16px 34px rgba(0, 0, 0, 0.18);
}

/* Keyboard accessibility */
.tags-modal .tag-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22), 0 0 0 6px rgba(0, 0, 0, 0.35);
}

/* If your old markup had a separate checkmark element — hide it only inside tag modal */
.tags-modal .check,
.tags-modal .checkmark,
.tags-modal .tag-check,
.tags-modal .tag-checkbox {
  display: none !important;
}

/* Make the modal wider/taller if you want (safe defaults) */
.tags-modal {
  width: min(700px, calc(100% - 32px));
  max-height: min(78vh, 760px);
  overflow: auto;
}
.tags-modal .tag-grid .tag-pill:hover{
  transform: translateY(-1px);
}

/* =========================
   TAGS MODAL — красивые “пилюли” с иконкой
   (не влияет на выбор языка)
========================= */
.tags-modal #tagsList {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;

  /* чтобы список не распирал модалку */
  max-height: min(44vh, 420px);
  overflow: auto;
  padding-right: 4px;
}

.tags-modal #tagsList .lang-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;

  padding: 10px 12px;
  border-radius: 999px;

  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);

  transition: transform 0.12s ease, background 0.12s ease,
    border-color 0.12s ease, box-shadow 0.12s ease;
}

.tags-modal #tagsList .lang-option:hover {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-1px);
}

.tags-modal #tagsList .lang-option:active {
  transform: translateY(0) scale(0.99);
}

.tags-modal #tagsList .lang-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 850;
  font-size: 13px;
}

.tags-modal #tagsList .tag-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  opacity: 0.95;
  flex: 0 0 auto;
}

.tags-modal #tagsList .tag-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tags-modal #tagsList .lang-chip {
  flex: 0 0 auto;
  min-width: 22px;
  height: 22px;
  padding: 0;
  display: inline-grid;
  place-items: center;

  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.85);

  font-weight: 900;
  font-size: 12px;
}

.tags-modal #tagsList .lang-option.is-active {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.tags-modal #tagsList .lang-option.is-active .lang-chip {
  border-color: rgba(120, 255, 180, 0.35);
  background: rgba(120, 255, 180, 0.18);
  color: rgba(190, 255, 215, 0.95);
}

/* маленькая косметика */
.tags-modal .modal-actions {
  margin-top: 14px;
}
.tags-modal [data-error] {
  margin-top: 10px;
  font-size: 13px;
}

/* =========================
   TAGS MODAL — chips layout (пилюли), без кружков и без чеков
========================= */

.tags-modal .tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  align-items: flex-start;
}

/* Сами "пилюли" (мы переопределяем lang-option ТОЛЬКО внутри tags-modal) */
.tags-modal .tag-grid .lang-option {
  width: auto !important; /* ключ: больше не строка на всю ширину */
  min-width: 0;
  padding: 10px 14px !important; /* убираем "языковые" отступы */
  border-radius: 999px !important;

  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;

  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);

  box-shadow: none;
  transition: transform 0.12s ease, background 0.12s ease,
    border-color 0.12s ease, box-shadow 0.12s ease;
}

.tags-modal .tag-grid .lang-option::before,
.tags-modal .tag-grid .lang-option::after {
  content: none !important;
  display: none !important;
}

.tags-modal .tag-grid .lang-chip {
  display: none !important;
}

.tags-modal .tag-grid .lang-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
  font-size: 13px;
}

.tags-modal .tag-grid .tag-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  opacity: 0.95;
}

.tags-modal .tag-grid .tag-text {
  white-space: nowrap;
}

.tags-modal .tag-grid .lang-option:hover {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-1px);
}

.tags-modal .tag-grid .lang-option:focus-visible {
  outline: 2px solid rgba(180, 220, 255, 0.35);
  outline-offset: 2px;
}

.tags-modal .tag-grid .lang-option.is-active {
  border-color: rgba(120, 255, 180, 0.35);
  background: rgba(120, 255, 180, 0.14);
  box-shadow: 0 0 0 1px rgba(120, 255, 180, 0.08) inset;
}

.tags-modal {
  scrollbar-width: none;
}
.tags-modal::-webkit-scrollbar {
  width: 0;
  height: 0;
}
.avatar.has-image {
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}


