/* Solarized Light, matching the other M408M lecture decks.
   Week 9: Arc Length, Curvature & Motion (§13.3–13.4) */
:root {
  --base03: #002b36;
  --base02: #073642;
  --base01: #586e75;
  --base1: #93a1a1;
  --base2: #eee8d5;
  --base3: #fdf6e3;
  --border-subtle: #e4dcba;
  --border-strong: #d9d0ae;

  --yellow: #b58900;
  --orange: #cb4b16;
  --red: #dc322f;
  --magenta: #d33682;
  --violet: #6c71c4;
  --blue: #268bd2;
  --cyan: #2aa198;
  --green: #859900;

  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", Menlo, Consolas, monospace;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--base3);
  color: var(--base03);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header */
.app-header {
  position: fixed;
  inset: 0 0 auto;
  height: 52px;
  background: rgba(238, 232, 213, 0.96);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-brand,
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.course-badge {
  background: var(--base02);
  color: var(--base3);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.course-badge:hover {
  text-decoration: none;
  background: var(--base03);
}

.session-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.header-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--base01);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.header-btn:hover {
  color: var(--blue);
  border-color: var(--border-subtle);
  background: rgba(253, 246, 227, 0.6);
}

.header-btn[aria-pressed="true"] {
  background: var(--blue);
  color: var(--base3);
}

.progress-bar-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(0, 43, 54, 0.06);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Deck */
.slide-deck {
  position: fixed;
  inset: 52px 0 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
}

.slide {
  width: min(1240px, 95vw);
  height: min(780px, calc(100dvh - 140px));
  background: var(--base3);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: 0 6px 22px rgba(0, 43, 54, 0.08);
  padding: 22px 32px;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

.slide.active {
  display: flex;
}

.slide-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  gap: 10px;
}

.slide-tag {
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.slide-tag::before {
  content: "●";
  font-size: 0.65rem;
  margin-right: 7px;
}

.slide-tag.solution {
  color: var(--green);
}

.slide-number-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  white-space: nowrap;
  background: var(--base2);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 2px 8px;
  color: var(--base01);
}

.slide-title {
  font-size: 1.75rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
}

.slide-subtitle {
  color: var(--base01);
  font-size: 0.98rem;
  line-height: 1.5;
  margin-bottom: 14px;
}

.slide-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.grid-2col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

[hidden] {
  display: none !important;
}

.card {
  background: var(--base2);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px 18px;
  min-width: 0;
}

h3 {
  color: var(--base02);
  font-size: 1.02rem;
  line-height: 1.4;
  font-weight: 700;
  margin-bottom: 6px;
}

p {
  font-size: 0.94rem;
}

p + p {
  margin-top: 6px;
}

.small {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--base01);
}

/* Numbered items */
.steps {
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.96rem;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 36px;
  min-width: 0;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(38, 139, 210, 0.14);
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 700;
}

.steps .small {
  margin-top: 4px;
}

/* Click-to-expand explanations */
details.explain {
  font-size: 0.88rem;
}

details.explain summary {
  cursor: pointer;
  width: fit-content;
  color: var(--blue);
  font-size: 0.86rem;
  font-weight: 600;
}

details.explain[open] {
  background: var(--base2);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px 12px 8px;
}

details.explain[open] summary {
  margin-bottom: 4px;
}

details.explain p {
  font-size: 0.88rem;
}

details.explain p + p,
details.explain .formula-box + p {
  margin-top: 4px;
}

summary:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

/* Formulas */
.formula-box {
  margin: 4px 0;
  padding: 4px;
  text-align: center;
  font-size: 1rem;
  min-width: 0;
}

.formula-box.highlight {
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(38, 139, 210, 0.25);
  background: rgba(38, 139, 210, 0.08);
}

.katex {
  font-size: 1.06em;
}

.katex-display {
  margin: 0.2em 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0;
}

.callout {
  border-left: 3px solid var(--cyan);
  background: rgba(42, 161, 152, 0.08);
  border-radius: 0 6px 6px 0;
  padding: 10px 14px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.callout-warn {
  border-left: 3px solid var(--orange);
  background: rgba(203, 75, 22, 0.08);
  border-radius: 0 6px 6px 0;
  padding: 10px 14px;
  font-size: 0.92rem;
  line-height: 1.5;
}

/* Figures */
.visual-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 16px;
  min-width: 0;
  min-height: 0;
  background: rgba(255, 255, 255, 0.3);
}

svg {
  display: block;
  width: 100%;
}

.visual-panel > svg {
  flex: 1 1 0;
  min-height: 200px;
  height: 100%;
}

figcaption {
  text-align: center;
  color: var(--base01);
  font-size: 0.86rem;
  line-height: 1.45;
}

.drag-hint {
  text-align: center;
  font-size: 0.74rem;
  color: var(--base1);
}

svg.rotatable {
  cursor: grab;
  touch-action: none;
}

svg.rotatable.dragging {
  cursor: grabbing;
}

/* Controls */
.controls {
  display: grid;
  gap: 2px;
}

.controls label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

output {
  font-family: var(--font-mono);
  color: var(--blue);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
  cursor: pointer;
  min-height: 20px;
}

.control-btn {
  padding: 5px 14px;
  border: 1px solid var(--border-strong);
  background: var(--base3);
  border-radius: 6px;
  color: var(--base02);
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.control-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.control-btn[aria-pressed="true"] {
  background: var(--blue);
  color: var(--base3);
  border-color: var(--blue);
}

/* Play/Pause beside a slider, like a video scrubber */
.scrubber {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scrubber input[type="range"] {
  flex: 1;
  min-width: 0;
}

.play-btn {
  min-width: 84px;
  background: var(--blue);
  border-color: var(--blue);
  color: var(--base3);
}

.play-btn:hover {
  background: #1978b8;
  border-color: #1978b8;
  color: var(--base3);
}

.play-btn span {
  display: inline-block;
  width: 14px;
  text-align: center;
  margin-right: 2px;
}

.segmented {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.segmented .control-btn {
  border-radius: 0;
  margin-left: -1px;
}

.segmented .control-btn:first-child {
  border-radius: 6px 0 0 6px;
  margin-left: 0;
}

.segmented .control-btn:last-child {
  border-radius: 0 6px 6px 0;
}

.readout {
  background: var(--base2);
  border-radius: 6px;
  color: var(--base02);
  padding: 7px 12px;
  font-size: 0.84rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

.readout .num {
  font-family: var(--font-mono);
  font-size: 0.94em;
  white-space: pre;
}

/* Title slide: title on the left, outline on the right */
.title-slide.active {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: 64px;
  padding: 48px 72px;
}

.title-main {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.title-badge-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.title-badge {
  background: var(--base2);
  color: var(--cyan);
  border: 1px solid var(--border-subtle);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.title-badge.accent {
  background: rgba(38, 139, 210, 0.1);
  color: var(--blue);
  border-color: rgba(38, 139, 210, 0.3);
}

.title-heading {
  font-size: 3.9rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.06;
}

.title-heading span {
  display: block;
  color: var(--blue);
}

.outline-panel {
  background: var(--base2);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 24px 28px;
}

.outline-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--cyan);
  margin-bottom: 10px;
}

.outline {
  list-style: none;
}

.outline li {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  column-gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-strong);
  font-size: 0.96rem;
  font-weight: 700;
}

.outline li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.outline b {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(38, 139, 210, 0.14);
  color: var(--blue);
  font-size: 0.9rem;
}

/* Tables */
.solar-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}

.solar-table th,
.solar-table td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-strong);
}

.solar-table th {
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.solar-table th .katex {
  text-transform: none;
}

/* Sign table: keep "> 0" on one line */
.signs td:nth-child(2),
.signs td:nth-child(3) {
  white-space: nowrap;
}

.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 16px;
  align-items: baseline;
  font-size: 0.94rem;
  line-height: 1.5;
}

.facts dt {
  font-weight: 700;
  color: var(--base02);
  white-space: nowrap;
}

.facts dd {
  min-width: 0;
}

/* Exercises: one card per problem */
.card-primary {
  border-left: 4px solid var(--blue);
}

.card-cyan {
  border-left: 4px solid var(--cyan);
}

.key-list {
  padding-left: 20px;
  font-size: 1rem;
}

.key-list li {
  padding-left: 3px;
  margin-bottom: 10px;
}

.key-list li:last-child {
  margin-bottom: 0;
}

.key-list li::marker {
  color: var(--blue);
  font-weight: 700;
}

.exercises-slide .slide-body {
  flex: 0 0 auto;
  margin-block: auto;
}

.exercises-slide .card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px 24px;
}

.exercise-single {
  width: min(100%, 760px);
  margin-inline: auto;
}

.exercises-slide .card h3 {
  font-size: 1.14rem;
}

.exercises-slide .formula-box,
.exercise-given {
  font-size: 1.02rem;
  text-align: center;
}

/* Slides without a figure: cards centered vertically */
.text-slide .slide-body {
  flex: 0 0 auto;
  margin-block: auto;
}

.text-slide .card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 24px 22px;
}

.text-slide .card h3 {
  font-size: 1.12rem;
}

/* Solutions: compact steps beside the figure */
.solution-slide .stack {
  gap: 6px;
}

.solution-slide .formula-box {
  margin: 2px 0;
  padding: 2px;
}

.solution-slide .formula-box.highlight {
  padding: 4px 6px;
}

.why {
  font-size: 0.86rem;
  color: var(--base02);
  border-left: 3px solid var(--cyan);
  padding-left: 10px;
}

.why b {
  color: var(--cyan);
}

.step {
  font-weight: 800;
  color: var(--blue);
  margin-right: 4px;
}

/* Summary table */
.reference {
  font-size: 0.94rem;
}

.reference td {
  padding: 8px 12px;
  vertical-align: middle;
}

.reference td:first-child {
  font-weight: 700;
  color: var(--base02);
  width: 34%;
}

/* Readout text colored to match the figure */
.c-blue {
  color: var(--blue);
}

.c-cyan {
  color: var(--cyan);
}

.c-orange {
  color: var(--orange);
}

.c-magenta {
  color: var(--magenta);
}

.c-green {
  color: var(--green);
}

.c-violet {
  color: var(--violet);
}

/* Footer */
.app-footer {
  position: fixed;
  inset: auto 0 0;
  height: 64px;
  background: rgba(238, 232, 213, 0.96);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.footer-left,
.footer-center,
.slide-dots {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slide-counter {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  white-space: nowrap;
}

.slide-dots {
  gap: 6px;
}

.slide-dot {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  background: #c6b991;
  padding: 0;
  transition: all 0.2s ease;
}

.slide-dot[aria-current="step"] {
  width: 22px;
  border-radius: 4px;
  background: var(--blue);
}

.nav-btn {
  background: var(--base3);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px 18px;
  font-size: 0.9rem;
  color: var(--base02);
  font-weight: 600;
  transition: all 0.15s ease;
}

.nav-btn:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue);
  background: #fffdf7;
}

.footer-right {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--base01);
}

/* Dialogs */
.modal-dialog {
  margin: auto;
  width: min(1020px, 92vw);
  max-height: 86dvh;
  background: var(--base3);
  color: var(--base03);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0, 43, 54, 0.24);
  padding: 0;
}

.modal-dialog::backdrop {
  background: rgba(0, 43, 54, 0.6);
  backdrop-filter: blur(4px);
}

.help-dialog {
  max-width: 640px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--base2);
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
  font-size: 1.1rem;
  color: var(--base02);
}

.modal-close {
  border: 0;
  background: none;
  color: var(--base01);
  font-size: 1.7rem;
  padding: 0 6px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--red);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(86dvh - 70px);
}

.slide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.grid-card {
  background: var(--base2);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px;
  text-align: left;
  color: var(--base02);
  transition: all 0.15s ease;
}

.grid-card:hover {
  border-color: var(--blue);
  background: #fdfaf0;
}

.grid-card[aria-current="step"] {
  border-color: var(--blue);
  background: rgba(38, 139, 210, 0.08);
}

.grid-card-num {
  display: block;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.grid-card-title {
  font-weight: 700;
  font-size: 0.86rem;
  line-height: 1.35;
}

.noscript-notice {
  position: fixed;
  bottom: 72px;
  left: 10%;
  right: 10%;
  z-index: 110;
  background: var(--base2);
  padding: 16px;
  text-align: center;
  border: 1px solid var(--yellow);
  border-radius: 8px;
}

/* Short screens: tighten spacing so figures keep their room */
@media (max-height: 800px) and (min-width: 901px) {
  .slide {
    padding: 16px 28px;
  }
  .slide-title {
    font-size: 1.55rem;
  }
  .slide-subtitle {
    margin-bottom: 10px;
    font-size: 0.92rem;
  }
  .slide-body,
  .stack {
    gap: 8px;
  }
  .card {
    padding: 8px 14px;
  }
  .steps {
    gap: 8px;
  }
  .title-slide.active {
    padding: 32px 56px;
  }
  .title-heading {
    font-size: 3.3rem;
  }
  .outline li {
    padding: 8px 0;
  }
  .reference td {
    padding: 6px 12px;
  }
}

/* Very short windows: compact everything */
@media (max-height: 650px) and (min-width: 901px) {
  .slide {
    padding: 8px 22px;
  }
  .slide-meta {
    margin-bottom: 0;
  }
  .slide-title {
    font-size: 1.3rem;
    margin-bottom: 2px;
  }
  .slide-subtitle {
    font-size: 0.84rem;
    margin-bottom: 6px;
  }
  .slide-body,
  .stack {
    gap: 6px;
  }
  .card {
    padding: 6px 12px;
  }
  h3 {
    margin-bottom: 2px;
  }
  .steps {
    gap: 4px;
    font-size: 0.88rem;
  }
  p,
  .facts {
    font-size: 0.86rem;
  }
  .katex {
    font-size: 0.98em;
  }
  .katex-display {
    margin: 0;
  }
  .formula-box {
    margin: 2px 0;
    padding: 2px;
  }
  .formula-box.highlight {
    padding: 4px;
  }
  .visual-panel {
    padding: 8px 12px;
    gap: 4px;
  }
  .visual-panel > svg {
    min-height: 140px;
  }
  .readout {
    padding: 4px 10px;
    font-size: 0.78rem;
  }
  .drag-hint {
    display: none;
  }
  .title-heading {
    font-size: 2.8rem;
  }
  .outline li {
    padding: 5px 0;
  }
}

@media (max-width: 900px) {
  .slide {
    height: calc(100dvh - 136px);
    padding: 20px;
  }
  .slide-body {
    flex: 0 0 auto;
    min-height: auto;
  }
  .grid-2col {
    grid-template-columns: 1fr;
  }
  .title-slide.active {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 28px;
    padding: 24px;
  }
  .visual-panel > svg {
    flex: none;
    height: auto;
    min-height: 0;
  }
  .title-heading {
    font-size: 2.6rem;
  }
  .slide-title {
    font-size: 1.5rem;
  }
  .session-title {
    font-size: 0.8rem;
  }
  .slide-dots,
  .footer-right {
    display: none;
  }
  .app-header {
    padding: 0 12px;
  }
  .app-footer {
    padding: 0 16px;
  }
}

@media (max-width: 560px) {
  .session-title {
    display: none;
  }
  .slide {
    padding: 16px;
    width: 95vw;
  }
  .slide-tag {
    font-size: 0.65rem;
  }
  .slide-title {
    font-size: 1.3rem;
  }
  .slide-subtitle {
    font-size: 0.86rem;
  }
  .title-badge {
    font-size: 0.65rem;
  }
  .outline-panel {
    padding: 16px 18px;
  }
  .facts {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .facts dd {
    margin-bottom: 6px;
  }
  .solar-table {
    display: block;
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  @page {
    size: landscape;
    margin: 10mm;
  }
  html,
  body {
    height: auto;
    overflow: visible;
  }
  .app-header,
  .app-footer,
  dialog,
  .controls,
  .segmented,
  .drag-hint {
    display: none !important;
  }
  .slide-deck {
    display: block;
    position: static;
    padding: 0;
  }
  .slide {
    display: flex !important;
    width: 100%;
    height: auto;
    min-height: 170mm;
    break-after: page;
    break-inside: avoid;
    overflow: visible;
    box-shadow: none;
    padding: 20px;
    border: 0;
  }
  .slide:last-child {
    break-after: auto;
  }
  .slide-body {
    min-height: auto;
  }
  .visual-panel > svg {
    flex: none;
    height: 240px;
  }
  * {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

.steps-tight {
  gap: 4px;
  margin: 2px 0 4px;
  font-size: 0.92rem;
}

.steps-tight > li {
  padding-left: 30px;
}

.steps-tight > li::before {
  width: 20px;
  height: 20px;
  font-size: 0.74rem;
}

.steps-method {
  gap: 6px;
}

.steps-tight > li > .formula-box:first-child {
  margin-top: 0;
}

.steps-tight > li:has(> .formula-box:first-child)::before {
  top: 50%;
  transform: translateY(-50%);
}

.steps-tight .formula-box {
  margin: 0;
  padding: 0 4px;
}

.optional-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--yellow);
  background: rgba(181, 137, 0, 0.12);
  border: 1px solid rgba(181, 137, 0, 0.35);
}

.key-list .optional-badge {
  margin-left: 0;
  margin-right: 6px;
  font-size: 0.72rem;
  padding: 1px 7px;
  vertical-align: 1px;
}

.step + .optional-badge {
  margin-left: 2px;
  margin-right: 6px;
  font-size: 0.72rem;
  padding: 1px 7px;
  vertical-align: 1px;
}
