/* Narwhal's Crafted — Franchise IT Bible
   All brand values come from brand-spec.md (single source of truth). */

/* ---------- fonts (self-hosted copies of the brand webfonts) ---------- */
@font-face {
  font-family: "kisnaregular";
  src: url("/webfonts/kisna-regular-webfont.woff2") format("woff2"),
       url("/webfonts/kisna-regular-webfont.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "tay_sweetheartregular";
  src: url("/webfonts/taysweetheart-webfont.woff2") format("woff2"),
       url("/webfonts/taysweetheart-webfont.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens (brand-spec.md §11) ---------- */
:root {
  /* color — verified */
  --ink:   #093543;
  --deep:  #06495e;
  --navy:  #204a5e;
  --cyan:  #40b9d0;
  --slate: #598c9f;
  --foam:  #fef6f6;
  --red:   #ef4440;   /* universal hover / alert */
  --beige: #F0E6E6;

  /* color — internal derived */
  --cyan-tint: #e3f3f7;
  --cyan-dim:  #2a98ae;
  --line: rgba(9, 53, 67, .14);
  --text-main:  #0d2a35;
  --text-muted: #4a6870;

  /* seasonal green for success states (brand-spec §1) */
  --green: #0eaa4e;

  /* type — production names */
  --font-title:  "kisnaregular", "Arial Rounded MT Bold", sans-serif;
  --font-accent: "tay_sweetheartregular", "Brush Script MT", cursive;
  --font-body:   acumin-variable, "DM Sans", system-ui, sans-serif;
  --font-mono:   "DM Mono", ui-monospace, monospace;

  /* layout — verified */
  --container-max: 991px;
  --radius-btn: 0.25rem;
  --radius-card: 6px;
  --shadow-btn: 0 0.625rem 1.25rem rgba(0, 0, 0, .15);
  --shadow-card: 0 0.625rem 1rem rgba(0, 0, 0, .05);

  /* layout — internal tools */
  --sidebar-w: 280px;
  --content-max: 760px;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--foam) url("/img/bkg_tex.png") repeat;
  color: var(--text-main);
  font-family: var(--font-body);
  font-weight: 300;
  font-variation-settings: "slnt" 0, "wdth" 67.5, "wght" 300;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: var(--font-title);
  font-weight: normal;
  color: var(--navy);
  margin: 0 0 .5rem;
  line-height: 1.15;
}
h1 { font-size: 2.3125rem; letter-spacing: .095rem; }   /* fs-700 */
h2 { font-size: 1.875rem;  letter-spacing: .034rem; }   /* fs-550 */
h3 { font-size: 1.375rem;  letter-spacing: .0275rem; }  /* fs-485 */
h4 { font-size: 1.25rem;   letter-spacing: .07rem; }    /* fs-450 */

p { margin: 0 0 1rem; letter-spacing: .02em; }

a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--red); }

strong, b { font-weight: 500; }
code {
  font-family: var(--font-mono);
  font-size: .9em;
  background: var(--beige);
  padding: .1em .35em;
  border-radius: 3px;
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
  }
}

/* ---------- buttons (4px radius, float shadow, NO hover transition) ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-title);
  font-size: 1.0625rem;
  letter-spacing: .07rem;
  padding: .75rem 1.25rem;
  border: none;
  border-radius: var(--radius-btn);
  background: var(--navy);
  color: var(--foam);
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: none;
  text-align: center;
}
.btn:hover { background: var(--red); color: var(--foam); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-cyan { background: var(--cyan); color: var(--ink); }
.btn-cyan:hover { background: var(--red); color: var(--foam); }

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--slate);
  box-shadow: none;
}
.btn-ghost:hover { background: transparent; color: var(--red); border-color: var(--red); }

.btn-danger { background: var(--red); }
.btn-danger:hover { background: var(--ink); }

.btn-small { font-size: .875rem; padding: .4rem .75rem; }

/* tiny icon buttons (reorder arrows etc.) */
.icon-btn {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  color: var(--navy);
  cursor: pointer;
  font-size: .8rem;
  font-weight: 400;
  line-height: 1;
  padding: .35rem .5rem;
}
.icon-btn:hover { color: var(--red); border-color: var(--red); background: var(--cyan-tint); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn:disabled:hover { color: var(--navy); border-color: var(--line); }

/* ---------- forms ---------- */
label { display: block; font-size: .875rem; color: var(--text-muted); margin-bottom: .25rem; }

input[type="text"], input[type="password"], input[type="url"], select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  color: var(--text-main);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  padding: .55rem .7rem;
  margin-bottom: .9rem;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-tint);
}
textarea { min-height: 7rem; resize: vertical; }

.field-hint { font-size: .8rem; color: var(--text-muted); margin: -.6rem 0 .9rem; }

/* type-specific field group in the section editor */
[data-fields] {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--foam);
  padding: 1rem 1rem .25rem;
  margin-bottom: .9rem;
}

.form-error {
  background: #fdecec;
  border: 1px solid var(--red);
  border-radius: var(--radius-btn);
  color: var(--red);
  font-weight: 400;
  font-size: .9rem;
  padding: .5rem .75rem;
  margin-bottom: 1rem;
}
.form-error:empty { display: none; }

/* ---------- header / shell ---------- */
.app-header {
  display: flex;
  align-items: center;
  gap: .9rem;
  background: var(--navy);
  color: var(--foam);
  padding: .65rem 1.25rem;
}
.app-header img.logo { height: 42px; filter: drop-shadow(0 0 .625rem rgba(0, 0, 0, .15)); }
.app-header .app-title {
  font-family: var(--font-title);
  font-size: 1.375rem;
  letter-spacing: .0275rem;
  color: var(--foam);
  margin: 0;
  cursor: pointer;
}
.app-header .app-title:hover { color: var(--cyan); }
.app-header .spacer { flex: 1; }
.app-header .whoami { font-size: .875rem; color: var(--cyan-tint); }
.app-header a { color: var(--cyan); }
.app-header a:hover { color: var(--red); }
.nav-burger { display: none; background: none; border: 0; padding: .3rem; color: var(--foam); cursor: pointer; }
.nav-burger svg { width: 28px; height: 28px; display: block; }
.nav-burger svg[hidden] { display: none; }
.nav-burger:hover { color: var(--cyan); }
.sidebar-user { display: none; }

/* app pages are a full-height column so the footer hugs the bottom */
body.app-page, body.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.app-page .app-body { flex: 1; }
body.app-page > main.content { flex: 1; }   /* admin tab panes sit directly on body */
body.login-page .login-wrap { flex: 1; min-height: 0; }

.app-body { display: flex; }

/* ---------- sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 3px solid var(--cyan);
  padding: 1.25rem 0;
  background: rgba(255, 255, 255, .45);
}
.sidebar h2 {
  font-size: 1rem;
  letter-spacing: .07rem;
  color: var(--slate);
  text-transform: uppercase;
  padding: 0 1.25rem;
}
.chapter-nav { list-style: none; margin: 0; padding: 0; }
.chapter-nav button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 4px solid transparent;
  font-family: var(--font-title);
  font-size: 1.125rem;
  letter-spacing: .034rem;
  color: var(--navy);
  padding: .55rem 1.25rem;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chapter-nav button:hover { color: var(--red); }
.chapter-nav li.active button {
  border-left-color: var(--cyan);
  background: var(--cyan-tint);
  color: var(--deep);
}

/* ---------- content ---------- */
.content {
  flex: 1;
  padding: 2rem 2.5rem 5rem;
  min-width: 0;
}
.content-inner { max-width: var(--content-max); }

.chapter-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .75rem 1rem;
  border-bottom: 3px solid var(--beige);
  padding-bottom: .75rem;
  margin-bottom: 1.5rem;
}
.chapter-head h1 { margin: 0; flex: 1 1 auto; }
.chapter-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- on-page section index ---------- */
.section-index {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--cyan);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: .6rem 1rem;
  margin-bottom: 1.25rem;
}
.section-index summary {
  display: flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-title);
  font-size: .9rem;
  letter-spacing: .07rem;
  text-transform: uppercase;
  color: var(--slate);
}
.section-index summary::-webkit-details-marker { display: none; }
.section-index summary::after { content: "▾"; margin-left: auto; color: var(--cyan); }
.section-index[open] summary::after { content: "▴"; }
.section-index summary:hover { color: var(--red); }
.section-index ul {
  list-style: none;
  margin: .6rem 0 .3rem;
  padding: 0;
  columns: 2;
  column-gap: 2.5rem;
}
.section-index li { margin-bottom: .35rem; break-inside: avoid; }
.section-index a { font-weight: 400; font-size: .95rem; }
@media (max-width: 600px) { .section-index ul { columns: 1; } }

/* ---------- sections ---------- */
.section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  scroll-margin-top: 1rem;
}
.section-head {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .6rem;
}
.section-head h3 { margin: 0; }
.section.is-internal { border: 1px solid var(--red); }

.badge {
  display: inline-block;
  font-family: var(--font-title);
  font-size: .7rem;
  letter-spacing: .07rem;
  text-transform: uppercase;
  border-radius: var(--radius-btn);
  padding: .15rem .5rem;
  line-height: 1.4;
}
.badge-internal { background: var(--red); color: #fff; }
.badge-bid { background: var(--cyan-tint); color: var(--deep); border: 1px solid var(--cyan); }
.badge-full { background: var(--navy); color: var(--foam); }
.badge-type { background: var(--beige); color: var(--text-muted); }

/* section content blocks */
.section ul, .section ol { margin: 0 0 .5rem; padding-left: 1.4rem; }
.section li { margin-bottom: .35rem; }

.section table { width: 100%; border-collapse: collapse; margin-bottom: .5rem; }
.section th {
  font-family: var(--font-title);
  font-weight: normal;
  font-size: .95rem;
  letter-spacing: .034rem;
  text-align: left;
  background: var(--navy);
  color: var(--foam);
  padding: .5rem .7rem;
}
.section td {
  padding: .45rem .7rem;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
  font-size: .95rem;
}
.section tr:nth-child(even) td { background: var(--cyan-tint); }

.section figure { margin: 0; }
.section figure img {
  max-width: 100%;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
}
.section figcaption { font-size: .85rem; color: var(--text-muted); margin-top: .4rem; }

.callout {
  border-left: 4px solid;
  border-radius: var(--radius-btn);
  padding: .8rem 1rem;
  font-weight: 400;
}
.callout-info    { border-color: var(--cyan);  background: var(--cyan-tint); color: var(--deep); }
.callout-warning { border-color: var(--red);   background: #fdecec;          color: #8c1f1c; }
.callout-success { border-color: var(--green); background: #e8f7ee;          color: #0c5e30; }

.product-card { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; }
/* multiple products stack inside one section, separated by hairlines */
.product-card + .product-card {
  border-top: 1px solid var(--line);
  margin-top: 1.25rem;
  padding-top: 1.25rem;
}
.product-card img {
  width: 160px;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  filter: drop-shadow(0 0 .625rem rgba(0, 0, 0, .15));
}
.product-card .product-info { flex: 1; min-width: 220px; }
.product-sku {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
}
.product-card .btn { margin-top: .25rem; }

/* ---------- portal home / landing ---------- */
/* Home is sidebar-free and full-bleed: hero copy sits on foam, then the
   chapter grid rides a textured teal band with foam wave edges — the
   marketing site's signature section rhythm. */
body.home-view .sidebar { display: none; }
/* the teal band grows to meet the footer, so home is foam-free below the hero */
body.home-view .content { padding: 0; display: flex; }
body.home-view .content-inner { max-width: none; flex: 1; display: flex; flex-direction: column; }

.home-hero { text-align: center; padding: 3rem 1rem 1.5rem; }
.home-hero img.logo { height: 96px; filter: drop-shadow(0 0 .625rem rgba(0, 0, 0, .15)); }
.home-hero h1 {
  font-size: 3.3125rem;                      /* fs-725 */
  letter-spacing: .066rem;
  margin: .5rem 0 0;
}
@media (max-width: 600px) {
  .home-hero h1 { font-size: 2.5rem; }
}
.home-tagline {
  font-family: var(--font-accent);
  font-size: 1.6rem;
  color: var(--slate);
  margin: .15rem 0 1rem;
}
.home-welcome { color: var(--text-muted); font-weight: 400; max-width: 34rem; margin: 0 auto; }
.home-empty { text-align: center; padding: 0 1rem 3rem; }

/* foam wave edges (site .wave-break) — the divs sit INSIDE the teal band,
   so the band's teal shows through under the foam wave crest */
.wave-break {
  background: url("/img/bkg_tex.png") left top repeat,
              url("/img/wave_section_break.svg") center top no-repeat;
  height: 3.68rem;
}
@media screen and (min-width: 1400px) {
  /* wave svg is 1417px wide — scale past it on wider screens (the band's
     overflow:hidden clips the scaled edges, so no horizontal scroll) */
  .wave-break { scale: 1.5 1; }
}
.home-band {
  margin-top: .5rem;
  background: var(--cyan) url("/img/bkg_tex.png") repeat;
  overflow: hidden;
  flex: 1;                     /* runs all the way down to the footer */
}
.home-band .band-inner { max-width: 880px; margin: 0 auto; padding: 1.75rem 1.5rem 2.5rem; }
/* on the teal band the cyan card accent disappears — cards go clean white */
.home-band .chapter-card { border-top-color: #fff; }
.home-band .chapter-card:hover { border-top-color: var(--red); }

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.75rem;
}
.home-band .chapter-grid { margin-top: 0; }
.chapter-card {
  font-family: var(--font-body);
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--cyan);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.1rem 1.2rem .9rem;
  cursor: pointer;
}
.chapter-card:hover { border-color: var(--slate); border-top-color: var(--red); }
.chapter-card h3 { margin-bottom: .25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-card:hover h3 { color: var(--red); }
.chapter-card .card-count { font-size: .85rem; font-weight: 400; color: var(--text-muted); }
.chapter-card .card-go {
  display: block;
  margin-top: .8rem;
  font-family: var(--font-title);
  font-size: .9rem;
  letter-spacing: .05rem;
  color: var(--cyan);
}
.chapter-card:hover .card-go { color: var(--red); }

/* ---------- repeatable product rows (admin section editor) ---------- */
.product-row {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: .9rem .9rem .1rem;
  margin-bottom: .9rem;
}
.product-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .6rem;
}
.product-row-head span {
  font-family: var(--font-title);
  font-size: .8rem;
  letter-spacing: .07rem;
  text-transform: uppercase;
  color: var(--slate);
}
.product-row textarea { min-height: 4rem; }

/* ---------- login page ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-btn);
  padding: 2.25rem 2rem;
  text-align: center;
}
.login-card img.logo { height: 84px; margin-bottom: .75rem; }
.login-card h1 { font-size: 1.875rem; letter-spacing: .034rem; }
.login-tagline {
  font-family: var(--font-accent);
  color: var(--slate);
  font-size: 1.35rem;
  margin: -.25rem 0 1.5rem;
}
.login-card form { text-align: left; }
.login-card .btn { width: 100%; margin-top: .25rem; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 73, 94, .5);   /* brand deep-teal scrim */
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4rem 1rem 2rem;
  overflow-y: auto;
  z-index: 50;
}
.modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-btn);
  padding: 1.5rem 1.75rem;
}
.modal-close {
  position: absolute;
  top: .65rem;
  right: .65rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--slate);
  cursor: pointer;
  padding: .25rem .4rem;
}
.modal-close:hover { color: var(--red); }
.modal.modal-wide { max-width: 820px; }
.modal h2 { margin-bottom: 1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }
.hidden { display: none !important; }

/* ---------- admin ---------- */
.tabs {
  display: flex;
  gap: .25rem;
  padding: 0 1.25rem;
  background: var(--deep);
}
.tabs button {
  font-family: var(--font-title);
  font-size: 1rem;
  letter-spacing: .034rem;
  background: none;
  border: none;
  color: var(--cyan-tint);
  padding: .6rem 1rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}
.tabs button:hover { color: var(--red); }
.tabs button.active { color: #fff; border-bottom-color: var(--cyan); }

.admin-list { list-style: none; margin: 0 0 .75rem; padding: 0; }
.admin-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: .55rem .75rem;
  margin-bottom: .5rem;
}
.admin-list li:hover { border-color: var(--slate); }
.admin-list li.active { border-color: var(--cyan); background: var(--cyan-tint); }
.admin-list .item-title {
  flex: 1 1 8rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-title);
  font-size: 1.05rem;
  color: var(--navy);
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.admin-list .item-title:hover { color: var(--red); }
.admin-list .badge { flex-shrink: 0; }
.admin-list .row-actions { display: flex; gap: .3rem; flex-shrink: 0; margin-left: auto; }
.row-index {
  flex-shrink: 0;
  width: 1.3rem;
  text-align: right;
  font-size: .8rem;
  font-weight: 400;
  color: var(--text-muted);
}
.admin-col-side > .btn { width: 100%; }

.admin-cols { display: flex; gap: 2rem; align-items: flex-start; }
.admin-col-side { width: 300px; flex-shrink: 0; }
.admin-col-main { flex: 1; min-width: 0; max-width: var(--content-max); }

.data-table { width: 100%; border-collapse: collapse; background: #fff; }
.data-table th {
  font-family: var(--font-title);
  font-weight: normal;
  font-size: .9rem;
  letter-spacing: .034rem;
  text-align: left;
  background: var(--navy);
  color: var(--foam);
  padding: .5rem .7rem;
}
.data-table td {
  padding: .5rem .7rem;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
  font-size: .9rem;
}

.upload-thumb {
  max-height: 90px;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  display: block;
  margin-bottom: .9rem;
}

.empty-note { color: var(--text-muted); font-style: italic; }

/* ---------- excerpt (screen view; print rules in print.css) ---------- */
body.excerpt-page { background: var(--slate); }
.sheet {
  max-width: 8.5in;
  margin: 1.5rem auto;
  background: #fff;
  box-shadow: 0 3px 6px rgba(0, 0, 0, .26);
  padding: 1in .85in;
}
.excerpt-toolbar {
  max-width: 8.5in;
  margin: 1rem auto 0;
  display: flex;
  gap: .6rem;
  justify-content: flex-end;
}

.excerpt-cover { text-align: center; padding: 2.5rem 0 1rem; }
.excerpt-cover img.logo { height: 110px; margin-bottom: 1rem; }
.excerpt-cover .brand-name {
  font-family: var(--font-title);
  font-size: 2.25rem;
  letter-spacing: .1rem;
  color: var(--navy);
  margin-bottom: .25rem;
}
.excerpt-cover .doc-kind {
  font-family: var(--font-title);
  font-size: 1.0625rem;
  letter-spacing: .07rem;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 2.5rem;
}
.excerpt-cover h1 { font-size: 3.3125rem; letter-spacing: .066rem; margin-bottom: 2.5rem; }
.excerpt-cover .prepared-for {
  font-weight: 400;
  font-size: 1.125rem;
  color: var(--text-main);
}
.excerpt-cover .prepared-for strong { font-weight: 500; }
.excerpt-cover .cover-date { color: var(--text-muted); font-weight: 400; margin-top: .25rem; }
.excerpt-cover .cover-rule {
  width: 120px;
  border: none;
  border-top: 3px solid var(--cyan);
  margin: 2rem auto;
}
.excerpt-cover .confidential {
  font-size: .85rem;
  font-weight: 400;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: .07rem;
}

/* on screen the footer shows once at the bottom; print.css makes it repeat per page */
.print-footer {
  font-size: .75rem;
  font-weight: 400;
  color: var(--text-muted);
  border-top: 1px solid var(--line);
  padding-top: .4rem;
  margin-top: 2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.excerpt-body .section { box-shadow: none; }

/* ---------- site footer (navy scalloped wave + sign-off, like the site) ---------- */
/* Navy wave rising into the band. The pre-flipped svg (navy fill at the
   bottom) paints on the footer itself; padding-top is 3px less than the
   svg's 59px height, so its solid edge tucks UNDER the band — no exposed
   junction, no seam. */
.site-foot {
  margin-top: auto;
  padding-top: 56px;
  background: url("/img/wave_section_break-navy-flip.svg") center top no-repeat;
}
/* on home the band meets the teal section, so the wave rises out of teal, not foam */
body.home-view .site-foot {
  background: url("/img/wave_section_break-navy-flip.svg") center top no-repeat,
              var(--cyan) url("/img/bkg_tex.png") repeat;
}
@media screen and (min-width: 1400px) {
  /* wave svg is 1417px wide — stretch it on wider screens */
  .site-foot { background-size: 100% 59px; }
  body.home-view .site-foot { background-size: 100% 59px, auto; }
}
.foot-band {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .25rem 1.5rem;
  background: var(--navy);
  color: var(--foam);
  padding: .1rem 1.25rem .9rem;
}
.foot-narly { font-family: var(--font-accent); font-size: 1.55rem; color: var(--cyan); }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .app-body { flex-direction: column; }
  .nav-burger { display: block; }
  /* Sidebar becomes an off-canvas drawer, opened by the header burger */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    width: min(310px, 85vw);
    background: var(--foam) url("/img/bkg_tex.png") repeat;
    border-right: 3px solid var(--cyan); border-bottom: none;
    overflow-y: auto;
    padding-top: 1rem;
    transform: translateX(-105%);
    transition: transform .2s ease;
  }
  body.home-view .sidebar { display: block; } /* drawer stays reachable on Home */
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(6, 73, 94, .5); }
  /* User controls move into the drawer (portal.js relocates the elements) */
  .sidebar-user {
    display: flex; flex-direction: column; align-items: flex-start; gap: .75rem;
    margin: 1.25rem 1.25rem 2rem; padding-top: 1.1rem;
    border-top: 1px solid var(--line);
  }
  .sidebar-user .whoami { color: var(--text-muted); font-size: .875rem; }
  .sidebar-user a { color: var(--cyan-dim); }
  .sidebar-user a:hover { color: var(--red); }
  .content { padding: 1.25rem 1rem 4rem; }
  .admin-cols { flex-direction: column; }
  .admin-col-side { width: 100%; }
}
