:root {
  color-scheme: dark;
  --black: #090b0f;
  --black-2: #11151c;
  --black-3: #191f29;
  --orange: #ff7a1a;
  --orange-2: #ff9a3d;
  --orange-soft: rgba(255, 122, 26, 0.13);
  --white: #ffffff;
  --text: #f5f7fb;
  --muted: #9ca8b8;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --green: #23c45e;
  --red: #ef4444;
  --yellow: #f5b544;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--black);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 122, 26, 0.16), transparent 34rem),
    linear-gradient(135deg, var(--black), #0d1118 52%, #0a0c10);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

button {
  cursor: pointer;
}

.layout {
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid var(--line);
  background: rgba(9, 11, 15, 0.94);
  padding: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--orange), #ffbe72);
  color: #151515;
  font-weight: 900;
}

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

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

.side-section {
  display: grid;
  gap: 8px;
}

.side-label,
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-link,
.nav-button {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #cbd3df;
  padding: 0 12px;
  text-align: left;
}

.nav-link:hover,
.nav-link.active,
.nav-button:hover,
.nav-button.active {
  border-color: var(--line-strong);
  background: var(--orange-soft);
  color: var(--white);
}

.nav-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--orange-2);
  font-size: 13px;
  font-weight: 900;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.topbar h1,
.auth-copy h1,
.home-hero h1 {
  margin: 4px 0 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.04;
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #d7deea;
  padding: 0 13px;
  font-size: 13px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(35, 196, 94, 0.13);
}

.button,
.button-secondary,
.icon-button,
.table-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  min-height: 40px;
  padding: 0 15px;
  font-weight: 800;
}

.button {
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: #151515;
}

.button:hover {
  filter: brightness(1.05);
}

.button-secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  color: var(--white);
}

.icon-button {
  width: 40px;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  color: var(--orange);
}

.grid-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.card,
.metric,
.auth-card,
.home-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 21, 28, 0.88);
  box-shadow: var(--shadow);
}

.metric {
  padding: 17px;
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 7px 0 4px;
  color: var(--white);
  font-size: 30px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, 0.85fr);
  gap: 14px;
}

.card {
  min-width: 0;
  padding: 18px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
}

.card-header h2 {
  margin: 2px 0 0;
  font-size: 19px;
}

.card-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.select,
.input,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--white);
  min-height: 42px;
  padding: 0 12px;
  outline: none;
}

.select:focus,
.input:focus,
.textarea:focus {
  border-color: rgba(255, 122, 26, 0.85);
  box-shadow: 0 0 0 4px rgba(255, 122, 26, 0.12);
}

.textarea {
  min-height: 118px;
  padding-top: 10px;
  resize: vertical;
}

.heatmap {
  display: grid;
  grid-template-columns: 1.25fr 0.8fr 0.7fr;
  grid-auto-rows: minmax(88px, 1fr);
  gap: 8px;
  min-height: 420px;
}

.tile {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 13px;
  background: #1f2937;
}

.tile-large {
  grid-row: span 2;
}

.tile-positive {
  background: linear-gradient(135deg, rgba(35, 196, 94, 0.94), rgba(20, 96, 55, 0.9));
}

.tile-negative {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.94), rgba(127, 29, 29, 0.9));
}

.tile-neutral {
  background: linear-gradient(135deg, rgba(255, 122, 26, 0.9), rgba(124, 45, 18, 0.9));
}

.tile strong {
  font-size: clamp(22px, 3vw, 42px);
  line-height: 1;
}

.tile span,
.tile small {
  color: rgba(255, 255, 255, 0.86);
}

.tile-price {
  font-size: 20px;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td {
  color: #e7edf7;
}

.positive {
  color: #28e58c;
  font-weight: 850;
}

.negative {
  color: #ff5d6c;
  font-weight: 850;
}

.neutral {
  color: #d7deea;
  font-weight: 850;
}

.muted-line {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.table-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.status-good {
  background: rgba(35, 196, 94, 0.13);
  color: #69e89a;
}

.status-warn {
  background: rgba(245, 181, 68, 0.14);
  color: #ffd27a;
}

.status-danger {
  background: rgba(239, 68, 68, 0.14);
  color: #ff9898;
}

.watchlist,
.feed,
.job-list,
.source-list {
  display: grid;
  gap: 10px;
}

.plans-mini {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.plan-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 16px;
}

.plan-box.featured {
  border-color: rgba(255, 122, 26, 0.62);
  background: linear-gradient(135deg, rgba(255, 122, 26, 0.16), rgba(255, 255, 255, 0.05));
}

.plan-box h3 {
  margin: 4px 0 8px;
  font-size: 22px;
}

.plan-price {
  display: block;
  margin: 8px 0 12px;
  color: var(--orange-2);
  font-size: 30px;
  font-weight: 900;
}

.payment-box {
  border: 1px solid rgba(255, 122, 26, 0.38);
  border-radius: 8px;
  background: rgba(255, 122, 26, 0.1);
  padding: 14px;
}

.payment-box strong {
  display: block;
  color: var(--white);
  font-size: 18px;
}

.payment-box span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.list-item,
.feed-item,
.job-item,
.source-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 12px;
}

.list-item strong,
.feed-item strong,
.job-item strong,
.source-item strong {
  display: block;
}

.list-item span,
.feed-item span,
.job-item span,
.source-item span,
.source-item p {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid label,
.auth-form label {
  display: grid;
  gap: 7px;
  color: #d7deea;
  font-size: 14px;
  font-weight: 750;
}

.form-grid label.wide {
  grid-column: 1 / -1;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tab {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  padding: 0 12px;
  font-weight: 800;
}

.tab.active {
  border-color: rgba(255, 122, 26, 0.65);
  background: var(--orange-soft);
  color: var(--orange-2);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 0.7fr);
  gap: 26px;
  align-items: center;
  padding: 28px;
}

.auth-copy {
  max-width: 720px;
}

.auth-copy p,
.home-hero p {
  max-width: 620px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.auth-card {
  padding: 24px;
}

.auth-card h2 {
  margin: 0 0 5px;
  font-size: 26px;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d7deea;
  font-size: 14px;
  font-weight: 800;
}

.check-row input {
  accent-color: var(--orange);
}

.small-link {
  color: var(--orange-2);
  font-weight: 800;
}

.home-shell {
  min-height: 100vh;
  padding: 24px;
}

.home-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 42px;
}

.home-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1fr);
  gap: 24px;
  align-items: center;
}

.home-card {
  padding: 18px;
}

.table-link {
  color: var(--white);
  font-weight: 900;
  text-decoration: none;
}

.table-link:hover {
  color: var(--orange-2);
}

.stock-page {
  min-height: 100vh;
  padding: 20px;
}

.stock-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto 18px;
  max-width: 1880px;
}

.stock-layout {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr) 330px;
  gap: 14px;
  margin: 0 auto;
  max-width: 1880px;
}

.asset-sidebar,
.stock-main,
.stock-rightbar {
  min-width: 0;
}

.asset-sidebar {
  position: sticky;
  top: 20px;
  align-self: start;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 11, 15, 0.91);
  padding: 18px;
  box-shadow: var(--shadow);
}

.asset-heading {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.asset-heading h1 {
  overflow-wrap: anywhere;
  margin: 0 0 4px;
  font-size: 24px;
  line-height: 1.12;
}

.asset-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.asset-badge {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), #ffbd77);
  color: #111;
  font-size: 12px;
  font-weight: 950;
}

.asset-price {
  margin-top: 8px;
  color: var(--white);
  font-size: clamp(34px, 5vw, 50px);
  font-weight: 950;
  line-height: 1;
}

.asset-question {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  width: fit-content;
  border: 1px solid rgba(255, 122, 26, 0.35);
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange-2);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 850;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 12px;
}

.detail-metric span,
.profile-grid span,
.profile-score span,
.sentiment span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-metric strong {
  display: block;
  margin-top: 7px;
  color: var(--white);
  font-size: 18px;
}

.profile-grid {
  display: grid;
  gap: 8px;
}

.profile-grid > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}

.profile-grid strong {
  color: var(--white);
  text-align: right;
}

.profile-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(35, 196, 94, 0.24);
  border-radius: 8px;
  background: rgba(35, 196, 94, 0.11);
  padding: 10px 12px;
}

.profile-score strong {
  color: #28e58c;
}

.stock-main {
  display: grid;
  align-content: start;
  gap: 14px;
}

.stock-tabs {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 11, 15, 0.93);
  padding: 8px 0 10px;
  backdrop-filter: blur(14px);
}

.stock-tabs .tab {
  border-radius: 8px;
  min-width: 96px;
}

.chart-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 7;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1118;
}

.news-list {
  display: grid;
  gap: 12px;
}

.news-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 14px;
}

.news-item strong {
  color: var(--white);
  font-size: 18px;
  line-height: 1.32;
}

.news-item span {
  color: var(--muted);
  font-size: 13px;
}

.stock-rightbar {
  display: grid;
  align-content: start;
  gap: 14px;
}

.stock-rightbar .button {
  width: 100%;
  margin-top: 14px;
}

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

.sentiment > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 12px;
}

.sentiment strong {
  display: block;
  color: #28e58c;
  font-size: 26px;
}

.sentiment > div:last-child strong {
  color: #ff5d6c;
}

.sentiment-bar {
  overflow: hidden;
  height: 12px;
  margin-top: 12px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.9);
}

.sentiment-bar span {
  display: block;
  width: 80%;
  height: 100%;
  background: var(--green);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  transform: translateY(18px);
  opacity: 0;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10131a;
  color: var(--white);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.mobile-top {
  display: none;
}

@media (max-width: 1180px) {
  .grid-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid,
  .home-hero,
  .auth-page,
  .stock-layout {
    grid-template-columns: 1fr;
  }

  .auth-page {
    align-items: start;
  }

  .asset-sidebar {
    position: static;
  }

  .stock-rightbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .side-section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace,
  .home-shell,
  .auth-page {
    padding: 16px;
  }

  .topbar,
  .home-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .home-links {
    justify-content: flex-start;
  }

  .grid-metrics,
  .split,
  .form-grid,
  .plans-mini,
  .heatmap,
  .detail-metrics,
  .stock-rightbar {
    grid-template-columns: 1fr;
  }

  .tile-large {
    grid-row: span 1;
  }

  .stock-page {
    padding: 16px;
  }

  .stock-topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .side-section {
    grid-template-columns: 1fr;
  }

  .auth-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button,
  .button-secondary {
    width: 100%;
  }
}
