html {
  font-size: 16px;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101418;
  color: #e8eaed;
}

.aps-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.aps-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 16px;
}

.aps-logo {
  font-weight: 650;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: #e8eaed;
}

.aps-logo span {
  color: #c4b48a;
}

.aps-tagline {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.4;
  color: #8b9098;
}

.aps-tagline a,
.aps-blog-link {
  color: #c4b48a;
  text-decoration: none;
}

.aps-blog-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
}

.aps-blog-link:hover,
.aps-tagline a:hover {
  text-decoration: underline;
}

.aps-article {
  max-width: 680px;
}

.aps-article h1 {
  margin: 8px 0 16px;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.aps-article h2 {
  margin: 28px 0 10px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #e8eaed;
}

.aps-article p {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.6;
  color: #d5d8dc;
}

.aps-note-date {
  color: #8b9098;
  font-size: 13px;
}

.aps-note-chart {
  margin: 10px 0 14px;
}

.aps-note-chart svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.aps-note-chart figcaption,
.aps-earlier .aps-note-chart {
  margin-top: 6px;
  color: #8b9098;
  font-size: 12px;
  line-height: 1.4;
}

.aps-earlier .aps-note-chart {
  margin: 8px 0 0;
}

.aps-note-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.aps-note-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid #2c3238;
}

.aps-note-list a {
  color: #e8eaed;
  text-decoration: none;
}

.aps-note-list a:hover {
  color: #c4b48a;
}

.aps-note-list time {
  flex-shrink: 0;
  color: #8b9098;
  font-size: 13px;
}

.aps-note-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.aps-note-table th,
.aps-note-table td {
  text-align: left;
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid #2c3238;
}

.aps-note-table th {
  color: #8b9098;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

.aps-note-disclaimer {
  margin-top: 22px;
  color: #8b9098;
  font-size: 13px;
}

.aps-controls {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.aps-controls label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8b9098;
}

.aps-controls select {
  appearance: none;
  background: #101418;
  color: #e8eaed;
  border: 1px solid #2c3238;
  border-radius: 6px;
  padding: 7px 28px 7px 10px;
  font-size: 13px;
  min-width: 108px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #8b9098 50%),
    linear-gradient(135deg, #8b9098 50%, transparent 50%);
  background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.aps-controls select:focus {
  outline: none;
  border-color: #c4b48a;
}

.aps-chart-wrap {
  position: relative;
}

.aps-chart {
  width: 100%;
  height: clamp(420px, 62vh, 720px);
  border: 1px solid #2c3238;
  border-radius: 8px;
  overflow: hidden;
  background: #101418;
}

.aps-news-lines {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.aps-situation {
  margin: 14px 0 0;
  max-width: 72ch;
}

.aps-situation p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #c5c8cc;
}

.aps-situation p + p {
  margin-top: 10px;
}

.aps-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
  border: 1px solid #2c3238;
  border-radius: 8px;
}

.aps-stat {
  padding: 12px 16px;
  border-right: 1px solid #2c3238;
}

.aps-stat:last-child {
  border-right: 0;
}

.aps-stat-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8b9098;
}

.aps-stat-value {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 560;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.aps-stat-value.is-up {
  color: #7dbaa4;
}

.aps-stat-value.is-down {
  color: #d08989;
}

.aps-dailies {
  margin-top: 28px;
}

.aps-dailies-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.aps-dailies-head a,
.aps-note-more a,
.aps-note-nav a {
  color: #c4b48a;
  text-decoration: none;
  font-size: 13px;
}

.aps-dailies-head a:hover,
.aps-note-more a:hover,
.aps-note-nav a:hover,
.aps-pager a:hover {
  text-decoration: underline;
}

.aps-note-more {
  margin: 6px 0 0;
}

.aps-note-nav,
.aps-pager {
  display: flex;
  gap: 16px;
  align-items: center;
  margin: 0 0 18px;
}

.aps-pager {
  margin: 18px 0 0;
}

.aps-pager a,
.aps-note-nav a {
  color: #c4b48a;
  text-decoration: none;
  font-size: 13px;
}

.aps-pager .is-muted {
  color: #8b9098;
  font-size: 13px;
}

.aps-disclaimer {
  margin: 22px 0 0;
  max-width: 68ch;
  font-size: 13px;
  line-height: 1.5;
  color: #8b9098;
}

.aps-note-list li {
  align-items: flex-start;
}

.aps-note-list p {
  margin: 6px 0 0;
  color: #8b9098;
  font-size: 14px;
  line-height: 1.45;
}

.aps-note-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 32px;
  align-items: start;
  margin-top: 18px;
}

.aps-earlier ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.aps-earlier li + li {
  margin-top: 14px;
}

.aps-earlier a {
  display: block;
  color: #e8eaed;
  text-decoration: none;
}

.aps-earlier time {
  display: block;
  margin-bottom: 2px;
  color: #8b9098;
  font-size: 12px;
}

.aps-earlier span {
  display: block;
  font-size: 14px;
  line-height: 1.4;
}

.aps-earlier a:hover span {
  color: #c4b48a;
}

.aps-earlier-empty {
  margin: 0;
  color: #8b9098;
  font-size: 13px;
}

@media (max-width: 800px) {
  .aps-note-split {
    grid-template-columns: 1fr;
  }
}

.aps-dailies article {
  margin-top: 0;
}

.aps-dailies .aps-note-date {
  display: block;
}

.aps-dailies h3 {
  margin: 2px 0 6px;
  font-size: 16px;
  font-weight: 650;
}

.aps-dailies p {
  margin: 0;
  max-width: 68ch;
  font-size: 15px;
  line-height: 1.6;
  color: #c5c8cc;
}

.aps-dailies p + p,
.aps-dailies .aps-note-more {
  margin-top: 10px;
}

.aps-matches {
  margin-top: 22px;
}

.aps-matches summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  width: fit-content;
}

.aps-matches summary::-webkit-details-marker,
.aps-matches summary::marker {
  content: "";
  display: none;
}

.aps-matches summary::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid #c4b48a;
}

.aps-matches[open] summary::before {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid #c4b48a;
  border-bottom: 0;
}

.aps-matches .pattern-matches-grid {
  margin-top: 10px;
}

.aps-section-note {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
  color: #8b9098;
}

.aps-matches-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8b9098;
}

.aps-footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid #2c3238;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #8b9098;
}

.aps-footer a {
  color: #c4b48a;
  text-decoration: none;
  margin-left: 14px;
}

.aps-footer a:first-child {
  margin-left: 0;
}

.aps-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .aps-header {
    flex-direction: column;
    align-items: stretch;
  }

  .aps-controls {
    width: 100%;
  }

  .aps-controls label {
    flex: 1;
  }

  .aps-controls select {
    width: 100%;
  }

  .aps-chart {
    height: 420px;
  }

  .aps-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .aps-stat:nth-child(2) {
    border-right: 0;
  }

  .aps-stat:nth-child(1),
  .aps-stat:nth-child(2) {
    border-bottom: 1px solid #2c3238;
  }
}
