/* Base */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #ffffff;
  --color-border: #d0d0d0;
  --color-focus: #0051a8;
  --color-link: #0051a8;
  --color-link-hover: #003670;
  --color-muted: #555555;
  --color-nav-bg: #1a1a1a;
  --color-nav-text: #ffffff;
  --color-surface: #f7f7f7;
  --color-text: #1a1a1a;
  --font-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
  --font-sans: system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --max-width: 64rem;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
}

/* Focus */

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

/* Links */

a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-link-hover);
}

/* Skip Link */

.skip-link {
  background: var(--color-focus);
  border-radius: 0 0 0.25rem 0.25rem;
  color: #fff;
  font-weight: 600;
  left: 1rem;
  padding: 0.5rem 1rem;
  position: absolute;
  text-decoration: none;
  top: -100%;
  z-index: 1000;
}

.skip-link:focus {
  top: 0;
}

/* Layout */

.container {
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 0 1.5rem;
}

.site-header,
.site-footer {
  background: var(--color-nav-bg);
  color: var(--color-nav-text);
}

/* Header */

.site-header {
  padding: 1rem 0;
}

.site-header .container {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
}

.site-title {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
}

.site-title:hover {
  color: #fff;
}

/* Header Ticker */

.header-ticker {
  background: #2a2a2a;
  border-top: 1px solid #444;
  font-size: 0.8125rem;
  overflow-x: auto;
  padding: 0.375rem 0;
}

.header-ticker .container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: center;
}

.header-ticker span {
  color: #ccc;
  white-space: nowrap;
}

.header-ticker strong {
  color: #fff;
}

/* Navigation */

.site-nav > ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
}

.site-nav a {
  border-radius: 0.25rem;
  color: var(--color-nav-text);
  display: block;
  font-size: 0.9375rem;
  padding: 0.375rem 0.75rem;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  background: rgba(255, 255, 255, 0.15);
}

/* Page Layout */

.page-layout {
  display: grid;
  flex: 1;
  gap: 2rem;
  grid-template-columns: 15rem 1fr;
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 2rem 1.5rem;
  width: 100%;
}

@media (max-width: 48rem) {
  .page-layout {
    grid-template-columns: 1fr;
  }
}

/* Sidebar */

.sidebar {
  font-size: 0.9375rem;
}

.sidebar-section {
  margin-bottom: 1.5rem;
}

.sidebar-heading {
  color: var(--color-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

details.sidebar-section > summary {
  cursor: pointer;
  list-style: none;
}

details.sidebar-section > summary::-webkit-details-marker {
  display: none;
}

details.sidebar-section > summary::after {
  border-color: var(--color-muted) transparent transparent;
  border-style: solid;
  border-width: 0.3125rem 0.25rem 0;
  content: '';
  display: inline-block;
  margin-left: 0.375rem;
  transition: transform 0.2s;
  vertical-align: middle;
}

details.sidebar-section[open] > summary::after {
  transform: rotate(180deg);
}

details.sidebar-section > summary:hover {
  color: var(--color-text);
}

.sidebar-list {
  list-style: none;
}

.sidebar-list li + li {
  margin-top: 0.25rem;
}

.sidebar-list a {
  border-radius: 0.25rem;
  color: var(--color-link);
  display: block;
  padding: 0.375rem 0.5rem;
  text-decoration: none;
}

.sidebar-list a:hover {
  background: var(--color-surface);
}

.sidebar-list a[aria-current='page'] {
  background: var(--color-surface);
  font-weight: 600;
}

/* Platform Images */

.platform-images {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
}

.platform-images figure {
  margin: 0;
}

.platform-images img {
  border-radius: 0.375rem;
  height: auto;
  width: 100%;
}

.platform-images figcaption {
  color: var(--color-muted);
  font-size: 0.8125rem;
  margin-top: 0.375rem;
}

.news-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  margin-bottom: 2rem;
  padding: 1rem 1.25rem;
}

.news-box h2 {
  font-size: 1.125rem;
  margin: 0 0 0.75rem;
}

.news-box dl {
  font-size: 0.9375rem;
}

.news-box dt {
  color: var(--color-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-top: 0.75rem;
}

.news-box dt:first-of-type {
  margin-top: 0;
}

.news-box dd {
  margin: 0.25rem 0 0;
}

/* Content */

.content {
  min-width: 0;
}

.content h2 {
  font-size: 1.375rem;
  margin: 2rem 0 0.75rem;
}

.content h2:first-child {
  margin-top: 0;
}

.content li + li {
  margin-top: 0.25rem;
}

.content p {
  margin-bottom: 1rem;
}

.content ul,
.content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

/* Instrument Card */

.instrument-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
}

.instrument-card img {
  border-radius: 0.25rem;
  height: auto;
  max-width: 100%;
  min-width: 20rem;
}

.refresh-btn {
  align-items: center;
  background: var(--color-link);
  border: none;
  border-radius: 0.25rem;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 0.9375rem;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
}

.refresh-btn:hover {
  background: var(--color-link-hover);
}

/* Form */

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.form-group select {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  color: var(--color-text);
  display: block;
  font: inherit;
  font-size: 0.9375rem;
  padding: 0.5rem 0.75rem;
  width: 100%;
}

.form-group select:focus {
  border-color: var(--color-focus);
}

.form-submit {
  align-items: center;
  background: var(--color-link);
  border: none;
  border-radius: 0.25rem;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
}

.form-submit:hover {
  background: var(--color-link-hover);
}

/* Data Table */

.data-meta {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
}

.data-meta dl {
  display: grid;
  font-size: 0.9375rem;
  gap: 0.25rem 1rem;
  grid-template-columns: auto 1fr;
}

.data-meta dt {
  font-weight: 600;
}

.data-actions {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.data-table-wrap {
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  margin-top: 1.5rem;
  max-height: 32rem;
  overflow: auto;
}

.data-table-wrap table {
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  width: 100%;
}

.data-table-wrap th {
  background: var(--color-nav-bg);
  color: var(--color-nav-text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.5rem 0.75rem;
  position: sticky;
  text-align: left;
  text-transform: uppercase;
  top: 0;
}

.data-table-wrap td {
  border-top: 1px solid var(--color-border);
  padding: 0.25rem 0.75rem;
  white-space: nowrap;
}

.data-table-wrap tr:hover td {
  background: var(--color-surface);
}

/* Footer */

.site-footer {
  font-size: 0.875rem;
  margin-top: 3rem;
  padding: 1.5rem 0;
}

.site-footer .container {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
}

.site-footer a {
  color: var(--color-nav-text);
}

/* Utilities */

.visually-hidden {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}
