:root {
  --bg-main: #05060a;
  --bg-card: #222327;
  --bg-card-soft: #1a1b1f;
  --bg-control: #16171b;
  --bg-input: #d0d0d1;
  --text-main: #ffffff;
  --text-muted: #a5a6ad;
  --accent: #ffb300;
  --accent-dark: #e28f00;
  --radius-xl: 15px;
  --radius-pill: 999px;
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.55);
  --transition-fast: 0.25s ease;
  --transition-slow: 0.45s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body.tl-body {
  min-height: 100vh;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* коли сторінка ще "пуста" — блокуємо скрол по Y */
body.tl-body.tl-locked {
  overflow-y: hidden;
}

/* ----- layout ----- */

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition:
    padding-top var(--transition-slow),
    transform var(--transition-slow);
}

/* колапс/експанд анімація */
.wrap-collapsed .hero {
  margin-top: 20vh;
}

.wrap-expanded .hero {
  margin-top: 0;
}

/* заголовок теж змінює розмір */
.title {
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ffffff;
  text-align: center;
  transition: font-size var(--transition-slow), transform var(--transition-slow);
}

.wrap-expanded .title {
  font-size: clamp(17px, 2.4vw, 26px);
  transform: translateY(-2px);
}

/* main panel анімується */

.wrap-collapsed #main-panel {
  opacity: 0;
  transform: translateY(40px);
  pointer-events: none;
  max-height: 0;
}

.wrap-expanded #main-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  max-height: 9999px;
}

.hero,
#main-panel {
  transition:
    margin-top var(--transition-slow),
    opacity var(--transition-slow),
    transform var(--transition-slow),
    max-height var(--transition-slow);
}

/* ----- header ----- */

.top-header {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}

/* ----- control strip ----- */

.hero {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.control-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  padding: 8px;
  background: var(--bg-control);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-soft);
  max-width: 680px;
  width: 100%;
}
/* рядок з монетою + інтервалом */
.mobile-row {
  display: flex;
  flex-direction: row;
  gap: 10px;
  flex: 1 1 auto;
}

/* всередині: інпут розтягується, інтервал фіксований */
.mobile-row .pair-input-wrapper {
  flex: 1 1 auto;
}

.mobile-row .select-wrapper {
  flex: 0 0 110px;
}


#ema-value{
  display: flex;
  justify-content: space-between;
  width: 100%;
}
/* input + список монет */

.pair-input-wrapper {
  position: relative;
  flex: 1 1 220px;
  display: flex;
  align-items: stretch;
  background: var(--bg-input);
  border-radius: var(--radius-pill);
  /* overflow: hidden;  ← забрати */
  overflow: visible;
}


.pair-input {
  flex: 1 1 auto;
  border: none;
  background: transparent;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  color: #000;
}

.pair-input::placeholder {
  color: #555;
}

.pair-toggle {
  border: none;
  background: none;
  width: 40px;
  cursor: pointer;
  font-size: 18px;
  color: #444;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pair-toggle:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* suggestions dropdown */

.pair-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #2a2b30;
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  max-height: 260px;
  overflow-y: auto;
  padding: 6px 0;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition:
    opacity var(--transition-fast),
    transform var(--transition-fast);
  z-index: 20;
}

.pair-suggestions.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.pair-option {
  padding: 8px 14px;
  font-size: 14px;
  color: #f5f5f5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.pair-option span.symbol-main {
  font-weight: 600;
}

.pair-option span.symbol-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.pair-option:hover {
  background: #3a3b41;
}

.pair-empty {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-muted);
}

/* select interval */

.select-wrapper {
  flex: 0 0 110px;
  background: var(--bg-input);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  padding: 0 8px;
}

.select {
  width: 100%;
  border: none;
  background: transparent;
  padding: 9px 4px;
  font-size: 14px;
  outline: none;
  color: #111;
}

/* TEST button */

.btn-test {
  flex: 0 0 110px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #111;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  padding: 10px 12px;
  box-shadow: var(--shadow-soft);
  transition:
    background var(--transition-fast),
    transform 0.1s ease;
}

.btn-test:hover {
  background: var(--accent-dark);
}

.btn-test:active {
  transform: translateY(1px);
}

.status-label {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ----- MAIN PANEL ----- */

.main-panel {
  width: 100%;
  max-width: 98vw;
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1.7fr);
  grid-auto-rows: auto;
  gap: 14px;
}

/* cards */

.card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 12px 14px 16px;
  box-shadow: var(--shadow-soft);
}

.card-price {
  min-height: 100px;
}

.card-rsi,
.card-ema {
  min-height: 35px;
}
.card-macd {
  min-height: 160px;
}

#macd-chart {
  width: 100%;
  max-height: 160px;
}


.card-title {
  font-size: 13px;
  text-transform: lowercase;
  color: var(--text-muted);
}

/* card header with mode toggle */

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

/* mode toggle */

.price-mode-toggle {
  display: inline-flex;
  background: #16171b;
  border-radius: 999px;
  padding: 2px;
}

.mode-btn {
  border: none;
  background: transparent;
  color: #c7c7cf;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  min-width: 50px;
}

.mode-btn.active {
  background: #2b2c32;
  color: #fff;
}

/* charts column */

.charts-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* side column */

.side-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.side-card {
  background: var(--bg-card-soft);
}

.top-side-card {
  padding: 10px 10px 12px;
}

.bottom-side-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 5px 5px 5px;
}

/* traffic light */

.light-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.light-row {
  display: flex;
  gap: 8px;
  background: #111215;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
}

.light {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #3b3c42;
  box-shadow: inset 0 0 0 2px #202126;
  opacity: 0.35;
  transition:
    background var(--transition-fast),
    opacity var(--transition-fast),
    box-shadow var(--transition-fast);
}

#light-green.on {
  background: #45d26f;
  opacity: 1;
  box-shadow: 0 0 14px rgba(69, 210, 111, 0.7);
}

#light-yellow.on {
  background: #ffd34a;
  opacity: 1;
  box-shadow: 0 0 14px rgba(255, 211, 74, 0.7);
}

#light-red.on {
  background: #ff4b4b;
  opacity: 1;
  box-shadow: 0 0 14px rgba(255, 75, 75, 0.7);
}

.score-block {
  margin-top: 6px;
  text-align: center;
}

.score-main {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #ffd34a; /* дефолт – нейтральний */
}

.score-stars {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.score-star {
  font-size: 15px;
  color: #444;              /* неактивна (сіра) */
  text-shadow: none;
  transition: color 0.2s ease, text-shadow 0.2s ease, transform 0.15s ease;
}

.score-star--active-neutral {
  color: #ffb300;           /* золото */
  text-shadow: 0 0 8px rgba(255, 179, 0, 0.7);
  transform: translateY(-1px);
}

.score-star--active-good {
  color: #45d26f;           /* зелена “good” */
  text-shadow: 0 0 10px rgba(69, 210, 111, 0.9);
  transform: translateY(-1px);
}


/* indicators + reasons */

.side-section {
  background: #202127;
  border-radius: 12px;
  padding: 8px 10px;
}

.side-title {
  margin: 0 0 4px;
  font-size: 15px;
  text-transform: lowercase;
  color: var(--text-muted);
}

.indicators {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.indicator-box {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.indicator-label {
  color: var(--text-muted);
}

.indicator-value {
  font-weight: 600;
}

.reasons-section {
  /* max-height: 180px; */
  overflow-y: auto;
}

.reasons-list {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 15px;
  line-height: 1.4;
  color: #d6d7df;
}

/* ----- RESPONSIVE ----- */

@media (max-width: 900px) {
  /* замість grid робимо колону, щоб можна було міняти порядок */
  .main-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
  }

  /* SIDE зверху, CHARTS знизу */
  .side-column {
    order: 0;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .charts-column {
    order: 1;
  }

  /* карточки справа стають більш широкими/адаптивними */
  .side-card {
    /* flex: 1 1 260px; */
  }

  .card-price {
    min-height: 220px;
  }
}

@media (max-width: 640px) {
  .wrap {
    padding-inline: 10px;
  }

  /* control-strip стає колонкою на всю ширину */
  .control-strip {
    border-radius: 18px;
    flex-direction: column;
    align-items: stretch;
    max-width: 100%;
  }

  .pair-input-wrapper,
  .select-wrapper,
  .btn-test {
    flex: 1 1 auto;
    width: 100%;
  }

  .btn-test {
    text-align: center;
  }

  .status-label {
    text-align: center;
  }

  /* графіки трохи нижчі на телефоні/малому планшеті */
  .card-price canvas {
    height: 220px !important;
  }

  .card-rsi canvas,
  .card-ema canvas {
    height: 90px !important;
  }

  .card-price {
    min-height: 220px;
  }
}

@media (max-width: 480px) {
  .main-panel {
    margin-top: 12px;
  }

  .card {
    padding: 10px 8px 12px;
  }

  .card-price canvas {
    height: 190px !important;
  }

  .card-rsi canvas,
  .card-ema canvas {
    height: 80px !important;
  }

  /* .reasons-section {
    max-height: 150px;
  } */

  .light-row {
    padding: 5px 8px;
  }

  .light {
    width: 34px;
    height: 34px;
  }

  .score-text {
    font-size: 12px;
  }
}


/* --- select інтервалів: зробити схожим на поле монет --- */

.select-wrapper {
  position: relative;
  flex: 0 0 110px;
  background: var(--bg-input);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  padding: 0 8px;
  box-shadow: var(--shadow-soft); /* як у control-strip */
}

/* сам select всередині */
.select {
  width: 100%;
  border: none;
  background: transparent;
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
  color: #000;
  cursor: pointer;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* стрілочка, як у монет */
.select-wrapper::after {
  content: "▾";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #444;
  pointer-events: none;
}

.select option {
  background: #2a2b30;    /* як .pair-suggestions */
  color: #f5f5f5;
}

.select option:checked {
  background: #3a3b41;    /* як hover в .pair-option */
}


/* --- Mobile: input + interval в один рядок --- */
@media (max-width: 640px) {

  /* control strip стає колонкою, але 1-й ряд робимо flex */
  .control-strip {
    flex-direction: column;
    align-items: stretch;
  }

  /* контейнер з інпутом і select у один рядок */
  .mobile-row {
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: 100%;
  }

  .mobile-row .pair-input-wrapper,
  .mobile-row .select-wrapper {
    flex: 1 1 0;
    width: 100%;
  }

  /* TEST окремо, широка кнопка */
  .btn-test {
    margin-top: 6px;
    width: 100%;
  }
  .premium-inner {
    flex-direction: row;
    align-items: flex-start;
  }

  /* міняємо видимість блоків */
  .premium-card--desktop {
    display: none;
  }

  .premium-card--mobile {
    display: block;
    margin-top: 18px;
    margin-inline: 10px;
  }
}



/* ---------- PREMIUM CARD ---------- */

.premium-card {
  background: radial-gradient(circle at 0 0, rgba(255,179,0,0.16), transparent 55%),
              linear-gradient(135deg, #1c1d22 0%, #14151b 50%, #111015 100%);
  border-radius: var(--radius-xl);
  /* border: 1px solid rgba(255, 179, 0, 0.18); */
  position: relative;
  overflow: hidden;
}

.premium-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.04), transparent 40%);
  pointer-events: none;
}

.premium-inner {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.premium-icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.premium-icon img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(0,0,0,0.7));
  opacity: 0.9;
}

.premium-content {
  flex: 1 1 auto;
}

.premium-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(255, 179, 0, 0.09);
  color: rgba(255, 179, 0, 0.9);
  margin-bottom: 4px;
}

.premium-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
}

.premium-text {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.premium-list {
  margin: 0 0 10px 16px;
  padding: 0;
  font-size: 13px;
  color: #e3e4ec;
  line-height: 1.35;
}

.premium-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  background: var(--accent);
  color: #111;
  box-shadow: 0 8px 20px rgba(255, 179, 0, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.premium-link:hover {
  background: var(--accent-dark);
  box-shadow: 0 10px 26px rgba(255, 179, 0, 0.45);
  transform: translateY(-1px);
}

.premium-link:active {
  transform: translateY(0);
  box-shadow: 0 5px 14px rgba(255, 179, 0, 0.35);
}

/* за замовчуванням – тільки desktop-версія */
.premium-card--desktop {
  display: block;
}

.premium-card--mobile {
  display: none;
}


/* --- LONG / SHORT toggle --- */

.side-toggle {
  display: flex;
  gap: 8px;
  /* margin-top: 12px; */
  flex-wrap: wrap;
  justify-content: flex-start;
}

.side-btn {
  position: relative;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.08s ease;
  background: #161921;
  color: #c5c9d6;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* Long button базовий колір */
.side-btn--long {
  /* легкий натяк на зелений */
  box-shadow: 0 0 0 1px rgba(46, 204, 113, 0.25);
}

/* Short button базовий колір */
.side-btn--short {
  /* легкий натяк на червоний */
  box-shadow: 0 0 0 1px rgba(231, 76, 60, 0.25);
}

/* Активна кнопка (обрана сторона) */
.side-btn--active {
  color: #05060a;
  background: linear-gradient(135deg, #ffb347, #ff5f6d);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 8px 18px rgba(0, 0, 0, 0.45);
  transform: translateY(-1px);
}

/* Hover ефект */
.side-btn:hover {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 6px 16px rgba(0, 0, 0, 0.4);
}

/* active / click */
.side-btn:active {
  transform: translateY(0);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 3px 8px rgba(0, 0, 0, 0.3);
}

/* Мобільна адаптація, щоб кнопки не ламались */
@media (max-width: 640px) {
  .side-toggle {
    width: 100%;
    justify-content: space-between;
  }

  .side-btn {
    flex: 1 1 48%;
    text-align: center;
  }
}
/* ---------- FIBONACCI BLOCK ---------- */

.fibo-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #202127;
  border-radius: 12px;
  padding: 14px 16px 16px;
}

/* верхній рядок: назва + напрям тренду */
.fibo-header {
  display: flex;
  justify-content: space-between;
  /* align-items: flex-end; */
  margin-bottom: -4px;
}

.fibo-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  text-transform: lowercase;
  color: var(--text-muted);
}

.fibo-direction {
  font-size: 12px;
  color: #cbd5f5;
  text-align: right;
  /* max-width: 160px; */
  line-height: 1.25;
}

/* рядок руху */
.fibo-range {
  margin: 10px 0 6px;
  font-size: 12px;
  color: #9ca3af;
}

/* таблиця рівнів */
.fibo-levels {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fibo-level-row {
  display: grid;
  grid-template-columns: 48px 80px 1fr;
  gap: 8px;
  font-size: 12px;
  align-items: center;
}

.fibo-level-label {
  color: #facc15;
  font-weight: 700;
  text-align: left;
}

.fibo-level-price {
  color: #e5e7eb;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.fibo-level-desc {
  color: #9ca3af;
  white-space: nowrap;
}

/* нижній коментар */
.fibo-status {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.4;
  color: #cbd5f5;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 10px;
  margin-bottom: 0px;
}


/* трішки компактніше на дуже малих екранах */
@media (max-width: 640px) {
  .fibo-section {
    padding: 8px 10px 10px;
  }

  .fibo-level-row {
    grid-template-columns: 48px 72px 1fr;
    font-size: 11px;
  }

  .fibo-status {
    font-size: 11px;
  }
}


body.tl-body {
  min-height: 100vh;
}

.wrap {
  min-height: auto;   /* або просто забрати цей рядок */
}

@media (max-width: 900px) {
  /* main-panel вже flex-колонка — це ок */
  .main-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
  }

  /* робимо side-column "прозорим" контейнером */
  .side-column {
    display: contents;   /* <-- ключовий момент */
  }

  /* порядок:
     0 — весь sidebar (крім fibo)
     1 — графіки
     2 — fibo під графіками
  */

  .top-side-card,
  .bottom-side-card,
  .premium-card--desktop {
    order: 0;            /* sidebar залишається як є, зверху */
  }

  .charts-column {
    order: 1;            /* графіки відразу після sidebar */
  }

  #fibo-box {
    order: 2;            /* fibo переноситься ПІД графіки */
    width: 100%;
    margin-top: 8px;
  }
}

.status{
  color: rgba(255, 0, 0, 0.731);
  font-size: 12px;
}



/* ===== AI feedback card ===== */
.ai-card{
  padding: 16px 16px 14px;
  border-radius: 18px;
  background: #22232791;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  backdrop-filter: blur(10px);
  transform: translateY(6px);
  opacity: 0;
  animation: aiPopIn .35s ease forwards;
}

@keyframes aiPopIn{
  to { transform: translateY(0); opacity: 1; }
}

.ai-card__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 10px;
}

.ai-title{
  font-weight: 700;
  letter-spacing: .2px;
  font-size: 15px;
  opacity: .95;
}

.ai-quota{
  display:flex;
  align-items:center;
  gap: 8px;
  font-size: 12px;
  opacity: .9;
}

.ai-quota__badge{
  min-width: 26px;
  text-align:center;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(249,115,22,0.12);
  border: 1px solid rgba(249,115,22,0.25);
  color: #f97316;
  font-weight: 700;
}

.ai-body{
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 14px;
  opacity: .95;
}

.ai-meta{
  margin-top: 10px;
  font-size: 12px;
  opacity: .7;
}

/* ===== Loading state (shimmer) ===== */
.ai-loading{
  position: relative;
}

.ai-skel{
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.ai-skel .line{
  height: 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  overflow:hidden;
  position: relative;
}

.ai-skel .line::after{
  content:"";
  position:absolute;
  inset:0;
  transform: translateX(-60%);
  background: linear-gradient(90deg,
    rgba(255,255,255,0.00) 0%,
    rgba(255,255,255,0.10) 40%,
    rgba(255,255,255,0.00) 80%);
  animation: aiShimmer 1.1s infinite;
}

@keyframes aiShimmer{
  to { transform: translateX(60%); }
}

.ai-skel .line.w80{ width: 80%; }
.ai-skel .line.w92{ width: 92%; }
.ai-skel .line.w70{ width: 70%; }
.ai-skel .line.w88{ width: 88%; }

/* ===== "limit reached" nice message ===== */
.ai-limit{
  padding: 12px 12px;
  border-radius: 14px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.18);
}

.ai-limit .t1{
  font-weight: 800;
  margin-bottom: 6px;
}

.ai-limit .t2{
  opacity: .85;
  font-size: 13px;
  line-height: 1.35;
}


/* прибираємо pop-in анімацію саме для AI card (щоб не “літало”) */
.ai-card{
  animation: none !important;
  transform: none !important;
  opacity: 1 !important;
  backdrop-filter: blur(10px);
}

/* центрування + компактність */
.ai-center{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;

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

  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);

  max-width: 520px;
  margin: 0 auto;            /* по центру */
}

/* заголовок + текст */
.ai-center .t1{
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 6px;
}

.ai-center .t2{
  font-size: 13px;
  line-height: 1.35;
  opacity: .82;
  max-width: 44ch;
}

/* легка різниця по статусам (без анімацій) */
.ai-center--tired{
  border-color: rgba(255,179,0,0.18);
  background: rgba(255,179,0,0.06);
}
.ai-center--limit{
  border-color: rgba(239,68,68,0.18);
  background: rgba(239,68,68,0.06);
}
.ai-center--down{
  border-color: rgba(255,255,255,0.10);
}

/* прибрати все, що тягне висоту */
#ai-feedback-body{
  min-height: unset !important;
}



.tl-bubbles{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height: 22px; /* щоб блок не скакав */
}

.tl-bubbles .b{
  width: 12px;      /* великі кружочки */
  height: 12px;
  border-radius: 999px;
  background: rgba(229,231,235,0.95); /* світлий */
  transform: scale(0.6);
  opacity: 0.35;
  animation: tlBubblePulse 0.9s infinite ease-in-out;
}

.tl-bubbles .b:nth-child(1){ animation-delay: 0s; }
.tl-bubbles .b:nth-child(2){ animation-delay: 0.15s; }
.tl-bubbles .b:nth-child(3){ animation-delay: 0.30s; }

@keyframes tlBubblePulse{
  0%, 100% { transform: scale(0.6); opacity: 0.35; }
  50%      { transform: scale(1.25); opacity: 1; }
}



/* =========================
   PLAN PILL (1:1 like screenshots)
   ========================= */

.top-header{
  width: 100%;
  display: flex;
  justify-content: center; /* title centered */
  align-items: center;
  margin-bottom: 6px;
  position: relative;
}

/* container on the right */
.plan-ui{
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px; /* spacing between main pill and dropdown pill */
  z-index: 50;
}

/* base pill */
.plan-pill{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 0px;
  background: rgba(34,35,39,0.92); /* like your screenshot dark pill */
  /* box-shadow: 0 10px 22px rgba(0,0,0,0.45); */
  color: rgba(255,255,255,0.92);
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  /* margin-top: -36px; */
}

@media screen and (max-width: 640px){

  .plan-pill{
    margin-top: -10px;
  }
  
}

.plan-pill:hover{
  border-color: rgba(255,255,255,0.14);
  background: rgba(34,35,39,0.98);
}

.plan-label{
  opacity: .92;
}

.plan-value{
  font-weight: 800;
  letter-spacing: .2px;
}

/* FREE green */
.plan-value--free{
  color: #4ade80;
}

/* Premium gold */
.plan-value--premium{
  color: var(--accent);
}

.plan-sep{
  opacity: .75;
}

.plan-cta{
  opacity: .92;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Dropdown wrapper positioned under the premium pill (NO overlay dim) */
.plan-dropdown{
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.plan-dropdown.is-open{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.plan-pill--dropdown{
  padding: 6px 10px;         /* same compact feel */
  border-radius: 8px;
}

.plan-date{
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.plan-continue{
  color: rgba(255,255,255,0.92);
  text-decoration: none;
}

.plan-continue:hover{
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Make premium pill look like clickable button (still identical visually) */
#plan-pill-premium{
  border-color: rgba(255,179,0,0.16);
}

/* ===== Mobile: avoid overlap with centered title ===== */
@media (max-width: 640px){
  .top-header{
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
  }

  .plan-ui{
    position: static;
    transform: none;
    align-items: center;   /* looks clean on phone */
  }

  .plan-dropdown{
    position: static;      /* dropdown goes right under pill, centered */
    transform: translateY(-6px);
  }

  .plan-dropdown.is-open{
    transform: translateY(0);
  }
}



/* ===== Header layout: left / center / right ===== */
.top-header{
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  position: relative;
  margin-bottom: 6px;
}

.title{
  grid-column: 2;
  justify-self: center;
  margin: 0;
}

.lang-menu{
  grid-column: 1;
  justify-self: start;
  position: relative;
  z-index: 80;
}

.top-actions{
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}


@media (max-width: 640px){
  .top-header{
    /* grid-template-columns: auto 1fr auto; */
    gap: 8px;
    margin-bottom: 10px;
  }

  .lang-menu{ grid-column: 1; }
  .title{ grid-column: 2; }

  /* plan/ui стає другою стрічкою (по центру) */
  .top-actions{
    grid-column: 1 / -1;
    justify-self: center;
    margin-top: 6px;
  }

  .plan-ui{
    position: static !important;
    transform: none !important;
    align-items: center;
  }

  .plan-dropdown{
    position: static;
  }
}

/* ===== Language dropdown (like screenshot) ===== */
.lang-trigger{
  height: 25px;
  padding: 0 10px 0 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(18,18,18,0.72);
  color: rgba(255,255,255,0.92);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  backdrop-filter: blur(10px);
  font-size: 10px;
}

.lang-current{
  font-weight: 800;
  letter-spacing: .06em;
}

.lang-caret{
  opacity: .75;
  font-size: 10px;
  transform: translateY(-1px);
}

.lang-panel{
  position: absolute;
  left: 0; /* dropdown під кнопкою */
  top: calc(100% + 8px);
  min-width: 92px;
  padding: 10px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(12,12,12,0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.55);

  display: none;
}

.lang-panel.open{ display: block; }

.lang-item{
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.88);
  font-weight: 700;
  letter-spacing: .06em;
  padding: 10px 8px;
  border-radius: 12px;
  cursor: pointer;
}

.lang-item:hover{
  background: rgba(255,255,255,0.06);
}

.lang-item.active{
  color: var(--accent);
}





/* === Burger menu === */
.burger-menu-wrap {
  position: relative;
}

.burger-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}

.burger-btn span {
  width: 22px;
  height: 2px;
  background: #fff;
  display: block;
}

.burger-panel {
  position: absolute;
  left: 0;
  top: 42px;
  background: #0b0b0b;
  border: 1px solid #1f1f1f;
  border-radius: 10px;
  min-width: 220px;
  padding: 12px;
  z-index: 200;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}

.burger-panel.hidden {
  display: none;
}

.burger-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.burger-title {
  font-size: 12px;
  opacity: 0.6;
  margin-bottom: 4px;
}

.burger-item {
  background: none;
  border: none;
  color: #fff;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.burger-item:hover {
  background: #1a1a1a;
}

.burger-item.danger {
  color: #ff5c5c;
}

.burger-item.logout {
  color: #ff9f43;
}
.burger-item.login {
  color: #43ff72;
}

.burger-sep {
  height: 1px;
  background: #222;
  margin: 8px 0;
}
