:root { --otvaga:#4d9fff; --strah:#ff5566; --zhadnost:#3ddc84; --bezumie:#b366ff; }
.tonnel-indicator { --border:#303032; --accent:var(--gold); --text:#f1f0eb; }
  .head { display:flex; align-items:center; flex-wrap:wrap; gap:clamp(8px,2vw,16px); margin-bottom:22px; }
  .head .token { flex:1 1 auto; min-width:0; }
  .head .price-block { flex:0 0 auto; min-width:0; }
  .token-warning {
    display:flex; align-items:flex-start; gap:8px; margin-top:20px; padding:14px 16px;
    background:rgba(255,176,32,0.08); border:1px solid rgba(255,176,32,0.25); border-radius:12px;
    font-size:0.82rem; line-height:1.5; color:#ffcb66;
  }
  .token-warning .warn-icon { flex-shrink:0; }
  .token { display:flex; align-items:center; gap:12px; min-width:0; }
  .token > div { min-width:0; }
  .token img {
    width:clamp(30px,6vw,44px); height:clamp(30px,6vw,44px); border-radius:50%; background:#111; object-fit:cover;
    filter:drop-shadow(0 0 5px rgba(201,162,39,0.3)) drop-shadow(0 0 10px rgba(201,162,39,0.15));
    animation:icon-header-glow 4.5s ease-in-out infinite;
  }
  @keyframes icon-header-glow {
    0%, 100% { filter:drop-shadow(0 0 5px rgba(201,162,39,0.3)) drop-shadow(0 0 10px rgba(201,162,39,0.15)); }
    50% { filter:drop-shadow(0 0 11px rgba(201,162,39,0.7)) drop-shadow(0 0 20px rgba(201,162,39,0.4)); }
  }
  @media (prefers-reduced-motion: reduce) {
    .token img { animation:none; filter:drop-shadow(0 0 7px rgba(201,162,39,0.4)) drop-shadow(0 0 14px rgba(201,162,39,0.25)); }
  }
  .token-name { font-size:clamp(0.9rem,3vw,1.3rem); font-weight:700; letter-spacing:-0.01em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; flex-shrink:1; }
  .token-name-row { display:flex; align-items:center; gap:10px; min-width:0; }
  .tf-group {
    display:flex; align-items:center; background:#000; border:1px solid var(--border);
    border-radius:999px; padding:3px; gap:1px; flex-shrink:0;
  }
  .tf-btn {
    text-decoration:none; border:none; background:transparent; color:var(--muted); font-weight:700;
    font-size:0.66rem; padding:4px 10px; border-radius:999px; cursor:pointer; font-family:inherit;
    transition:all 0.2s ease; white-space:nowrap;
  }
  .tf-btn.active { background:rgba(255,255,255,0.12); color:var(--text); }
  .tf-btn:not(.active):hover { color:var(--text); }
  .price-block { text-align:right; }
  .price { font-size:clamp(1rem,3.2vw,1.6rem); font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap; }
  .change { font-size:clamp(0.68rem,1.8vw,0.9rem); font-weight:600; white-space:nowrap; }
  .change.up { color:var(--zhadnost); }
  .change.down { color:var(--strah); }

  .chart-card {
    position:relative; background:#000; border:1px solid var(--border); border-radius:16px;
    padding:18px 12px; overflow:hidden;
  }
  .chart-wrap { position:relative; width:100%; height:420px; }
  canvas { width:100%; height:100%; display:block; }

  .badge {
    position:absolute; left:0; transform:translateY(-50%);
    display:flex; align-items:center; gap:8px; white-space:nowrap; pointer-events:none;
  }
  .badge-emoji {
    width:40px; height:40px; border-radius:50%; display:flex; align-items:center; justify-content:center;
    background:#0a0a0a; flex-shrink:0; overflow:hidden;
  }
  .badge-emoji img { width:94%; height:94%; object-fit:contain; }
  .badge-text { font-size:0.7rem; line-height:1.3; color:var(--muted); white-space:nowrap; }
  .badge-text b { display:block; font-size:0.78rem; font-weight:700; }

  .meta {
    display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px;
    margin-top:14px; font-size:0.75rem; color:var(--muted);
  }
  .status-dot { display:inline-block; width:6px; height:6px; border-radius:50%; background:var(--zhadnost); margin-right:5px; animation:pulse 2s ease-in-out infinite; }
  @keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.3;} }
  .today-dot {
    position:absolute; width:8px; height:8px; border-radius:50%; transform:translate(-50%,-50%);
    pointer-events:none; animation:pulse 2s ease-in-out infinite;
  }

  .thesis {
    margin-top:28px; background:#000; border:1px solid var(--border); border-radius:16px;
    padding:26px 28px;
  }
  .thesis-eyebrow {
    font-size:0.68rem; font-weight:700; letter-spacing:0.14em; text-transform:uppercase;
    color:var(--accent); opacity:0.85; margin-bottom:8px;
  }
  .thesis-title { font-size:1.15rem; font-weight:700; letter-spacing:-0.01em; margin-bottom:12px; }
  .thesis-text { font-size:17px; line-height:1.7; color:var(--muted); margin-bottom:22px; }
  .thesis-text b { font-weight:700; }
  .thesis-cycle { display:flex; align-items:flex-start; gap:clamp(2px,1.5vw,8px); flex-wrap:nowrap; }
  .cycle-step { display:flex; flex-direction:column; align-items:center; gap:6px; flex:1 1 0; min-width:0; }
  .cycle-emoji {
    width:clamp(26px,9vw,44px); height:clamp(26px,9vw,44px); border-radius:50%; background:#0a0a0a; display:flex;
    align-items:center; justify-content:center; flex-shrink:0; overflow:hidden;
  }
  .cycle-emoji img { width:94%; height:94%; object-fit:contain; }
  .cycle-label { font-size:clamp(0.56rem,2.4vw,0.72rem); font-weight:700; text-align:center; overflow-wrap:break-word; }
  .cycle-arrow {
    color:var(--muted); font-size:clamp(0.7rem,2.8vw,1.2rem); opacity:0.4; flex:0 0 auto;
    align-self:center; padding-top:calc(clamp(26px,9vw,44px) / 2 - 0.6em);
  }

  .cycle-progress { margin-top:26px; padding-top:22px; border-top:1px solid var(--border); }
  .cycle-progress-label { font-size:0.82rem; color:var(--muted); margin-bottom:16px; }
  .cycle-progress-label b { font-weight:700; }
  .cycle-progress-track {
    position:relative; height:8px; border-radius:4px; margin:0 2px;
    background:linear-gradient(90deg, var(--strah), var(--otvaga), var(--zhadnost), var(--bezumie));
  }
  .cycle-progress-tick { position:absolute; top:-3px; width:2px; height:14px; background:rgba(255,255,255,0.5); transform:translateX(-1px); }
  .cycle-progress-dot {
    position:absolute; top:-6px; width:20px; height:20px; border-radius:50%; background:#fff;
    border:3px solid #000; box-shadow:0 0 0 2px rgba(255,255,255,0.5); transform:translate(-50%,0);
    transition:left 0.4s ease;
  }
  .cycle-progress-ticklabels { position:relative; height:16px; margin-top:6px; }
  .cycle-progress-ticklabels span { position:absolute; top:0; font-size:0.68rem; font-weight:700; white-space:nowrap; }
  .cycle-price-row {
    display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:26px; padding-top:18px;
    border-top:1px solid var(--border); font-size:0.85rem; color:var(--muted);
  }
  .cycle-price-row b { color:var(--text); font-weight:700; font-variant-numeric:tabular-nums; }
  .cycle-price-row .change { font-size:0.8rem; font-weight:700; }

  .tonnel-clip { margin-top:18px; border-radius:12px; overflow:hidden; background:#000; border:1px solid var(--border); }
  .tonnel-clip img { width:100%; display:block; }

/* Note shell around the migrated indicator. Thresholds and phase colours stay original. */
.tonnel-indicator > h1 { margin: 38px 0 26px; font-size: 31px; line-height: 1.3; }
.indicator-card, .thesis { background: linear-gradient(#111213, #0a0b0c); border: 1px solid #303032; border-radius: 18px; }
.indicator-card { padding: 24px 28px; }
.indicator-toolbar { display: flex; justify-content: flex-end; align-items: center; gap: 16px; margin-bottom: 18px; color: var(--muted); font-size: 11px; }
.indicator-toolbar .tf-group { border-color: #393321; }
.head { margin-bottom: 20px; }
.token-name { font-size: 26px; }
.chart-card { padding: 0; border-color: #24272a; border-radius: 12px; background: #090b0c; }
.chart-wrap { height: 480px; padding: 0; }
.level-line { position: absolute; left: 0; height: 0; border-top: 1.5px dashed; opacity: .85; pointer-events: none; z-index: 1; }
.badge { z-index: 2; }
.today-dot { z-index: 3; }
.chart-message { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; color: var(--muted); font-size: 14px; text-align: center; }
.thesis { margin-top: 24px; padding: 28px; }
.thesis-title { font-size: 24px; line-height: 1.35; }
.thesis-cycle { gap: 10px; }
.cycle-step { padding: 16px 10px; border: 1px solid #292a2b; border-radius: 12px; background: #0c0e0f; }
.cycle-label { font-size: 14px; }
.cycle-progress-label { font-size: 14px; }
.cycle-progress-ticklabels { height: 22px; }
.cycle-progress-ticklabels span { font-size: 12px; }
.tonnel-clip img { height: auto; }
.meta { line-height: 1.5; }
.data-status { margin: 10px 0 0; color: #a39b8a; font-size: 12px; line-height: 1.5; }
.data-status:empty { display: none; }
.token-warning { margin-top: 24px; line-height: 1.6; }
.nav-item:not(:disabled):hover { border-color: #b79a43; }
@media (max-width: 640px) {
  .tonnel-indicator > h1 { margin: 28px 0 22px; font-size: 25px; }
  .indicator-card { padding: 18px 14px; border-radius: 14px; }
  .chart-wrap { height: 340px; }
  .badge { gap: 0; }
  .badge-emoji { width: 30px; height: 30px; }
  .badge-text { display: none; }
  .token-name { font-size: 20px; }
  .token { gap: 8px; }
  .token-name-row { gap: 8px; }
  .head { gap: 12px; }
  .head .price-block { margin-left: auto; }
  .tf-btn { padding: 6px 10px; font-size: 11px; }
  .thesis { padding: 20px 14px; border-radius: 14px; }
  .thesis-title { font-size: 21px; }
  .thesis-cycle { gap: 4px; }
  .cycle-step { padding: 12px 3px; gap: 8px; }
  .cycle-label { font-size: 10px; }
  .cycle-arrow { font-size: 12px; padding-top: 0; }
  .cycle-progress-ticklabels span { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .status-dot, .today-dot, .token img { animation: none; }
  .cycle-progress-dot { transition: none; }
}

.chart-history-scroll { overflow-x: scroll; overflow-y: hidden; height: 16px; margin-top: 10px; scrollbar-color: #9b7d40 #171a1a; scrollbar-width: thin; }
.chart-history-scroll::-webkit-scrollbar { height: 8px; }
.chart-history-scroll::-webkit-scrollbar-thumb { background: #9b7d40; border-radius: 5px; }
.chart-history-scroll::-webkit-scrollbar-track { background: #171a1a; }
#chartHistoryTrack { height: 1px; }
.chart-history-scroll:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }
.chart-history-period { color: var(--muted); font-size: 11px; margin: 6px 0 0; }
/* Keep the native scroll geometry for synchronization; use the same visible
   control on desktop and phones instead of OS-dependent overlay scrollbars. */
.chart-history-scroll { height: 0; margin-top: 0; visibility: hidden; }
.chart-history-range { display: block; width: 100%; height: 28px; margin: 4px 0 0; padding: 0; appearance: none; -webkit-appearance: none; background: transparent; accent-color: #b99a56; touch-action: pan-y; cursor: ew-resize; }
.chart-history-range::-webkit-slider-runnable-track { height: 5px; border-radius: 4px; background: #3b3425; }
/* The visible grip is 24 × 6px; transparent borders retain a taller hit area. */
.chart-history-range::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; box-sizing: border-box; width: 24px; height: 24px; margin-top: -9.5px; border: 9px solid transparent; border-left: 0; border-right: 0; border-radius: 2px; background: #a68a4d; background-clip: padding-box; }
.chart-history-range::-moz-range-track { height: 5px; border-radius: 4px; background: #3b3425; }
.chart-history-range::-moz-range-thumb { box-sizing: border-box; width: 24px; height: 24px; border: 9px solid transparent; border-left: 0; border-right: 0; border-radius: 2px; background: #a68a4d; background-clip: padding-box; }
.chart-history-range:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
@media (max-width: 640px), (pointer: coarse) { .chart-history-range { height: 44px; } }
