:root {
  color-scheme: dark;
  --bg: #080b0f;
  --surface: #10151b;
  --surface-2: #151b22;
  --surface-3: #1b232d;
  --line: #26313e;
  --muted: #8592a3;
  --text: #e7edf4;
  --soft: #b8c3cf;
  --green: #39d98a;
  --teal: #39c8c3;
  --red: #ff5964;
  --amber: #f6b44b;
  --blue: #6ea8fe;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(38, 49, 62, 0.22), transparent 340px),
    radial-gradient(circle at 70% -20%, rgba(57, 200, 195, 0.12), transparent 360px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.login-shell {
  display: grid;
  width: min(100vw - 28px, 420px);
  margin: 0;
  padding: 0;
}

.login-panel {
  display: grid;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(21, 27, 34, 0.98), rgba(9, 13, 18, 0.98));
  box-shadow: var(--shadow);
  padding: 26px;
}

.login-panel h1 {
  margin-bottom: 0;
  font-size: 34px;
}

.login-panel p {
  margin-bottom: 6px;
  color: var(--muted);
}

.login-error {
  color: var(--red);
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 20px;
  height: 64px;
  padding: 0 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 11, 15, 0.9);
  backdrop-filter: blur(18px);
}

.brand,
.top-status,
nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  min-width: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 14px;
  letter-spacing: 0;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(57, 217, 138, 0.35);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(57, 217, 138, 0.22), rgba(110, 168, 254, 0.14));
  color: var(--green);
  font-weight: 800;
  font-size: 12px;
}

nav {
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

nav a {
  flex: 0 0 auto;
  border-radius: 6px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  padding: 9px 12px;
  text-transform: uppercase;
}

nav a:hover,
nav a:focus-visible {
  background: var(--surface-3);
  color: var(--text);
}

.top-status {
  justify-content: flex-end;
  gap: 8px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(133, 146, 163, 0.1);
}

.dot.ok {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(57, 217, 138, 0.12), 0 0 22px rgba(57, 217, 138, 0.45);
}

.dot.bad {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(255, 89, 100, 0.12);
}

main {
  width: min(1480px, calc(100vw - 44px));
  margin: 0 auto;
  padding: 22px 0 44px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(280px, 0.9fr);
  gap: 14px;
  margin-bottom: 14px;
}

.headline-panel,
.decision-tile,
.panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(21, 27, 34, 0.98), rgba(12, 16, 21, 0.98));
  box-shadow: var(--shadow);
}

.headline-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 2fr);
  align-items: center;
  gap: 18px;
  min-height: 156px;
  padding: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 56px);
  line-height: 0.96;
}

h2 {
  margin-bottom: 0;
  font-size: 15px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric-row div,
.bars div {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  padding: 14px;
}

.metric-row span,
.bars span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-row strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: clamp(21px, 2.4vw, 34px);
  line-height: 1;
}

.decision-tile {
  min-height: 156px;
  padding: 22px;
}

.decision-tile h2 {
  margin-bottom: 12px;
  color: var(--amber);
  font-size: 38px;
  line-height: 1;
}

.decision-tile p {
  margin-bottom: 0;
  color: var(--soft);
  line-height: 1.5;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr) minmax(300px, 0.82fr);
  gap: 14px;
  align-items: start;
}

.span-2 {
  grid-column: span 2;
}

.panel {
  min-width: 0;
  overflow: hidden;
  margin-bottom: 14px;
}

.panel-head {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.panel-head a {
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  max-width: 380px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

td {
  color: var(--soft);
  font-size: 13px;
  line-height: 1.35;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.pill,
.risk-flag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill.buy,
.pill.buy,
.pill.long {
  background: rgba(57, 217, 138, 0.14);
  color: var(--green);
}

.pill.sell,
.pill.short {
  background: rgba(255, 89, 100, 0.14);
  color: var(--red);
}

.pill.hold,
.pill.unknown {
  background: rgba(246, 180, 75, 0.14);
  color: var(--amber);
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.warning {
  color: var(--amber);
}

.muted {
  color: var(--muted);
}

.bars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.bars strong {
  font-size: 22px;
}

#spark {
  display: block;
  width: calc(100% - 28px);
  height: 120px;
  margin: 0 14px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  background: rgba(57, 200, 195, 0.05);
}

.stack-list,
.news-list,
.flag-row {
  display: grid;
  gap: 9px;
  padding: 14px;
}

.list-row {
  display: grid;
  gap: 4px;
  min-height: 54px;
  border-left: 3px solid rgba(57, 217, 138, 0.7);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  padding: 10px 12px;
}

.list-row strong {
  font-size: 14px;
}

.list-row span,
.list-row p,
.news-list span,
.news-grid span,
.news-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.list-row.wide {
  min-height: 70px;
}

.flag-row {
  grid-template-columns: repeat(auto-fit, minmax(120px, max-content));
}

.risk-flag {
  border: 1px solid rgba(246, 180, 75, 0.28);
  background: rgba(246, 180, 75, 0.12);
  color: var(--amber);
}

.news-list article,
.news-grid article {
  display: grid;
  gap: 6px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.news-list article:first-child {
  border-top: 0;
  padding-top: 0;
}

.news-list strong,
.news-grid strong {
  color: var(--soft);
  line-height: 1.35;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
  padding: 8px 2px;
}

.page-head h1 {
  font-size: 38px;
}

.page-head p {
  max-width: 620px;
  margin-bottom: 4px;
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.form-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0c1117;
  color: var(--text);
  font: inherit;
  padding: 11px 12px;
  outline: none;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: rgba(57, 200, 195, 0.7);
  box-shadow: 0 0 0 3px rgba(57, 200, 195, 0.12);
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--green), var(--teal));
  color: #04100d;
  cursor: pointer;
  font-weight: 900;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  padding: 14px;
}

.news-grid article {
  min-height: 150px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
}

@media (max-width: 1120px) {
  .topbar,
  .hero-grid,
  .headline-panel,
  .layout-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .topbar {
    height: auto;
    padding: 14px 18px;
  }

  nav {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .top-status {
    justify-content: flex-start;
  }

  .span-2 {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 13px;
  }

  .topbar {
    gap: 12px;
  }

  .brand {
    order: 1;
  }

  .top-status {
    order: 2;
    justify-content: flex-end;
  }

  nav {
    order: 3;
    width: 100%;
    padding-bottom: 2px;
  }

  nav a {
    padding: 9px 10px;
  }

  main {
    width: min(100vw - 24px, 1480px);
    padding-top: 14px;
  }

  .metric-row,
  .bars {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-head {
    display: block;
  }

  th,
  td {
    padding: 10px;
  }

  table {
    min-width: 760px;
  }

  .panel {
    overflow-x: auto;
  }
}

@media (max-width: 560px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px;
  }

  .brand small,
  .top-status span:last-child {
    display: none;
  }

  .headline-panel,
  .decision-tile,
  .panel {
    border-radius: 6px;
  }

  .headline-panel,
  .decision-tile {
    padding: 16px;
  }

  .metric-row,
  .bars {
    grid-template-columns: 1fr;
  }

  .page-head h1 {
    font-size: 30px;
  }

  .page-head p {
    font-size: 13px;
    line-height: 1.45;
  }

  table.responsive-table {
    min-width: 0;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td {
    display: block;
    width: 100%;
  }

  .responsive-table tr {
    margin: 10px;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.028);
    overflow: hidden;
  }

  .responsive-table td {
    display: grid;
    grid-template-columns: minmax(86px, 0.42fr) minmax(0, 1fr);
    gap: 10px;
    max-width: none;
    min-height: 40px;
    align-items: center;
    padding: 9px 11px;
  }

  .responsive-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .responsive-table td[colspan] {
    display: block;
  }

  .responsive-table td[colspan]::before {
    content: "";
  }

  .panel {
    overflow-x: hidden;
  }
}
