/* ProTrader Trading Room — calm, private-banking terminal. One accent (brass),
   one cool gray family, semantic gain/loss colors kept muted. */

:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-sunk: #eceef1;
  --ink: #111318;
  --ink-soft: #3a3f48;
  --muted: #6b717c;
  --faint: #9aa0aa;
  --line: rgba(17, 19, 24, 0.07);
  --accent: #9a7324;
  --accent-soft: rgba(154, 115, 36, 0.12);
  --gain: #1f8a5b;
  --gain-soft: rgba(31, 138, 91, 0.1);
  --loss: #c2453b;
  --loss-soft: rgba(194, 69, 59, 0.1);
  --shadow:
    0 1px 2px rgba(24, 32, 48, 0.04), 0 8px 24px -12px rgba(24, 32, 48, 0.12);
  --grain-opacity: 0.035;
  --sans:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", ui-sans-serif,
    sans-serif;
  --display:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    ui-sans-serif, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 7px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0c0e;
    --surface: #121418;
    --surface-sunk: #0e1013;
    --ink: #eceef1;
    --ink-soft: #c3c8d0;
    --muted: #8a909a;
    --faint: #5c626c;
    --line: rgba(236, 238, 241, 0.06);
    --accent: #d4a954;
    --accent-soft: rgba(212, 169, 84, 0.12);
    --gain: #45b584;
    --gain-soft: rgba(69, 181, 132, 0.12);
    --loss: #e0685c;
    --loss-soft: rgba(224, 104, 92, 0.12);
    --shadow:
      0 1px 0 rgba(255, 255, 255, 0.03) inset,
      0 12px 32px -16px rgba(0, 0, 0, 0.6);
    --grain-opacity: 0.05;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  padding: max(18px, env(safe-area-inset-top)) 18px
    max(28px, env(safe-area-inset-bottom));
  background:
    radial-gradient(120% 60% at 0% 0%, var(--accent-soft), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.bar,
.page,
.state,
.foot {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- top bar ---------- */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font: 600 15px/1 var(--display);
  letter-spacing: -0.01em;
}

.mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--surface) url("mark.png") center / cover no-repeat;
  box-shadow: 0 0 0 1px var(--line);
}

.live {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
}

.live.is-live .pulse {
  background: var(--gain);
  animation: pulse 2.4s var(--ease) infinite;
}

.live.is-offline .pulse {
  background: var(--loss);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 var(--gain-soft);
  }
  70% {
    box-shadow: 0 0 0 7px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* ---------- hero ---------- */

.hero {
  padding: 6px 2px 26px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.tag {
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.figure {
  margin: 0;
  font: 600 clamp(40px, 12vw, 54px) / 1 var(--display);
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.figure .cents {
  color: var(--faint);
  font-weight: 500;
}

.delta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.chip {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-sunk);
  color: var(--ink-soft);
  font: 500 13px/1.3 var(--mono);
  font-variant-numeric: tabular-nums;
}

.chip.gain {
  background: var(--gain-soft);
  color: var(--gain);
}

.chip.loss {
  background: var(--loss-soft);
  color: var(--loss);
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.pair dt,
.facts dt {
  color: var(--muted);
  font-size: 12.5px;
}

.pair dd {
  margin: 2px 0 0;
  font: 500 17px/1.3 var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.gain-text {
  color: var(--gain);
}

.loss-text {
  color: var(--loss);
}

.notice {
  margin: 16px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13.5px;
}

/* ---------- panels ---------- */

.panel {
  margin-bottom: 12px;
  padding: 18px 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

h2 {
  margin: 0;
  font: 600 15px/1.3 var(--display);
  letter-spacing: -0.01em;
}

.panel-meta,
.count {
  margin: 0;
  color: var(--muted);
  font: 500 12.5px/1.3 var(--mono);
  font-variant-numeric: tabular-nums;
}

/* Segmented loss-budget gauge */
.gauge {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 3px;
  height: 22px;
}

.gauge span {
  border-radius: 3px;
  background: var(--surface-sunk);
  transform-origin: bottom;
  transition: background-color 400ms var(--ease);
}

.gauge span.on {
  background: var(--accent);
}

.gauge span.on.hot {
  background: var(--loss);
}

.gauge-caption {
  margin: 10px 0 16px;
  color: var(--muted);
  font-size: 13px;
  text-wrap: pretty;
}

.gauge-caption strong {
  color: var(--ink);
  font: 600 13px var(--mono);
}

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.facts dd {
  margin: 2px 0 0;
  font: 500 14.5px/1.35 var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.guards {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.guards li {
  position: relative;
  margin-top: 8px;
  padding: 10px 12px 10px 30px;
  border-radius: var(--radius-sm);
  background: var(--loss-soft);
  color: var(--ink-soft);
  font-size: 13.5px;
  text-wrap: pretty;
}

.guards li::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 15px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--loss);
}

.guards li.adjust {
  background: var(--accent-soft);
}

.guards li.adjust::before {
  background: var(--accent);
}

.next-event {
  margin: 0;
  font-size: 15px;
  text-wrap: pretty;
}

.next-event .when {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font: 500 13px var(--mono);
}

/* ---------- rows ---------- */

.rows,
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rows li {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.rows li:first-child {
  padding-top: 2px;
  border-top: 0;
}

.row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.row-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.side {
  padding: 2px 6px;
  border-radius: 4px;
  font: 700 10.5px/1.3 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.side.buy {
  background: var(--gain-soft);
  color: var(--gain);
}

.side.sell {
  background: var(--loss-soft);
  color: var(--loss);
}

.row-end {
  font: 600 15px var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.row-sub {
  margin: 5px 0 0;
  color: var(--muted);
  font: 400 12.5px/1.45 var(--mono);
  font-variant-numeric: tabular-nums;
}

/* Price ladder: stop — entry — target on one line */
.ladder {
  position: relative;
  height: 6px;
  margin: 14px 0 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--loss-soft), var(--gain-soft));
}

.ladder.sell {
  background: linear-gradient(90deg, var(--gain-soft), var(--loss-soft));
}

.ladder .risk,
.ladder .reward {
  position: absolute;
  top: 0;
  bottom: 0;
}

.ladder .risk {
  border-radius: 999px 0 0 999px;
  background: var(--loss);
  opacity: 0.55;
}

.ladder .reward {
  border-radius: 0 999px 999px 0;
  background: var(--gain);
  opacity: 0.55;
}

.ladder.sell .risk {
  border-radius: 0 999px 999px 0;
}

.ladder.sell .reward {
  border-radius: 999px 0 0 999px;
}

.ladder .entry {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 14px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--ink);
}

.ladder .now {
  position: absolute;
  top: -3px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.ladder-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font: 400 11.5px/1.3 var(--mono);
  font-variant-numeric: tabular-nums;
}

.ladder-labels b {
  color: var(--ink-soft);
  font-weight: 500;
}

.rr {
  color: var(--accent);
  font: 600 12.5px var(--mono);
}

/* News timeline */
.timeline li {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.timeline li:first-child {
  padding-top: 2px;
  border-top: 0;
}

.timeline time {
  white-space: nowrap;
  color: var(--muted);
  font: 500 13px/1.5 var(--mono);
  font-variant-numeric: tabular-nums;
}

.timeline .ccy {
  margin-right: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-sunk);
  font: 600 11px var(--mono);
}

.impact {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 8px 0 -1px;
  border-radius: 50%;
  background: var(--faint);
  vertical-align: middle;
}

.impact.high {
  background: var(--loss);
}

.impact.medium {
  background: var(--accent);
}

.empty {
  margin: 0;
  padding: 2px 0;
  color: var(--muted);
  font-size: 14px;
  text-wrap: pretty;
}

/* ---------- loading, messages, footer ---------- */

.skeleton {
  display: inline-block;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--surface-sunk),
    var(--line),
    var(--surface-sunk)
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.skeleton-figure {
  width: 64%;
  height: 46px;
}

.skeleton-line {
  width: 70%;
  height: 14px;
}

.skeleton-word {
  width: 60%;
  height: 16px;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.state {
  padding: 56px 8px 40px;
  text-align: center;
}

.state-mark {
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto 18px;
  border-radius: 13px;
  background: var(--surface) url("mark.png") center / cover no-repeat;
  box-shadow: var(--shadow);
}

.state h1 {
  margin: 0 0 8px;
  font: 600 22px/1.25 var(--display);
  letter-spacing: -0.02em;
}

.state p {
  max-width: 34ch;
  margin: 0 auto;
  color: var(--muted);
  text-wrap: balance;
}

.foot {
  margin-top: 26px;
  color: var(--faint);
  font-size: 12px;
  text-align: center;
}

.foot p {
  max-width: 44ch;
  margin: 6px auto;
  text-wrap: balance;
}

/* ---------- motion ---------- */

.reveal {
  animation: rise 520ms var(--ease) both;
}

.page .reveal:nth-child(2) {
  animation-delay: 60ms;
}
.page .reveal:nth-child(3) {
  animation-delay: 120ms;
}
.page .reveal:nth-child(4) {
  animation-delay: 180ms;
}
.page .reveal:nth-child(5) {
  animation-delay: 240ms;
}
.page .reveal:nth-child(6) {
  animation-delay: 300ms;
}
.page .reveal:nth-child(7) {
  animation-delay: 360ms;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .skeleton,
  .live.is-live .pulse {
    animation: none;
  }
}
