/* ASX Pulse — dark finance, Gold Coast night board */
:root {
  --navy: #0B1F33;
  --navy-2: #10283f;
  --navy-3: #16324d;
  --gold: #E6B325;
  --gold-dim: rgba(230, 179, 37, 0.16);
  --up: #3DDC97;
  --down: #FF5A5F;
  --blue: #4DA3FF;
  --ink: #e8eef6;
  --muted: #8aa0b8;
  --line: rgba(230, 179, 37, 0.22);
  --card: rgba(16, 40, 63, 0.78);
  --shadow: 0 18px 40px rgba(4, 12, 22, 0.45);
  --radius: 18px;
  --font: "Manrope", system-ui, sans-serif;
  --display: "Syne", "Manrope", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--navy);
  color: var(--ink);
  min-height: 100dvh;
  line-height: 1.45;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--gold); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.glow { position: absolute; border-radius: 50%; filter: blur(40px); opacity: 0.45; }
.glow-gold { width: 420px; height: 420px; background: #E6B325; top: -160px; left: -80px; opacity: 0.18; }
.glow-blue { width: 520px; height: 520px; background: #4DA3FF; bottom: -200px; right: -120px; opacity: 0.16; }
.grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(77, 163, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 163, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%);
}

.top, .tabs, main, footer { position: relative; z-index: 1; }
.top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px 28px;
  align-items: center;
  padding: 22px 28px 10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(11, 31, 51, 0.92), rgba(11, 31, 51, 0.65));
}
.top::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--blue), var(--up));
}
.brand { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.logo { border-radius: 9px; box-shadow: 0 0 0 1px var(--gold-dim); }
h1 {
  font-family: var(--display);
  font-size: 1.55rem;
  letter-spacing: 0.02em;
  margin: 0;
  line-height: 1.1;
}
.sub { margin: 2px 0 0; color: var(--gold); font-size: 0.82rem; font-weight: 600; }
.when { text-align: right; color: var(--muted); font-size: 0.86rem; }
.when time { display: block; color: var(--ink); font-family: var(--mono); font-size: 0.92rem; }
.pin {
  display: inline-block;
  color: var(--navy);
  background: var(--gold);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 4px;
}
.seek { position: relative; display: flex; gap: 8px; min-width: 280px; }
.seek input, .inline-form input {
  background: var(--navy-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 0;
  flex: 1;
}
.seek input:focus, .inline-form input:focus, button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}
.seek button, .inline-form button {
  background: var(--gold);
  color: var(--navy);
  font-weight: 800;
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
}
.ghost {
  background: transparent !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
}
.suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  list-style: none; margin: 0; padding: 6px;
  background: #10283f;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 20;
  max-height: 280px;
  overflow: auto;
}
.suggest li { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.suggest li:hover, .suggest li.active { background: var(--gold-dim); }
.suggest code { font-family: var(--mono); color: var(--gold); }

.tabs {
  display: flex; gap: 8px; padding: 14px 28px 0;
}
.tabs a {
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
}
.tabs a.on, .tabs a:hover {
  color: var(--navy);
  background: var(--gold);
  border-color: var(--gold);
}

main { padding: 18px 28px 48px; display: grid; gap: 16px; max-width: 1240px; margin: 0 auto; }
.view { display: grid; gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.card-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
h2 { font-family: var(--display); font-size: 1.12rem; margin: 0 0 10px; }
.muted { color: var(--muted); margin: 0; }
.tiny { font-size: 0.78rem; margin-top: 8px; }
.banner {
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 90, 95, 0.12);
  border: 1px solid rgba(255, 90, 95, 0.35);
  color: #ffd2d3;
}

.hero-kicker { color: var(--blue); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.72rem; }
.hero-row { display: flex; justify-content: space-between; gap: 24px; align-items: end; flex-wrap: wrap; margin-top: 8px; }
.hero-px { font-family: var(--mono); font-size: 2.6rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.hero-chg { margin-top: 8px; font-family: var(--mono); font-weight: 600; }
.up { color: var(--up); }
.down { color: var(--down); }
.hero-meta { color: var(--muted); max-width: 360px; font-size: 0.9rem; }

.gl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.gl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gl-list li {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 10px; background: rgba(11, 31, 51, 0.55);
  cursor: pointer;
}
.gl-list .px, .gl-list .chg { font-family: var(--mono); }
.gainer { box-shadow: inset 3px 0 0 var(--up); }
.loser { box-shadow: inset 3px 0 0 var(--down); }

.table-wrap { overflow-x: auto; }
.sheet { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.sheet th, .sheet td { padding: 10px 8px; border-bottom: 1px solid rgba(77, 163, 255, 0.12); text-align: left; }
.sheet th { color: var(--muted); font-weight: 700; cursor: pointer; user-select: none; white-space: nowrap; }
.sheet .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sheet tbody tr { cursor: pointer; }
.sheet tbody tr:hover { background: var(--gold-dim); }
.sheet .empty { text-align: center; color: var(--muted); cursor: default; padding: 28px 8px; }
.sheet tr.up-row td:nth-child(4), .sheet tr.up-row td:nth-child(5) { color: var(--up); }
.sheet tr.down-row td:nth-child(4), .sheet tr.down-row td:nth-child(5) { color: var(--down); }

.news { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.news li { padding: 10px 0; border-bottom: 1px solid rgba(77, 163, 255, 0.12); }
.news a { color: var(--ink); font-weight: 650; }
.news .meta { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 4px; }

.analyse-head { display: grid; grid-template-columns: 1fr auto; gap: 12px 20px; align-items: center; }
.analyse-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat {
  background: rgba(11, 31, 51, 0.55);
  border: 1px solid rgba(77, 163, 255, 0.12);
  border-radius: 14px;
  padding: 12px;
}
.stat .k { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
.stat .v { font-family: var(--mono); font-size: 1.05rem; margin-top: 4px; }

.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 0.8rem;
}
.pills button.on { background: var(--blue); color: var(--navy); border-color: var(--blue); }
.overlay-toggles { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 0.82rem; margin: 8px 0 10px; }
.chart-box { position: relative; }
canvas { width: 100%; display: block; background: rgba(8, 20, 34, 0.55); border-radius: 12px; }
#vol-chart { margin-top: 8px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.chart-tip {
  position: absolute; pointer-events: none;
  background: #10283f; border: 1px solid var(--line);
  padding: 6px 8px; border-radius: 8px; font-family: var(--mono); font-size: 0.75rem;
  transform: translate(12px, 12px);
}
.tag {
  display: inline-block; margin-left: 8px;
  font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--navy); background: var(--gold); padding: 2px 7px; border-radius: 999px; vertical-align: middle;
}
.pulse-card p { font-size: 1.02rem; }

.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.inline-form input { max-width: 180px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  display: inline-flex; gap: 8px; align-items: center;
  background: var(--gold-dim); border: 1px solid var(--gold);
  color: var(--gold); border-radius: 999px; padding: 4px 10px; font-family: var(--mono);
}
.chip button { background: none; border: 0; color: var(--ink); padding: 0 0 0 4px; }

footer {
  max-width: 1240px; margin: 0 auto; padding: 8px 28px 36px;
  color: var(--muted); font-size: 0.82rem;
}
footer p { border-top: 1px solid var(--line); padding-top: 16px; }

@media (max-width: 860px) {
  .top { grid-template-columns: 1fr; padding: 18px 16px 10px; }
  .when { text-align: left; }
  .tabs, main, footer { padding-left: 16px; padding-right: 16px; }
  .gl-grid, .split, .analyse-head { grid-template-columns: 1fr; }
  .hero-px { font-size: 2.1rem; }
  .seek { min-width: 0; }
}
