.guide-header,
.guide-footer,
.guide-main {
  width: min(72rem, calc(100% - 2rem));
  margin-inline: auto;
}

.guide-header {
  min-height: 5.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid var(--line);
}

.guide-header nav,
.guide-footer nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
}

.guide-header nav a,
.guide-footer a {
  color: var(--navy);
  font-size: .92rem;
  font-weight: 750;
  text-decoration: none;
  text-underline-offset: .25rem;
}

.guide-header nav a:hover,
.guide-footer a:hover {
  text-decoration: underline;
}

.guide-hero,
.category-hero {
  max-width: 53rem;
  padding: clamp(4.5rem, 10vw, 8rem) 0 clamp(3rem, 7vw, 5rem);
}

.guide-hero h1,
.category-hero h1,
.article-header h1 {
  margin-bottom: 1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 7vw, 5.5rem);
  letter-spacing: -.045em;
}

.guide-hero > p:last-child,
.category-hero > p:last-child {
  max-width: 46rem;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.3rem);
}

.category-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
  padding-bottom: clamp(4rem, 8vw, 7rem);
}

.category-nav a {
  min-height: 11rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.35rem;
  border: 2px solid var(--navy);
  border-radius: 9px;
  background: var(--white);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease;
}

.category-nav a:nth-child(2) { border-color: var(--teal); }
.category-nav a:nth-child(3) { border-color: var(--coral); }
.category-nav a:nth-child(4) { border-color: var(--mustard); }
.category-nav a:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 rgba(23, 50, 77, .16); }
.category-nav strong { color: var(--navy); font: 700 1.45rem/1.15 Georgia, "Times New Roman", serif; }
.category-nav span { color: var(--muted); font-size: .94rem; }

.guide-list {
  padding: clamp(4rem, 8vw, 7rem) 0;
  border-top: 1px solid var(--line);
}

.guide-section-heading { margin-bottom: 2rem; }
.guide-section-heading h2 { margin: 0; font: 700 clamp(2.2rem, 5vw, 3.6rem)/1.1 Georgia, "Times New Roman", serif; }
.guide-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }

.guide-card {
  min-height: 18rem;
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
}

.guide-card-category {
  margin-bottom: .75rem;
  color: var(--teal);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.guide-card h2 { margin-bottom: .8rem; font: 700 clamp(1.55rem, 3vw, 2.05rem)/1.15 Georgia, "Times New Roman", serif; }
.guide-card h2 a { text-decoration: none; }
.guide-card h2 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .25rem; }
.guide-card > p:not(.guide-card-category) { color: var(--muted); }
.guide-card > div { margin-top: auto; display: flex; justify-content: space-between; gap: 1rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: .88rem; }
.guide-card > div span { color: var(--muted); }
.guide-card > div a { color: var(--teal); font-weight: 800; text-decoration: none; }

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding-top: 1.5rem;
  color: var(--muted);
  font-size: .84rem;
}

.breadcrumbs a { color: var(--teal); font-weight: 700; text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

.category-switcher {
  margin: clamp(4rem, 9vw, 7rem) 0;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper-deep);
}

.category-switcher h2 { font-size: 1.15rem; }
.category-switcher div { display: flex; flex-wrap: wrap; gap: .75rem; }
.category-switcher a { padding: .65rem .85rem; border: 1px solid var(--line); border-radius: 6px; background: var(--white); color: var(--navy); font-weight: 750; text-decoration: none; }

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 47rem) minmax(14rem, 1fr);
  align-items: start;
  gap: clamp(2rem, 7vw, 6rem);
}

.article-header { padding: clamp(3.5rem, 8vw, 6.5rem) 0 3rem; border-bottom: 1px solid var(--line); }
.article-header h1 { font-size: clamp(2.75rem, 6vw, 4.9rem); }
.article-dek { max-width: 43rem; color: var(--muted); font-size: clamp(1.08rem, 2vw, 1.28rem); }
.article-meta { display: flex; flex-wrap: wrap; gap: .7rem 1.4rem; color: var(--muted); font-size: .85rem; }
.article-cta { margin-top: 1.6rem; }
.article-print { margin: 1.6rem 0 0 .5rem; background: transparent; }

.article-body { padding: 1rem 0 3rem; }
.article-body section { padding-top: 2.4rem; }
.article-body h2,
.faq h2 { font: 700 clamp(1.75rem, 4vw, 2.45rem)/1.15 Georgia, "Times New Roman", serif; }
.article-body p,
.article-body li,
.faq p { color: #3f505d; font-size: 1.04rem; line-height: 1.75; }
.article-body ul { padding-left: 1.3rem; }
.article-body li + li { margin-top: .55rem; }

.guide-table-wrap { margin: 1.5rem 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.guide-table-wrap table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.guide-table-wrap caption { padding: .85rem 1rem; color: var(--muted); font-weight: 700; text-align: left; }
.guide-table-wrap th, .guide-table-wrap td { padding: .8rem 1rem; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.guide-table-wrap thead th { border-top: 0; background: var(--navy); color: white; font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; }
.guide-table-wrap tbody th { color: var(--navy); white-space: nowrap; }

.guide-callout { margin: 1.5rem 0; padding: 1.2rem 1.3rem; border-left: 5px solid var(--mustard); border-radius: 5px; background: #fff8e5; }
.guide-callout strong { color: var(--navy); }
.guide-callout p { margin: .35rem 0 0; }

.pattern-list { display: grid; gap: 1rem; margin: 1.5rem 0; }
.pattern-card { display: grid; grid-template-columns: minmax(10rem, 1fr) auto; align-items: center; gap: 1rem; margin: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.pattern-card figcaption { display: grid; gap: .35rem; }
.pattern-card figcaption strong { color: var(--navy); font-size: 1.05rem; }
.pattern-card figcaption span { color: var(--muted); font-size: .9rem; }
.pattern-board { display: grid; gap: .2rem; padding: .45rem; border: 2px solid var(--navy); border-radius: 6px; background: var(--paper-deep); }
.pattern-row { display: flex; gap: .2rem; }
.pattern-row span { width: 3.15rem; min-height: 2.5rem; display: grid; place-items: center; border: 1px solid var(--navy); border-radius: 3px; font-size: .7rem; font-weight: 850; }
.pattern-covered span { background: #b9c4c8; color: var(--navy); }
.pattern-covered .is-mine { background: var(--coral); color: white; }
.pattern-covered .is-safe { background: #d9eee4; color: #205c48; }
.pattern-clues span { background: white; color: var(--teal); font-size: 1rem; }

.guide-tool { margin: 2rem 0 1rem; padding: clamp(1.25rem, 4vw, 2rem); border: 2px solid var(--navy); border-radius: 10px; background: var(--white); box-shadow: var(--shadow); }
.tool-heading h2 { margin-bottom: .65rem; font: 700 clamp(1.8rem, 4vw, 2.5rem)/1.15 Georgia, "Times New Roman", serif; }
.tool-heading > p:last-child { color: var(--muted); }
.calculator-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin: 1.5rem 0; }
.calculator-player { display: grid; grid-template-columns: 1fr 5.5rem; gap: .5rem 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
.calculator-player strong { color: var(--navy); }
.calculator-player > span { grid-column: 1 / -1; color: var(--muted); font-size: .78rem; }
.calculator-player label, .calculator-bags label { display: flex; align-items: center; justify-content: space-between; gap: .5rem; color: var(--muted); font-size: .82rem; }
.calculator-player input, .calculator-bags input { width: 3.5rem; min-height: 2.5rem; padding: .35rem; border: 1px solid var(--line); border-radius: 5px; background: white; color: var(--navy); font: inherit; font-weight: 800; }
.calculator-bags { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.calculator-bags label { justify-content: flex-start; }
.tool-error { min-height: 1.5rem; margin: .75rem 0; color: #a23b2b; font-size: .9rem; font-weight: 700; }
.calculator-results { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.calculator-results > div { display: grid; gap: .2rem; padding: 1rem; border-radius: 7px; background: var(--navy); color: white; }
.calculator-results span { color: #c7d5de; font-size: .78rem; text-transform: uppercase; }
.calculator-results strong { font-size: 2rem; }
.calculator-results small { color: #dce6eb; }

.trainer-status { display: flex; justify-content: space-between; gap: 1rem; margin: 1.5rem 0 .75rem; color: var(--muted); font-size: .85rem; }
.trainer-status strong { color: var(--navy); }
.trainer-board { width: max-content; max-width: 100%; display: grid; gap: .25rem; padding: .6rem; border: 2px solid var(--navy); border-radius: 7px; background: var(--paper-deep); }
.trainer-row { display: flex; gap: .25rem; }
.trainer-row > * { width: 4rem; min-height: 3.25rem; display: grid; place-items: center; border: 1px solid var(--navy); border-radius: 4px; font: 850 1rem/1 "Avenir Next", sans-serif; }
.trainer-covered button { background: #b9c4c8; color: var(--navy); cursor: pointer; }
.trainer-covered button[aria-pressed="true"] { background: #d9eee4; box-shadow: inset 0 0 0 3px var(--teal); }
.trainer-flag { background: var(--coral); color: white; }
.trainer-clues span { background: white; color: var(--teal); }
.trainer-feedback { min-height: 3rem; margin: 1rem 0; color: var(--navy); font-weight: 700; }
.trainer-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.trainer-actions button:disabled { opacity: .45; cursor: not-allowed; }

.faq { margin-bottom: clamp(4rem, 8vw, 7rem); padding-top: 3rem; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { padding: 1.15rem 2rem 1.15rem 0; color: var(--navy); font-weight: 800; cursor: pointer; }
.faq details p { padding-right: 2rem; }

.related-guides {
  position: sticky;
  top: 1.5rem;
  margin-top: 8rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
}

.related-guides h2 { font: 700 1.4rem/1.15 Georgia, "Times New Roman", serif; }
.related-guides > a { display: grid; gap: .3rem; padding: 1rem 0; border-top: 1px solid var(--line); color: var(--navy); text-decoration: none; }
.related-guides > a strong { line-height: 1.3; }
.related-guides > a span { color: var(--muted); font-size: .8rem; }
.related-guides > a:hover strong { text-decoration: underline; }
.related-guides .all-guides-link { display: block; color: var(--teal); font-weight: 800; }

.guide-footer {
  min-height: 8rem;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 2rem;
  border-top: 1px solid var(--line);
}

.guide-footer > p { margin: 0; color: var(--muted); font-size: .8rem; }

@media (max-width: 820px) {
  .category-nav { grid-template-columns: 1fr; }
  .category-nav a { min-height: 8rem; }
  .article-layout { grid-template-columns: 1fr; }
  .related-guides { position: static; margin: 0 0 4rem; }
  .guide-footer { grid-template-columns: 1fr; gap: 1rem; padding-block: 2rem; }
}

@media (max-width: 620px) {
  .guide-header { min-height: 4.5rem; }
  .guide-header nav a:first-child { display: none; }
  .guide-grid { grid-template-columns: 1fr; }
  .guide-card { min-height: 16rem; }
  .calculator-grid, .calculator-results { grid-template-columns: 1fr; }
  .pattern-card { grid-template-columns: 1fr; }
  .pattern-board { width: max-content; max-width: 100%; }
  .article-print { margin-left: 0; }
}

@media print {
  .guide-header, .guide-footer, .related-guides, .article-cta, .article-print, .faq, .guide-tool { display: none !important; }
  .guide-main, .article-layout { width: 100%; display: block; }
  .article-header { padding: 0 0 1rem; }
  .article-header h1 { font-size: 28pt; }
  .article-body { padding: 0; }
  .article-body section { break-inside: avoid; padding-top: 1rem; }
  .guide-table-wrap { overflow: visible; }
  body { background: white; }
}
