:root {
  color-scheme: dark;

  --bg: #00100f;
  --panel: #061d2b;
  --panel-dark: #031722;
  --line: rgba(116, 165, 192, 0.20);
  --text: #f6f7fb;
  --muted: #aeb8c8;
  --gold: #ffda4d;
  --green: #28d36f;
  --red: #ff536f;
  --blue: #39bff0;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  padding:
    calc(14px + env(safe-area-inset-top))
    0
    calc(120px + env(safe-area-inset-bottom));

  background:
    radial-gradient(
      circle at 50% -8%,
      rgba(255, 201, 40, 0.17),
      transparent 31%
    ),
    linear-gradient(
      180deg,
      #001410,
      #000b0d 70%
    );

  color: var(--text);

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

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

.page-shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 10px;
}

.hero-card,
.toolbar-card,
.status-card,
.trade-card,
.analysis-card {
  border:
    1px solid
    rgba(82, 173, 213, 0.18);

  border-radius: 23px;

  background:
    radial-gradient(
      circle at 100% 0,
      rgba(37, 179, 228, 0.11),
      transparent 42%
    ),
    linear-gradient(
      150deg,
      rgba(7, 30, 44, 0.98),
      rgba(4, 18, 29, 0.98)
    );

  box-shadow:
    0 15px 38px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 20px;
}

.eyebrow,
.section-title {
  color: var(--gold);

  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.17em;
  line-height: 1.4;
  text-transform: uppercase;
}

.hero-card h1 {
  margin: 8px 0 5px;

  font-size: clamp(2rem, 9vw, 3.15rem);
  font-weight: 950;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.hero-card p {
  margin: 0;

  color: var(--muted);
  font-weight: 720;
  line-height: 1.45;
}

.refresh-button,
.primary-button {
  min-height: 45px;
  padding: 0 17px;

  border: 0;
  border-radius: 15px;

  background:
    linear-gradient(
      135deg,
      #ffda4d,
      #ffad2a
    );

  color: #18130a;
  font-weight: 950;
  cursor: pointer;
}

.toolbar-card {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 10px;
  margin-top: 11px;
  padding: 14px;
}

.toolbar-card label {
  display: grid;
  gap: 6px;
}

.toolbar-card label span {
  color: var(--muted);

  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.search-label {
  grid-column: 1 / -1;
}

select,
input {
  width: 100%;
  min-height: 45px;
  padding: 0 12px;

  border: 1px solid var(--line);
  border-radius: 13px;

  outline: none;

  background:
    rgba(3, 18, 29, 0.86);

  color: var(--text);
  font-weight: 800;
}

.status-card {
  margin-top: 11px;
  padding: 17px;

  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

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

.scanner-results {
  display: grid;
  gap: 10px;
  margin-top: 11px;
}

.timeframe-group {
  display: grid;
  gap: 9px;
}

.timeframe-heading {
  padding: 8px 3px 2px;

  color: var(--gold);

  font-size: 0.77rem;
  font-weight: 950;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.trade-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 15px;

  cursor: pointer;
}

.trade-card:active {
  transform: scale(0.992);
}

.trade-symbol {
  font-size: 1.27rem;
  font-weight: 950;
  letter-spacing: -0.025em;
}

.trade-meta {
  margin-top: 5px;

  color: var(--muted);

  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1.4;
}

.trade-score {
  min-width: 63px;
  text-align: right;
}

.trade-score strong {
  display: block;

  color: var(--text);

  font-size: 1.27rem;
  font-weight: 950;
}

.trade-score span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
}

.long {
  color: var(--green) !important;
}

.short {
  color: var(--red) !important;
}

.waiting {
  color: var(--gold) !important;
}

.trade-page {
  display: grid;
  gap: 11px;
}

.analysis-card {
  padding: 18px;
}

.trade-hero-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 13px;
  align-items: start;
  margin-top: 10px;
}

.trade-title {
  margin: 0;

  font-size: clamp(2rem, 9vw, 3.25rem);
  font-weight: 950;
  letter-spacing: -0.055em;
  line-height: 0.94;
}

.trade-subtitle {
  margin-top: 9px;

  color: var(--muted);
  font-weight: 750;
}

.close-button {
  display: grid;
  place-items: center;

  width: 48px;
  height: 46px;

  border:
    1px solid
    rgba(255, 218, 77, 0.27);

  border-radius: 15px;

  background:
    rgba(255, 218, 77, 0.08);

  color: var(--gold);

  font-size: 1.25rem;
  font-weight: 950;
  text-decoration: none;
}

.readiness-box {
  margin-top: 16px;
  padding: 15px;

  border: 1px solid var(--line);
  border-radius: 18px;

  background:
    rgba(3, 19, 31, 0.77);
}

.small-label {
  color: var(--muted);

  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.readiness-value {
  margin-top: 8px;

  color: var(--red);

  font-size: clamp(1.75rem, 7vw, 2.55rem);
  font-weight: 950;
  line-height: 1.04;
}

.readiness-value.ready {
  color: var(--green);
}

.readiness-value.watch {
  color: var(--gold);
}

.progress {
  overflow: hidden;

  height: 10px;
  margin-top: 12px;

  border-radius: 999px;

  background:
    rgba(109, 139, 168, 0.22);
}

.progress span {
  display: block;

  width: var(--progress);
  height: 100%;

  border-radius: inherit;

  background:
    linear-gradient(
      90deg,
      #ff526f,
      #ffb12f,
      #ffe04c,
      #25d473
    );
}

.stat-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 9px;
  margin-top: 10px;
}

.stat-box {
  min-height: 91px;
  padding: 13px;

  border: 1px solid var(--line);
  border-radius: 17px;

  background:
    rgba(3, 18, 29, 0.72);
}

.stat-box strong {
  display: block;
  margin-top: 10px;

  font-size: 1.22rem;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.section-title {
  margin-bottom: 11px;
}

.data-rows,
.check-rows {
  display: grid;
  gap: 7px;
}

.data-row,
.check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;

  min-height: 51px;
  padding: 10px 13px;

  border: 1px solid var(--line);
  border-radius: 15px;

  background:
    rgba(3, 18, 29, 0.70);
}

.data-row span,
.check-row span {
  color: #bac3d0;

  font-size: 0.9rem;
  font-weight: 820;
}

.data-row strong,
.check-row strong {
  color: var(--text);

  font-size: 0.97rem;
  font-weight: 950;
  text-align: right;
  overflow-wrap: anywhere;
}

.check-row.good {
  border-color: rgba(40, 211, 111, 0.25);
}

.check-row.bad {
  border-color: rgba(255, 83, 111, 0.25);
}

.check-row.warn {
  border-color: rgba(255, 218, 77, 0.25);
}

.check-row.good strong {
  color: var(--green);
}

.check-row.bad strong {
  color: var(--red);
}

.check-row.warn strong {
  color: var(--gold);
}

.atlas-read {
  margin: 0;

  color: #c2cad6;

  font-size: 0.94rem;
  font-weight: 720;
  line-height: 1.52;
}

details {
  border-bottom:
    1px solid
    rgba(107, 139, 169, 0.14);
}

details:last-child {
  border-bottom: 0;
}

summary {
  display: flex;
  justify-content: space-between;
  align-items: center;

  min-height: 57px;

  color: var(--gold);

  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.10em;
  list-style: none;
  text-transform: uppercase;
  cursor: pointer;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  font-size: 1.4rem;
}

details[open] summary::after {
  content: "−";
}

.detail-content {
  padding: 0 0 9px;
}

.actions {
  display: grid;
  gap: 8px;
}

.action-button {
  display: grid;
  place-items: center;

  min-height: 51px;
  padding: 0 15px;

  border: 0;
  border-radius: 15px;

  background:
    linear-gradient(
      135deg,
      #ffda4d,
      #ffad2a
    );

  color: #18130a;

  font-weight: 950;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.bottom-nav {
  position: fixed;
  z-index: 1000;

  right: 18px;
  bottom:
    calc(13px + env(safe-area-inset-bottom));
  left: 18px;

  display: grid;
  grid-template-columns:
    repeat(5, minmax(0, 1fr));

  max-width: 690px;
  min-height: 82px;
  margin: auto;
  padding: 8px;

  border:
    1px solid
    rgba(255, 218, 77, 0.18);

  border-radius: 26px;

  background:
    rgba(3, 7, 8, 0.96);

  box-shadow:
    0 20px 55px rgba(0, 0, 0, 0.60);
}

.nav-item {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;

  min-width: 0;
  border-radius: 20px;

  color: #d8dfeb;

  font-size: 0.67rem;
  font-weight: 850;
  text-decoration: none;
}

.nav-item.active {
  border:
    1px solid
    rgba(255, 218, 77, 0.22);

  background:
    linear-gradient(
      180deg,
      rgba(255, 218, 77, 0.18),
      rgba(255, 218, 77, 0.05)
    );

  color: var(--gold);
}

.nav-icon {
  font-size: 1.55rem;
  line-height: 1;
}

@media (max-width: 390px) {
  .page-shell {
    padding-inline: 8px;
  }

  .hero-card,
  .analysis-card {
    padding: 15px;
  }

  .bottom-nav {
    right: 11px;
    left: 11px;
  }
}
