/* 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-input:focus,
.tc-textarea:focus,
.tc-select:focus {
  box-shadow: var(--tc-focus-ring);
}

.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: 1;
  min-width: 0;
  line-height: 1.35;
}

.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);
}

/* 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-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: 36px;
  white-space: normal;
  padding-block: 8px;
}

.vt-account-busy-btn.is-busy .tc-btn-busy-text {
  white-space: normal;
  text-align: center;
  line-height: 1.4;
  font-weight: 700;
}

.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%;
  }
}

@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;
  }
}
