:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --muted-surface: #f7f8fa;
  --border: #e5e7eb;
  --border-strong: #cfd5dc;
  --text: #202124;
  --muted: #60646c;
  --faint: #8b919b;
  --up: #d93025;
  --down: #1683c7;
  --neutral: #5f6368;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Avenir Next", "Helvetica Neue", Helvetica, sans-serif;
}

.shell {
  min-height: 100vh;
  padding: 22px 24px 28px;
}

.public-shell {
  padding: 18px 20px 22px;
}

.public-shell main {
  width: 100%;
}

.topbar {
  align-items: flex-end;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  margin: 0 auto 18px;
  max-width: 1480px;
  padding-bottom: 16px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.15;
}

.topbar p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 7px;
}

.top-actions,
.range-tabs {
  align-items: center;
  display: flex;
  gap: 8px;
}

button,
.top-actions a {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 14px;
  height: 36px;
  padding: 0 13px;
  text-decoration: none;
}

button:hover,
.top-actions a:hover {
  border-color: #9aa1aa;
}

.quote-panel {
  border-bottom: 1px solid var(--border);
  margin: 0 auto 18px;
  max-width: 1480px;
  padding: 28px 0 26px;
}

.public-quote {
  border-bottom: 0;
  margin-bottom: 0;
  max-width: 1120px;
  padding: 8px 0 0;
}

.quote-head {
  align-items: flex-start;
  display: flex;
  gap: 24px;
  justify-content: space-between;
}

.quote-head h2 {
  color: #3c4043;
  font-size: 37px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.08;
  margin-bottom: 4px;
}

.index-subtitle {
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 14px;
}

#indexValue {
  color: #17191c;
  display: block;
  font-size: 76px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 0.95;
}

.index-change {
  display: block;
  font-size: 37px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  margin-top: 16px;
}

.index-change.up {
  color: var(--up);
}

.index-change.down {
  color: var(--down);
}

.index-change.flat {
  color: var(--neutral);
}

#indexBasis {
  color: var(--muted);
  font-size: 14px;
  margin-top: 10px;
}

.range-tab {
  min-width: 46px;
}

.range-tab.active {
  background: #1f2328;
  border-color: #1f2328;
  color: #ffffff;
}

.quote-chart {
  height: 270px;
  margin-top: 24px;
  position: relative;
}

.public-chart {
  height: min(48vh, 360px);
  min-height: 230px;
}

.public-footer {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: center;
  margin: 18px auto 0;
  max-width: 1120px;
  padding-top: 12px;
}

.public-footer a {
  color: var(--faint);
  font-size: 12px;
  text-decoration: none;
}

.public-footer a:hover {
  color: var(--muted);
  text-decoration: underline;
}

.info-shell {
  margin: 0 auto;
  max-width: 760px;
  min-height: 100vh;
  padding: 24px 20px 28px;
}

.info-top {
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  padding-bottom: 14px;
}

.info-top a {
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}

.info-page h1 {
  color: var(--text);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.18;
  margin-bottom: 20px;
}

.info-page h2 {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.3;
  margin: 26px 0 8px;
}

.info-page p {
  color: #3c4043;
  font-size: 15px;
  line-height: 1.72;
  margin: 0 0 14px;
}

.info-page a {
  color: var(--text);
}

.policy-date {
  color: var(--muted) !important;
  font-size: 13px !important;
}

.quote-chart canvas {
  display: block;
  height: 100%;
  position: relative;
  width: 100%;
  z-index: 1;
}

.market-stats {
  border-top: 1px solid var(--border);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  margin-top: 20px;
}

.market-stats div {
  border-right: 1px solid var(--border);
  padding: 14px 16px 0 0;
}

.market-stats div:not(:first-child) {
  padding-left: 16px;
}

.market-stats div:last-child {
  border-right: 0;
}

.market-stats span {
  color: var(--muted);
  display: block;
  font-size: 13px;
}

.market-stats strong {
  display: block;
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1.1;
  margin-top: 6px;
}

#positivePosts {
  color: var(--up);
}

#negativePosts {
  color: var(--down);
}

.layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 380px;
  margin: 0 auto;
  max-width: 1480px;
}

.main-panel,
.side-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.main-panel {
  min-width: 0;
  padding: 0;
}

.table-wrap {
  max-height: 420px;
  overflow: auto;
}

table {
  border-collapse: collapse;
  font-size: 13px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--muted-surface);
  color: var(--muted);
  font-weight: 700;
  position: sticky;
  top: 0;
}

td {
  line-height: 1.35;
}

td a {
  color: var(--text);
  text-decoration: none;
}

td a:hover {
  text-decoration: underline;
}

.side-panel {
  overflow: hidden;
}

.side-head {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  padding: 14px;
}

.side-head h2 {
  font-size: 16px;
  font-weight: 800;
}

.side-head span {
  color: var(--muted);
  font-size: 12px;
}

.stock-list {
  max-height: calc(100vh - 488px);
  overflow: auto;
}

.stock-item {
  border-bottom: 1px solid var(--border);
  display: grid;
  gap: 8px;
  grid-template-columns: 62px minmax(0, 1fr);
  padding: 12px 14px;
}

.tag {
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  height: 24px;
  line-height: 22px;
  text-align: center;
}

.tag.positive {
  background: #fff0ef;
  border: 1px solid #f2c3bd;
  color: var(--up);
}

.tag.negative {
  background: #eaf5fd;
  border: 1px solid #b8ddf5;
  color: var(--down);
}

.tag.neutral {
  background: #f2f3f4;
  border: 1px solid #d6d9dd;
  color: var(--neutral);
}

.stock-item a {
  color: var(--text);
  display: block;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.stock-item a:hover {
  text-decoration: underline;
}

.stock-item span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 5px;
}

.empty {
  color: var(--muted);
  font-size: 14px;
  padding: 16px 14px;
}

@media (max-width: 1000px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .stock-list {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 14px 16px 22px;
  }

  .topbar,
  .quote-head {
    align-items: stretch;
    flex-direction: column;
    gap: 13px;
  }

  .top-actions {
    align-items: stretch;
  }

  button,
  .top-actions a {
    justify-content: center;
  }

  .range-tabs {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .quote-panel {
    padding-top: 20px;
  }

  .quote-head h2 {
    font-size: 31px;
  }

  #indexValue {
    font-size: 58px;
  }

  .index-change {
    font-size: 31px;
  }

  .quote-chart {
    height: 220px;
  }

  .public-shell {
    padding: 14px 14px 18px;
  }

  .public-chart {
    height: 250px;
  }

  .public-footer {
    gap: 10px;
    margin-top: 14px;
  }

  .info-shell {
    padding: 20px 16px 24px;
  }

  .market-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-stats div {
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    padding: 12px 10px 12px 0;
  }

  .market-stats div:not(:first-child) {
    padding-left: 10px;
  }
}
