:root {
  --clr-accent: #315a9e;
  --clr-success: #6aa84f;
  --clr-danger: #b6362b;
  --clr-border: #e3e6ec;
  --clr-muted: #5f6673;
  --clr-soft: #f7f8fb;
  --clr-panel-soft: #fdfdfe;
  --clr-panel-border: #eef1f4;
  --fs-body: 16px;
  --section-space: clamp(56px, 7vw, 88px);
}

body,
td,
th,
tr,
p,
a {
  font-family: Lato, Verdana, Helvetica, sans-serif;
  font-size: 14px;
}

body {
  color: #1f242d;
  background: #fff;
}

a {
  color: #1772d0;
  text-decoration: none;
}

a:focus,
a:hover {
  color: #f09228;
  text-decoration: none;
}

p {
  font-size: var(--fs-body);
  line-height: 1.55;
}

p a {
  font-size: inherit;
}

.key-finding {
  color: var(--clr-accent);
  font-weight: 700;
}

h1 {
  font-size: clamp(1.55rem, 5.5vw, 36px);
  line-height: 1.2;
}

h3 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: clamp(26px, 4.5vw, 34px);
  line-height: 1.2;
}

.page-section {
  margin-top: var(--section-space);
}

#video {
  margin-top: clamp(40px, 4vw, 56px);
}

.row h4 {
  font-size: clamp(14px, 2.4vw, 18px);
  line-height: 1.45;
}

.linkbar a {
  font-size: var(--linkbar-fs, 18px);
}

.subtitle {
  color: var(--clr-muted);
}

.paper-meta {
  margin-top: 4px;
}

.hero-video {
  width: 1000px;
  max-width: 100%;
  border: 1px solid var(--clr-border);
  background: #000;
}

.hero-video-title {
  margin: 0 0 14px;
  font-weight: 400;
  color: #1f242d;
}

.hero-video-note {
  width: 1000px;
  max-width: 100%;
  margin: 0 auto 12px;
  color: #244778;
  font-size: 15px;
  line-height: 1.4;
  text-align: center;
}

.hero-video-note b {
  color: #173763;
}

.figure-img {
  width: 1000px;
  max-width: 100%;
  margin: 36px auto 24px;
  display: block;
}

.method-img {
  width: 1000px;
}

.wide-img {
  width: 1000px;
}

.caption {
  font-size: 14px;
  line-height: 1.45;
  color: #303741;
  margin-bottom: 18px;
}

.takeaway-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 20px 0 4px;
  border: 1px solid var(--clr-panel-border);
  border-radius: 8px;
  overflow: hidden;
}

.takeaway-strip > div {
  padding: 13px 16px;
  background: var(--clr-panel-soft);
  border-right: 1px solid var(--clr-panel-border);
}

.takeaway-strip > div:last-child {
  border-right: 0;
}

.takeaway-strip span,
.motivation-label {
  display: block;
  margin-bottom: 3px;
  color: var(--clr-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.takeaway-strip strong {
  color: var(--clr-accent);
  font-size: 14px;
}

.motivation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.motivation-lead {
  margin: -4px 0 18px;
  color: #242a33;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}

.motivation-card {
  padding: 18px;
  background: var(--clr-panel-soft);
  border: 1px solid var(--clr-panel-border);
  border-radius: 8px;
}

.motivation-card > strong {
  display: block;
  margin-bottom: 5px;
  color: var(--clr-accent);
  font-size: 17px;
  line-height: 1.35;
}

.motivation-card > p {
  margin: 0;
  color: var(--clr-muted);
  font-size: 13px;
  line-height: 1.45;
}

.motivation-solution {
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) minmax(360px, 1.3fr);
  gap: 6px 24px;
  align-items: center;
  margin-top: 12px;
  padding: 18px 20px;
  background: #e7f0ff;
  border: 1px solid #8facdc;
  border-radius: 8px;
}

.motivation-solution > strong {
  grid-column: 1;
  display: block;
  color: var(--clr-accent);
  font-size: 18px;
}

.motivation-solution > .motivation-label {
  grid-column: 1;
  margin-bottom: -2px;
}

.motivation-solution > p {
  grid-column: 2;
  margin: 0;
  color: var(--clr-muted);
  font-size: 13px;
  line-height: 1.45;
}

.motivation-equation {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: #244778;
  font-size: 14px;
  font-weight: 700;
}

.motivation-equation > b {
  margin: 0 7px;
  color: var(--clr-accent);
}

.method-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 4px;
}

.method-steps > div {
  position: relative;
  min-height: 112px;
  padding: 16px 16px 14px 50px;
  border: 1px solid var(--clr-border);
  border-radius: 8px;
}

.method-steps > div > span {
  position: absolute;
  top: 16px;
  left: 15px;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--clr-accent);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.method-steps strong {
  display: block;
  margin-bottom: 4px;
  color: var(--clr-accent);
  font-size: 15px;
}

.method-steps p {
  margin: 0;
  color: var(--clr-muted);
  font-size: 13px;
  line-height: 1.4;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 6px;
}

.metric {
  border: 1px solid var(--clr-border);
  background: var(--clr-soft);
  padding: 14px;
  min-height: 116px;
}

.metric-value {
  color: var(--clr-accent);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 8px;
}

.metric-label {
  color: #242a33;
  font-size: 14px;
  line-height: 1.35;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 34px 0 18px;
}

.simulation-table-wrapper {
  overflow-x: visible;
}

.results-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 14px;
}

.simulation-table {
  min-width: 0;
  table-layout: fixed;
  font-size: 11px;
  line-height: 1.2;
}

.results-table th,
.results-table td {
  border: 1px solid var(--clr-border);
  padding: 8px 10px;
  text-align: center;
  vertical-align: middle;
}

.results-table th {
  background: #f0f3f8;
  font-weight: 700;
}

.results-table td:first-child,
.results-table th:first-child {
  text-align: left;
}

.simulation-table th,
.simulation-table td {
  padding: 5px 3px;
  overflow-wrap: anywhere;
}

.simulation-table th:first-child,
.simulation-table td:first-child {
  width: 13%;
}

.best {
  color: var(--clr-success);
  font-weight: 700;
}

.note {
  color: var(--clr-muted);
  font-size: 14px;
  line-height: 1.45;
}

.outcome-success,
.outcome-failure {
  font-weight: 700;
}

.outcome-success {
  color: #6f8f2f;
}

.outcome-failure {
  color: #b45a50;
}

.video-subheading {
  margin: 26px 0 8px;
  font-size: 18px;
  font-weight: 700;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0 12px;
}

.video-card {
  border: 1px solid var(--clr-border);
  background: #fff;
  padding: 10px;
}

.compare-labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #242a33;
}

.compare-labels span {
  background: #f0f3f8;
  border: 1px solid var(--clr-border);
  padding: 6px 8px;
  text-align: center;
}

.compare-labels .compare-success {
  color: #4f742e;
  background: #eef6e9;
  border-color: #b8d6a6;
}

.compare-labels .compare-failure {
  color: #9b332c;
  background: #faeceb;
  border-color: #e2aaa6;
}

.video-instruction {
  margin: 0 0 8px;
  color: #303741;
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: break-word;
}

.video-instruction b {
  color: #242a33;
}

.compare-video {
  width: 100%;
  display: block;
  background: #000;
}

.video-title {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.35;
  color: #303741;
}

pre {
  font-size: 14px;
  padding: 16px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}

ul {
  margin: 0 0 0 20px;
  padding: 0;
}

li {
  font-size: var(--fs-body);
  line-height: 1.5;
  margin: 6px 0;
}

@media (max-width: 991px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  h1 {
    word-break: break-word;
  }

  .row h4 {
    overflow-wrap: break-word;
  }

  .linkbar {
    --linkbar-fs: 17px;
    line-height: 1.3;
  }

  .linkbar a {
    display: inline-block;
    padding: 12px 10px;
    line-height: 1.3;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .takeaway-strip,
  .method-steps {
    grid-template-columns: 1fr;
  }

  .motivation-grid {
    grid-template-columns: 1fr;
  }

  .motivation-lead {
    font-size: 18px;
  }

  .motivation-solution {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .motivation-solution > .motivation-label,
  .motivation-solution > strong,
  .motivation-solution > p,
  .motivation-equation {
    grid-column: 1;
  }

  .motivation-equation {
    grid-row: auto;
    margin: 6px 0 2px;
  }

  .takeaway-strip > div {
    border-right: 0;
    border-bottom: 1px solid var(--clr-border);
  }

  .takeaway-strip > div:last-child {
    border-bottom: 0;
  }

  .simulation-table {
    font-size: clamp(6.5px, 2vw, 7.5px);
    line-height: 1.15;
  }

  .simulation-table th,
  .simulation-table td {
    padding: 3px 1px;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: auto;
  }

  pre {
    padding: 12px !important;
    overflow-x: auto;
  }
}
