/* CoinbaseEcho: a plain dark trading-terminal look. Colors live in :root, so a
   redesign (plan milestone 6) mostly means changing these tokens. */

:root {
  --bg: #0b0f14;
  --panel: #11171f;
  --line: #1f2833;
  --grid: #161d26;
  --text: #e6edf3;
  --muted: #8b98a8;
  --accent: #4c8dff;
  --up: #22c55e;
  --down: #ef4444;
  --radius: 10px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  font-size: 14px;
}
a { color: var(--accent); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.brand { color: var(--text); font-weight: 700; text-decoration: none; letter-spacing: .2px; }

.status { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status[data-status="live"]::before { background: var(--up); box-shadow: 0 0 0 3px rgb(34 197 94 / .2); }
.status[data-status="reconnecting"]::before { background: #f59e0b; }

.dash {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 12px 16px;
  min-height: 0;
}

.toolbar {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
}
.ticker { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
select, .timeframes button {
  font: inherit; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
}
select { font-weight: 600; }
.pair-name { color: var(--muted); }
.price { font-size: 22px; font-variant-numeric: tabular-nums; transition: color .3s; }
.price[data-dir="up"] { color: var(--up); }
.price[data-dir="down"] { color: var(--down); }

.timeframes { display: flex; gap: 4px; }
.timeframes button { cursor: pointer; min-width: 44px; }
.timeframes button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.chart-wrap, .trades-wrap {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); min-height: 0;
}
.chart-wrap { position: relative; min-height: 360px; }
.chart { position: absolute; inset: 8px; }
.chart-msg {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%); margin: 0;
  padding: 6px 10px; border-radius: 6px; background: var(--bg); color: var(--muted); font-size: 12px;
}

.trades-wrap { display: flex; flex-direction: column; overflow: hidden; }
.trades-wrap h2 { font-size: 13px; margin: 0; padding: 10px 12px 6px; color: var(--muted); font-weight: 600; }
.trades-head, .trades li {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; padding: 2px 12px;
  font-variant-numeric: tabular-nums;
}
.trades-head { color: var(--muted); font-size: 11px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.trades-head span:not(:first-child), .trades li span:not(:first-child) { text-align: right; }
.trades { list-style: none; margin: 0; padding: 4px 0; overflow: auto; flex: 1; font-size: 12px; }
.trades li.buy .price { color: var(--up); }
.trades li.sell .price { color: var(--down); }
.trades li .price { font-size: 12px; }
.trades li .time { color: var(--muted); }

.foot { padding: 10px 16px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }

.notfound main { margin: auto; text-align: center; }

/* Wide screens: the dashboard fills the window. */
@media (min-width: 801px) {
  body { height: 100vh; height: 100dvh; }
}
@media (max-width: 800px) {
  .dash { grid-template-columns: 1fr; grid-template-rows: auto 60vh 360px; }
}

@media (prefers-reduced-motion: reduce) {
  .price { transition: none; }
}

/* Header account area */
.account { display: flex; align-items: center; gap: 12px; }
.account .who { color: var(--muted); font-size: 12px; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-button {
  font: inherit; font-size: 12px; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; cursor: pointer;
}

/* Sign-in pages */
.auth-page { align-items: stretch; }
.auth-card {
  width: min(400px, calc(100% - 32px)); margin: auto; padding: 28px 24px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.auth-card h1 { font-size: 20px; margin: 16px 0 16px; }
.auth-card form { display: grid; gap: 12px; }
.auth-card label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.auth-card input {
  font: inherit; font-size: 15px; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
.auth-card input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.auth-card button {
  font: inherit; font-weight: 600; color: #fff; background: var(--accent);
  border: 0; border-radius: 8px; padding: 11px 14px; cursor: pointer; margin-top: 4px;
}
.auth-card button:disabled { opacity: .6; cursor: wait; }
.auth-hint { margin: -6px 0 0; color: var(--muted); font-size: 12px; }
.auth-note { color: var(--muted); font-size: 13px; margin: -6px 0 16px; }
.auth-links { color: var(--muted); font-size: 13px; margin: 16px 0 0; }
.auth-msg { margin: 16px 0 0; padding: 10px 12px; border-radius: 8px; font-size: 13px; background: rgb(239 68 68 / .12); color: #fca5a5; }
.auth-msg[data-kind="ok"] { background: rgb(34 197 94 / .12); color: #86efac; }
