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

:root {
  --primary: #5a3ebd;
  --accent: #12aef6;
  --text: #1c1c1c;
  --muted: #808080;
  --line: #f0f1f3;
  --soft-line: #f8f8fa;
  --green: #1c8d77;
  --red: #ec3540;
  --lavender: #f0efff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

button, input, textarea { font: inherit; }
button { background: none; border: 0; cursor: pointer; }

.app-shell { min-height: 100vh; position: relative; }

.top-nav {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  display: flex;
  height: 67px;
  justify-content: space-between;
  padding: 12px 32px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  align-items: flex-start;
  color: var(--text);
  display: flex;
  gap: 6px;
  line-height: 1;
}

.brand-mark {
  background:
    linear-gradient(var(--accent), var(--accent)) 0 0 / 4px 4px,
    linear-gradient(var(--primary), var(--primary)) 7px 0 / 4px 4px,
    linear-gradient(var(--accent), var(--accent)) 14px 0 / 4px 4px,
    linear-gradient(var(--primary), var(--primary)) 0 7px / 4px 4px,
    linear-gradient(var(--accent), var(--accent)) 7px 7px / 4px 4px,
    linear-gradient(var(--primary), var(--primary)) 14px 7px / 4px 4px,
    linear-gradient(var(--accent), var(--accent)) 0 14px / 4px 4px,
    linear-gradient(var(--primary), var(--primary)) 7px 14px / 4px 4px;
  background-repeat: no-repeat;
  height: 21px;
  width: 21px;
}

.brand-word, .brand-docs { font-size: 20px; font-weight: 700; }
.brand-docs { color: var(--primary); }
.brand-beta { font-size: 10px; font-weight: 600; letter-spacing: 1.5px; margin-left: 2px; margin-top: 1px; }

.nav-tabs {
  display: flex;
  margin-left: 120px;
}

.nav-tab {
  align-items: center;
  border: 2px solid var(--soft-line);
  color: var(--muted);
  display: flex;
  font-size: 16px;
  font-weight: 700;
  gap: 12px;
  justify-content: center;
  min-height: 43px;
  min-width: 0;
  padding: 10px 16px;
}

.nav-tab + .nav-tab { margin-left: -2px; }

.nav-tab.active {
  background: #fff;
  border: 2px solid var(--primary);
  color: var(--primary);
  margin: 0;
  position: relative;
  z-index: 1;
}

.nav-tab.icon-only {
  min-width: 43px;
  padding: 10px 12px;
}

.search-nav::before {
  border: 2px solid var(--muted);
  border-radius: 50%;
  content: "";
  display: block;
  height: 15px;
  width: 15px;
}

.search-nav::after {
  background: var(--muted);
  content: "";
  display: block;
  height: 2px;
  margin-left: -5px;
  margin-top: 16px;
  transform: rotate(45deg);
  width: 10px;
}

.user-menu { align-items: center; display: flex; font-size: 14px; gap: 8px; }
.help-icon { color: #cfd4d9; margin-left: 8px; }

.page { display: none; margin: 0 auto; max-width: 1220px; padding: 32px 0 80px; }
.page:not(.active) { display: none !important; }
.page.active { display: block; }
.page.active.home-layout { display: grid; }

.gradient-heading {
  background-image: linear-gradient(109deg, var(--primary) 12%, var(--accent) 92%);
  background-clip: text;
  color: transparent;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  margin: 0;
}

h2 { font-size: 18px; line-height: 1; margin: 0; }

.home-layout { display: grid; gap: 136px; grid-template-columns: 503px 499px; padding-top: 32px; }
.home-left h2 { margin: 28px 0 20px; }
.home-right { display: grid; gap: 64px; padding-top: 61px; }

.filter-slider { align-items: center; display: flex; gap: 8px; max-width: 650px; overflow: hidden; }

.chip, .chip-more {
  border-radius: 4px;
  color: #000;
  flex: 0 0 auto;
  font-size: 12px;
  line-height: 1;
  min-height: 35px;
  padding: 10px;
}

.chip-0 {
  background: var(--lavender);
  border: 1px solid var(--primary);
  color: var(--primary);
}

.chip-1 { background: #f3fff2; }
.chip-2 { background: #fff9f2; }
.chip-3 { background: #ffe8e6; }
.chip-4 { background: #f5f6f7; }
.chip-5 { background: #fafaff; }

.chip-more {
  align-items: center;
  background: #fff;
  border: 1px solid #cfd4d9;
  border-radius: 999px;
  box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  height: 32px;
  justify-content: center;
  padding: 8px;
  width: 32px;
}

.company-list { display: grid; gap: 10px; margin-top: 20px; }

.company-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  min-height: 42px;
}

.company-row.compact { grid-template-columns: 1fr auto 24px; width: 503px; }

.company-identity { align-items: flex-start; display: flex; gap: 26px; }

.company-click {
  color: inherit;
  padding: 0;
  text-align: left;
}

.company-click:hover .company-name,
.company-click:focus-visible .company-name {
  color: var(--primary);
  text-decoration: underline;
}

.company-icon {
  align-items: center;
  background: #fff;
  border-radius: 40px;
  box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.05);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.company-icon.samsung { color: #3378d8; font-size: 8px; }
.company-icon.tesla { color: #e92027; }
.company-icon.apple { color: #000; font-size: 10px; }
.company-icon.amazon { color: #f2a100; font-size: 18px; }
.company-icon.nvidia { color: #76b900; }

.company-identity > span:last-child { display: grid; gap: 1px; }
.company-name { font-size: 14px; line-height: 1; }
.company-identity strong, .template-row strong, .report-row strong { display: block; font-size: 12px; line-height: 1; }

.performance {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  font-size: 12px;
}

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

.change {
  border-radius: 4px;
  color: #fff;
  display: inline-flex;
  font-size: 10px;
  justify-content: flex-end;
  min-width: 43px;
  padding: 5px 6px;
}

.change.positive { background: var(--green); }
.change.negative { background: var(--red); }

.text-link { color: var(--primary); font-size: 12px; padding: 0; text-decoration: underline; }
.open-grid { display: block; margin-left: auto; margin-top: 20px; }

.section-header { align-items: center; display: flex; justify-content: space-between; margin-bottom: 32px; }
.section-list { display: grid; gap: 10px; }

.template-row, .report-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  min-height: 46px;
}

.template-row { grid-template-columns: 1fr 24px; }
.template-row span span, .report-row span span { display: block; font-size: 14px; }

.calendar-controls { align-items: center; display: flex; gap: 15px; margin-bottom: 24px; }
.calendar-controls strong { font-size: 12px; }

.calendar-icon {
  border-radius: 2px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
  display: grid;
  overflow: hidden;
  place-items: center;
  width: 30px;
}

.calendar-icon span { background: #ff8c80; height: 3px; width: 100%; }

.calendar-icon strong, .calendar-icon em {
  background: #fff;
  font-size: 12px;
  font-style: normal;
  line-height: 1;
  text-align: center;
  width: 100%;
}

.calendar-icon em { color: var(--muted); padding-bottom: 2px; }

.circle-button {
  align-items: center;
  border: 1px solid #cfd4d9;
  border-radius: 999px;
  display: inline-flex;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.report-row {
  grid-template-columns: 1fr 88px 82px 82px 24px;
  column-gap: 14px;
}

.earnings-meta {
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  align-items: center;
  border-radius: 4px;
  display: inline-flex;
  font-size: 10px;
  justify-content: center;
  padding: 5px 6px;
}

.status-pill.confirmed {
  background: #f3fff2;
  color: var(--green);
}

.status-pill.expected,
.status-pill.unconfirmed {
  background: #fff9f2;
  color: #95632a;
}

.mention-dots { align-items: center; display: flex; height: 26px; padding-left: 4px; }

.dot {
  border-radius: 50%;
  display: block;
  height: 26px;
  margin-left: -6px;
  width: 26px;
}

.dot-0 { background: #f0efff; }
.dot-1 { background: #f3fff2; }
.dot-2 { background: #fff9f2; }
.dot-3 { background: #ffe8e6; }

.watchlist-tools { align-items: center; display: flex; justify-content: space-between; margin: 22px 0 28px; }

.search-field {
  align-items: center;
  border: 2px solid var(--soft-line);
  display: flex;
  gap: 8px;
  height: 43px;
  padding: 10px 20px;
  width: 320px;
}

.search-field input { border: 0; color: var(--text); outline: 0; width: 100%; }
.search-field input::placeholder { color: #cfd4d9; }

.table-header, .table-row {
  column-gap: 118px;
  display: grid;
  grid-template-columns: 198px 147px 143px 1fr 24px;
}

.table-header {
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  padding-bottom: 9px;
}

.table-row { min-height: 52px; }
.table-row .company-identity { align-items: center; }
.table-row .performance { justify-content: flex-start; }
.template-cell { align-self: center; font-size: 12px; }
.centered-link { display: block; font-size: 16px; margin: 30px auto 0; }

.company-page {
  max-width: 1200px;
  padding-top: 32px;
}

.report-back {
  align-items: center;
  color: transparent;
  background-image: linear-gradient(100deg, var(--accent), var(--primary));
  background-clip: text;
  display: inline-flex;
  font-size: 24px;
  font-weight: 700;
  gap: 15px;
  margin: 0 0 40px;
}

.report-back::first-letter {
  color: var(--muted);
}

.company-detail-layout {
  display: grid;
  grid-template-columns: 482px 1px 509px;
  column-gap: 80px;
  position: relative;
}

.company-detail-layout::before {
  background: #dfe3e8;
  content: "";
  grid-column: 2;
  grid-row: 1;
  min-height: 950px;
  width: 1px;
}

.company-report {
  grid-column: 1;
}

.company-report-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 26px;
  padding: 10px;
}

.company-report-title h1 {
  font-size: 18px;
  line-height: 1;
  margin: 0;
}

.report-section {
  margin-bottom: 10px;
  padding: 10px;
}

.report-section-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.report-section-heading h2,
.company-section-heading h2,
.company-docs h2,
.key-stats h2,
.company-chats h2 {
  font-size: 18px;
  line-height: 1;
  margin: 0;
}

.report-section-heading button {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.report-section p {
  font-size: 14px;
  line-height: 1.12;
  margin: 0;
}

.company-side {
  display: grid;
  gap: 40px;
  grid-column: 3;
  position: relative;
}

.generate-report {
  color: var(--muted);
  font-size: 14px;
  justify-self: end;
  margin-bottom: -18px;
}

.stock-card {
  display: grid;
  gap: 20px;
}

.company-section-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.range-tabs {
  display: flex;
  gap: 16px;
}

.range-tabs button {
  border-radius: 4px;
  font-size: 12px;
  padding: 6px;
}

.range-tabs .range-active {
  background: var(--soft-line);
}

.stock-chart {
  height: 216px;
  width: 509px;
}

.stock-chart svg {
  height: 100%;
  width: 100%;
}

.chart-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 2;
}

.chart-fill {
  fill: url("#chartFill");
}

.company-docs,
.key-stats,
.company-chats {
  display: grid;
  gap: 20px;
}

.doc-row {
  align-items: center;
  display: grid;
  grid-template-columns: 30px 1fr 92px 53px 24px;
  gap: 12px;
  min-height: 34px;
}

.doc-title strong,
.doc-title em,
.chat-row-small strong,
.chat-row-small em {
  display: block;
  font-size: 14px;
  font-style: normal;
  line-height: 1.2;
}

.doc-title em,
.doc-row > span:nth-child(3),
.chat-row-small em {
  color: var(--muted);
}

.stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 19px;
  width: 433px;
}

.stat-card {
  background: var(--soft-line);
  border-radius: 4px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.stat-card strong,
.stat-card span {
  font-size: 14px;
  line-height: 1.2;
}

.chat-row-small {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 86px 1fr 24px;
  min-height: 46px;
}

.stacked-icons {
  display: flex;
}

.stacked-icons .company-icon {
  margin-right: -5px;
}

.chat-launcher {
  align-items: center;
  background: var(--lavender);
  border: 1px solid #2084ff;
  border-radius: 4px;
  bottom: 30px;
  color: #1f70ff;
  display: flex;
  height: 40px;
  justify-content: center;
  position: fixed;
  right: 38px;
  width: 40px;
  z-index: 20;
}

.chat-panel {
  background: #fff;
  border-left: 1px solid var(--line);
  bottom: 0;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.08);
  display: none;
  grid-template-rows: 58px 1fr 173px;
  position: fixed;
  right: 0;
  top: 67px;
  width: 420px;
  z-index: 30;
}

.chat-panel.open { display: grid; }

.chat-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 9px 15px;
}

.chat-header > div { display: flex; gap: 8px; }

.chat-tool {
  align-items: center;
  background: var(--lavender);
  border-radius: 4px;
  color: var(--primary);
  display: flex;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.plain-icon { color: var(--text); padding: 0; }
.chat-thread { display: grid; align-content: start; gap: 10px; overflow: auto; padding: 24px 10px; }

.chat-message {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 19px;
  padding: 8px 16px;
}

.chat-avatar {
  align-items: center;
  background: #f3f4f6;
  border-radius: 999px;
  display: flex;
  font-size: 10px;
  font-weight: 700;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.brand-avatar { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; }
.chat-message p { font-size: 16px; line-height: 1.375; margin: 0; }
.feedback { color: var(--muted); font-size: 12px; grid-column: 2; }

.chat-box { border-top: 1px solid var(--line); display: grid; gap: 10px; padding: 12px 14px; }

.doc-pill {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  display: inline-flex;
  font-size: 12px;
  gap: 8px;
  padding: 8px;
  width: fit-content;
}

.chat-box textarea { border: 1px solid var(--line); border-radius: 4px; min-height: 62px; outline: 0; padding: 10px; resize: none; }
.chat-box button { background: var(--primary); border-radius: 4px; color: #fff; justify-self: end; padding: 8px 12px; }

.icon { display: inline-block; font-size: 20px; line-height: 1; text-align: center; }
.dots {
  align-items: center;
  color: #1c1c1c;
  display: inline-flex;
  font-size: 0;
  justify-content: center;
  line-height: 1;
  min-height: 24px;
  min-width: 24px;
}

.dots::before {
  content: "⋮";
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
}

@media (max-width: 1100px) {
  .top-nav { align-items: flex-start; gap: 16px; height: auto; position: static; }
  .nav-tabs { margin-left: 0; overflow-x: auto; }
  .nav-tab { font-size: 16px; min-width: auto; }
  .user-menu { display: none; }
  .page { padding: 24px 20px 80px; }
  .home-layout { grid-template-columns: 1fr; gap: 44px; }
  .home-left, .home-right, .company-row.compact { width: 100%; }
  .watchlist-tools { align-items: stretch; flex-direction: column; gap: 16px; }
  .filter-slider { overflow-x: auto; }
  .search-field { width: 100%; }
  .watch-table { overflow-x: auto; }
  .table-header, .table-row { min-width: 960px; }
  .chat-panel { top: 0; width: min(420px, 100vw); }
  .company-detail-layout {
    grid-template-columns: 1fr;
    gap: 44px;
  }
  .company-detail-layout::before {
    display: none;
  }
  .company-report,
  .company-side {
    grid-column: 1;
  }
  .stock-chart,
  .stats-grid {
    width: 100%;
  }
}
