@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --ah-ink: #101d36;
  --ah-text: #3d4d68;
  --ah-muted: #75839a;
  --ah-blue: #1f6feb;
  --ah-blue-dark: #1557bb;
  --ah-soft-blue: #eaf3ff;
  --ah-line: #dfe6f0;
  --ah-soft: #f5f8fc;
  --ah-shadow: 0 18px 50px rgba(18, 43, 78, 0.1);
}

body {
  background: #eef3f9;
  color: var(--ah-text);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.home-section > .container-fluid {
  margin-top: 0 !important;
  padding: 28px 28px 48px;
}

.analytics-landing { margin: 0 auto; max-width: 1460px; }

.analytics-launchpad {
  align-items: center;
  background:
    radial-gradient(circle at 87% 10%, rgba(61, 141, 255, 0.2), transparent 30%),
    linear-gradient(135deg, #ffffff 0%, #f7fbff 58%, #edf6ff 100%);
  border: 1px solid rgba(166, 183, 208, 0.5);
  border-radius: 26px;
  box-shadow: var(--ah-shadow);
  display: grid;
  gap: 58px;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.85fr);
  min-height: 540px;
  overflow: visible;
  padding: 54px;
  position: relative;
  z-index: 3;
}

.launchpad-kicker,
.section-kicker {
  color: var(--ah-blue);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.launchpad-kicker i { margin-right: 7px; }
.launchpad-copy h1 {
  color: var(--ah-ink);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: clamp(2.35rem, 4.35vw, 3.9rem);
  font-weight: 750;
  letter-spacing: -0.052em;
  line-height: 1.04;
  margin: 18px 0 22px;
  max-width: 680px;
}

.launchpad-copy > p {
  color: var(--ah-text);
  font-size: 1rem;
  line-height: 1.72;
  margin: 0;
  max-width: 650px;
}

.search-bar-container { margin-top: 30px; }
.search-bar { align-items: stretch; display: flex; gap: 9px; position: relative; }
.search-input-container {
  align-items: center;
  background: #fff;
  border: 1px solid #c7d4e5;
  border-radius: 13px;
  box-shadow: 0 5px 16px rgba(18, 43, 78, 0.07);
  display: flex;
  flex-direction: row;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 14px;
  position: relative;
}
.search-input-container:focus-within { border-color: var(--ah-blue); box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.12); }
.search-input-container > i {
  align-items: center;
  align-self: stretch;
  color: #8a99af;
  display: inline-flex;
  flex: 0 0 auto;
  justify-content: center;
  line-height: 1;
}
.search-form.form-control {
  background: transparent;
  border: 0;
  box-shadow: none !important;
  color: var(--ah-ink);
  font-size: 0.9rem;
  height: 52px;
  padding: 10px 11px;
}

#suggestions {
  background: #fff;
  border: 1px solid var(--ah-line);
  border-radius: 11px;
  box-shadow: 0 16px 36px rgba(18, 43, 78, 0.15);
  left: 0;
  max-height: 280px;
  overflow: auto;
  position: absolute;
  right: 0;
  top: calc(100% + 7px);
  z-index: 100;
}

.watchlist-section { position: relative; z-index: 1; }

.search-bar .btn {
  border: 0;
  border-radius: 11px;
  font-size: 0.78rem;
  font-weight: 700;
  min-height: 52px;
  padding: 10px 17px;
  white-space: nowrap;
}
.analytics-go,
#addToWatchlistButton { background: var(--ah-blue); color: #fff; }
.analytics-go:hover,
#addToWatchlistButton:hover { background: var(--ah-blue-dark); color: #fff; }
.btn-disabled-watchlist { background: #dfe5ee !important; color: #8b97aa !important; cursor: not-allowed; }

.popular-searches { align-items: center; color: var(--ah-muted); display: flex; flex-wrap: wrap; font-size: 0.73rem; gap: 8px; margin-top: 15px; }
.popular-searches a { background: rgba(255,255,255,0.8); border: 1px solid #d7e2f0; border-radius: 999px; color: #4d607e; font-weight: 600; padding: 5px 9px; text-decoration: none; }
.popular-searches a:hover { border-color: #a9c6ee; color: var(--ah-blue); }

.launchpad-preview {
  background: #fff;
  border: 1px solid #d6e0ed;
  border-radius: 22px;
  box-shadow: 0 24px 55px rgba(26, 58, 99, 0.16);
  padding: 23px;
  transform: rotate(1.4deg);
}
.preview-topline { align-items: center; color: var(--ah-muted); display: flex; font-size: 0.69rem; font-weight: 650; justify-content: space-between; }
.preview-live { align-items: center; color: #17855c; display: flex; gap: 6px; }
.preview-live i { background: #22a875; border-radius: 50%; display: block; height: 7px; width: 7px; }
.preview-company { align-items: center; display: flex; gap: 12px; margin-top: 24px; }
.preview-symbol { background: var(--ah-ink); border-radius: 9px; color: #fff; font-size: 0.74rem; font-weight: 750; padding: 8px 10px; }
.preview-company strong { color: var(--ah-ink); display: block; font-size: 0.94rem; }
.preview-company small { color: var(--ah-muted); display: block; font-size: 0.65rem; margin-top: 2px; }
.preview-price { align-items: baseline; display: flex; gap: 12px; margin-top: 25px; }
.preview-price strong { color: var(--ah-ink); font-size: 2rem; letter-spacing: -0.04em; }
.preview-price span { color: #17855c; font-size: 0.75rem; font-weight: 700; }
.preview-chart { height: 150px; margin: 12px -4px 8px; }
.preview-chart svg { height: 100%; width: 100%; }
.preview-area { fill: url(#chartFill); }
.preview-line { fill: none; stroke: #2f7bed; stroke-linecap: round; stroke-width: 4; }
.preview-metrics { border-top: 1px solid var(--ah-line); display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); padding-top: 15px; }
.preview-metrics div { background: var(--ah-soft); border-radius: 9px; padding: 10px; }
.preview-metrics span { color: var(--ah-muted); display: block; font-size: 0.6rem; margin-bottom: 5px; text-transform: uppercase; }
.preview-metrics strong { color: var(--ah-ink); font-size: 0.72rem; }

.watchlist-section {
  background: #fff;
  border: 1px solid var(--ah-line);
  border-radius: 22px;
  box-shadow: 0 6px 20px rgba(18, 43, 78, 0.06);
  margin-top: 22px;
  padding: 27px;
}
.watchlist-header { align-items: end; display: flex; gap: 20px; justify-content: space-between; margin-bottom: 18px; }
.watchlist-header h2,
.guest-watchlist h2 { color: var(--ah-ink); font-size: 1.35rem; font-weight: 750; letter-spacing: -0.025em; margin: 4px 0 0; }
#toggleViewButton { background: #fff; border: 1px solid #cbd7e6; border-radius: 9px; color: var(--ah-text); font-size: 0.74rem; font-weight: 650; padding: 8px 12px; }
#toggleViewButton:hover { border-color: var(--ah-blue); color: var(--ah-blue); }

#cardView { margin: 0 -7px; }
.card { border: 1px solid var(--ah-line); border-radius: 14px; box-shadow: none; overflow: hidden; transition: border-color 0.18s ease, transform 0.18s ease; }
.card:hover { border-color: #b7cae5; transform: translateY(-2px); }
.card .card-body { padding: 18px; }
.card h5 { color: var(--ah-ink); font-size: 1rem; font-weight: 700; }
.card p { color: var(--ah-muted); font-size: 0.78rem; }
.watchlist-sparkline {
  height: 92px;
  margin-top: 12px;
  position: relative;
  width: 100%;
}
.watchlist-sparkline canvas {
  display: block;
  height: 92px !important;
  max-height: 92px;
  width: 100% !important;
}

.table { background: #fff; border: 1px solid var(--ah-line); border-radius: 12px; box-shadow: none; overflow: hidden; }
.table th { background: var(--ah-soft); border-color: var(--ah-line); color: var(--ah-muted); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; }
.table td { border-color: var(--ah-line); color: var(--ah-text); font-size: 0.78rem; padding: 12px; vertical-align: middle; }

#watchlistEmptyMsg,
.guest-watchlist { background: var(--ah-soft); border: 1px solid var(--ah-line); border-radius: 14px; color: var(--ah-text); padding: 22px; }
.guest-watchlist { align-items: center; display: flex; gap: 18px; }
.guest-watchlist-icon { align-items: center; background: var(--ah-soft-blue); border-radius: 13px; color: var(--ah-blue); display: flex; flex: 0 0 48px; font-size: 1.15rem; height: 48px; justify-content: center; }
.guest-watchlist p { color: var(--ah-muted); font-size: 0.82rem; margin-top: 7px !important; }
.link-login,
.link-signup { color: var(--ah-blue); text-decoration: none; }

button:focus-visible,
input:focus-visible,
a:focus-visible { outline: 3px solid rgba(31, 111, 235, 0.25); outline-offset: 2px; }

@media (max-width: 1080px) {
  .analytics-launchpad { gap: 36px; grid-template-columns: 1fr; padding: 42px; }
  .launchpad-copy h1 { max-width: 820px; }
  .launchpad-preview { margin: 0 auto; max-width: 650px; transform: none; width: 100%; }
}

@media (max-width: 680px) {
  .home-section > .container-fluid { padding: 12px 10px 32px; }
  .analytics-launchpad { border-radius: 18px; padding: 27px 18px; }
  .launchpad-copy h1 { font-size: 2.55rem; }
  .search-bar { flex-direction: column; }
  .search-bar .btn { width: 100%; }
  .launchpad-preview { display: none; }
  .watchlist-section { border-radius: 17px; padding: 18px; }
  .watchlist-header { align-items: flex-start; flex-direction: column; }
  .guest-watchlist { align-items: flex-start; }
  .preview-metrics { grid-template-columns: 1fr; }
}
/* Saved stock cards use bounded SVG charts rather than resizing canvases. */
.watch-stock-card{background:#fff;border:1px solid #dfe6f0;border-radius:16px;padding:20px;height:100%;box-shadow:0 4px 14px rgba(20,44,81,.05)}
.watch-stock-heading{display:flex;justify-content:space-between;gap:12px;align-items:start}.watch-stock-identity{text-decoration:none;color:#101d36;min-width:0}.watch-stock-identity>span{font-size:.72rem;font-weight:750;color:#246de2;background:#edf3ff;border-radius:6px;padding:4px 7px}.watch-stock-identity h3{font-size:.95rem;margin:12px 0;line-height:1.4;overflow-wrap:anywhere}
.watch-remove{border:1px solid #dfe6f0;background:#f6f8fc;color:#71809b;border-radius:8px;width:30px;height:30px;flex-shrink:0;cursor:pointer}.watch-remove:hover{color:#bd4656;background:#fff0f2}.watch-remove:disabled{opacity:.5}
.watch-stock-price{font-size:1.4rem;font-weight:750;color:#101d36;font-variant-numeric:tabular-nums}.watch-stock-change{font-size:.75rem;margin:5px 0;color:#71809b}.watch-stock-change.positive{color:#17855c}.watch-stock-change.negative{color:#bd4656}
.watch-stock-chart{display:block;height:88px;margin:12px 0}.watch-stock-chart svg{width:100%;height:80px}.watch-spark-empty{padding:25px 0;font-size:.75rem;color:#71809b}
.watch-stock-meta{border-top:1px solid #edf1f6;padding:12px 0;display:flex;flex-direction:column;gap:5px;font-size:.7rem;color:#71809b}.watch-stock-meta strong{color:#31415f;font-weight:600}.watch-stock-card small{font-size:.65rem;color:#71809b}.watch-stock-card small a{color:#246de2}.watchlist-section #watchlistEmptyMsg{padding:16px;border:1px solid #dfe6f0;border-radius:12px;background:#f6f8fc;color:#31415f!important}.watchlist-section .table{font-size:.8rem}.watchlist-section #cardView{align-items:stretch}
