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

:root{
  --bg:#0a0a0a;
  --bg2:#111;
  --bg3:#1a1a1a;
  --text:#d4d4d4;
  --muted:#666;
  --buy:#4ade80;
  --short:#f87171;
  --neutral:#555;
  --accent:#fbbf24;
  --font:'SF Mono','Cascadia Code','Consolas','Menlo',monospace;
}

html{font-size:14px}
body{
  background:var(--bg);
  color:var(--text);
  font-family:var(--font);
  min-height:100dvh;
  -webkit-font-smoothing:antialiased;
}

/* ── Header ── */
header{
  padding:16px 16px 12px;
  border-bottom:1px solid var(--bg3);
}
.header-top{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
h1{
  font-size:1.1rem;
  font-weight:700;
  color:var(--accent);
  letter-spacing:-0.5px;
}
.price{
  font-size:1.1rem;
  font-weight:700;
  color:var(--text);
  font-variant-numeric:tabular-nums;
}
.tagline{
  color:var(--muted);
  font-size:0.75rem;
  margin-top:4px;
}
.stats{
  display:flex;
  gap:12px;
  margin-top:8px;
  flex-wrap:wrap;
  align-items:center;
}
.stat{
  font-size:0.75rem;
  color:var(--muted);
}
.stat b{font-weight:700}
.stat.buy b{color:var(--buy)}
.stat.short b{color:var(--short)}
.stat.neutral b{color:var(--neutral)}
.stat.last{
  color:var(--muted);
  margin-left:auto;
  font-size:0.7rem;
}

/* ── Backtest bar ── */
.backtest-bar{
  display:flex;
  gap:12px;
  margin-top:8px;
  padding:8px 10px;
  background:var(--bg2);
  border:1px solid var(--bg3);
  border-radius:4px;
  flex-wrap:wrap;
  align-items:center;
}
.bt-item{
  font-size:0.7rem;
  color:var(--muted);
}
.bt-item b{
  font-weight:700;
  font-variant-numeric:tabular-nums;
}

/* ── Chart ── */
#chart-section{
  position:relative;
  border-bottom:1px solid var(--bg3);
}
#chart-container{
  width:100%;
  height:45dvh;
  min-height:280px;
  max-height:500px;
}
#equity-container{
  width:100%;
  height:15dvh;
  min-height:80px;
  max-height:160px;
  border-top:1px solid var(--bg3);
}
.tf-bar{
  display:flex;
  gap:4px;
  padding:8px 16px 0;
}
.tf-btn{
  background:var(--bg2);
  border:1px solid var(--bg3);
  color:var(--muted);
  font-family:var(--font);
  font-size:0.7rem;
  padding:4px 10px;
  cursor:pointer;
  border-radius:3px;
  transition:color .15s,border-color .15s;
}
.tf-btn:hover{color:var(--text);border-color:var(--muted)}
.tf-btn.active{color:var(--accent);border-color:var(--accent)}

/* ── Timeline ── */
#timeline{
  padding:16px;
}
.timeline-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:12px;
}
#timeline h2{
  font-size:0.85rem;
  color:var(--muted);
  font-weight:600;
}
.tg-btn{
  font-family:var(--font);
  font-size:0.7rem;
  color:var(--accent);
  text-decoration:none;
  padding:4px 10px;
  border:1px solid var(--accent);
  border-radius:3px;
  background:transparent;
  cursor:pointer;
  transition:background .15s,color .15s;
}
.tg-btn:hover{
  background:var(--accent);
  color:var(--bg);
  text-decoration:none;
}
#timeline-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.meal-card{
  display:flex;
  gap:12px;
  padding:10px 12px;
  background:var(--bg2);
  border:1px solid var(--bg3);
  border-radius:6px;
  cursor:pointer;
  transition:border-color .15s;
  align-items:flex-start;
}
.meal-card:hover{border-color:var(--muted)}
.meal-photo{
  width:56px;
  height:56px;
  border-radius:4px;
  object-fit:cover;
  flex-shrink:0;
  background:var(--bg3);
}
.meal-photo-placeholder{
  width:56px;
  height:56px;
  border-radius:4px;
  flex-shrink:0;
  background:var(--bg3);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:1.4rem;
  color:var(--muted);
}
.meal-body{
  flex:1;
  min-width:0;
}
.meal-top{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:4px;
}
.meal-text{
  font-size:0.8rem;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.meal-badge{
  font-size:0.65rem;
  font-weight:700;
  padding:2px 6px;
  border-radius:3px;
  flex-shrink:0;
  text-transform:uppercase;
}
.meal-badge.buy{background:rgba(74,222,128,0.15);color:var(--buy)}
.meal-badge.short{background:rgba(248,113,113,0.15);color:var(--short)}
.meal-badge.neutral{background:rgba(85,85,85,0.15);color:var(--neutral)}

.meal-meta{
  display:flex;
  gap:8px;
  font-size:0.7rem;
  color:var(--muted);
  align-items:center;
}
.meal-keywords{
  font-size:0.65rem;
  color:var(--accent);
  margin-top:2px;
}
.meal-reactions{
  display:flex;
  gap:6px;
  font-size:0.7rem;
  color:var(--muted);
  margin-top:2px;
}

/* ── Strategy ── */
#strategy{
  padding:16px;
  border-bottom:1px solid var(--bg3);
}
#strategy h2{
  font-size:0.85rem;
  color:var(--muted);
  font-weight:600;
  margin-bottom:10px;
}
.strategy-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.strategy-card{
  padding:10px 12px;
  background:var(--bg2);
  border:1px solid var(--bg3);
  border-radius:6px;
}
.buy-card{border-left:3px solid var(--buy)}
.short-card{border-left:3px solid var(--short)}
.strategy-signal{
  font-size:0.75rem;
  font-weight:700;
  margin-bottom:4px;
}
.buy-card .strategy-signal{color:var(--buy)}
.short-card .strategy-signal{color:var(--short)}
.strategy-desc{
  font-size:0.7rem;
  color:var(--text);
  margin-bottom:6px;
}
.strategy-keywords{
  font-size:0.6rem;
  color:var(--muted);
  line-height:1.5;
  font-family:var(--font);
}
.strategy-note{
  margin-top:8px;
  font-size:0.65rem;
  color:var(--muted);
  line-height:1.5;
}

/* ── Footer ── */
footer{
  padding:20px 16px;
  text-align:center;
  color:var(--muted);
  font-size:0.7rem;
  border-top:1px solid var(--bg3);
}
footer p+p{margin-top:4px}
footer a{color:var(--accent);text-decoration:none}
footer a:hover{text-decoration:underline}

/* ── Responsive ── */
@media(max-width:480px){
  h1{font-size:0.95rem}
  .price{font-size:0.95rem}
  .stat.last{margin-left:0;flex-basis:100%}
  #chart-container{height:40dvh;min-height:240px}
  #equity-container{height:12dvh;min-height:60px}
  .meal-photo,.meal-photo-placeholder{width:44px;height:44px}
}

/* ── Desktop ── */
@media(min-width:768px){
  body{max-width:1400px;margin:0 auto}
  header{padding:20px 24px 16px}
  h1{font-size:1.3rem}
  .price{font-size:1.3rem}
  .stats{gap:16px}
  .backtest-bar{gap:20px}
  #main-content{
    display:flex;
    border-bottom:1px solid var(--bg3);
  }
  #chart-section{
    flex:0 0 60%;
    border-bottom:none;
    border-right:1px solid var(--bg3);
  }
  .tf-bar{padding:10px 16px 0}
  #chart-container{height:55dvh;min-height:360px;max-height:none}
  #equity-container{height:15dvh;min-height:100px;max-height:180px}
  #timeline{
    flex:0 0 40%;
    padding:12px 16px;
    overflow-y:auto;
    max-height:calc(55dvh + 15dvh + 50px);
  }
  #timeline-list{gap:6px}
  .meal-photo,.meal-photo-placeholder{width:48px;height:48px}
  .meal-text{font-size:0.75rem}
  #strategy{padding:16px 24px}
  .strategy-grid{gap:12px}
  footer{padding:24px}
}
