:root {
  --bg: #eef9ff;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-soft: #f7fcff;
  --line: rgba(74, 154, 224, 0.16);
  --line-strong: #299ee8;
  --text: #142033;
  --muted: #66758a;
  --red: #ff4f67;
  --blue: #3188ff;
  --green: #1faf82;
  --warning: #d9971f;
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.95), transparent 28%),
    linear-gradient(145deg, #f9fdff 0%, #e6f7ff 45%, #d7eefb 100%);
  color: var(--text);
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.hero-panel,
.hud-card,
.disclaimer {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow:
    18px 22px 44px rgba(103, 148, 180, 0.18),
    -10px -12px 28px rgba(255, 255, 255, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
}

.hero-panel {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-height: 150px;
  padding: 28px;
}

.brand-block {
  max-width: 760px;
}

.eyebrow,
.panel-label {
  margin: 0 0 8px;
  color: #237eb9;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  line-height: 0.98;
}

h2 {
  margin-bottom: 0;
  font-size: 1.08rem;
}

.subtitle {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.market-strip {
  display: grid;
  gap: 10px;
  min-width: 180px;
  color: #52677f;
  font-size: 0.9rem;
  font-weight: 750;
}

.market-strip span {
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}

.signal {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.signal.red {
  background: var(--red);
}

.signal.blue {
  background: var(--blue);
}

.signal.neutral {
  background: var(--green);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

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

.analytics-grid {
  grid-template-columns: 1fr;
}

.hud-card {
  min-height: 180px;
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.status-pill,
.confidence-badge {
  min-width: 60px;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, #e9f7ff);
  color: #45627a;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 900;
  box-shadow:
    6px 8px 16px rgba(116, 154, 183, 0.17),
    inset 0 -2px 5px rgba(74, 154, 224, 0.08);
}

.confidence-badge.high {
  border-color: rgba(44, 230, 160, 0.65);
  color: var(--green);
}

.confidence-badge.mid {
  border-color: rgba(244, 192, 77, 0.72);
  color: var(--warning);
}

.confidence-badge.low {
  border-color: rgba(138, 152, 168, 0.72);
  color: #b7c3cf;
}

.stat-card {
  min-height: 132px;
}

.primary-stat {
  border-color: rgba(44, 230, 160, 0.42);
}

.stat-value {
  display: block;
  margin: 8px 0 6px;
  color: var(--text);
  font-size: clamp(1.7rem, 3vw, 3.1rem);
  font-weight: 950;
  line-height: 1;
}

.stat-card strong {
  color: var(--muted);
}

.instrument-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(74, 154, 224, 0.13);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f0faff);
  box-shadow: inset 0 -2px 8px rgba(74, 154, 224, 0.08);
}

.instrument-line span {
  color: var(--muted);
  font-size: 0.9rem;
}

.upload-panel {
  display: grid;
  place-items: center;
  gap: 7px;
  margin-bottom: 14px;
  padding: 18px;
  border: 0;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff, #eef9ff);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  box-shadow:
    8px 10px 20px rgba(100, 139, 170, 0.14),
    inset 0 -3px 9px rgba(74, 154, 224, 0.06);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.upload-panel:hover {
  transform: translateY(-2px);
}

.upload-panel:active {
  transform: scale(0.97);
  box-shadow:
    3px 4px 10px rgba(100, 139, 170, 0.14),
    inset 4px 5px 12px rgba(74, 154, 224, 0.09);
}

.upload-panel input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-panel small,
.image-insight {
  color: var(--muted);
  line-height: 1.45;
}

.upload-bubble {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #b7edff, #54bfff);
  color: #ffffff;
  font-size: 2rem;
  font-weight: 900;
  box-shadow:
    0 7px 0 #2588d5,
    0 12px 22px rgba(48, 139, 225, 0.2);
}

.chart-canvas {
  display: none;
  width: 100%;
  aspect-ratio: 2 / 1;
  margin-bottom: 10px;
  border-radius: 20px;
  background: #f7fcff;
  box-shadow: inset 0 0 0 1px rgba(74, 154, 224, 0.12);
}

.chart-canvas.ready {
  display: block;
}

.image-insight {
  margin-bottom: 16px;
  font-size: 0.92rem;
}

.score-board {
  display: grid;
  gap: 10px;
}

.score-row {
  display: grid;
  grid-template-columns: 42px repeat(7, minmax(0, 1fr));
  gap: 7px;
  align-items: center;
}

.score-row > span {
  color: var(--line-strong);
  font-size: 0.78rem;
  font-weight: 950;
}

.score-btn {
  min-height: 52px;
  border: 0;
  border-radius: 18px;
  color: #17304a;
  font-size: 0.95rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow:
    7px 9px 16px rgba(100, 139, 170, 0.2),
    -4px -5px 12px rgba(255, 255, 255, 0.92),
    inset 0 2px 3px rgba(255, 255, 255, 0.86);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.score-btn:hover,
.score-btn.active {
  transform: translateY(-2px);
}

.score-btn.positive {
  background: linear-gradient(180deg, #ffd9df, #ff7f94);
}

.score-btn.negative {
  background: linear-gradient(180deg, #d9ecff, #79b7ff);
}

.score-btn.neutral {
  background: linear-gradient(180deg, #ffffff, #dcebf5);
}

.score-btn.positive.active {
  color: #7b1221;
}

.score-btn.negative.active {
  color: #0e3f8b;
}

.score-btn.active {
  transform: translateY(3px) scale(0.97);
  box-shadow:
    2px 3px 8px rgba(100, 139, 170, 0.18),
    inset 4px 5px 10px rgba(55, 91, 121, 0.13),
    inset -3px -4px 9px rgba(255, 255, 255, 0.72);
}

.score-btn.pulse {
  animation: chipPulse 240ms ease;
}

.analyze-btn {
  width: 100%;
  min-height: 88px;
  margin-top: 20px;
  border: 0;
  border-radius: 30px;
  background: linear-gradient(180deg, #b7edff 0%, #54bfff 45%, #268bff 100%);
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 950;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 57, 125, 0.24);
  box-shadow:
    0 18px 32px rgba(48, 139, 225, 0.28),
    0 7px 0 #1d70d2,
    inset 0 3px 4px rgba(255, 255, 255, 0.65);
  transition: transform 110ms ease, box-shadow 110ms ease, filter 110ms ease;
}

.analyze-btn:hover,
.analyze-btn:focus-visible {
  filter: saturate(1.08) brightness(1.02);
  outline: none;
}

.analyze-btn:active,
.analyze-btn.scanning {
  transform: scale(0.92);
  box-shadow:
    0 0 0 14px rgba(71, 181, 255, 0.14),
    0 8px 20px rgba(48, 139, 225, 0.2),
    0 2px 0 #1d70d2,
    inset 0 7px 14px rgba(0, 78, 152, 0.22);
}

.analyze-btn.scanning {
  animation: buttonPop 420ms ease;
}

.analyze-btn.locked {
  background: linear-gradient(180deg, #a8f2df 0%, #3fd7aa 55%, #1aa581 100%);
  box-shadow:
    0 16px 28px rgba(31, 175, 130, 0.23),
    0 7px 0 #148466,
    inset 0 3px 4px rgba(255, 255, 255, 0.58);
}

.analysis-note,
.result-copy {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.probability-hero {
  margin-bottom: 18px;
  padding: 20px;
  border: 0;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff, #e9fbf6);
  box-shadow:
    inset 0 -4px 12px rgba(31, 175, 130, 0.08),
    8px 10px 20px rgba(103, 148, 180, 0.14);
}

.probability-hero span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.probability-hero strong {
  display: block;
  margin-top: 8px;
  color: var(--green);
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

.result-title {
  margin-bottom: 14px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 950;
}

.result-title.bullish,
td.bullish {
  color: var(--red);
}

.result-title.bearish,
td.bearish {
  color: var(--blue);
}

.meter {
  height: 11px;
  overflow: hidden;
  margin-bottom: 14px;
  border: 0;
  border-radius: 999px;
  background: #dbeaf4;
}

.meter span {
  display: block;
  width: 34%;
  height: 100%;
  background: var(--warning);
  transition: width 180ms ease, background 180ms ease;
}

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

.result-stats span {
  min-height: 78px;
  padding: 13px;
  border: 1px solid rgba(74, 154, 224, 0.1);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f1faff);
  color: var(--muted);
  box-shadow: inset 0 -2px 8px rgba(74, 154, 224, 0.06);
}

.result-stats strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 1.1rem;
}

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

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

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(74, 154, 224, 0.13);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--line-strong);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td {
  color: #263a52;
}

.disclaimer {
  margin-top: 14px;
  padding: 16px 18px;
  color: #52677f;
  font-weight: 800;
  text-align: center;
}

.result-pop {
  animation: resultPop 420ms cubic-bezier(0.2, 1.35, 0.35, 1);
}

@keyframes buttonPop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(0.92);
  }
  100% {
    transform: scale(1.02);
  }
}

@keyframes resultPop {
  0% {
    opacity: 0.76;
    transform: translateY(14px) scale(0.96);
  }
  65% {
    transform: translateY(-4px) scale(1.015);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes chipPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.92);
  }
  100% {
    transform: scale(0.98);
  }
}

@media (max-width: 860px) {
  .hero-panel,
  .grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-stats {
    grid-template-columns: 1fr;
  }

  .instrument-line {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding: 18px 0;
  }

  .hero-panel,
  .hud-card {
    padding: 18px;
  }

  .score-row {
    grid-template-columns: 1fr;
  }
}
