/* ============================================================
   АНАЛИТИК CLOUD — Терминал идей (Signal Terminal)
   Standalone page, own "term-" namespace (no .cabinet-* reuse) —
   consumes the same design tokens from variables.css so the look
   matches the rest of the platform.
   ============================================================ */

.term-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.term-container {
  width: 100%;
  max-width: var(--shell-max-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
}

/* ── Topbar ── */
.term-topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
}

.term-topbar__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
}

/* Wrapper — display:contents on web/narrow; real flex row in Electron desktop */
.term-topbar__main {
  display: contents;
}

.term-topbar__main .term-topbar__back {
  margin-left: 0;
}

.term-topbar__header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.term-topbar__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--color-text);
}

.term-topbar__logo-icon svg,
.term-topbar__logo-icon img,
.term-topbar__logo-robot {
  width: 28px;
  height: 28px;
  display: block;
  object-fit: contain;
  object-position: center;
  background: transparent;
  border: none;
  box-shadow: none;
  filter: drop-shadow(0 0 5px rgba(216, 160, 80, 0.35));
}

.term-topbar__logo-text {
  font-family: var(--font-brand);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.term-topbar__logo-text .brand-main { color: var(--color-cyan); }
.term-topbar__logo-text .brand-word { color: var(--color-text); }

.term-topbar__logo-text--brand {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.term-topbar__logo-text--brand .brand-main,
.term-topbar__logo-text--brand .brand-word {
  color: var(--color-cyan);
}

.term-topbar__title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
}

.term-topbar__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.term-topbar__back:hover {
  border-color: var(--color-border-glow);
  color: var(--color-cyan);
}

/* ── Page shell ── */
.term-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--grid-gap);
  padding-top: var(--space-xl);
  padding-bottom: var(--space-2xl);
}

.term-card {
  background: var(--dt-card-bg);
  border: 1px solid var(--dt-card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  padding: var(--space-xl);
}

/* ── Hero / header block ── */
.term-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.term-hero__title {
  font-family: var(--font-display);
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 4px;
}

.term-hero__subtitle {
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
  margin: 0;
}

.term-hero__badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.term-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid var(--color-border);
  white-space: nowrap;
}

.term-badge--live {
  color: var(--color-green);
  border-color: var(--color-green-border);
  background: var(--color-green-dim);
}

.term-badge__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-green);
  box-shadow: 0 0 8px var(--color-green-glow);
  animation: term-pulse 1.6s ease-in-out infinite;
}

@keyframes term-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.term-badge--mode {
  color: var(--color-cyan);
  border-color: var(--color-border-glow);
  background: var(--color-cyan-dim);
}

.term-badge--verified {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.38);
  background: rgba(6, 78, 59, 0.22);
}

.term-badge--required {
  color: var(--color-yellow);
  border-color: var(--color-yellow-border);
  background: var(--color-yellow-dim);
}

/* ── Locked preview ── */
.term-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-md);
  padding: var(--space-2xl) var(--space-xl);
}

.term-locked[hidden] {
  display: none !important;
}

/* ── Telegram entry gate (browser direct access blocked) ── */
.term-page:has(#term-tg-gate:not([hidden])) {
  flex: 1;
  justify-content: center;
  padding-top: max(24px, 10vh);
  padding-bottom: max(32px, 10vh);
}

.term-page:has(#term-tg-gate:not([hidden])) .term-hero,
.term-page:has(#term-tg-gate:not([hidden])) .term-footer {
  display: none;
}

.term-tg-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: 28px 22px;
}

.term-tg-gate[hidden] {
  display: none !important;
}

.term-tg-gate__icon {
  color: var(--color-cyan);
  display: inline-flex;
}

.term-tg-gate__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text);
}

.term-tg-gate__text {
  max-width: 320px;
  margin: 0;
  color: rgba(212, 215, 218, 0.82);
  font-size: 14px;
  line-height: 1.5;
}

.term-tg-gate__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  margin-top: 4px;
}

.term-tg-gate__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  box-sizing: border-box;
}

.term-tg-gate__btn--primary {
  color: #101214;
  background: linear-gradient(135deg, #d8a050 0%, #b8853e 100%);
  border-color: rgba(216, 160, 80, 0.45);
}

.term-tg-gate__btn--ghost {
  color: var(--color-text-muted);
  background: rgba(216, 160, 80, 0.06);
  border-color: rgba(216, 160, 80, 0.18);
}

.term-tg-gate__hint {
  max-width: 480px;
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--color-yellow);
}

.term-locked__icon {
  color: var(--color-yellow);
  display: inline-flex;
}

.term-locked__text {
  max-width: 480px;
  color: var(--color-text-muted);
  font-size: var(--font-size-md);
  line-height: 1.5;
  margin: 0;
}

.term-locked__cta {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #141618;
  background: linear-gradient(135deg, var(--color-cyan), var(--color-purple));
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  cursor: pointer;
  transition: var(--transition-fast);
  width: 100%;
  max-width: 360px;
}

.term-locked__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  max-width: 360px;
}

.term-locked__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.term-locked__btn--secondary {
  color: var(--color-text);
  background: rgba(216, 160, 80, 0.08);
  border: 1px solid rgba(216, 160, 80, 0.28);
}

.term-locked__btn--secondary:hover {
  border-color: rgba(216, 160, 80, 0.45);
  box-shadow: 0 0 16px rgba(216, 160, 80, 0.12);
}

.term-locked__btn--ghost {
  color: var(--color-cyan);
  background: transparent;
  border: 1px solid rgba(216, 160, 80, 0.18);
}

.term-locked__btn--ghost:hover {
  background: rgba(216, 160, 80, 0.06);
  border-color: rgba(216, 160, 80, 0.34);
}

.term-locked__cta:hover { box-shadow: var(--shadow-glow-cyan); }
.term-locked__cta:disabled { opacity: 0.6; cursor: not-allowed; }

.term-locked__hint {
  color: var(--color-yellow);
  font-size: var(--font-size-sm);
  margin: 0;
}

/* ── Main terminal ── */
.term-main {
  display: flex;
  flex-direction: column;
  gap: var(--grid-gap);
}

.term-main[hidden] {
  display: none !important;
}

/* Mode selector */
.term-modes-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.term-modeselect {
  display: flex;
  gap: 8px;
  padding: 6px;
}

.term-mode-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 54px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-text-muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: var(--transition-fast);
  line-height: 1.2;
}

.term-mode-btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: currentColor;
  opacity: 0.88;
}

.term-mode-btn__icon svg {
  width: 100%;
  height: 100%;
}

.term-mode-btn__label {
  text-align: center;
}

.term-mode-btn:hover {
  color: var(--color-text);
  border-color: rgba(255, 255, 255, 0.1);
}

.term-mode-btn--otc.is-active {
  color: var(--color-purple);
  border-color: rgba(216, 160, 80, 0.45);
  background: var(--color-purple-dim);
  box-shadow: 0 0 0 1px rgba(216, 160, 80, 0.2) inset, 0 0 12px rgba(216, 160, 80, 0.14);
}

.term-mode-btn--fx.is-active {
  color: var(--color-cyan);
  border-color: rgba(216, 160, 80, 0.42);
  background: var(--color-cyan-dim);
  box-shadow: 0 0 0 1px rgba(216, 160, 80, 0.18) inset, 0 0 12px rgba(216, 160, 80, 0.12);
}

/* Crypto module — centered compact card below OTC / FX */
.term-crypto-module {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  max-width: 268px;
  margin: 0 auto;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(216, 160, 80, 0.22);
  background: rgba(216, 160, 80, 0.03);
  box-shadow: 0 0 10px rgba(216, 160, 80, 0.04);
}

.term-crypto-module.is-active {
  border-color: rgba(216, 160, 80, 0.48);
  background: rgba(216, 160, 80, 0.07);
  box-shadow: 0 0 0 1px rgba(216, 160, 80, 0.14) inset, 0 0 14px rgba(216, 160, 80, 0.16);
}

.term-crypto-module__head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
}

.term-crypto-module__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-cyan);
}

.term-crypto-module__icon svg {
  width: 100%;
  height: 100%;
}

.term-crypto-module__title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-cyan);
  white-space: nowrap;
}

.term-crypto-module__dots {
  width: 26px;
  height: 12px;
  flex-shrink: 0;
  background-image: radial-gradient(circle, rgba(216, 160, 80, 0.55) 1px, transparent 1px);
  background-size: 5px 5px;
  opacity: 0.55;
}

.term-crypto-module__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(216, 160, 80, 0.24);
  background: rgba(216, 160, 80, 0.05);
  font-size: 12px;
  line-height: 1.2;
}

.term-crypto-module__btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: currentColor;
  opacity: 0.9;
}

.term-crypto-module__btn-icon svg {
  width: 100%;
  height: 100%;
}

.term-crypto-module__btn-label {
  text-align: center;
}

.term-crypto-module__btn:hover {
  color: var(--color-text);
  border-color: rgba(216, 160, 80, 0.38);
}

.term-crypto-module__btn.is-active {
  color: var(--color-cyan);
  border-color: rgba(216, 160, 80, 0.5);
  background: var(--color-cyan-dim);
  box-shadow: 0 0 0 1px rgba(216, 160, 80, 0.2) inset, 0 0 10px rgba(216, 160, 80, 0.14);
}

/* Idea card */
.term-idea {
  min-height: 160px;
}

.term-idea__empty,
.term-idea__message {
  color: var(--color-text-dim);
  font-size: var(--font-size-base);
  text-align: center;
  margin: var(--space-lg) 0;
}

.term-idea__message {
  color: var(--color-yellow);
}

.term-idea__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.term-idea__asset {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
}

.term-idea__dir {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 6px 16px;
  border-radius: 8px;
}

.term-idea__dir--buy {
  color: var(--color-green);
  background: var(--color-green-dim);
  border: 1px solid var(--color-green-border);
}

.term-idea__dir--sell {
  color: var(--color-red);
  background: var(--color-red-dim);
  border: 1px solid var(--color-red-border);
}

.term-idea__meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.term-idea__meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.term-idea__meta-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.term-idea__meta-value {
  font-family: var(--font-display);
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--color-text);
}

.term-tier--standard { color: var(--color-standard); }
.term-tier--strong   { color: var(--color-strong); }
.term-tier--elite    { color: var(--color-elite); }

.term-idea__status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
}

.term-idea__status {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
}

.term-idea__countdown {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-cyan);
}

/* Action button */
.term-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.term-action__hint {
  margin: 0;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-cyan);
  text-align: center;
}

.term-action__hint[hidden] {
  display: none !important;
}

.term-action__btn {
  width: 100%;
  max-width: 420px;
  padding: 14px 24px;
  border-radius: 12px;
  border: 1px solid var(--color-border-glow);
  background: linear-gradient(135deg, rgba(216, 160, 80, 0.18), rgba(216, 160, 80, 0.18));
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: var(--transition-fast);
}

.term-action__btn:hover {
  box-shadow: var(--shadow-glow-cyan);
  border-color: var(--color-cyan);
}

.term-action__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* History */
.term-history__title {
  font-family: var(--font-display);
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 var(--space-md);
}

.term-history__head {
  display: grid;
  grid-template-columns: 64px 1fr 100px 80px;
  gap: 8px;
  padding: 0 10px 6px;
  font-size: var(--font-size-xs);
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--color-border);
}

.term-history__list {
  display: flex;
  flex-direction: column;
  max-height: 280px;
  overflow-y: auto;
}

.term-history__row {
  display: grid;
  grid-template-columns: 64px 1fr 100px 80px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(216, 160, 80, 0.06);
  font-size: var(--font-size-sm);
}

.term-history__row:last-child { border-bottom: none; }

.term-history__cell--time,
.term-history__cell--conf { color: var(--color-text-muted); font-family: var(--font-display); }

.term-history__cell--asset { color: var(--color-text); font-weight: 600; }

.term-dir--buy { color: var(--color-green); font-weight: 700; }
.term-dir--sell { color: var(--color-red); font-weight: 700; }

.term-history__cell--status {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.term-status--win { color: var(--color-green); }
.term-status--loss { color: var(--color-red); }
.term-status--pending { color: var(--color-text-dim); }
.term-status--cancelled { color: var(--color-text-dim); }

.term-history__empty {
  color: var(--color-text-dim);
  font-size: var(--font-size-base);
  text-align: center;
  padding: var(--space-lg) 0;
  margin: 0;
}

/* Telegram preparation block (inert) */
.term-telegram {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  opacity: 0.78;
}

.term-telegram__icon {
  color: var(--color-cyan);
  flex-shrink: 0;
}

.term-telegram__body { flex: 1; }

.term-telegram__title {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 2px;
}

.term-telegram__text {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin: 0;
}

.term-telegram__btn {
  flex-shrink: 0;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: not-allowed;
}

/* Footer nav */
.term-footer {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.term-footer__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.term-footer__sep {
  color: rgba(216, 160, 80, 0.28);
  font-size: var(--font-size-sm);
  font-weight: 600;
  line-height: 1;
  padding: 0 12px;
  user-select: none;
}

.term-footer__link {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-fast);
}

.term-footer__link:hover { color: var(--color-cyan); }

.term-footer__link--active {
  color: var(--color-cyan);
}

.term-footer__copy {
  color: var(--color-text-dim);
  font-size: var(--font-size-xs);
  margin: 0;
}

/* ══════════════════════════════
   DESKTOP COMPACT LOCKED (Electron — has session but not verified)
══════════════════════════════ */
.term-desktop-compact-locked {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}

.term-desktop-compact-locked[hidden] { display: none !important; }

.tdcl__icon {
  display: inline-flex;
  color: var(--color-yellow);
  flex-shrink: 0;
}

.tdcl__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tdcl__title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.tdcl__text {
  font-size: 11px;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
}

.tdcl__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tdcl__btn {
  flex: 1;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
  white-space: nowrap;
}

.tdcl__btn--primary {
  background: linear-gradient(135deg, rgba(216, 160, 80,0.18), rgba(216, 160, 80,0.18));
  border: 1px solid var(--color-border-glow);
  color: var(--color-text);
}

.tdcl__btn--primary:hover {
  box-shadow: var(--shadow-glow-cyan);
  border-color: var(--color-cyan);
  color: var(--color-cyan);
}

.tdcl__btn--secondary {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.tdcl__btn--secondary:hover {
  border-color: var(--color-border-glow);
  color: var(--color-text);
}

/* ══════════════════════════════
   DESKTOP LOGIN (Electron only — compact, no session yet)
══════════════════════════════ */
.term-desktop-login {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}

.term-desktop-login[hidden] { display: none !important; }

/* Header row: small icon + title */
.term-desktop-login__header {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--color-cyan);
}

.term-desktop-login__title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text);
}

/* Compact form */
.term-desktop-login__form {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.term-desktop-login__input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--color-border-glow);
  background: rgba(216, 160, 80, 0.04);
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 12px;
  outline: none;
  transition: var(--transition-fast);
  box-sizing: border-box;
}

.term-desktop-login__input::placeholder { color: var(--color-text-dim); }

.term-desktop-login__input:focus {
  border-color: var(--color-cyan);
  background: rgba(216, 160, 80, 0.08);
  box-shadow: 0 0 0 2px rgba(216, 160, 80, 0.12);
}

.term-desktop-login__btn {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, var(--color-cyan), var(--color-purple));
  color: #0e1012;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: var(--transition-fast);
}

.term-desktop-login__btn:hover  { opacity: 0.88; box-shadow: var(--shadow-glow-cyan); }
.term-desktop-login__btn:disabled { opacity: 0.5; cursor: not-allowed; }

.term-desktop-login__error {
  font-size: 11px;
  color: var(--color-red);
  margin: 0;
}

.term-desktop-login__error[hidden] { display: none; }

/* Footer: "open in browser" link-button */
.term-desktop-login__footer {
  display: flex;
  justify-content: center;
}

.term-desktop-login__open-cabinet {
  background: none;
  border: none;
  color: var(--color-text-dim);
  font-size: 11px;
  font-family: var(--font-display);
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: var(--transition-fast);
}

.term-desktop-login__open-cabinet:hover { color: var(--color-cyan); }

/* Hide the big referral lock in desktop mode */
body.is-desktop-app .term-locked { display: none !important; }

/* ══════════════════════════════
   SIGNAL CARD — redesigned compact panel
   Replaces .term-idea in the mini terminal
══════════════════════════════ */

.term-signal-card {
  padding: 0;
  overflow: hidden;
}

/* ── Empty state ── */
.term-signal__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px 18px;
  text-align: center;
  min-height: 120px;
}

.term-signal__empty[hidden] { display: none !important; }

.term-signal__empty-icon {
  color: var(--color-cyan);
  opacity: 0.3;
  animation: term-signal-breathe 2.4s ease-in-out infinite;
}

@keyframes term-signal-breathe {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.08); }
}

.term-signal__empty-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
  margin: 0;
}

.term-signal__empty-hint {
  font-size: 11px;
  color: var(--color-text-dim);
  margin: 0;
  max-width: 260px;
  line-height: 1.5;
}

/* ── No-signal / error message ── */
.term-signal__no-signal {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 16px;
  min-height: 60px;
}

.term-signal__no-signal[hidden] { display: none !important; }

.term-signal__no-signal-icon {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--color-text-dim);
}

.term-signal__no-signal-text {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ── Exchange market closed (FX schedule) ── */
.term-fx-closed {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 18px 16px 16px;
  min-height: 100px;
}

.term-fx-closed[hidden] {
  display: none !important;
}

.term-fx-closed__icon {
  color: var(--color-cyan);
  opacity: 0.75;
  margin-bottom: 2px;
}

.term-fx-closed__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-text);
  line-height: 1.35;
}

.term-fx-closed__opens {
  margin: 0;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-cyan);
  line-height: 1.4;
}

.term-fx-closed__alt {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.45;
  max-width: 280px;
}

/* ── Admin/dev signal rejection diagnostics ── */
.term-signal-debug {
  margin: 0 12px 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(233, 184, 99, 0.28);
  background: rgba(16, 19, 24, 0.72);
  font-family: var(--font-mono, 'Manrope', sans-serif);
}

.term-signal-debug[hidden] { display: none !important; }

.term-signal-debug__title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(241, 209, 154, 0.92);
}

.term-signal-debug__list {
  display: grid;
  grid-template-columns: minmax(88px, 34%) minmax(0, 1fr);
  gap: 4px 10px;
  margin: 0;
}

.term-signal-debug__key {
  margin: 0;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(169, 175, 181, 0.82);
  line-height: 1.35;
}

.term-signal-debug__val {
  margin: 0;
  font-size: 10px;
  line-height: 1.4;
  color: rgba(225, 227, 230, 0.92);
  word-break: break-word;
}

/* ── Active signal body ── */
.term-signal__body[hidden] { display: none !important; }

/* Top row: pair + mode badge + timer */
.term-signal__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px 6px;
}

.term-signal__top-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
  flex: 1 1 auto;
}

.term-signal__asset {
  font-family: var(--font-display);
  font-size: clamp(14px, 2.6vw, 18px);
  font-weight: 800;
  color: var(--color-cyan);
  letter-spacing: 0.06em;
  line-height: 1.15;
  min-width: 0;
  white-space: normal;
  word-break: keep-all;
  text-shadow: 0 0 16px rgba(216, 160, 80, 0.35);
}

.term-signal__mode-badge {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-cyan);
  background: var(--color-cyan-dim);
  border: 1px solid var(--color-border-glow);
  border-radius: 5px;
  padding: 2px 7px;
}

.term-signal__timer-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(216, 160, 80, 0.18);
  background: rgba(216, 160, 80, 0.05);
}

.term-signal__timer-wrap[hidden] { display: none !important; }

.term-signal__timer-icon {
  font-size: 12px;
  line-height: 1;
  opacity: 0.75;
}

.term-signal__timer-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.term-signal__countdown {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-cyan);
  letter-spacing: 0.06em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.term-signal__timer-label {
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--color-text-dim);
}

/* Legacy header alias — kept for compatibility */
.term-signal__header {
  display: none;
}

/* Admin-only bypass badge — shown only when testForexPoUnverified===true */
.term-signal__bypass-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px 12px 0;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.30);
  color: var(--color-yellow, #fbbf24);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.term-signal__bypass-badge[hidden] { display: none !important; }

/* Direction block — aligned with main platform cs-direction */
.term-signal__kicker { display: none; }

.term-signal__dir-block {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 6px 12px 0;
  padding: 12px 14px;
  min-height: 54px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: var(--transition-fast);
}

.term-signal__dir-block--buy {
  background: rgba(0, 255, 136, 0.08);
  border-color: rgba(0, 255, 136, 0.28);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.12), inset 0 0 14px rgba(0, 255, 136, 0.03);
}

.term-signal__dir-block--sell {
  background: rgba(255, 68, 102, 0.08);
  border-color: rgba(255, 68, 102, 0.28);
  box-shadow: 0 0 20px rgba(255, 68, 102, 0.12), inset 0 0 14px rgba(255, 68, 102, 0.03);
}

.term-signal__dir-texts {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.term-signal__dir-main {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-align: center;
  width: 100%;
  padding: 0 52px 0 8px;
  box-sizing: border-box;
}

.term-signal__dir-block--buy .term-signal__dir-main {
  color: var(--color-green);
  text-shadow: 0 0 14px rgba(0, 255, 136, 0.35);
}

.term-signal__dir-block--sell .term-signal__dir-main {
  color: var(--color-red);
  text-shadow: 0 0 14px rgba(255, 68, 102, 0.35);
}

.term-signal__dir-ru {
  display: none;
}

/* Tier badge inside direction block */
.term-signal__tier {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid transparent;
  text-align: center;
}

.term-signal__tier.term-tier--standard {
  color: var(--color-standard);
  border-color: var(--color-standard-dim);
  background: var(--color-standard-dim);
}

.term-signal__tier.term-tier--strong {
  color: var(--color-strong);
  border-color: var(--color-strong-dim);
  background: var(--color-strong-dim);
}

.term-signal__tier.term-tier--elite {
  color: var(--color-elite);
  border-color: var(--color-elite-dim);
  background: var(--color-elite-dim);
  box-shadow: 0 0 8px var(--color-elite-glow);
}

/* Details — unified field rows (main platform cs-fields) */
.term-signal__fields {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 8px 12px 12px;
  border-radius: 8px;
  border: 1px solid rgba(216, 160, 80, 0.1);
  background: rgba(14, 17, 22, 0.45);
  overflow: hidden;
}

.term-signal__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid rgba(216, 160, 80, 0.06);
}

.term-signal__row:first-child { border-top: none; }

.term-signal__row-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--color-text-dim);
  flex-shrink: 0;
}

.term-signal__row-value {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  text-align: right;
}

.term-signal__row-value--payout {
  color: var(--color-green);
}

.term-signal-card--buy {
  border-color: rgba(0, 255, 136, 0.32) !important;
  box-shadow: var(--shadow-card), 0 0 24px rgba(0, 255, 136, 0.1) !important;
}

.term-signal-card--sell {
  border-color: rgba(255, 68, 102, 0.32) !important;
  box-shadow: var(--shadow-card), 0 0 24px rgba(255, 68, 102, 0.1) !important;
}

/* Legacy grid — kept for mini overrides compatibility */
.term-signal__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--color-border);
  margin-top: 10px;
  border-top: 1px solid var(--color-border);
}

.term-signal__cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 14px;
  background: var(--dt-card-bg);
}

.term-signal__cell-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-dim);
}

.term-signal__cell-value {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.02em;
}

/* Confidence coloring */
.term-signal__conf.conf--standard { color: var(--color-standard); }
.term-signal__conf.conf--strong   { color: var(--color-strong);   }
.term-signal__conf.conf--elite    { color: var(--color-elite);     }

/* Status coloring */
.term-signal__status-val.is-active  { color: var(--color-green);      }
.term-signal__status-val.is-waiting { color: var(--color-text-dim);   }
.term-signal__status-val.is-expired { color: var(--color-text-dim);   }

/* Legacy bottom countdown row — replaced by top timer */
.term-signal__countdown-row { display: none !important; }

/* ── mini-mode overrides for signal card ── */
body.term-mini .term-signal-card { border-radius: 10px; }

body.term-mini .term-signal__empty { padding: 16px 14px; min-height: 100px; gap: 6px; }
body.term-mini .term-fx-closed { padding: 14px 12px 12px; min-height: 92px; gap: 5px; }
body.term-mini .term-fx-closed__title { font-size: 12px; }
body.term-mini .term-fx-closed__opens { font-size: 11px; }
body.term-mini .term-fx-closed__alt { font-size: 10px; }
body.term-mini .term-signal__empty-title { font-size: 11px; }
body.term-mini .term-signal__empty-hint  { font-size: 10px; }

body.term-mini .term-signal__top { padding: 8px 12px 4px; }
body.term-mini .term-signal__asset  { font-size: 14px; }

body.term-mini .term-signal__dir-block { margin: 4px 10px 0; padding: 10px 12px; min-height: 48px; }
body.term-mini .term-signal__dir-main  { font-size: 26px; }

body.term-mini .term-signal__fields { margin: 6px 10px 10px; }
body.term-mini .term-signal__row { padding: 7px 10px; }
body.term-mini .term-signal__row-value { font-size: 11px; }

body.term-mini .term-signal__countdown { font-size: 13px; }
body.term-mini .term-signal__timer-wrap { padding: 3px 7px; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .term-idea__meta { grid-template-columns: repeat(2, 1fr); }
  .term-history__head,
  .term-history__row { grid-template-columns: 56px 1fr 70px 90px; }
  .term-history__head span:nth-child(4),
  .term-history__row .term-history__cell--conf { display: none; }
}

@media (max-width: 600px) {
  .term-topbar__title { display: none; }
  .term-hero { flex-direction: column; align-items: flex-start; }
  .term-history__head { display: none; }
  .term-history__row {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    row-gap: 4px;
  }
  .term-telegram { flex-direction: column; align-items: flex-start; text-align: left; }
}

/* ══════════════════════════════
   MINI / DESKTOP COMPACT MODE
   Electron overlay + narrow browser
══════════════════════════════ */

.term-mini-only { display: none !important; }

.term-topbar__brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.term-topbar__subtitle {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.term-topbar__badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-left: auto;
}

.term-badge--pin {
  color: var(--color-cyan);
  border-color: var(--color-border-glow);
  background: var(--color-cyan-dim);
  font-size: 9px;
  padding: 3px 8px;
  pointer-events: none;
  user-select: none;
}

/* Layout pin — primary header control */
.term-layout-pin-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid rgba(216, 160, 80, 0.18);
  background: rgba(216, 160, 80, 0.05);
  color: rgba(174, 180, 186, 0.88);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
  padding: 0;
}

.term-layout-pin-btn__icon {
  display: block;
  transform: translateY(-1px);
  filter: grayscale(0.35) brightness(0.92);
  transition: filter 0.15s, transform 0.15s;
}

.term-layout-pin-btn:hover {
  border-color: rgba(216, 160, 80, 0.42);
  color: var(--color-cyan);
  background: rgba(216, 160, 80, 0.12);
}

.term-layout-pin-btn:hover .term-layout-pin-btn__icon {
  filter: none;
}

.term-layout-pin-btn.is-active {
  border-color: rgba(198, 139, 57, 0.58);
  background:
    linear-gradient(145deg, rgba(216, 160, 80, 0.2) 0%, rgba(233, 184, 99, 0.14) 100%);
  box-shadow:
    0 0 14px rgba(216, 160, 80, 0.28),
    0 0 20px rgba(233, 184, 99, 0.12);
}

.term-layout-pin-btn.is-active .term-layout-pin-btn__icon {
  filter: none;
  transform: translateY(-1px) scale(1.06);
}

.term-layout-pin-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(233, 184, 99, 0.38);
  background: rgba(233, 184, 99, 0.1);
  color: rgba(236, 238, 240, 0.95);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.term-layout-pin-badge[hidden] {
  display: none !important;
}

/* Window controls (Electron) */
.term-topbar__window-actions {
  display: none;
}

.term-win-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
  flex-shrink: 0;
}

.term-win-controls[hidden] {
  display: none !important;
}

body.is-desktop-app .term-win-controls {
  display: flex !important;
}

.term-win-btn {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: rgba(216, 160, 80, 0.04);
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 0;
}

.term-win-btn:hover {
  border-color: var(--color-border-glow);
  color: var(--color-cyan);
  background: rgba(216, 160, 80, 0.1);
}

.term-win-btn--close:hover {
  color: var(--color-red);
  border-color: var(--color-red-border);
  background: var(--color-red-dim);
}

.term-win-btn.is-active {
  color: var(--color-cyan);
  border-color: var(--color-cyan);
  background: var(--color-cyan-dim);
}

/* Controls row: mode + autosearch + trial */
.term-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}

.term-controls .term-modes-wrap {
  gap: 6px;
}

.term-controls .term-modeselect {
  padding: 0;
  gap: 6px;
}

.term-controls__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.term-auto-search.auto-search-row {
  margin: 0;
  padding: 0;
  flex: 1;
  min-width: 0;
}

.term-auto-search .auto-search-toggle__label {
  font-size: 11px;
}

.term-trial {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: rgba(216, 160, 80, 0.04);
}

.term-trial__label {
  font-size: 10px;
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.term-trial__value {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-cyan);
}

/* ── Mini mode active ── */
body.term-mini .platform-bg,
body.term-mini .market-bg { display: none; }

body.term-mini .term-mini-only { display: flex !important; }
body.term-mini .term-web-only  { display: none !important; }

body.term-mini .term-app {
  min-height: 100vh;
  max-width: 100%;
}

body.term-mini .term-container {
  max-width: 100%;
  padding: 0 10px 6px;
}

body.term-mini .term-topbar__inner {
  height: 42px;
  gap: 8px;
  padding-top: 0;
  padding-bottom: 0;
}

body.term-mini .term-topbar__logo-text--brand {
  font-size: 11px;
  letter-spacing: 0.09em;
}

body.term-mini .term-topbar__logo-icon svg, .term-topbar__logo-icon img, .term-topbar__logo-robot {
  width: 24px;
  height: 24px;
}

body.term-mini .term-topbar__logo-text {
  font-size: 11px;
}

body.term-mini .term-topbar__logo-icon,
body.is-desktop-app .term-topbar__logo-icon {
  display: none;
}

body.term-mini .term-topbar__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  gap: 8px;
}

body.term-mini .term-topbar__logo {
  flex: 0 1 auto;
  justify-content: flex-start;
  min-width: 0;
}

body.term-mini .term-topbar__header-right {
  flex: 0 0 auto;
  margin-left: auto;
}

body.term-mini .term-topbar__badges .term-badge {
  font-size: 9px;
  padding: 3px 7px;
  gap: 4px;
}

body.term-mini .term-badge__dot {
  width: 5px;
  height: 5px;
}

body.term-mini .term-page {
  gap: 8px;
  padding-top: 8px;
  padding-bottom: 14px;
}

body.term-mini .term-card {
  padding: 10px 12px;
  border-radius: 10px;
}

body.term-mini .term-main {
  gap: 8px;
}

body.term-mini .term-action__btn {
  padding: 11px 16px;
  font-size: 12px;
  border-radius: 10px;
  max-width: none;
}

body.term-mini .term-mode-btn {
  min-height: 48px;
  padding: 7px 8px;
  font-size: 12px;
  gap: 4px;
}

body.term-mini .term-mode-btn__icon {
  width: 20px;
  height: 20px;
}

body.term-mini .term-crypto-module {
  max-width: 248px;
  gap: 6px;
  padding: 7px 9px;
}

body.term-mini .term-crypto-module__title {
  font-size: 12px;
}

body.term-mini .term-crypto-module__btn {
  min-height: 32px;
  padding: 7px 9px;
  font-size: 12px;
}

body.term-mini .term-idea {
  min-height: 0;
  padding: 12px;
}

body.term-mini .term-idea__empty,
body.term-mini .term-idea__message {
  margin: 8px 0;
  font-size: 12px;
}

body.term-mini .term-idea__asset {
  font-size: 17px;
}

body.term-mini .term-idea__dir {
  font-size: 11px;
  padding: 5px 12px;
}

body.term-mini .term-idea__meta {
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

body.term-mini .term-idea__meta-item--mode {
  display: none;
}

body.term-mini .term-idea__meta-label {
  font-size: 9px;
}

body.term-mini .term-idea__meta-value {
  font-size: 12px;
}

body.term-mini .term-idea__status-row {
  padding-top: 8px;
}

body.term-mini .term-idea__countdown {
  font-size: 13px;
}

body.term-mini .term-history__title {
  font-size: 11px;
  margin-bottom: 6px;
}

body.term-mini .term-history__head {
  display: none;
}

body.term-mini .term-history__list {
  max-height: 108px;
  overflow-y: auto;
}

body.term-mini .term-history__row {
  grid-template-columns: 48px 1fr 52px 52px;
  gap: 4px;
  padding: 5px 6px;
  font-size: 10px;
}

body.term-mini .term-history__row .term-history__cell--conf {
  display: none;
}

body.term-mini .term-locked {
  padding: 14px 12px;
  gap: 10px;
}

body.term-mini .term-page:has(#term-tg-gate:not([hidden])) {
  padding-top: max(12px, 8vh);
  padding-bottom: max(16px, 8vh);
}

body.term-mini .term-tg-gate {
  padding: 22px 16px;
  gap: 12px;
  max-width: 100%;
}

body.term-mini .term-tg-gate__title {
  font-size: 18px;
}

body.term-mini .term-tg-gate__text {
  font-size: 13px;
  max-width: 100%;
}

body.term-mini .term-tg-gate__btn {
  min-height: 42px;
  font-size: 13px;
}

body.term-mini .term-locked__text {
  font-size: 12px;
}

/* ══════════════════════════════
   DESKTOP APP MODE (.is-desktop-app)
   Applied via JS when running inside Electron.
   Always combined with body.term-mini.
══════════════════════════════ */

/* Desktop-only elements are hidden in the browser */
.term-desktop-only { display: none !important; }

/* Show them inside Electron */
body.is-desktop-app .term-desktop-only { display: flex !important; }

/* Completely hide history — browser cabinet is the place for it */
body.is-desktop-app .term-history { display: none !important; }

/* Lock the window — no vertical scroll in the fixed panel */
body.is-desktop-app {
  height: 100vh;
  overflow: hidden;
}
body.is-desktop-app .term-app {
  height: 100vh;
  overflow: hidden;
}

body.is-desktop-app .term-container.term-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 8px;
}

/* Stretch #term-main to fill the page, signal card to fill the rest.
   Footer links stay pinned at the bottom without clipping. */
body.is-desktop-app #term-main {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

body.is-desktop-app .term-action,
body.is-desktop-app .term-controls,
body.is-desktop-app .term-mini-links {
  flex-shrink: 0;
  margin-top: 10px;
  padding-top: 6px;
}
body.is-desktop-app .term-desktop-footer {
  flex-shrink: 0;
}
body.is-desktop-app #term-idea-card {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-height: auto;
  overflow: visible;
}
body.is-desktop-app .term-signal-card {
  overflow: visible;
}
body.is-desktop-app .term-signal__empty,
body.is-desktop-app .term-signal__no-signal {
  flex: 1 1 auto;
  min-height: 0;
}
body.is-desktop-app .term-signal__body {
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
}

/* ── Desktop topbar: compact single-row (brand + window controls) ── */
body.is-desktop-app .term-topbar__inner {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  height: 42px;
  min-height: 0;
  gap: 8px;
  padding-top: 4px;
  padding-bottom: 4px;
}

body.is-desktop-app .term-topbar__main {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  flex-wrap: nowrap;
}

body.is-desktop-app .term-topbar__logo {
  flex: 0 0 auto;
  min-width: 0;
  max-width: none;
  gap: 6px;
  overflow: visible;
}

body.is-desktop-app .term-topbar__logo-icon {
  flex-shrink: 0;
}

body.is-desktop-app .term-topbar__logo-icon svg, .term-topbar__logo-icon img, .term-topbar__logo-robot {
  width: 22px;
  height: 22px;
}

body.is-desktop-app .term-topbar__logo-text {
  font-size: 12px;
  letter-spacing: 0.02em;
  overflow: visible;
  text-overflow: unset;
  white-space: nowrap;
}

body.is-desktop-app .term-topbar__subtitle {
  display: none !important;
}

body.is-desktop-app .term-topbar__brand {
  flex-shrink: 0;
  min-width: 0;
  overflow: visible;
}

body.is-desktop-app .term-topbar__window-actions {
  display: flex !important;
  align-items: center;
  gap: 4px;
  margin-left: 0;
  flex-shrink: 0;
}

body.is-desktop-app .term-topbar__header-right {
  margin-left: auto;
  gap: 5px;
}

body.is-desktop-app .term-layout-pin-btn {
  width: 30px;
  height: 30px;
  font-size: 15px;
}

body.is-desktop-app .term-win-controls {
  margin-left: 0;
  flex-shrink: 0;
}

body.is-desktop-app .term-win-btn--header-extra {
  display: none !important;
}

body.is-desktop-app .term-topbar__badges {
  display: none !important;
}

body.is-desktop-app.term-mini .term-topbar__inner {
  height: 42px;
  min-height: 0;
  padding-top: 4px;
  padding-bottom: 4px;
}

body.is-desktop-app.term-mini .term-topbar__logo {
  flex-shrink: 1;
  justify-content: flex-start;
}

body.is-desktop-app.term-mini .term-topbar__header-right {
  flex: 0 0 auto;
}

body.is-desktop-app.term-mini .term-layout-pin-btn--web,
body.is-desktop-app.term-mini .term-layout-pin-badge--web,
body.is-desktop-app.term-mini .term-topbar__drag-hint--wide {
  display: none !important;
}

body.is-desktop-app.term-mini .term-win-controls {
  display: flex !important;
  visibility: visible;
}

body.is-desktop-app.term-mini .term-win-btn {
  width: 28px;
  height: 28px;
  font-size: 15px;
}

/* ── Desktop frameless window: drag handle + full header drag zone ── */
body.is-desktop-app .term-topbar {
  cursor: grab;
  user-select: none;
  -webkit-app-region: drag;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.is-desktop-app .term-topbar:active {
  cursor: grabbing;
}

body.is-desktop-app .term-topbar__main,
body.is-desktop-app .term-topbar__badges,
body.is-desktop-app .term-topbar__drag-hint,
body.is-desktop-app .term-topbar__logo,
body.is-desktop-app .term-topbar__brand,
body.is-desktop-app .term-topbar__logo-text {
  -webkit-app-region: drag;
}

body.is-desktop-app .term-topbar__window-actions,
body.is-desktop-app .term-topbar__header-right,
body.is-desktop-app .term-layout-pin-btn,
body.is-desktop-app .term-layout-pin-badge,
body.is-desktop-app .term-win-controls,
body.is-desktop-app .term-win-btn {
  -webkit-app-region: no-drag;
  cursor: default;
}

body.is-desktop-app .term-topbar__drag-hint {
  -webkit-app-region: drag;
  cursor: grab;
}

body.is-desktop-app .term-topbar__logo {
  cursor: grab;
  text-decoration: none;
}

body.is-desktop-app .term-topbar__drag-hint {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-shrink: 0;
  margin: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid rgba(216, 160, 80, 0.18);
  background: rgba(216, 160, 80, 0.06);
  color: rgba(216, 160, 80, 0.72);
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  opacity: 0.92;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

body.is-desktop-app .term-topbar__drag-label {
  display: none;
}

body.is-desktop-app .term-topbar:hover .term-topbar__drag-hint {
  border-color: rgba(216, 160, 80, 0.32);
  background: rgba(216, 160, 80, 0.1);
  color: rgba(198, 139, 57, 0.9);
}

body.is-desktop-app .term-topbar__drag-grip {
  font-size: 14px;
  line-height: 1;
  opacity: 0.95;
}

body.is-desktop-app .term-app.term-app--dragging .term-topbar {
  cursor: grabbing;
  border-bottom-color: rgba(216, 160, 80, 0.42);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.35),
    0 0 28px rgba(216, 160, 80, 0.28);
}

body.is-desktop-app .term-app.term-app--dragging {
  box-shadow: inset 0 0 0 1px rgba(216, 160, 80, 0.12);
}

/* Compact bottom nav — mini terminal / desktop */
.term-mini-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  padding: 0 2px;
  margin-top: 4px;
}

.term-mini-links__sep {
  color: rgba(216, 160, 80, 0.28);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 0 5px;
  user-select: none;
}

.term-mini-links__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-align: center;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.term-mini-links__btn[href]:hover {
  border-color: rgba(216, 160, 80, 0.22);
  color: var(--color-cyan);
  background: rgba(216, 160, 80, 0.06);
  box-shadow: 0 0 12px rgba(216, 160, 80, 0.1);
}

.term-mini-links__btn--active {
  color: var(--color-cyan);
  cursor: default;
}

body.term-mini .term-mini-links {
  margin-top: 6px;
  margin-bottom: 4px;
  flex-shrink: 0;
}

body.term-mini .term-mini-links__btn {
  font-size: 9px;
  line-height: 1.2;
  min-height: 28px;
  padding: 5px 3px;
}

body.is-desktop-app .term-desktop-footer {
  flex-shrink: 0;
  margin-top: 2px;
  padding-bottom: 2px;
}

/* Desktop action footer (Открыть кабинет + Скрыть в трей) */
.term-desktop-footer {
  display: flex;
  gap: 8px;
  padding: 0 2px;
}

.term-desktop-footer__btn {
  flex: 1;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid var(--color-border-glow);
  background: rgba(216, 160, 80, 0.06);
  color: var(--color-text-muted);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
  white-space: nowrap;
}

.term-desktop-footer__btn:hover {
  border-color: var(--color-cyan);
  color: var(--color-cyan);
  background: rgba(216, 160, 80, 0.1);
}

.term-desktop-footer__btn--tray:hover {
  border-color: var(--color-border);
  color: var(--color-text-dim);
  background: rgba(255, 255, 255, 0.04);
}

/* ══════════════════════════════
   LAYOUT PIN — fixed position / float host
══════════════════════════════ */

body.term-layout-pinned:not(.is-desktop-app) {
  background: transparent;
}

body.term-layout-pinned:not(.is-desktop-app) .platform-bg,
body.term-layout-pinned:not(.is-desktop-app) .market-bg {
  display: none;
}

body.term-layout-pinned:not(.is-desktop-app) .term-app {
  position: fixed;
  z-index: 1200;
  width: min(400px, calc(100vw - 16px));
  max-width: 400px;
  min-height: 0;
  height: auto;
  max-height: calc(100vh - 16px);
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(216, 160, 80, 0.34);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.55),
    0 0 28px rgba(216, 160, 80, 0.12);
}

body.term-layout-pinned:not(.is-desktop-app) .term-topbar {
  cursor: grab;
}

body.term-layout-pinned:not(.is-desktop-app) .term-topbar:active {
  cursor: grabbing;
}

body.term-embed {
  background: #141618;
  overflow: hidden;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
}

html.term-embed {
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

body.term-embed .platform-bg,
body.term-embed .market-bg,
body.term-embed .term-web-only,
body.term-embed .term-footer,
body.term-embed .term-history,
body.term-embed .term-telegram,
body.term-embed .term-hero,
body.term-embed .term-locked {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.term-embed .term-app,
body.term-embed.term-mini .term-app {
  flex: 1 1 auto;
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.term-embed .term-topbar {
  display: none !important;
}

body.term-embed .term-container.term-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: 8px;
  padding-bottom: 12px;
}

body.term-embed #term-main {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}

body.term-embed .term-action,
body.term-embed .term-controls,
body.term-embed .term-mini-links {
  flex-shrink: 0;
}

body.term-embed .term-mini-links {
  margin-top: 10px;
  padding-top: 6px;
  margin-bottom: 2px;
}

body.term-embed #term-idea-card {
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
}

body.term-embed .term-signal-card {
  overflow: visible;
}

body.term-embed .term-signal__body {
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
}

.ac-term-float {
  position: fixed !important;
  z-index: 1250;
  width: min(400px, calc(100vw - 16px)) !important;
  height: min(650px, calc(100vh - 24px)) !important;
  max-height: min(650px, calc(100vh - 24px)) !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  flex: none !important;
  align-self: auto !important;
  border-radius: 12px;
  border: 1px solid rgba(216, 160, 80, 0.34);
  background: #141618;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.55),
    0 0 28px rgba(216, 160, 80, 0.12);
  overflow: hidden !important;
  box-sizing: border-box;
}

body:has(.cabinet-app) #ac-term-float,
body:has(.app) #ac-term-float {
  position: fixed !important;
  height: min(650px, calc(100vh - 24px)) !important;
  max-height: min(650px, calc(100vh - 24px)) !important;
  min-height: 0 !important;
}

.ac-term-float__chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  min-height: 34px;
  padding: 0 6px 0 10px;
  border-bottom: 1px solid rgba(216, 160, 80, 0.16);
  background: linear-gradient(180deg, rgba(216, 160, 80, 0.1), rgba(16, 19, 24, 0.98));
}

.ac-term-float__grip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: grab;
  user-select: none;
  color: rgba(216, 160, 80, 0.88);
}

.ac-term-float__grip:active {
  cursor: grabbing;
}

.ac-term-float__grip-icon {
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
  opacity: 0.9;
}

.ac-term-float__brand {
  display: flex;
  align-items: center;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ac-term-float__brand-main,
.ac-term-float__brand-word {
  color: var(--color-cyan);
}

.ac-term-float__grip-label {
  display: none !important;
}

.ac-term-float__win {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.ac-term-float__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(216, 160, 80, 0.2);
  border-radius: 7px;
  background: rgba(216, 160, 80, 0.06);
  color: rgba(236, 238, 240, 0.92);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.ac-term-float__btn:hover {
  border-color: rgba(216, 160, 80, 0.38);
  background: rgba(216, 160, 80, 0.12);
  color: #fff;
}

.ac-term-float__btn--close:hover {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.14);
  color: #fecaca;
}

.ac-term-float__frame {
  flex: 1 1 auto;
  min-height: 0 !important;
  height: auto !important;
  max-height: 100% !important;
  width: 100%;
  border: none;
  background: #141618;
  display: block;
}

/* Legacy embedded web pin — disabled; keep inert if class leaks */
body.term-layout-pinned:not(.is-desktop-app) .term-app {
  position: static !important;
  width: auto !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  left: auto !important;
  top: auto !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

@media (max-width: 520px) {
  .term-layout-pin-btn,
  .term-layout-pin-badge,
  .ac-term-float {
    display: none !important;
  }

  body.term-layout-pinned:not(.is-desktop-app) .term-app {
    position: static;
    width: 100%;
    max-width: 100%;
    border: none;
    box-shadow: none;
    border-radius: 0;
  }
}

/* ── Detach button (web) ── */
.term-detach-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 2px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid rgba(216, 160, 80, 0.28);
  background: rgba(216, 160, 80, 0.05);
  color: rgba(216, 160, 80, 0.9);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, color 0.18s, box-shadow 0.18s;
}

.term-detach-btn:hover {
  border-color: rgba(216, 160, 80, 0.55);
  background: rgba(216, 160, 80, 0.12);
  color: #f0d4a8;
  box-shadow: 0 0 12px rgba(216, 160, 80, 0.16);
}

.term-detach-btn[hidden] {
  display: none !important;
}

.term-detach-btn svg {
  display: block;
}

body.is-desktop-app .term-detach-btn {
  display: none !important;
}

/* Signal-sound bell toggle — reuses header-sound-btn__icon markup from
   index.html, but components.css scopes all its rules under
   .header-module--live (a wrapper that doesn't exist here), so the visual
   styling and on/off icon swap are redefined below, scoped to .term-sound-btn. */
.term-sound-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 2px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid rgba(255, 213, 74, 0.28);
  background: rgba(255, 213, 74, 0.05);
  color: #FFD54A;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, color 0.18s, box-shadow 0.18s;
}

.term-sound-btn:hover {
  border-color: rgba(255, 213, 74, 0.5);
  background: rgba(255, 213, 74, 0.12);
  color: #FFE082;
}

.term-sound-btn:focus-visible {
  outline: 1px solid rgba(255, 213, 74, 0.7);
  outline-offset: 1px;
}

.term-sound-btn .header-sound-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  line-height: 0;
}

.term-sound-btn .header-sound-btn__icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.term-sound-btn .header-sound-btn__icon--off {
  display: none;
}

.term-sound-btn.is-muted {
  border-color: transparent;
  background: transparent;
  color: rgba(255, 213, 74, 0.4);
  opacity: 0.8;
}

.term-sound-btn.is-muted:hover {
  border-color: rgba(255, 213, 74, 0.22);
  background: rgba(255, 213, 74, 0.06);
  color: rgba(255, 224, 130, 0.7);
  opacity: 0.95;
}

.term-sound-btn.is-muted .header-sound-btn__icon--on {
  display: none;
}

.term-sound-btn.is-muted .header-sound-btn__icon--off {
  display: inline-flex;
}

@media (max-width: 560px) {
  .term-sound-btn {
    width: 26px;
    height: 26px;
  }
}

.ac-term-float__btn--detach {
  color: rgba(216, 160, 80, 0.92) !important;
}

.ac-term-float__btn--detach:hover {
  color: #f0d4a8 !important;
  border-color: rgba(216, 160, 80, 0.5) !important;
  background: rgba(216, 160, 80, 0.12) !important;
}

.term-detach-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 12000;
  transform: translateX(-50%) translateY(8px);
  max-width: min(440px, calc(100vw - 24px));
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(18, 16, 8, 0.96);
  color: rgba(255, 236, 180, 0.96);
  font-family: var(--font-body, Manrope, sans-serif);
  font-size: 12.5px;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 18px rgba(251, 191, 36, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.term-detach-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.term-detach-toast[hidden] {
  display: none !important;
}

/* ── Detached compact window ── */
html.term-detached,
body.term-detached {
  width: 100%;
  min-height: 100%;
  height: auto;
  margin: 0;
  background: #121416;
  overflow-x: hidden;
  overflow-y: auto;
}

body.term-detached {
  display: block;
}

body.term-detached .platform-bg,
body.term-detached .market-bg,
body.term-detached .term-web-only,
body.term-detached .term-footer,
body.term-detached .term-telegram,
body.term-detached .term-hero,
body.term-detached .term-topbar__back,
body.term-detached .term-btn-layout-pin,
body.term-detached .term-layout-pin-badge {
  display: none !important;
}

body.term-detached .term-app,
body.term-detached.term-mini .term-app {
  min-height: 100vh;
  max-width: 100%;
  height: auto;
  overflow: visible;
}

body.term-detached .term-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}

body.term-detached .term-container.term-page {
  padding-top: 6px;
  padding-bottom: 16px;
}

body.term-detached #term-main {
  overflow: visible;
}

body.term-detached .term-history {
  display: block !important;
}

@media (max-width: 560px) {
  .term-detach-btn {
    width: 26px;
    height: 26px;
  }
}
