:root {
  --bg: #0b0e10;
  --bg-soft: #11161a;
  --panel: #161c21;
  --panel-2: #1b2228;
  --text: #e8ecef;
  --muted: #a7b0b7;
  --line: #2a333a;
  --accent: #f2d400;
  --accent-soft: rgba(242, 212, 0, 0.10);
  --danger-soft: rgba(235, 168, 45, 0.10);
  --max: 1120px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10pt;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: #f4df47; text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 14, 16, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.header-inner {
  width: min(var(--max), calc(100% - 32px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  flex: 0 0 auto;
}
.brand:hover { text-decoration: none; }
.brand img { width: 42px; height: 42px; border-radius: 6px; }
.brand-copy { display: grid; line-height: 1.15; }
.brand-title { font-size: 16px; font-weight: 700; letter-spacing: 0.01em; }
.brand-subtitle { margin-top: 4px; color: var(--muted); font-size: 9pt; font-weight: 400; }

.main-nav { margin-left: auto; }
.main-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  margin: 0;
}
.main-nav a {
  display: block;
  padding: 9px 10px;
  border-radius: 7px;
  color: #dce2e6;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.main-nav a:hover, .main-nav a:focus-visible, .main-nav a[aria-current="page"] {
  background: var(--panel-2);
  color: #fff;
  text-decoration: none;
}
.main-nav .external { color: #f4df47; }

.menu-toggle {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}
.menu-toggle span,
.menu-toggle::before,
.menu-toggle::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: currentColor;
  border-radius: 2px;
}

main {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 18px;
}
.page-head { margin-bottom: 24px; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 9pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
h1, h2, h3 { color: #fff; line-height: 1.2; }
h1 { margin: 0; font-size: clamp(24px, 4vw, 38px); letter-spacing: -0.02em; }
h2 { margin: 0 0 12px; font-size: 19px; }
h3 { margin: 0 0 8px; font-size: 15px; }
p { margin: 0 0 14px; }
.lead { max-width: 800px; margin-top: 12px; color: #c4cbd0; font-size: 11pt; }
.muted { color: var(--muted); }
.small { font-size: 9pt; }

.panel, .graph-card, .link-box, .notice, .glossary-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.panel { padding: 20px; }
.panel + .panel { margin-top: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.graph-card { overflow: hidden; }
.graph-card header { padding: 16px 18px 12px; }
.graph-card header p { margin: 4px 0 0; color: var(--muted); }
.graph-card figure { margin: 0; background: #fff; }
.graph-card img { width: 100%; }
.graph-card figcaption { padding: 10px 16px 13px; background: var(--panel); color: var(--muted); }

.graph-popup-trigger { cursor: zoom-in; transition: border-color .15s ease, transform .15s ease; }
.graph-popup-trigger:hover, .graph-popup-trigger:focus-visible { border-color: #5b6268; }
.graph-popup-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.graph-popup {
  width: min(var(--max), calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid #454e55;
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .72);
  overflow: hidden;
}
.graph-popup::backdrop { background: rgba(0, 0, 0, .74); backdrop-filter: blur(2px); }
.graph-popup-head {
  min-height: 58px;
  padding: 10px 12px 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: #11161a;
}
.graph-popup-head h2 { margin: 0; font-size: 17px; }
.graph-popup-close {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid #5a6268;
  border-radius: 8px;
  background: #20272c;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.graph-popup-close:hover, .graph-popup-close:focus-visible { background: #2a3339; }
.graph-popup-body { background: #fff; overflow: auto; }
.graph-popup-body img { width: 100%; height: auto; display: block; }

.status-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 24px;
}
.status-item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
}
.status-label { color: var(--muted); font-size: 9pt; }
.status-value { margin-top: 4px; font-size: 12pt; font-weight: 700; }

.notice {
  margin: 20px 0;
  padding: 16px 18px;
  background: var(--danger-soft);
}
.notice strong { color: #fff4bf; }

.media-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 24px;
  align-items: start;
}
.media-frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0a0c0e;
}
.media-frame img { width: 100%; }
.banner-link {
  display: block;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.banner-link img { width: 100%; }

.glossary { display: grid; gap: 12px; }
.glossary-item { padding: 17px 18px; }
.glossary-item h2 { font-size: 15px; margin-bottom: 7px; }
.glossary-item p { margin: 0; color: #c9d0d5; }

.converter-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.converter-table th, .converter-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.converter-table th { color: #fff; background: var(--panel-2); }
.converter-table tr:last-child td { border-bottom: 0; }

.link-box {
  margin: 34px 0 18px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: linear-gradient(180deg, var(--panel), #13191d);
}
.link-box-copy h2 { margin-bottom: 5px; font-size: 16px; }
.link-box-copy p { margin: 0; color: var(--muted); }
.link-box-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #665e13;
  border-radius: 8px;
  background: var(--accent-soft);
  color: #ffea57;
  font-weight: 700;
  text-decoration: none;
}
.button-link:hover { background: rgba(242, 212, 0, 0.16); text-decoration: none; }

.site-footer { border-top: 1px solid var(--line); background: #090c0e; }
.footer-inner {
  width: min(var(--max), calc(100% - 32px));
  min-height: 74px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
}
.footer-inner p { margin: 0; }
.footer-legal { display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.footer-legal a { color: #cbd2d7; }

@media (max-width: 900px) {
  .header-inner { min-height: 58px; }
  .brand-subtitle { display: none; }
  .menu-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 58px;
    left: 0;
    right: 0;
    margin: 0;
    padding: 10px 16px 16px;
    background: #0b0e10;
    border-bottom: 1px solid var(--line);
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { width: min(var(--max), 100%); margin: 0 auto; display: grid; gap: 4px; }
  .main-nav a { padding: 11px 12px; }
  .media-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  main { padding-top: 28px; }
  .grid-2, .status-row { grid-template-columns: 1fr; }
  .link-box { align-items: flex-start; flex-direction: column; }
  .link-box-links { justify-content: flex-start; }
  .footer-inner { min-height: 96px; padding: 18px 0; align-items: flex-start; flex-direction: column; }
  .footer-legal { justify-content: flex-start; }
  .converter-table { font-size: 9pt; }
}
