:root {
  color-scheme: light;
  --bg: #e7eef4;
  --surface: #ffffff;
  --ink: #142033;
  --muted: #3d5168;
  --line: #d3dee8;
  --ice: #f4f8fb;
  --navy: #10243c;
  --blue: #1f4e79;
  --red: #c8102e;
  --chip: #e6f0f8;
  --chip-ink: #14324f;
  --shadow: 0 10px 28px rgba(16, 36, 60, 0.07);
  --focus: #1f4e79;
  --header: #10243c;
  --header-ink: #f7fafc;
  --header-muted: #c5d4e4;
  --frame: #0e1824;
  --radius: 16px;
  --font: "Segoe UI", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --max: 1080px;
  --read: 860px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0c141c;
    --surface: #162433;
    --ink: #e8eef6;
    --muted: #b7c6d8;
    --line: #2c4158;
    --ice: #1b2d40;
    --chip: #1c3348;
    --chip-ink: #d7e7f6;
    --shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    --focus: #8ebce8;
    --header: #0a121a;
    --header-ink: #f7fafc;
    --header-muted: #c5d4e4;
    --frame: #070d13;
  }
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(255, 255, 255, 0.7), transparent 55%),
    var(--bg);
}

@media (prefers-color-scheme: dark) {
  body {
    background:
      radial-gradient(900px 420px at 0% -10%, rgba(46, 86, 122, 0.35), transparent 55%),
      var(--bg);
  }
}

img,
video {
  max-width: 100%;
}

a {
  color: var(--blue);
}

@media (prefers-color-scheme: dark) {
  a {
    color: #9dcef5;
  }
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  background: var(--surface);
  color: var(--ink);
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  z-index: 5;
}

.skip:focus {
  top: 0.75rem;
}

.site-header {
  background: var(--header);
  color: var(--header-ink);
  border-bottom: 4px solid var(--red);
}

.header-inner,
.wrap,
.wrap-read {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.wrap-read {
  width: min(var(--read), calc(100% - 2rem));
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  min-height: 4.25rem;
  padding: 0.75rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 auto;
  color: inherit;
  text-decoration: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.brand-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--header-muted);
}

.brand-name {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.mark {
  width: 28px;
  height: 36px;
  border: 1.5px solid #d5e4f2;
  border-radius: 10px;
  position: relative;
  flex: none;
}

.mark::before,
.mark::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  height: 1.5px;
  background: #7eb0d8;
}

.mark::before {
  top: 11px;
}

.mark::after {
  bottom: 11px;
}

.mark span {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: var(--red);
  transform: translateY(-50%);
}

.header-note {
  margin: 0;
  color: var(--header-muted);
  font-size: 0.92rem;
}

.plan-nav {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  color: var(--header-ink);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.plan-nav:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.plan-nav[aria-current="page"] {
  background: rgba(255, 255, 255, 0.12);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-left: auto;
}

.account-slot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  max-width: 100%;
  padding: 0.2rem 0.75rem 0.2rem 0.2rem;
  border-radius: 999px;
  color: var(--header-ink);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
  text-decoration: none;
}

.account-chip:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.avatar,
.avatar-fallback {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: none;
}

.avatar {
  object-fit: cover;
  background: #ffffff;
}

.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
}

.account-name {
  max-width: 8.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main {
  padding: 1.5rem 0 3rem;
}

.hero {
  margin-bottom: 1.25rem;
}

.hero h1,
.drill-head h1 {
  margin: 0.15rem 0 0.4rem;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.lede,
.blurb {
  color: var(--muted);
}

.lede {
  margin: 0;
  max-width: 40rem;
  font-size: 1.08rem;
}

.toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  margin: 1.25rem 0 0.9rem;
}

@media (min-width: 840px) {
  .toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.drill-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.filters {
  display: flex;
  gap: 0.45rem;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.filter {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.filter[aria-pressed="true"] {
  background: #1f4e79;
  border-color: #1f4e79;
  color: #f7fafc;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  height: 100%;
  min-width: 0;
}

.card-link {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.card-actions {
  padding: 0 1rem 1rem;
}

@media (prefers-reduced-motion: no-preference) {
  .card {
    transition: transform 0.15s ease, border-color 0.15s ease;
  }

  .card:hover {
    transform: translateY(-2px);
    border-color: #9db4c9;
  }
}

.card-media {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--ice);
}

.card-media img {
  position: absolute;
  inset: 0.55rem;
  width: calc(100% - 1.1rem);
  height: calc(100% - 1.1rem);
  object-fit: contain;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.9rem 1rem 0.75rem;
}

.card h2 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.series,
.kicker {
  margin: 0;
  color: var(--red);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card .blurb {
  margin: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.2rem 0 0;
  padding: 0;
  list-style: none;
}

.tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--chip);
  color: var(--chip-ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.empty {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
}

.back {
  margin: 0 0 0.8rem;
}

.back a {
  text-decoration: none;
  font-weight: 600;
}

.drill-head {
  margin-bottom: 1.25rem;
}

.series-note {
  margin: 0.8rem 0 0;
  padding: 0.75rem 0.9rem;
  background: var(--chip);
  color: var(--chip-ink);
  border-radius: 12px;
}

.panel {
  margin: 1.4rem 0;
}

.panel h2 {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.anim-frame {
  --chrome: 12rem;
  --legend: 8rem;
  container-type: inline-size;
  width: min(100%, calc((min(82vh, 880px) - var(--chrome)) * var(--anim-w) / var(--anim-h)));
  margin: 0 auto;
  max-width: 100%;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.drill-anim {
  display: block;
  width: 100%;
  height: calc((100cqi - 12px) * var(--anim-h) / var(--anim-w) + var(--chrome) + var(--legend));
  border: 0;
  background: #ffffff;
  overflow: hidden;
}

.anim-open {
  margin: 0.45rem 0 0;
  text-align: center;
  font-size: 0.92rem;
}

.anim-open a {
  font-weight: 600;
}

.diagram figcaption {
  margin: 0;
  padding: 0.55rem 0.85rem 0.7rem;
  color: #d5e1ec;
  font-size: 0.92rem;
}

.diagram {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.diagram img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(78vh, 920px);
  height: auto;
  margin: 0 auto;
  background: #ffffff;
}

.diagram figcaption {
  color: var(--muted);
  background: var(--surface);
}

.points,
.steps,
.related,
.downloads {
  margin: 0;
  padding: 0;
}

.points li,
.related li {
  margin: 0.35rem 0;
}

.points {
  padding-left: 1.15rem;
}

.steps {
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.8rem 0;
  border-top: 1px solid var(--line);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: #f7fafc;
  font-size: 0.85rem;
  font-weight: 700;
}

.steps {
  counter-reset: step;
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

.downloads a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.downloads a.primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #f7fafc;
}

.file-note {
  margin: 0.7rem 0 0;
  color: var(--muted);
}

.related a {
  font-weight: 600;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0 calc(1.5rem + env(safe-area-inset-bottom));
  color: var(--muted);
}

.site-footer p {
  margin: 0.25rem 0;
}

.site-footer a {
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.btn.primary,
.plan-toggle[aria-pressed="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: #f7fafc;
}

.btn.danger {
  color: var(--red);
}

.card-actions .plan-toggle,
.plan-row .plan-toggle {
  width: 100%;
}

.plan-row {
  margin: 0.85rem 0 0;
}

.plan-lede {
  max-width: 40rem;
}

.plan-banner {
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  background: var(--chip);
  color: var(--chip-ink);
  border-radius: 12px;
}

.plan-banner p {
  margin: 0 0 0.75rem;
}

.plan-banner .btn {
  width: 100%;
}

.plan-tools {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.plan-title-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.92rem;
  font-weight: 600;
  min-width: 0;
}

.plan-title-label input,
.plan-title-label textarea,
.plan-fields input,
.plan-share-fallback,
.rename-row input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
}

.plan-title-label textarea {
  min-height: 5.5rem;
  resize: vertical;
}

.plan-title-label input:read-only {
  border-color: transparent;
  background: transparent;
  padding-left: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.plan-title-label textarea:read-only {
  background: var(--ice);
}

.plan-actions,
.account-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.plan-account-state {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.account-methods,
.account-footer-actions {
  margin-top: 1rem;
}

.account-user {
  margin: 0 0 1rem;
  font-weight: 700;
}

.account-privacy {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.account-privacy h2 {
  margin: 0 0 0.4rem;
  color: var(--ink);
  font-size: 1.15rem;
}

.account-privacy p {
  margin: 0;
}

.account-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.account-card {
  padding: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.account-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.account-meta {
  margin: 0 0 0.75rem;
  color: var(--muted);
}

.rename-row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.plan-status {
  margin: 0;
  min-height: 1.4em;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.plan-total {
  margin: 0 0 0.8rem;
  font-weight: 700;
}

.plan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.plan-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  min-width: 0;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.plan-item-body {
  min-width: 0;
}

.plan-thumb {
  display: block;
  min-width: 0;
  padding: 0.35rem;
  background: var(--ice);
  border-radius: 12px;
}

.plan-thumb img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 8px;
}

.plan-item h2 {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0.15rem 0 0.35rem;
  font-size: 1.15rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.plan-item h2 a {
  min-width: 0;
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.plan-item h2 a:hover {
  text-decoration: underline;
}

.plan-index {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.plan-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.plan-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1 1 8.5rem;
  min-width: 0;
  font-size: 0.85rem;
  font-weight: 700;
}

.plan-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.7rem;
}

.plan-item-actions .btn {
  flex: 1 1 5.5rem;
}

@media screen {
  .plan-print-title,
  .plan-print-notes,
  .plan-print-meta,
  .plan-print-note,
  .plan-points,
  .plan-points-heading {
    display: none;
  }
}

.plan-page.is-shared .plan-print-meta:not(:empty) {
  display: block;
  margin: 0.35rem 0 0;
  font-weight: 700;
}

@media (min-width: 720px) {
  .plan-actions,
  .account-actions,
  .rename-row {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .plan-actions .btn,
  .account-actions .btn,
  .plan-banner .btn,
  .rename-row .btn {
    width: auto;
  }

  .rename-row input {
    flex: 1 1 12rem;
  }

  .plan-item {
    grid-template-columns: 200px minmax(0, 1fr);
    align-items: start;
  }

  .plan-row .plan-toggle {
    width: auto;
  }
}

@media (max-width: 640px) {
  .header-actions {
    width: 100%;
  }

  .header-actions .plan-nav,
  .account-chip {
    flex: 1 1 auto;
    justify-content: center;
  }

  .header-note {
    display: none;
  }

  .header-inner,
  .wrap,
  .wrap-read {
    width: min(var(--max), calc(100% - 1.5rem));
  }

  main {
    padding-top: 1.15rem;
  }

  .downloads a {
    flex: 1 1 calc(50% - 0.5rem);
  }
}

@media (max-width: 380px) {
  .downloads a {
    flex-basis: 100%;
  }
}

@media print {
  .site-header,
  .site-footer,
  .downloads,
  .back,
  .anim-frame,
  .anim-open,
  .filters,
  .toolbar,
  .card-actions,
  .plan-row,
  .plan-lede,
  .plan-banner,
  .plan-tools,
  .plan-fields,
  .plan-item-actions,
  .plan-status,
  .skip {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
  }

  .card,
  .diagram,
  .series-note,
  .plan-item {
    box-shadow: none;
  }

  .plan-item,
  .plan-thumb,
  .plan-page .tag {
    background: white !important;
    color: black !important;
    border-color: #ccc !important;
  }

  .plan-page .tag {
    border: 1px solid #999;
  }

  .plan-print-title:not(:empty) {
    display: block;
    margin: 0 0 0.4rem;
    font-size: 1.5rem;
    font-weight: 700;
  }

  .plan-print-notes:not(:empty) {
    display: block;
    margin: 0 0 0.8rem;
    white-space: pre-wrap;
  }

  .plan-print-meta:not(:empty),
  .plan-print-note:not(:empty) {
    display: block;
    margin: 0.25rem 0;
  }

  .plan-print-meta:not(:empty) {
    font-weight: 700;
  }

  .plan-points-heading {
    display: block;
    margin: 0.55rem 0 0.2rem;
    font-size: 1rem;
  }

  .plan-points {
    display: block;
  }

  .plan-item {
    display: block;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 0.9rem;
  }

  .plan-thumb {
    width: auto;
    max-width: 100%;
    margin: 0 0 0.35rem;
    padding: 0;
  }

  .plan-thumb img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 3.3in;
  }

  .plan-total {
    margin-bottom: 0.6rem;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}
