/* CODELUNEX site styles. Mobile-first; breakpoints 640 / 900 / 1100 px. */

:root {
  --navy-900: #0b2340;
  --navy-800: #10305a;
  --navy-700: #1a416f;
  --blue-600: #155fcc;   /* 5.9:1 on white */
  --blue-700: #114ea8;
  --blue-100: #dbe8fb;
  --blue-50: #eef4fd;
  --ink: #142235;
  --muted: #55697d;      /* 5.67:1 on white, 5.35:1 on --bg-alt */
  --bg: #ffffff;
  --bg-alt: #f5f8fc;
  --line: #dbe4ee;
  --line-strong: #b9c7d6;
  --success: #13714a;
  --success-bg: #e8f5ee;
  --warn: #8a5300;
  --warn-bg: #fdf3e2;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --on-dark: #ffffff;
  --on-dark-muted: #c9d6e6;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, "Liberation Mono", monospace;

  --fs-sm: .875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: clamp(1.625rem, 1.2rem + 1.6vw, 2.125rem);
  --fs-h1: clamp(2rem, 1.35rem + 2.6vw, 3.125rem);

  --sp-1: .25rem;
  --sp-2: .5rem;
  --sp-3: .75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4.5rem;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(11, 35, 64, .06), 0 1px 3px rgba(11, 35, 64, .08);
  --shadow: 0 4px 12px rgba(11, 35, 64, .08), 0 2px 4px rgba(11, 35, 64, .05);
  --shadow-lg: 0 18px 40px rgba(11, 35, 64, .14);
  --focus: 0 0 0 3px #ffffff, 0 0 0 5px var(--blue-600);

  --container: 1160px;
  --gutter: 16px;
  --header-h: 64px;
}

/* ------------------------------------------------------------------ base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.6;
  overflow-wrap: break-word;
}

img, svg, video { max-width: 100%; }
img { height: auto; display: block; }
picture { display: block; }   /* the AVIF/WebP wrapper of an image lays out like the <img> it holds */

h1, h2, h3, h4 {
  color: var(--navy-900);
  line-height: 1.2;
  margin: 0 0 var(--sp-4);
  letter-spacing: -.01em;
}
h1 { font-size: var(--fs-h1); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: var(--fs-2xl); font-weight: 750; }
h3 { font-size: var(--fs-lg); font-weight: 700; }
h4 { font-size: var(--fs-md); font-weight: 700; }

p, ul, ol, dl, table, figure { margin: 0 0 var(--sp-4); }
ul, ol { padding-left: 1.4rem; }
li + li { margin-top: var(--sp-1); }

a { color: var(--blue-600); text-underline-offset: .18em; }
a:hover { color: var(--blue-700); }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
main:focus { outline: none; }

code, kbd { font-family: var(--mono); font-size: .92em; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 4px; padding: .05em .35em; }

hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-6) 0; }

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  background: var(--navy-900);
  color: var(--on-dark);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 8px; color: var(--on-dark); }

.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
.icon-sm { width: 1em; height: 1em; vertical-align: -.15em; }
.icon-lg { width: 28px; height: 28px; }

.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.lead { font-size: var(--fs-md); color: var(--muted); max-width: 46rem; }

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: .7rem 1.25rem;
  border: 2px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }

.btn-primary { background: var(--blue-600); color: #fff; }
.btn-primary:hover { background: var(--blue-700); color: #fff; }

.btn-secondary { background: #fff; color: var(--navy-900); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--navy-900); color: var(--navy-900); }

.btn-light { background: #fff; color: var(--navy-900); }
.btn-light:hover { background: var(--blue-50); color: var(--navy-900); }

.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .7); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .1); border-color: #fff; color: #fff; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f1c13; color: #fff; }

.btn-sm { min-height: 44px; padding: .5rem .9rem; font-size: var(--fs-sm); }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }

.text-link { font-weight: 700; display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; }

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--navy-900);
  text-decoration: none;
  min-height: 44px;
}
.brand:hover { color: var(--navy-900); }
.logo { display: block; width: 158px; height: auto; }
.logo-word { font-family: var(--font); font-size: 21px; font-weight: 800; letter-spacing: .04em; }
.brand-light { color: #fff; }
.brand-light:hover { color: #fff; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 44px;
  min-width: 44px;
  padding: .45rem .8rem;
  background: #fff;
  color: var(--navy-900);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.nav-toggle .icon { width: 22px; height: 22px; }
.nav-toggle-open, .nav-toggle-close { display: inline-flex; }
.nav-toggle[aria-expanded="false"] .nav-toggle-close,
.nav-toggle[aria-expanded="true"] .nav-toggle-open { display: none; }

/* Mobile: the menu is an overlay panel under the header, so opening it causes no layout shift. */
.site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-3) var(--gutter) var(--sp-5);
}
.site-nav.is-open { display: block; }

.nav-list { list-style: none; margin: 0 0 var(--sp-4); padding: 0; }
.nav-list li + li { margin-top: 0; }
.nav-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 var(--sp-3);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
}
.nav-link:hover { background: var(--bg-alt); color: var(--navy-900); }
.nav-link.is-active, .nav-link[aria-current="page"] { color: var(--blue-700); background: var(--blue-50); }
.nav-cta { width: 100%; }

/* The "Templates" disclosure menu, used once there are more than three published categories
   (sitelib.NAV_MAX_CATEGORY_LINKS). Inline in the mobile panel, a dropdown on desktop. */
.nav-has-sub { display: flex; flex-wrap: wrap; align-items: center; position: relative; }
.nav-has-sub > .nav-link { flex: 1 1 auto; }
.nav-sub-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.nav-sub-toggle:hover { background: var(--bg-alt); color: var(--navy-900); }
.nav-sub-toggle .icon { transition: transform .15s ease; }
.nav-sub-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.nav-sub { flex-basis: 100%; list-style: none; margin: 0; padding: 0 0 0 var(--sp-4); }
.nav-sub-toggle[hidden], .nav-sub[hidden] { display: none; }
.nav-sub-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--sp-3);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.nav-sub-link:hover { background: var(--bg-alt); color: var(--navy-900); }
.nav-sub-link.is-active, .nav-sub-link[aria-current="page"] { color: var(--blue-700); background: var(--blue-50); }

@media (min-width: 900px) {
  :root { --header-h: 72px; }
  .logo { width: 176px; }
  .nav-toggle { display: none; }
  .site-nav {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    position: static;
    max-height: none;
    overflow: visible;
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  .nav-list { display: flex; gap: 2px; margin: 0; }
  .nav-link { min-height: 44px; padding: 0 .7rem; }
  .nav-link.is-active, .nav-link[aria-current="page"] { background: none; box-shadow: inset 0 -3px 0 var(--blue-600); border-radius: 0; }
  .nav-cta { width: auto; }
  .nav-has-sub { flex-wrap: nowrap; }
  .nav-has-sub > .nav-link { padding-right: .2rem; }
  .nav-sub-toggle { min-width: 32px; min-height: 44px; }
  .nav-sub {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 60;
    min-width: 15rem;
    padding: var(--sp-2);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
  }
}
@media (min-width: 900px) and (max-width: 1099px) {
  .nav-link { padding: 0 .5rem; font-size: .95rem; }
  .nav-cta { padding: .6rem .9rem; font-size: .95rem; }
}

/* ----------------------------------------------------------- breadcrumbs */

.breadcrumbs { padding-top: var(--sp-4); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .25rem; list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); color: var(--muted); }
.breadcrumbs li { display: inline-flex; align-items: center; margin: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: .35rem; color: var(--line-strong); }
.breadcrumbs a { color: var(--muted); display: inline-flex; align-items: center; min-height: 32px; }
.breadcrumbs a:hover { color: var(--blue-700); }
.breadcrumbs [aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------------ hero */

.hero { padding: var(--sp-6) 0 var(--sp-7); background: linear-gradient(180deg, var(--blue-50) 0%, #fff 100%); }
.hero-inner { display: grid; gap: var(--sp-6); align-items: center; }
.hero h1 { max-width: 20ch; }
.hero .lead { margin-bottom: var(--sp-5); }
.hero-points { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); list-style: none; padding: 0; margin: var(--sp-5) 0 0; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.hero-points li { display: inline-flex; align-items: center; gap: .35rem; margin: 0; }
.hero-points .icon { color: var(--success); }
.hero-media { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line); background: #fff; }
.hero-compact { padding: var(--sp-5) 0 var(--sp-6); }
.hero-compact h1 { max-width: 28ch; }

@media (min-width: 900px) {
  .hero { padding: var(--sp-8) 0; }
  .hero-inner.has-media { grid-template-columns: 1.05fr 1fr; gap: var(--sp-7); }
  .hero-compact { padding: var(--sp-6) 0 var(--sp-7); }
}

.eyebrow { display: inline-block; margin-bottom: var(--sp-3); color: var(--blue-700); font-size: var(--fs-sm); font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }

/* -------------------------------------------------------------- sections */

.section { padding: var(--sp-7) 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 46rem; margin-bottom: var(--sp-6); }
.section-head p { color: var(--muted); font-size: var(--fs-md); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-foot { margin-top: var(--sp-6); }
.section-intro { max-width: 46rem; margin-bottom: var(--sp-6); color: var(--muted); font-size: var(--fs-md); }
.card-group > h2 { margin-bottom: var(--sp-4); }
.card-group + .card-group { margin-top: var(--sp-7); }
@media (min-width: 900px) { .section { padding: var(--sp-8) 0; } }

.split { display: grid; gap: var(--sp-6); align-items: start; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; gap: var(--sp-7); }
  .split.center { align-items: center; }
  .split-wide { grid-template-columns: 1.4fr 1fr; }
}

/* ------------------------------------------------------------------ grids */

.card-grid { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; list-style: none; padding: 0; margin: 0; }
.card-grid > li { margin: 0; }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .card-grid-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
}
.card h3 { margin-bottom: var(--sp-2); }
.card p:last-child { margin-bottom: 0; }

/* Template card: the title link is stretched over the whole card. */
.template-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.template-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--line-strong); }
.template-card:focus-within { box-shadow: var(--focus); }
.template-card .card-media { aspect-ratio: 16 / 10; background: var(--bg-alt); border-bottom: 1px solid var(--line); overflow: hidden; }
.template-card .card-media img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.template-card .card-media-icon { display: flex; align-items: center; justify-content: center; color: var(--blue-600); }
.template-card .card-media-icon .icon { width: 56px; height: 56px; }
.template-card .card-body { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-5); flex: 1; }
.template-card h3 { margin: 0; font-size: var(--fs-lg); }
.template-card h3 a { color: var(--navy-900); text-decoration: none; }
.template-card h3 a::after { content: ""; position: absolute; inset: 0; }
.template-card h3 a:focus-visible { box-shadow: none; }
.template-card p { margin: 0; color: var(--muted); }
.template-card .card-meta { margin-top: auto; padding-top: var(--sp-3); font-size: var(--fs-sm); font-weight: 700; color: var(--success); }

.feature-grid { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; list-style: none; padding: 0; margin: 0; }
.feature-grid > li { margin: 0; }
@media (min-width: 640px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .feature-grid-3 { grid-template-columns: repeat(3, 1fr); } }
.feature { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-4); align-items: start; }
.feature-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 12px; background: var(--blue-50); color: var(--blue-700); }
.feature-icon .icon { width: 26px; height: 26px; }
.feature h3 { font-size: var(--fs-md); margin-bottom: var(--sp-1); }
.feature p { margin: 0; color: var(--muted); }

/* ------------------------------------------------------------------ lists */

.check-list { list-style: none; padding: 0; }
.check-list li { position: relative; padding-left: 1.9rem; }
.check-list li + li { margin-top: var(--sp-2); }
.check-list .icon { position: absolute; left: 0; top: .2em; color: var(--success); }

.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: var(--sp-4); }
.steps > li { counter-increment: step; position: relative; margin: 0; padding: var(--sp-5) var(--sp-5) var(--sp-5) 4.25rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.steps > li::before {
  content: counter(step);
  position: absolute; left: var(--sp-5); top: var(--sp-5);
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--navy-900); color: #fff; font-weight: 800; font-size: var(--fs-sm);
}
.steps h3 { font-size: var(--fs-md); margin-bottom: var(--sp-1); }
.steps p { margin: 0; color: var(--muted); }
@media (min-width: 900px) { .steps-3 { grid-template-columns: repeat(3, 1fr); } .steps-4 { grid-template-columns: repeat(4, 1fr); } .steps-5 { grid-template-columns: repeat(5, 1fr); } .steps-3 > li, .steps-4 > li, .steps-5 > li { padding: 4rem var(--sp-5) var(--sp-5); } }

/* Spreadsheet -> web app -> export flow */
.flow { display: grid; gap: var(--sp-3); list-style: none; padding: 0; margin: 0 0 var(--sp-5); }
.flow li { display: flex; align-items: center; gap: var(--sp-3); margin: 0; padding: var(--sp-4); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); font-weight: 700; color: var(--navy-900); }
.flow .feature-icon { width: 40px; height: 40px; }
.flow-arrow { display: none; }
@media (min-width: 640px) {
  .flow { grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; }
  .flow li { flex-direction: column; text-align: center; height: 100%; justify-content: center; }
  .flow .flow-arrow { display: flex; padding: 0; border: 0; background: none; color: var(--muted); }
}

/* ----------------------------------------------------------------- FAQ */

.faq { display: grid; gap: var(--sp-3); max-width: 52rem; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  min-height: 56px; padding: var(--sp-4) var(--sp-5);
  cursor: pointer; list-style: none;
  font-weight: 700; color: var(--navy-900);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-size: 1.5rem; line-height: 1; color: var(--blue-600); }
.faq details[open] summary::after { content: "\2212"; }
.faq summary:focus-visible { border-radius: var(--radius); }
.faq .faq-answer { padding: 0 var(--sp-5) var(--sp-5); color: var(--ink); }
.faq .faq-answer p:last-child { margin-bottom: 0; }
.faq h3 { display: inline; font-size: inherit; margin: 0; color: inherit; }

/* ---------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: var(--sp-5); }
.table-wrap:focus-visible { box-shadow: var(--focus); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 0; }
caption { text-align: left; padding: var(--sp-3) var(--sp-4); font-weight: 700; color: var(--navy-900); }
th, td { text-align: left; vertical-align: top; padding: .7rem var(--sp-4); border-top: 1px solid var(--line); }
thead th { background: var(--bg-alt); color: var(--navy-900); font-size: var(--fs-sm); font-weight: 750; border-top: 0; white-space: nowrap; }
tbody th { font-weight: 700; color: var(--navy-900); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Two-column tables wrap to fit any phone; only the four-column ones scroll sideways. */
.table-wrap table.wide { min-width: 560px; }

/* -------------------------------------------------- facts, download, toc */

.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 0 0 var(--sp-5); }
.facts div { background: #fff; padding: var(--sp-3) var(--sp-4); }
.facts dt { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; font-weight: 750; color: var(--navy-900); }
@media (min-width: 900px) { .facts { grid-template-columns: repeat(3, 1fr); } }

.download-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--sp-5); box-shadow: var(--shadow); }
.download-box h2 { font-size: var(--fs-lg); margin-bottom: var(--sp-3); }
.download-box .btn { width: 100%; }
.download-box .btn + .btn { margin-top: var(--sp-3); }
.download-box .file-meta { margin: var(--sp-3) 0 0; font-size: var(--fs-sm); color: var(--muted); }
.download-pdfs { display: grid; gap: var(--sp-2); margin-top: var(--sp-4); }
.download-pdfs .btn + .btn { margin-top: 0; }

.toc { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-6); }
.toc h2 { font-size: var(--fs-md); margin-bottom: var(--sp-2); }
.toc ol { margin: 0; columns: 1; }
.toc a { display: inline-block; padding: .2rem 0; }
@media (min-width: 640px) { .toc ol { columns: 2; column-gap: var(--sp-6); } }

figure { margin: 0 0 var(--sp-5); }
.figure-frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow); }
figcaption { margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--muted); }

.callout { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-4) var(--sp-5); border-radius: var(--radius); border: 1px solid var(--blue-100); background: var(--blue-50); margin-bottom: var(--sp-5); }
.callout .icon { color: var(--blue-700); margin-top: .15em; }
.callout p:last-child { margin-bottom: 0; }
.callout-warn { border-color: #f1d9ad; background: var(--warn-bg); }
.callout-warn .icon { color: var(--warn); }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; background: var(--blue-50); color: var(--blue-700); font-size: var(--fs-sm); font-weight: 700; }
.badge-success { background: var(--success-bg); color: var(--success); }

.meta-line { color: var(--muted); font-size: var(--fs-sm); }

.noscript-note { padding: var(--sp-5); border: 1px solid #f1d9ad; background: var(--warn-bg); border-radius: var(--radius); color: var(--ink); }

/* ------------------------------------------------------------------ prose */

.prose { max-width: 46rem; }
.prose h2 { margin-top: var(--sp-7); }
.prose h3 { margin-top: var(--sp-6); }
.prose > :first-child { margin-top: 0; }
.prose li + li { margin-top: var(--sp-2); }

.layout-sidebar { display: grid; gap: var(--sp-6); }
@media (min-width: 1100px) {
  .layout-sidebar { grid-template-columns: minmax(0, 1fr) 320px; gap: var(--sp-7); align-items: start; }
  .layout-sidebar .sidebar { position: sticky; top: calc(var(--header-h) + 24px); }
}

/* --------------------------------------------- templates hub + template pages */

.tpl-hero { display: grid; gap: var(--sp-5); align-items: start; }
.tpl-hero .lead { margin-bottom: 0; }
.hero .facts { margin: var(--sp-5) 0 0; }
@media (min-width: 900px) { .tpl-hero { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: var(--sp-7); align-items: center; } }
@media (min-width: 1100px) { .facts-6 { grid-template-columns: repeat(6, 1fr); } }

.tpl-body { max-width: 60rem; padding: var(--sp-6) 0 var(--sp-7); }
.tpl-section { padding-top: var(--sp-6); }
.tpl-section h2, .toc h2 { scroll-margin-top: calc(var(--header-h) + 16px); }
.tpl-section > p, .tpl-section > ul, .tpl-section > ol:not(.steps) { max-width: 48rem; }
.tpl-section h3 { font-size: var(--fs-md); margin-top: var(--sp-5); }
.tpl-section .steps { margin-bottom: var(--sp-5); }
.tpl-section .steps p { color: var(--ink); }
.tpl-section .card-grid { margin-top: var(--sp-4); }
.tpl-aside { margin-top: var(--sp-6); max-width: 48rem; }
.tpl-aside + .tpl-meta { margin-top: var(--sp-5); }
.tpl-meta { margin-top: var(--sp-7); padding-top: var(--sp-4); border-top: 1px solid var(--line); }

.preview { max-width: 60rem; }
.preview-portrait { max-width: 38rem; }
.preview-tall { max-width: 30rem; }
.figure-scroll { overflow-x: auto; }
.figure-scroll:focus-visible { box-shadow: var(--focus); }
.figure-scroll img { min-width: 900px; }
@media (min-width: 900px) { .figure-scroll img { min-width: 0; } }

/* The six calendar color themes, side by side (calendar pages). */
.theme-grid { list-style: none; padding: 0; margin: var(--sp-4) 0 var(--sp-5); display: grid; gap: var(--sp-4); grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 60rem; }
.theme-grid > li { margin: 0; }
.theme-grid figure { margin: 0; }
.theme-grid figcaption { font-weight: 600; color: var(--ink); }
@media (min-width: 640px) { .theme-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.decision-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-3); max-width: 52rem; }
.decision-list li { margin: 0; display: grid; gap: var(--sp-1); padding: var(--sp-4) var(--sp-5); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.decision-list p { margin: 0; }
@media (min-width: 640px) { .decision-list li { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--sp-4); } }

/* -------------------------------------------------------------- CTA band */

.cta-band { background: var(--navy-900); color: var(--on-dark-muted); padding: var(--sp-7) 0; }
.cta-band h2 { color: #fff; }
.cta-band p { max-width: 40rem; font-size: var(--fs-md); }
.cta-band-inner { display: grid; gap: var(--sp-5); align-items: center; }
@media (min-width: 900px) { .cta-band-inner { grid-template-columns: 1.4fr auto; } .cta-band p { margin-bottom: 0; } }

/* ---------------------------------------------------------------- footer */

.site-footer { background: var(--navy-900); color: var(--on-dark-muted); padding: var(--sp-7) 0 var(--sp-5); font-size: .95rem; border-top: 1px solid var(--navy-700); }
.cta-band + .site-footer { border-top-color: var(--navy-700); }
.footer-grid { display: grid; gap: var(--sp-6); grid-template-columns: 1fr; }
.footer-brand p { margin-top: var(--sp-3); max-width: 22rem; }
.footer-heading { color: #fff; font-size: var(--fs-base); margin-bottom: var(--sp-3); letter-spacing: .02em; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li + li { margin-top: 0; }
.footer-col a { display: inline-flex; align-items: center; min-height: 40px; color: #fff; text-decoration: none; }
.footer-col a:hover { text-decoration: underline; color: #fff; }
.site-footer :focus-visible { box-shadow: 0 0 0 3px var(--navy-900), 0 0 0 5px #fff; }
.footer-bottom { margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid var(--navy-700); font-size: var(--fs-sm); }
.footer-bottom p { margin-bottom: var(--sp-2); max-width: 60rem; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .footer-grid { grid-template-columns: 1.3fr 1.4fr 1fr 1fr; } }

/* ---------------------------------------------------------- 404 + misc */

.center-block { text-align: center; max-width: 40rem; margin: 0 auto; }
.link-grid { display: grid; gap: var(--sp-3); grid-template-columns: 1fr; list-style: none; padding: 0; margin: var(--sp-5) 0 0; }
.link-grid li { margin: 0; }
.link-grid a { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: 52px; border: 1px solid var(--line); border-radius: var(--radius); font-weight: 700; text-decoration: none; background: #fff; }
.link-grid a:hover { border-color: var(--blue-600); }
@media (min-width: 640px) { .link-grid { grid-template-columns: repeat(2, 1fr); } }

/* --------------------------------------------------------- motion + print */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .btn:hover, .template-card:hover { transform: none; }
}

@media print {
  .site-header, .site-footer, .skip-link, .cta-band, .breadcrumbs, .nav-toggle { display: none !important; }
  body { color: #000; }
  a { color: #000; }
  .section { padding: 1rem 0; }
}
