:root {
  font-family: "Segoe UI", "Space Grotesk", "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #f5f7fb;
  color: #0f172a;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top right, #ffffff 0%, #e2e8f0 65%, #cbd5f5 100%);
  display: flex;
  justify-content: center;
  padding: 2rem 1rem 3rem;
}

.dashboard-shell {
  width: min(1250px, 100%);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3.5rem;
  background: #ffffff;
  border-radius: 30px;
  box-shadow: 0 35px 80px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-start;
}

.dashboard-disclaimer,
.dashboard-footer {
  margin: 0 auto;
  max-width: 980px;
  padding: 0.85rem 1.25rem;
  border-radius: 16px;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.85);
  color: #f8fafc;
  box-shadow: 0 25px 40px rgba(15, 23, 42, 0.35);
}

.dashboard-footer {
  margin-top: 1.5rem;
  background: rgba(17, 24, 39, 0.95);
}

.dashboard-footer__contact {
  margin-top: 0.45rem;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #94a3b8;
}

.dashboard-footer__contact a {
  color: #f8fafc;
  text-decoration: underline;
}

.dashboard-header h1 {
  margin: 0.2rem 0;
  font-size: 2.7rem;
  letter-spacing: 0.08em;
  color: #0f172a;
}

.dashboard-header .eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: #64748b;
}

.dashboard-header .subhead {
  margin: 0;
  color: #475569;
  max-width: 520px;
}

.dashboard-cta {
  display: flex;
  gap: 0.5rem;
}

.btn {
  border-radius: 999px;
  border: none;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn--filled {
  background: linear-gradient(135deg, #2563eb, #9333ea);
  color: #fff;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.4);
}

.btn--ghost {
  background: transparent;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.2);
}

.diagram-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(14, 165, 233, 0.15));
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.diagram-controls__left h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #0f172a;
}

.diagram-controls__left p {
  margin: 0.2rem 0 0;
  color: #475569;
}

.diagram-timeframe {
  display: flex;
  gap: 0.65rem;
}

.diagram-timeframe__btn {
  border: 1px solid rgba(15, 23, 42, 0.25);
  border-radius: 999px;
  padding: 0.55rem 1.35rem;
  background: #f5f7fb;
  color: #0f172a;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.diagram-timeframe__btn.is-active {
  background: #0f172a;
  color: #fff;
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.2);
  transform: translateY(-1px);
}

.diagram-gallery {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.diagram-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding-bottom: 0.5rem;
}

.diagram-tab {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.diagram-tab__box {
  border-radius: 12px;
  border: 1px solid rgba(79, 70, 229, 0.2);
  padding: 0.45rem 1.5rem;
  min-width: 130px;
  text-align: center;
  font-size: 0.9rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #0f172a;
  background: rgba(248, 250, 252, 0.85);
  box-shadow: 0 20px 30px rgba(15, 23, 42, 0.08);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.diagram-tab__box:hover {
  transform: translateY(-1px);
  box-shadow: 0 25px 35px rgba(15, 23, 42, 0.12);
}

.diagram-tab.is-active .diagram-tab__box {
  border-color: rgba(79, 70, 229, 0.4);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.3), rgba(37, 99, 235, 0.35));
  color: #ffffff;
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.2);
}

.diagram-panel.is-hidden {
  display: none;
}

.diagram-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
}

.diagram-card {
  background: linear-gradient(135deg, #ffffff, #ecf0ff);
  border-radius: 26px;
  padding: 1.25rem;
  border: 1px solid rgba(79, 70, 229, 0.15);
  box-shadow: 0 25px 40px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 340px;
}

.diagram-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.diagram-card__header h3 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.1em;
}

.diagram-card__symbol {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.4);
}

.diagram-card__symbol-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.diagram-card__value {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #475569;
  font-weight: 600;
}

.diagram-card__icon {
  width: 20px;
  height: 20px;
  margin-right: 0.35rem;
  border-radius: 50%;
  object-fit: cover;
}

.diagram-card__timeframe-switch {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.diagram-card__timeframe-btn {
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 999px;
  padding: 0.25rem 0.9rem;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  background: #f5f7fb;
  color: #0f172a;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.diagram-card__timeframe-btn.is-active {
  background: linear-gradient(135deg, #2563eb, #4338ca);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

.diagram-card__chart {
  position: relative;
  margin: 0;
}

.diagram-card__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.35rem 0.6rem;
  font-size: 0.75rem;
  color: #475569;
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  padding-top: 0.75rem;
}

.diagram-card__metrics span {
  display: inline-block;
  font-weight: 600;
  color: #0f172a;
}

.metric-chip {
  border-radius: 999px;
  padding: 0.25rem 0.9rem;
  font-size: 0.75rem;
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

.metric-chip--positive {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
}

.metric-chip--negative {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.metric-chip--muted {
  background: #e2e8f0;
  color: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.2);
}

[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  transform: translate(-50%, -8px);
  bottom: 100%;
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 2;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translate(-50%, -12px);
}

.diagram-card__analysis {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  font-size: 0.8rem;
  color: #1f2937;
  padding-bottom: 0.15rem;
}

.diagram-card__analysis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
}

.diagram-card__analysis-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.diagram-card__analysis-signal {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #475569;
}

.diagram-card__signal-icon {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.diagram-card__signal-label {
  color: #475569;
}

.diagram-card__action-pill {
  border-radius: 999px;
  padding: 0.2rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 70px;
}

.action-pill--buy {
  background: linear-gradient(135deg, #22c55e, #10b981);
  color: #f3fcf6;
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.25);
}

.action-pill--sell {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff4f4;
  box-shadow: 0 10px 20px rgba(239, 68, 68, 0.25);
}

.action-pill--neutral {
  background: #e0e7ff;
  color: #312e81;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.action-pill--other {
  background: linear-gradient(135deg, #eaecff, #e9f5ff);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.35);
}
.diagram-card__analysis-meta-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.diagram-card__analysis-meta {
  font-size: 0.65rem;
  color: #475569;
  text-transform: none;
  letter-spacing: normal;
}
.diagram-card__analysis-meta-label {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #94a3b8;
}
.diagram-card__analysis-meta time {
  display: block;
  margin-top: 0.1rem;
}

.diagram-card__analysis-text {
  margin: 0;
  color: #0f172a;
  line-height: 1.4;
  white-space: pre-line;
}

.diagram-card__analysis-score {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #475569;
}

.trend-pill {
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.75rem;
  background: rgba(15, 23, 42, 0.15);
  transition: background 0.2s ease, color 0.2s ease;
}

.trend-pill--positive {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.2);
}

.trend-pill--negative {
  color: #f87171;
  background: rgba(248, 113, 113, 0.2);
}

.diagram-card__image {
  width: 100%;
  height: 300px;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(145deg, #e2e8f0, #f8fafc);
  object-fit: cover;
  display: block;
}

.diagram-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.75);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.diagram-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.diagram-overlay__image {
  max-width: min(80vw, 800px);
  max-height: min(80vh, 600px);
  border-radius: 24px;
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.5);
}

.diagram-overlay__close {
  position: absolute;
  right: 2rem;
  top: 2rem;
  border: none;
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  font-size: 1.4rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
}

.restm-section {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 28px;
  padding: 1.75rem;
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.restm-table-wrapper {
  overflow-x: auto;
  margin-top: 1rem;
}

.restm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  color: #cbd5f5;
}

.restm-table thead th {
  text-align: left;
  padding: 0.65rem 0.75rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: #94a3b8;
}

.restm-table tbody tr {
  border-top: 1px solid rgba(226, 232, 240, 0.1);
}

.restm-table td {
  padding: 0.9rem 0.75rem;
  color: #f8fafc;
}

.restm-empty {
  margin: 2rem 0;
  text-align: center;
  color: #94a3b8;
  font-size: 0.95rem;
}

.diagram-overlay__image {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 24px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.20);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.diagram-overlay__close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(23, 23, 23, 0.85);
  border: none;
  color: #ffffff;
  font-size: 2rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

main .grid {
  width: 100%;
}

.card {
  background: #fbfbfb;
  border-radius: 18px;
  padding: 1.25rem 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 25px 40px -30px rgba(0, 0, 0, 0.15);
}

.card__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.card__header small {
  color: #8b8075;
}

.count-pill {
  font-size: 0.8rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #efefef;
  color: #4f4f4f;
  white-space: nowrap;
}

canvas {
  width: 100%;
  height: min(70vh, 520px);
}

.empty {
  color: #777777;
  margin: 1rem 0 0;
}

@media (max-width: 768px) {
  body {
    padding: 1.25rem;
  }
}
