:root {
  color-scheme: dark;
  --page-bg: #101416;
  --page-bg-soft: #161c1f;
  --panel: #1b2226;
  --panel-strong: #20292e;
  --line: #364349;
  --line-soft: #29343a;
  --text: #f4f7f8;
  --muted: #b5c1c6;
  --accent: #00e5ff;
  --accent-ink: #051518;
  --warm: #f2d06b;
  --danger: #ff9c8c;
  --content-width: 760px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.articles-shell {
  min-width: 320px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.8;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

a:hover {
  color: #72f2ff;
}

button,
textarea {
  font: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 8px 12px;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 4px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.articles-header .logo {
  line-height: normal;
}

.articles-header .country-toggle {
  margin-bottom: 12px;
}

.library-main,
.article-main {
  width: 100%;
  margin: 0;
}

.library-main {
  padding: 0 0 40px;
}

.library-hero {
  padding: 0 0 12px;
}

.eyebrow,
.article-kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.library-hero h1 {
  margin: 0;
  color: #cccccc;
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.4;
  text-align: center;
}

.article-hero h1 {
  margin: 0;
  color: #202428;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 850;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.article-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  color: #262b2e;
  background: #ffffff;
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.article-card:hover {
  color: #262b2e;
  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.14), 0 12px 22px rgba(0, 0, 0, 0.14);
  transform: translateY(-3px);
}

.card-category {
  color: #8a5b00;
  font-size: 14px;
  font-weight: 800;
}

.article-card h2 {
  margin: 12px 0 10px;
  color: #202428;
  font-size: clamp(24px, 3.2vw, 31px);
  line-height: 1.35;
}

.article-card p {
  margin: 0 0 18px;
  color: #566168;
}

.card-link {
  margin-top: auto;
  color: #007f8d;
  font-size: 15px;
  font-weight: 800;
}

.article-main {
  padding: 0 0 40px;
}

.breadcrumbs {
  width: 100%;
  margin: 0 0 10px;
  color: #aebbc0;
  font-size: 14px;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 6px;
  color: #63737a;
}

.breadcrumbs a {
  color: #d4dde0;
}

.article-hero,
.article-body {
  max-width: var(--content-width);
  margin-right: auto;
  margin-left: auto;
}

.article-content-card,
.article-feedback {
  width: 100%;
  padding: 20px;
  color: #293034;
  background: #ffffff;
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.1);
}

.article-content-card {
  margin: 0 0 20px;
}

.article-hero {
  position: static;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 38px;
  border-bottom: 1px solid #dfe5e7;
  text-align: left;
}

.article-deck {
  max-width: 760px;
  margin: 22px 0 0;
  color: #4c5a60;
  font-size: clamp(19px, 2.5vw, 24px);
  line-height: 1.65;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 24px 0 0;
  color: #69777d;
  font-size: 14px;
}

.article-body {
  padding-top: 34px;
}

.article-body h2 {
  margin: 56px 0 18px;
  font-size: clamp(28px, 4.5vw, 38px);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.article-body h3 {
  margin: 34px 0 12px;
  font-size: 23px;
  line-height: 1.4;
}

.article-body p,
.article-body ul,
.article-body ol {
  margin-top: 0;
  margin-bottom: 24px;
}

.article-body ul,
.article-body ol {
  padding-left: 1.35em;
}

.article-body li + li {
  margin-top: 9px;
}

.article-body strong {
  color: #111719;
}

.article-content-card a,
.article-feedback a {
  color: #007b89;
}

.article-kicker {
  color: #007b89;
}

.quick-answer {
  margin: 6px 0 38px;
  padding: 24px 26px;
  background: linear-gradient(145deg, #eafcff, #f7feff);
  border: 1px solid #8edce5;
  border-radius: 7px;
}

.quick-answer h2 {
  margin: 0 0 12px;
  color: #007b89;
  font-size: 20px;
}

.quick-answer ul {
  margin-bottom: 0;
}

.formula-card {
  display: grid;
  gap: 12px;
  margin: 28px 0;
  padding: 24px;
  border: 1px solid #e6d39b;
  border-top: 5px solid var(--warm);
  border-radius: 7px;
  background: #fffaf0;
}

.formula-line {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  align-items: baseline;
}

.formula-distance {
  color: #8a5b00;
  font-weight: 850;
}

.formula-math {
  color: #30383c;
  font-variant-numeric: tabular-nums;
}

.example-box,
.track-note,
.source-note {
  margin: 28px 0;
  padding: 22px 24px;
  border-left: 4px solid #00a6bd;
  background: #f3f7f8;
}

.example-box h3,
.track-note h3,
.source-note h2 {
  margin-top: 0;
}

.example-box p:last-child,
.track-note p:last-child,
.source-note p:last-child {
  margin-bottom: 0;
}

.pace-calculator {
  margin: 34px 0;
  padding: 24px;
  background: linear-gradient(145deg, #effcfd, #f8feff);
  border: 1px solid #9adbe3;
  border-top: 5px solid #00a6bd;
  border-radius: 8px;
}

.calculator-heading {
  margin-bottom: 20px;
}

.calculator-eyebrow {
  margin: 0 0 4px;
  color: #007b89;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.article-body .pace-calculator h2 {
  margin: 0;
  color: #20272a;
  font-size: clamp(24px, 4vw, 31px);
  line-height: 1.3;
}

.pace-calculator fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.pace-calculator legend {
  margin-bottom: 8px;
  color: #435158;
  font-size: 15px;
  font-weight: 800;
}

.pace-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.pace-input-control {
  display: grid;
  gap: 5px;
  color: #5a686e;
  font-size: 13px;
  font-weight: 750;
}

.pace-input-control input {
  width: 78px;
  height: 58px;
  padding: 7px 10px;
  color: #182126;
  background: #ffffff;
  border: 2px solid #8aa0a7;
  border-radius: 7px;
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  line-height: 1;
  text-align: center;
}

.pace-input-control input:focus {
  border-color: #008fa2;
  box-shadow: 0 0 0 3px rgba(0, 166, 189, 0.18);
  outline: 0;
}

.pace-input-control input[aria-invalid="true"] {
  border-color: #b63224;
}

.pace-separator,
.pace-unit {
  padding-bottom: 9px;
  color: #364348;
  font-weight: 850;
}

.pace-separator {
  font-size: 30px;
  line-height: 1;
}

.pace-unit {
  font-size: 18px;
}

.pace-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.pace-presets button {
  min-width: 62px;
  min-height: 38px;
  padding: 7px 12px;
  color: #334147;
  background: #ffffff;
  border: 1px solid #91a5ab;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.pace-presets button:hover,
.pace-presets button:focus-visible {
  color: #006e7c;
  border-color: #008fa2;
  outline: 0;
}

.pace-presets button[aria-pressed="true"] {
  color: #052126;
  background: #a9f3fa;
  border-color: #00a6bd;
}

.calculator-error {
  margin: 14px 0 0;
  color: #a1291e;
  font-size: 14px;
  font-weight: 750;
}

.split-results {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  margin-top: 22px;
}

.split-result {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 13px 8px;
  background: #ffffff;
  border: 1px solid #c9d7da;
  border-radius: 7px;
  text-align: center;
}

.split-result-primary {
  background: #e3fbfd;
  border-color: #65ccd7;
}

.split-distance {
  color: #56666c;
  font-size: 13px;
  font-weight: 800;
}

.split-time {
  overflow: hidden;
  color: #172125;
  font-size: clamp(20px, 3.2vw, 27px);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
}

.calculator-note {
  margin: 12px 0 0;
  color: #627177;
  font-size: 13px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.table-scroll {
  overflow-x: auto;
  margin: 26px 0 12px;
  border: 1px solid #d5dde0;
  border-radius: 6px;
  -webkit-overflow-scrolling: touch;
}

.pace-table {
  width: 100%;
  min-width: 690px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.pace-table th,
.pace-table td {
  padding: 13px 15px;
  border-bottom: 1px solid #e0e6e8;
  text-align: right;
  white-space: nowrap;
}

.pace-table th:first-child,
.pace-table td:first-child {
  position: sticky;
  left: 0;
  text-align: left;
  background: #f0f4f5;
}

.pace-table thead th {
  color: #815600;
  background: #f0f4f5;
  font-size: 14px;
}

.pace-table tbody tr:last-child td {
  border-bottom: 0;
}

.pace-table tbody tr:nth-child(even) td {
  background-color: #f8fafb;
}

.pace-table tbody tr:nth-child(even) td:first-child {
  background-color: #eaf0f2;
}

.steps {
  counter-reset: article-step;
  padding: 0 !important;
  list-style: none;
}

.steps li {
  position: relative;
  min-height: 48px;
  padding-left: 62px;
}

.steps li::before {
  counter-increment: article-step;
  content: counter(article-step);
  position: absolute;
  top: 2px;
  left: 0;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #052126;
  background: #00d7ed;
  border-radius: 50%;
  font-weight: 900;
  line-height: 1;
}

.faq-list details {
  padding: 18px 0;
  border-top: 1px solid #dce3e5;
}

.faq-list details:last-child {
  border-bottom: 1px solid #dce3e5;
}

.faq-list summary {
  cursor: pointer;
  color: #20272a;
  font-weight: 800;
}

.faq-list details p {
  margin: 14px 0 0;
  color: #56646a;
}

.article-feedback {
  margin-top: 0;
}

.article-feedback h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.article-feedback > p {
  margin: 0;
  color: #5b686e;
}

.feedback-actions,
.feedback-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.feedback-button {
  min-height: 44px;
  padding: 9px 17px;
  color: #283034;
  background: #f3f6f7;
  border: 1px solid #8d9ba0;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 750;
}

.feedback-button:hover,
.feedback-button:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.feedback-button.primary {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.feedback-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.feedback-form {
  margin-top: 20px;
}

.feedback-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 750;
}

.feedback-form textarea {
  width: 100%;
  min-height: 112px;
  padding: 12px 14px;
  resize: vertical;
  color: #20272a;
  background: #ffffff;
  border: 1px solid #8d9ba0;
  border-radius: 5px;
}

.feedback-form textarea:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(0, 229, 255, 0.18);
}

.feedback-status {
  min-height: 1.7em;
  margin-top: 14px !important;
  color: #007b89 !important;
}

.feedback-status[data-state="error"] {
  color: var(--danger) !important;
}

.article-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 28px;
  font-size: 15px;
}

.site-footer {
  margin-top: 20px;
  padding: 20px;
  border-top: 1px solid var(--line-soft);
  background: #0b0f11;
  text-align: center;
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 28px;
  padding: 0;
  color: #89999f;
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer a {
  padding: 0;
  color: #b2bec3;
  background: none;
  border-radius: 0;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

[hidden] {
  display: none !important;
}

@media (max-width: 768px) {
  body.articles-shell {
    font-size: 16px;
  }

  .library-main,
  .article-main {
    padding-top: 0;
  }

  .library-hero h1 {
    font-size: 0.95rem;
  }

  .article-hero h1 {
    font-size: clamp(32px, 10vw, 44px);
  }

  .article-card,
  .article-content-card,
  .article-feedback {
    padding: 15px;
  }

  .pace-calculator {
    padding: 18px;
  }

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

  .split-result:last-child {
    grid-column: 1 / -1;
  }

  .formula-line {
    grid-template-columns: 82px 1fr;
    gap: 10px;
  }

  .article-body h2 {
    margin-top: 46px;
  }

  .quick-answer,
  .formula-card,
  .example-box,
  .track-note,
  .source-note {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .article-card {
    transition: none;
  }
}
