/* ─────────────────────────────────────────────────────────────────────────
   Crypto & News Dashboard — light pastel theme
   ───────────────────────────────────────────────────────────────────────── */

:root{
  /* Background tones — toggled via [data-theme] on #dash */
  --bg-1:        #fcfaf5;   /* warm near-white outer */
  --bg-2:        #ffffff;
  --surface:     #ffffff;   /* card body */
  --surface-2:   #f4f1ea;   /* recessed inside cards (segmented track) */

  --ink-1:       #1a1814;   /* primary text */
  --ink-2:       #4a4740;   /* secondary text */
  --ink-3:       #8a857c;   /* tertiary / hint */
  --ink-4:       #c8c3b9;   /* axis lines, dividers */
  --line:        rgba(26,24,20,.06);

  /* Pastel accents per asset (line + soft fill) */
  --btc:        #e0a96d;    --btc-soft:        rgba(224,169,109,.18);
  --eth:        #9a8ad8;    --eth-soft:        rgba(154,138,216,.18);
  --trx:        #e08778;    --trx-soft:        rgba(224,135,120,.20);
  --usdc:       #7eb0c2;    --usdc-soft:       rgba(126,176,194,.20);

  /* Per-news-feed accent dots */
  --feed-1:     #c9a3c1;    /* dusty rose */
  --feed-2:     #a6c0a3;    /* sage */
  --feed-3:     #c2a87a;    /* sand */
  --feed-4:     #8fb1cf;    /* sky */

  --up:          #4e9a6b;
  --up-soft:     rgba(78,154,107,.10);
  --down:        #c8695a;
  --down-soft:   rgba(200,105,90,.10);
  --flat:        #8a857c;

  --radius-card: 28px;
  --radius-md:   16px;
  --radius-sm:   10px;
  --radius-pill: 999px;

  --shadow-card:
    0 0.5px 0 rgba(255,255,255,.9) inset,
    0 0 0 0.5px rgba(26,24,20,.04),
    0 2px 4px rgba(26,24,20,.03),
    0 8px 24px rgba(26,24,20,.05),
    0 24px 64px rgba(26,24,20,.06);

  --gap-grid: 28px;
  --pad-card: 28px;
}

/* Cool variant — bluish neutrals */
[data-theme="cool"]{
  --bg-1: #f6f7fa;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --ink-1: #16181d;
  --ink-2: #444852;
  --ink-3: #858993;
  --ink-4: #c4c7cf;
  --line: rgba(22,24,29,.06);
}
/* Paper — nearly pure white */
[data-theme="paper"]{
  --bg-1: #ffffff;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f3f1;
  /* Cards on a pure-white bg need a stronger border, since shadow alone
     reads as edge color rather than separation. */
  --shadow-card:
    0 0 0 1px rgba(26,24,20,.06),
    0 1px 2px rgba(26,24,20,.02),
    0 8px 24px rgba(26,24,20,.04);
}
[data-theme="mist"]{
  --bg-1: #f1f2f4;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #ebecee;
}

/* Density */
[data-density="compact"]{ --gap-grid: 20px; --pad-card: 22px; }
[data-density="comfy"]  { --gap-grid: 36px; --pad-card: 32px; }

*,*::before,*::after{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  color: var(--ink-1);
  background: var(--bg-1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

/* ── Stage: scales 1920×1080 into any viewport ────────────────────────── */
#stage{
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: var(--bg-1);
}
#dash{
  width: 1920px;
  height: 1080px;
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  padding: 36px 40px 36px;
  gap: 28px;
  transform-origin: center center;
}

/* ── Topbar ───────────────────────────────────────────────────────────── */
.topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 0;
}
.brand{ display: flex; align-items: center; gap: 18px; }
.brand-mark{
  display: grid;
  grid-template-columns: 12px 12px;
  grid-template-rows: 12px 12px;
  gap: 4px;
}
.brand-mark .dot{
  width: 12px; height: 12px; border-radius: 999px;
  box-shadow: 0 0 0 0.5px rgba(0,0,0,.04);
}
.dot-btc { background: var(--btc); }
.dot-eth { background: var(--eth); }
.dot-trx { background: var(--trx); }
.dot-usdc{ background: var(--usdc); }

.brand-text h1{
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink-1);
}
.brand-text p{
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.005em;
}

.topbar-right{ display:flex; align-items:center; gap: 18px; }
.meta-pill{
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  box-shadow: var(--shadow-card);
}
.meta-pill .pulse{
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--up);
  box-shadow: 0 0 0 0 rgba(78,154,107,.5);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse{
  0%   { box-shadow: 0 0 0 0 rgba(78,154,107,.45); }
  60%  { box-shadow: 0 0 0 8px rgba(78,154,107,0); }
  100% { box-shadow: 0 0 0 0 rgba(78,154,107,0); }
}
.meta-label{ font-weight: 600; color: var(--ink-1); }
.meta-sep{
  display: inline-block; width: 1px; height: 12px;
  background: var(--ink-4);
}
.meta-text{ font-variant-numeric: tabular-nums; color: var(--ink-3); }

.clock{
  padding: 8px 18px 10px;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  text-align: right;
  min-width: 120px;
}
.clock-time{
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-1);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.clock-date{
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ── Body grid ────────────────────────────────────────────────────────── */
.grid{
  flex: 1;
  display: grid;
  grid-template-columns: 1.18fr 1fr;
  gap: 32px;
  min-height: 0;
}
.col{
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
}
.col-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}
.col-head h2{
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ── Segmented range tabs ─────────────────────────────────────────────── */
.seg{
  display: inline-flex;
  padding: 4px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
}
.seg-btn{
  appearance: none; border: 0;
  padding: 7px 16px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  background: transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.seg-btn:hover{ color: var(--ink-2); }
.seg-btn.is-active{
  background: var(--ink-1);
  color: #faf8f4;
}

.news-meta{
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}
.meta-pin{
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--ink-4);
}

/* ── Card base ────────────────────────────────────────────────────────── */
.card{
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--pad-card);
  display: flex;
  flex-direction: column;
}

/* ── Crypto grid ──────────────────────────────────────────────────────── */
.crypto-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--gap-grid);
  flex: 1;
  min-height: 0;
}
.crypto-card{
  min-height: 0;
  position: relative;
  overflow: hidden;
}
.crypto-card::before{
  /* Faint accent halo in the top-right corner */
  content: '';
  position: absolute;
  right: -120px; top: -120px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: var(--accent-soft);
  filter: blur(28px);
  opacity: .55;
  pointer-events: none;
}

.crypto-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  z-index: 1;
}
.crypto-id{ display: flex; align-items: center; gap: 14px; }
.crypto-glyph{
  width: 44px; height: 44px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  letter-spacing: -0.02em;
}
.crypto-name .sym{
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-1);
  line-height: 1.1;
}
.crypto-name .full{
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.crypto-price{ text-align: right; }
.price-row{
  display: inline-flex; align-items: baseline; gap: 8px;
  font-variant-numeric: tabular-nums;
}
.ccy{
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.price-row .num{
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 26px;
  font-weight: 600;
  color: var(--ink-1);
  letter-spacing: -0.02em;
}
.delta{
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 4px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}
.delta.is-up   { color: var(--up);   background: var(--up-soft); }
.delta.is-down { color: var(--down); background: var(--down-soft); }
.delta.is-flat { color: var(--flat); background: rgba(138,133,124,.10); }
.delta-arrow{ font-size: 9px; }
.delta-pct{ opacity: .85; margin-left: 2px; }

.chart{
  flex: 1;
  margin: 18px -8px 0;
  min-height: 140px;
  position: relative;
  z-index: 1;
}

.crypto-foot{
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  position: relative;
  z-index: 1;
}
.foot-item{ display: flex; flex-direction: column; gap: 4px; }
.foot-item span{
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.foot-item b{
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-1);
  font-variant-numeric: tabular-nums;
}

/* ── News column ──────────────────────────────────────────────────────── */
.news-list{
  flex: 1;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  gap: var(--gap-grid);
  min-height: 0;
}

.news-card{
  padding: 22px 26px;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.news-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.news-head-left{ display: flex; align-items: center; gap: 12px; min-width: 0; }
.feed-dot{
  width: 10px; height: 10px; border-radius: 999px;
  flex-shrink: 0;
}
.feed-1 .feed-dot{ background: var(--feed-1); }
.feed-2 .feed-dot{ background: var(--feed-2); }
.feed-3 .feed-dot{ background: var(--feed-3); }
.feed-4 .feed-dot{ background: var(--feed-4); }

.news-title{
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-1);
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.news-lang{
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-3);
  padding: 3px 8px;
  background: var(--surface-2);
  border-radius: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.news-count{
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.news-items{
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  overflow: hidden;
}
.news-item{
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.news-item:first-child{ border-top: 0; padding-top: 4px; }
.news-item-title{
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-1);
  line-height: 1.35;
  letter-spacing: -0.005em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: pretty;
}
.news-item-meta{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
}
.news-item-meta .src{ color: var(--ink-2); }
.news-item-meta .dot-sep{
  width: 3px; height: 3px; border-radius: 999px;
  background: var(--ink-4);
  display: inline-block;
}
.news-item-meta time{
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
}

.news-empty{
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  color: var(--ink-3);
  font-size: 13px;
}
.news-empty svg{ opacity: .35; }
.news-empty b{ color: var(--ink-2); font-weight: 600; }
.news-empty span{ font-size: 11.5px; }
