/* Polish + help tooltips — keeps original teal/indigo palette */

.tc-glass-card {
  position: relative;
  overflow: hidden;
  background: var(--tc-surface-elevated);
  box-shadow: var(--tc-shadow-card);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tc-glass-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--tc-card-shine);
  pointer-events: none;
}

.tc-glass-card > * {
  position: relative;
  z-index: 1;
}

.tc-hero-card {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    var(--tc-shadow-soft),
    0 0 40px rgba(20, 184, 166, 0.08);
}

[data-theme="light"] .tc-hero-card {
  box-shadow: var(--tc-shadow-soft);
  border: 1px solid var(--tc-stroke);
}

.tc-inset-panel {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.tc-inset-panel:hover {
  border-color: var(--tc-stroke-strong);
  background: color-mix(in srgb, var(--tc-surface-muted) 88%, var(--tc-teal) 12%);
}

.tc-status-strip {
  position: relative;
  overflow: hidden;
}

.tc-status-strip::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: 0;
  width: 3px;
  border-radius: 999px;
  background: var(--tc-brand-gradient);
}

.tc-status-strip .tc-status-row {
  padding-right: 8px;
}

.tc-stat-card {
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--tc-shadow-soft);
}

.tc-stat-card::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--tc-teal), transparent 85%);
  opacity: 0.85;
}

.tc-stat-card:hover {
  border-color: var(--tc-stroke-strong);
  transform: translateY(-2px);
}

.tc-feature-card {
  position: relative;
  overflow: hidden;
  box-shadow: var(--tc-shadow-soft);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.tc-feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, transparent 45%, rgba(20, 184, 166, 0.07) 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.tc-feature-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--tc-teal) 45%, var(--tc-stroke));
  box-shadow: var(--tc-shadow-soft), 0 0 0 1px rgba(20, 184, 166, 0.12);
}

.tc-feature-card:hover::before {
  opacity: 1;
}

.tc-icon-badge {
  box-shadow: 0 8px 20px rgba(20, 184, 166, 0.22);
}

.tc-icon-badge--sm {
  box-shadow: none;
}

.tc-mode-pill.is-active {
  box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.25), 0 6px 18px rgba(20, 184, 166, 0.12);
}

.tc-btn--primary {
  background: var(--tc-teal);
  border-color: var(--tc-teal);
  color: var(--tc-on-accent);
  box-shadow: 0 6px 18px rgba(20, 184, 166, 0.28);
}

.tc-btn--primary:hover:not(:disabled) {
  background: var(--tc-teal-light);
  border-color: var(--tc-teal-light);
  color: var(--tc-on-accent);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(20, 184, 166, 0.35);
}

.tc-btn--accent {
  background: var(--tc-indigo);
  border-color: var(--tc-indigo);
  color: var(--tc-on-accent);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.28);
}

.tc-btn--accent:hover:not(:disabled) {
  background: var(--tc-indigo-deep);
  border-color: var(--tc-indigo-deep);
  color: var(--tc-on-accent);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.35);
}

.tc-btn--amber {
  background: var(--tc-amber);
  border-color: var(--tc-amber);
  color: #1A1205;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.28);
}

.tc-btn--amber:hover:not(:disabled) {
  filter: brightness(1.08);
  color: #1A1205;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.38);
}

.tc-input:focus,
.tc-textarea:focus,
.tc-select:focus {
  box-shadow: var(--tc-focus-ring);
}

.tc-input:disabled,
.tc-textarea:disabled,
.tc-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--tc-surface-muted);
}

.tc-empty-state {
  border: 1px dashed var(--tc-stroke);
  border-radius: var(--tc-radius-lg);
  background: color-mix(in srgb, var(--tc-surface-muted) 70%, transparent);
}

.tc-empty-icon-host {
  background: var(--tc-brand-gradient);
  border: none;
  color: var(--tc-on-accent);
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.18);
}

/* Checkbox rows */
.tc-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  color: var(--tc-text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.tc-check-row:hover {
  background: var(--tc-surface-hover);
  border-color: var(--tc-stroke);
  color: var(--tc-text-primary);
}

.tc-check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--tc-teal);
  flex-shrink: 0;
  cursor: pointer;
}

.tc-check-row-text {
  flex: 0 1 auto;
  min-width: 0;
  line-height: 1.35;
}

.tc-check-row:has(.vt-help) {
  width: max-content;
  max-width: 100%;
  gap: 4px;
}

.tc-check-row .vt-help {
  margin-inline-start: 0;
}

.tc-label-with-help {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.tc-label-with-help .tc-field-label {
  margin: 0;
}

/* Help tip (!) */
.vt-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  outline: none;
  cursor: help;
}

.vt-help-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--tc-amber) 70%, var(--tc-stroke));
  background: var(--tc-amber-soft);
  color: var(--tc-amber);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.vt-help:hover .vt-help-mark,
.vt-help:focus-visible .vt-help-mark {
  transform: scale(1.08);
  border-color: var(--tc-amber);
  background: color-mix(in srgb, var(--tc-amber) 28%, var(--tc-surface));
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

/* Portal tooltip — escapes overflow:hidden cards */
.vt-help-tip--portal {
  position: fixed;
  z-index: 10000;
  width: max-content;
  max-width: min(320px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--tc-help-tip-bg);
  border: 1px solid color-mix(in srgb, var(--tc-amber) 35%, var(--tc-stroke));
  color: var(--tc-text-primary);
  font-family: var(--tc-font);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
  text-align: right;
  direction: rtl;
  box-shadow: var(--tc-shadow-soft);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.vt-help-tip--portal.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.vt-help-tip-arrow {
  position: absolute;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  pointer-events: none;
  transform: translateX(-50%);
}

.vt-help-tip--portal[data-placement="top"] .vt-help-tip-arrow {
  top: 100%;
  border-top-color: var(--tc-help-tip-bg);
}

.vt-help-tip--portal[data-placement="bottom"] .vt-help-tip-arrow {
  bottom: 100%;
  border-bottom-color: var(--tc-help-tip-bg);
}

.vt-page .tc-page-root {
  animation: vt-page-in 0.3s ease both;
}

@keyframes vt-page-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.vt-connection-hud {
  background: var(--tc-surface-card);
}

.vt-sidebar-footer {
  background: var(--tc-sidebar-footer-fade);
}

/* Link explorer — communities filter: search | posts | select-all on one row */
.vt-community-filter-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 10px;
}

.vt-community-filter-row__search {
  flex: 1 1 0;
  min-width: 0;
}

.vt-community-filter-row__posts {
  flex: 1 1 0;
  min-width: 0;
}

.vt-community-filter-row__select {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: 40px;
  padding-bottom: 2px;
}

.vt-community-filter-row__select .tc-check-row {
  margin: 0;
  width: 100%;
}

@media (max-width: 720px) {
  .vt-community-filter-row {
    flex-wrap: wrap;
  }

  .vt-community-filter-row__search {
    flex: 1 1 100%;
  }

  .vt-community-filter-row__posts {
    flex: 1 1 40%;
  }

  .vt-community-filter-row__select {
    flex: 1 1 40%;
    min-height: 0;
    padding-bottom: 0;
  }
}

/* User explorer — group search + select-all */
.vt-user-filter-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 10px;
}

.vt-user-filter-row__search {
  flex: 1 1 50%;
  min-width: 0;
}

.vt-user-filter-row__select {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: 40px;
  padding-bottom: 2px;
}

.vt-user-filter-row__select .tc-check-row {
  margin: 0;
  width: 100%;
}

.vt-full-history-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.vt-full-history-row .tc-check-row {
  margin: 0;
}

.vt-inline-danger-note {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--tc-rose, #f43f5e);
}

.vt-user-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.vt-user-actions-row .tc-check-row {
  margin: 0;
  padding-inline: 0;
}

/* Persian graphical file picker */
.vt-file-picker {
  position: relative;
  display: block;
  margin: 0;
  cursor: pointer;
  border-radius: 14px;
  border: 1.5px dashed color-mix(in srgb, var(--tc-teal) 45%, var(--tc-stroke));
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--tc-teal) 10%, transparent), transparent 55%),
    var(--tc-surface-muted);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.vt-file-picker:hover:not(.is-disabled) {
  border-color: var(--tc-teal);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--tc-teal) 16%, transparent), transparent 55%),
    var(--tc-surface-hover);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc-teal) 16%, transparent);
}

.vt-file-picker.has-file {
  border-style: solid;
  border-color: color-mix(in srgb, var(--tc-teal) 70%, var(--tc-stroke));
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--tc-teal) 14%, transparent), transparent 60%),
    var(--tc-surface);
}

.vt-file-picker.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.vt-file-picker__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: inherit;
  z-index: 2;
}

.vt-file-picker__surface {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  pointer-events: none;
}

.vt-file-picker__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tc-on-accent);
  background: var(--tc-brand-gradient);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--tc-indigo) 28%, transparent);
}

.vt-file-picker__copy {
  flex: 1 1 auto;
  min-width: 0;
}

.vt-file-picker__title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--tc-text-primary);
  line-height: 1.35;
}

.vt-file-picker__hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--tc-text-secondary);
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vt-file-picker__cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--tc-teal) 55%, var(--tc-stroke));
  background: color-mix(in srgb, var(--tc-teal) 16%, var(--tc-surface));
  color: var(--tc-teal-light);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 640px) {
  .vt-file-picker__surface {
    flex-wrap: wrap;
  }

  .vt-file-picker__cta {
    width: 100%;
  }

  .vt-file-picker__hint {
    white-space: normal;
  }
}

/* User explorer — export toolbar above results */
.vt-user-export-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}

.vt-user-export-row__format {
  flex: 2 1 0;
  min-width: 0;
}

.vt-user-export-row__btn {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
}

@media (max-width: 720px) {
  .vt-user-filter-row {
    flex-wrap: wrap;
  }

  .vt-user-filter-row__search,
  .vt-user-filter-row__select {
    flex: 1 1 100%;
    min-height: 0;
    padding-bottom: 0;
  }

  .vt-user-export-row {
    flex-wrap: wrap;
  }

  .vt-user-export-row__format {
    flex: 1 1 100%;
  }

  .vt-user-export-row__btn {
    flex: 1 1 calc(50% - 5px);
  }
}

/* Supergroup boost — file load + start-from on one row */
.vt-boost-links-tools-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 10px;
}

.vt-boost-links-tools-row__file {
  flex: 1 1 0;
  min-width: 0;
}

.vt-boost-links-tools-row__start {
  flex: 0 0 140px;
  min-width: 0;
}

.vt-boost-filter-pair {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
}

.vt-boost-filter-pair > * {
  flex: 1 1 0;
  min-width: 0;
}

.vt-boost-filter-pair .tc-check-row {
  padding: 4px 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--tc-text-secondary);
}

.vt-boost-filter-pair .tc-check-row-text {
  font-size: 12px;
  font-weight: 400;
}

.vt-boost-filter-pair .tc-check-row:has(.vt-help) {
  width: 100%;
  max-width: 100%;
}

.vt-broadcast-groups-list {
  max-height: 320px;
  min-height: 160px;
  overflow: auto;
  position: relative;
}

.vt-boost-numeric-pair {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 10px;
}

.vt-boost-numeric-pair__item {
  flex: 1 1 0;
  min-width: 0;
}

.vt-boost-numeric-pair__item .tc-input {
  width: 100%;
  min-width: 0;
}

@media (max-width: 720px) {
  .vt-boost-links-tools-row {
    flex-wrap: wrap;
  }

  .vt-boost-links-tools-row__file,
  .vt-boost-links-tools-row__start {
    flex: 1 1 100%;
  }

  .vt-boost-filter-pair {
    flex-wrap: wrap;
  }

  .vt-boost-filter-pair > * {
    flex: 1 1 100%;
  }
}

/* Status modals — glass card language */
.vt-modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, var(--tc-safe-top)) max(16px, var(--tc-safe-right)) max(16px, var(--tc-safe-bottom)) max(16px, var(--tc-safe-left));
  direction: rtl;
}

.vt-modal-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, #05080f 62%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.vt-modal-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: min(78vh, 640px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--tc-radius-lg);
  border: 1px solid var(--tc-stroke);
  background: var(--tc-surface-elevated);
  box-shadow: var(--tc-shadow-card), 0 0 48px rgba(20, 184, 166, 0.08);
  animation: vt-modal-in 0.18s ease;
}

.vt-modal-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--tc-card-shine);
  pointer-events: none;
}

.vt-modal-header,
.vt-modal-body {
  position: relative;
  z-index: 1;
}

.vt-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--tc-stroke);
  background: color-mix(in srgb, var(--tc-surface-muted) 55%, transparent);
}

.vt-modal-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.vt-modal-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
  color: var(--tc-on-accent, #fff);
  background: var(--tc-brand-gradient);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--tc-teal) 35%, transparent);
}

.vt-modal-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--tc-text-primary);
  line-height: 1.35;
}

.vt-modal-close {
  flex-shrink: 0;
}

.vt-modal-body {
  padding: 14px 16px 16px;
  overflow: auto;
}

.vt-modal-body .vt-connection-hud {
  margin: 0;
}

@keyframes vt-modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

[data-theme="light"] .vt-modal-backdrop {
  background: color-mix(in srgb, #0f172a 35%, transparent);
}

[data-theme="light"] .vt-modal-card {
  box-shadow: var(--tc-shadow-card);
}

/* Theme toggle */
.vt-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--tc-stroke);
  background: var(--tc-surface-muted);
  color: var(--tc-text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.vt-theme-toggle:hover {
  background: var(--tc-surface-hover);
  border-color: var(--tc-stroke-strong);
  color: var(--tc-text-primary);
}

.vt-theme-toggle-icon {
  display: inline-flex;
  line-height: 0;
}

.vt-titlebar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vt-login-theme {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 5;
}

[data-theme="light"] .vt-login-shell {
  background: var(--tc-bg);
}

[data-theme="light"] .vt-remember {
  color: var(--tc-text-secondary);
}

.tc-caption,
.vt-connection-hud-message,
.vt-connection-hud-detail,
.vt-status-chip-text,
.vt-status-chip-detail {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.vt-account-loading {
  color: var(--tc-rose);
  font-weight: 700;
}

.vt-account-status-row {
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.vt-account-status-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.vt-account-status-main .tc-caption {
  margin: 0;
}

.vt-account-status-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-inline-start: 4px;
}

.vt-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid var(--tc-stroke);
  background: var(--tc-surface-muted);
  color: var(--tc-text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.vt-icon-btn:hover:not(:disabled):not(.is-busy) {
  border-color: var(--tc-teal);
  color: var(--tc-teal-light);
  background: var(--tc-teal-soft);
}

.vt-icon-btn:disabled,
.vt-icon-btn.is-busy {
  opacity: 0.55;
  cursor: default;
}

.vt-icon-btn .vt-icon {
  display: flex;
}

.vt-account-status-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  flex-shrink: 0;
}

.vt-account-status-side .tc-check-row {
  padding: 4px 8px;
  font-size: 12px;
}

.vt-hero-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 2px;
  font-size: 12px;
  color: var(--tc-text-secondary);
  line-height: 1.4;
}

.vt-hero-stat strong {
  color: var(--tc-text-primary);
  font-weight: 700;
}

.vt-hero-stat--teal strong { color: var(--tc-teal-light); }
.vt-hero-stat--amber strong { color: var(--tc-amber); }

.vt-hero-stat-sep {
  color: var(--tc-text-tertiary);
  opacity: 0.7;
}

.vt-hero-stat-note {
  margin-inline-start: 4px;
  color: var(--tc-rose);
  font-size: 11px;
}

.vt-session-toolbar {
  gap: 8px;
}

.vt-session-toolbar .tc-btn {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
}

.vt-account-busy-btn.is-busy,
.vt-account-busy-btn.is-busy .tc-btn-busy-text {
  color: var(--tc-rose);
  border-color: color-mix(in srgb, var(--tc-rose) 45%, var(--tc-stroke));
}

.vt-account-busy-btn.is-busy {
  height: auto;
  min-height: 30px;
  white-space: normal;
  padding-block: 6px;
}

.vt-account-busy-btn.is-busy .tc-btn-busy-text {
  white-space: normal;
  text-align: center;
  line-height: 1.35;
  font-weight: 700;
  font-size: 11.5px;
}

.vt-account-main {
  flex: 1;
  min-width: 160px;
  cursor: pointer;
}

.vt-account-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 140px;
}

@media (max-width: 640px) {
  .vt-account-main,
  .vt-account-actions {
    min-width: 0;
    width: 100%;
  }

  .vt-account-status-row {
    flex-direction: column;
    align-items: stretch;
  }

  .vt-account-status-side {
    width: 100%;
  }

  .vt-account-status-side .tc-check-row {
    width: 100%;
  }
}

/* Account page — session cards wrap side-by-side when space allows */
.vt-session-list {
  gap: 10px;
}

.vt-session-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.vt-session-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--tc-radius-md);
  border: 1px solid var(--tc-stroke);
  background: var(--tc-surface-muted);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  min-width: 0;
  height: 100%;
}

.vt-session-row:hover {
  border-color: var(--tc-stroke-strong);
  background: var(--tc-surface-hover);
}

.vt-session-row.is-focused {
  border-color: var(--tc-teal);
  background: color-mix(in srgb, var(--tc-surface-muted) 82%, var(--tc-teal) 18%);
  box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.28);
}

.vt-session-avatar {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--tc-layer);
  color: var(--tc-text-tertiary);
  overflow: hidden;
}

.vt-session-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vt-session-avatar--healthy { background: var(--tc-teal-soft); color: var(--tc-teal-light); }
.vt-session-avatar--rose { background: var(--tc-rose-soft); color: var(--tc-rose); }
.vt-session-avatar--amber { background: var(--tc-amber-soft); color: var(--tc-amber); }

.vt-session-info {
  flex: 1;
  min-width: 0;
}

.vt-session-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.vt-session-name {
  font-size: 14px;
  margin: 0;
}

.vt-session-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--tc-stroke);
  background: var(--tc-layer);
  color: var(--tc-text-secondary);
  white-space: nowrap;
}

.vt-session-status-pill--healthy {
  color: var(--tc-teal-light);
  border-color: color-mix(in srgb, var(--tc-teal) 45%, var(--tc-stroke));
  background: var(--tc-teal-soft);
}

.vt-session-status-pill--rose {
  color: var(--tc-rose);
  border-color: color-mix(in srgb, var(--tc-rose) 45%, var(--tc-stroke));
  background: var(--tc-rose-soft);
}

.vt-session-status-pill--amber {
  color: var(--tc-amber);
  border-color: color-mix(in srgb, var(--tc-amber) 45%, var(--tc-stroke));
  background: var(--tc-amber-soft);
}

.vt-session-meta {
  margin: 4px 0 0;
  direction: ltr;
  text-align: right;
}

.vt-session-health-msg {
  margin: 4px 0 0;
  opacity: 0.8;
}

.vt-session-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
  min-width: 128px;
}

.vt-session-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  margin: 0;
}

.vt-session-logout {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  align-self: stretch;
}

/* Proxy manager — pool table */
.vt-proxy-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 460px;
  overflow: auto;
}

.vt-proxy-table-head,
.vt-proxy-table-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto 56px;
  align-items: center;
  gap: 10px;
}

.vt-proxy-table-head {
  padding: 0 12px 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--tc-text-tertiary);
  position: sticky;
  top: 0;
  background: var(--tc-surface-elevated);
  z-index: 1;
}

.vt-proxy-table-row {
  padding: 8px 12px;
  border-radius: var(--tc-radius-sm);
  border: 1px solid var(--tc-stroke);
  background: var(--tc-surface-muted);
}

.vt-proxy-table-row:hover {
  border-color: var(--tc-stroke-strong);
}

.vt-proxy-table-row .tc-caption {
  margin: 0;
}

.vt-proxy-host {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tc-text-primary);
  overflow-wrap: anywhere;
}

.vt-proxy-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: max-content;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.4;
  border: 1px solid var(--tc-stroke);
  background: var(--tc-layer);
  color: var(--tc-text-secondary);
  white-space: nowrap;
  justify-self: start;
}

.vt-proxy-status--healthy {
  color: var(--tc-teal-light);
  border-color: color-mix(in srgb, var(--tc-teal) 45%, var(--tc-stroke));
  background: var(--tc-teal-soft);
}

.vt-proxy-status--dead {
  color: var(--tc-rose);
  border-color: color-mix(in srgb, var(--tc-rose) 45%, var(--tc-stroke));
  background: var(--tc-rose-soft);
}

.vt-proxy-status--untested {
  color: var(--tc-amber);
  border-color: color-mix(in srgb, var(--tc-amber) 45%, var(--tc-stroke));
  background: var(--tc-amber-soft);
}

.vt-proxy-remove {
  height: 26px;
  padding: 0 10px;
  font-size: 11.5px;
}

.vt-proxy-test-progress {
  color: var(--tc-amber);
  font-weight: 600;
}

/* Compact single-line status filters — scoped to the proxy manager page only. */
.vt-proxy-filters {
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 6px;
  margin-bottom: 10px;
}

.vt-proxy-filters .tc-mode-pill {
  height: 24px;
  padding: 0 10px;
  font-size: 11px;
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .vt-proxy-table-head {
    display: none;
  }

  .vt-proxy-table-row {
    grid-template-columns: 1fr auto;
    gap: 6px 10px;
  }
}

@media (max-width: 640px) {
  .vt-session-grid {
    grid-template-columns: 1fr;
  }

  .vt-session-row {
    flex-wrap: wrap;
  }

  .vt-session-actions {
    flex-direction: row;
    flex-wrap: wrap;
    min-width: 0;
    width: 100%;
    justify-content: flex-start;
    margin-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vt-page .tc-page-root,
  .tc-feature-card,
  .tc-stat-card,
  .tc-btn--primary,
  .vt-help-mark,
  .vt-help-tip--portal,
  .vt-sidebar,
  .vt-nav-backdrop,
  .vt-nav-toggle-bar {
    animation: none !important;
    transition: none !important;
  }

  .vt-shell.is-nav-open .vt-nav-toggle-bar:nth-child(1),
  .vt-shell.is-nav-open .vt-nav-toggle-bar:nth-child(3) {
    transform: none !important;
  }
}

/* Fake Chat */
.fc-pair-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fc-pair-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--tc-stroke);
  background: var(--tc-surface-muted);
}

.fc-pair-card__sides {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
}

.fc-pair-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.fc-pair-side__badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--tc-on-accent);
  background: var(--tc-brand-gradient);
}

.fc-pair-side__badge--b {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.fc-pair-side__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--tc-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fc-pair-card__swap {
  color: var(--tc-text-secondary);
  font-size: 16px;
}

.fc-new-dialogue-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.fc-new-dialogue-row .tc-input {
  flex: 1 1 auto;
  min-width: 0;
}

.fc-dialogue-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 420px;
  overflow: auto;
}

.fc-dialogue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--tc-text-primary);
  cursor: pointer;
  text-align: start;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.fc-dialogue-item:hover {
  background: var(--tc-surface-hover);
}

.fc-dialogue-item.is-active {
  border-color: color-mix(in srgb, var(--tc-teal) 55%, var(--tc-stroke));
  background: color-mix(in srgb, var(--tc-teal) 12%, transparent);
}

.fc-dialogue-item__title {
  font-size: 13.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fc-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.fc-chat-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--tc-stroke);
  background:
    radial-gradient(circle at top, color-mix(in srgb, var(--tc-teal) 10%, transparent), transparent 55%),
    var(--tc-surface-muted);
}

.fc-chat-preview__empty {
  margin: auto;
  text-align: center;
}

.fc-bubble-row {
  display: flex;
  width: 100%;
}

.fc-bubble-row.is-one {
  justify-content: flex-start;
}

.fc-bubble-row.is-two {
  justify-content: flex-end;
}

.fc-bubble {
  width: min(100%, 420px);
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--tc-stroke) 80%, transparent);
  background: var(--tc-surface);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.fc-bubble-row.is-one .fc-bubble {
  border-bottom-right-radius: 6px;
  background: color-mix(in srgb, var(--tc-teal) 14%, var(--tc-surface));
}

.fc-bubble-row.is-two .fc-bubble {
  border-bottom-left-radius: 6px;
  background: color-mix(in srgb, #6366f1 16%, var(--tc-surface));
}

.fc-bubble__meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.fc-bubble__speaker {
  font-size: 11px;
  font-weight: 800;
  color: var(--tc-teal-light);
}

.fc-bubble-row.is-two .fc-bubble__speaker {
  color: #a5b4fc;
}

.fc-bubble__index {
  font-size: 11px;
  color: var(--tc-text-secondary);
}

.fc-bubble__reply {
  margin: 0 0 8px;
  padding: 6px 8px;
  border-radius: 8px;
  border-inline-start: 3px solid var(--tc-teal);
  background: color-mix(in srgb, var(--tc-surface-muted) 80%, transparent);
  font-size: 11.5px;
  color: var(--tc-text-secondary);
  line-height: 1.4;
}

.fc-bubble__body {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--tc-text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.fc-bubble__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.fc-mini-btn {
  appearance: none;
  border: 1px solid var(--tc-stroke);
  background: var(--tc-surface-muted);
  color: var(--tc-text-secondary);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.fc-mini-btn:hover:not(:disabled) {
  color: var(--tc-text-primary);
  border-color: var(--tc-teal);
}

.fc-mini-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.fc-mini-btn.is-danger:hover:not(:disabled) {
  border-color: #f87171;
  color: #fecaca;
}

.fc-compose {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}

.fc-compose__row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 720px) {
  .fc-pair-card__sides {
    grid-template-columns: 1fr;
  }

  .fc-pair-card__swap {
    display: none;
  }

  .fc-new-dialogue-row {
    flex-direction: column;
    align-items: stretch;
  }
}
