:root {
  --ink: #152131;
  --ink-strong: #0b1726;
  --muted: #405168;
  --line: #d5dde8;
  --paper: #ffffff;
  --canvas: #f3f6fa;
  --navy: #07172b;
  --navy-mid: #0e2947;
  --blue: #176aa5;
  --blue-light: #d9edf9;
  --red: #c92440;
  --red-dark: #a81932;
  --gold: #d6b45f;
  --focus: #bd203a;
  --page-gutter: clamp(1.1rem, 4vw, 4rem);
  --reading-scale: 1;
  color-scheme: light;
  font-size: calc(16px * var(--reading-scale));
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 1rem/1.58 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button, select, label.upload-control, .import-button { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [contenteditable="true"]:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.1; letter-spacing: -.025em; }
h1 { color: var(--ink-strong); font-size: clamp(2.3rem, 4.2vw, 4rem); }
h2 { color: var(--ink-strong); font-size: clamp(1.65rem, 3vw, 2.55rem); }
h3 { color: var(--ink-strong); font-size: 1.35rem; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  z-index: 100;
  inset-inline-start: 1rem;
  top: -5rem;
  padding: .7rem 1rem;
  background: var(--navy);
  color: white;
}
.skip-link:focus { top: 1rem; }
.app-shell { min-height: 100vh; }
.work-area { display: block; min-height: calc(100vh - 78px); margin: 0 auto; }
.main-content { min-width: 0; width: 100%; margin: 0 auto; padding: 0; }
.view { width: min(100% - 2 * var(--page-gutter), 1440px); margin: 0 auto; padding-block: clamp(2rem, 5vw, 4.4rem); }
.view[hidden] { display: none !important; }
#view-home { width: 100%; padding: 0; }

/* Compact white institutional header */
.topbar {
  position: sticky;
  inset-block-start: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 78px;
  padding: .7rem clamp(1rem, 3.2vw, 3.5rem);
  border-bottom: 1px solid #dfe4eb;
  background: rgba(255,255,255,.98);
  color: var(--ink-strong);
  backdrop-filter: blur(16px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .72rem;
  min-width: 0;
  color: var(--ink-strong);
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--red);
}
.brand-mark svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: square; stroke-linejoin: round; }
.brand-wording { display: grid; gap: .06rem; white-space: nowrap; }
.brand-wording strong { font-size: .98rem; font-weight: 700; letter-spacing: -.035em; }
.brand-wording sup { margin-inline-start: 2px; color: var(--red); font-size: .62em; }
.brand-wording small { color: #31445a; font-size: .69rem; font-weight: 650; letter-spacing: .11em; text-transform: uppercase; }
.top-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .25rem;
  min-width: 0;
}
.language-mark { display: inline-flex; width: 18px; height: 18px; color: var(--ink-strong); }
.language-mark svg, .tool-icon svg, .theme-button svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.language-select {
  min-height: 36px;
  max-width: 108px;
  padding: .3rem 1.35rem .3rem .25rem;
  border: 0;
  background: transparent;
  color: var(--ink-strong);
  font-size: .83rem;
  font-weight: 650;
}
.tool-divider { width: 1px; height: 26px; margin-inline: .35rem; background: #d7dee7; }
.icon-button, .tool-button, .menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--ink-strong);
  cursor: pointer;
}
.icon-button { min-width: 34px; padding: .3rem .4rem; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.tool-button { gap: .4rem; padding: .35rem .55rem; font-size: .76rem; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; white-space: nowrap; }
.tool-icon { display: inline-grid; width: 18px; height: 18px; color: var(--red); }
.icon-button:hover, .tool-button:hover, .menu-toggle:hover { background: #edf3f8; }
.theme-button { width: 38px; }
.menu-toggle {
  width: 42px;
  height: 38px;
  margin-inline-start: .25rem;
  border-inline-start: 1px solid #d7dee7;
}
.menu-lines { display: grid; gap: 5px; width: 22px; }
.menu-lines i { display: block; width: 100%; height: 2px; background: var(--ink-strong); transition: transform .18s, opacity .18s; }
.menu-toggle[aria-expanded="true"] .menu-lines i:first-child { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-lines i:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-lines i:last-child { transform: translateY(-7px) rotate(-45deg); }
.top-navigation {
  position: absolute;
  inset-block-start: calc(100% - 1px);
  inset-inline-end: clamp(1rem, 3.2vw, 3.5rem);
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(2, minmax(210px, 1fr));
  width: min(590px, calc(100vw - 2rem));
  padding: .6rem 1rem;
  border-top: 3px solid var(--red);
  border-inline: 1px solid #dbe2eb;
  border-bottom: 1px solid #dbe2eb;
  background: #fff;
  box-shadow: 0 18px 45px rgba(5,18,36,.2);
}
.top-navigation[hidden] { display: none !important; }
.nav-button {
  min-height: 52px;
  padding: .8rem .9rem;
  border: 0;
  border-bottom: 1px solid #e5e9ef;
  background: transparent;
  color: var(--ink-strong);
  font-size: .94rem;
  font-weight: 650;
  text-align: start;
  white-space: nowrap;
  cursor: pointer;
}
.nav-button:hover { background: #f1f5f9; color: var(--red-dark); }
.nav-button.active { box-shadow: inset 3px 0 var(--red); color: var(--red-dark); }
.nav-button:last-child { grid-column: 1 / -1; border-bottom: 0; }

/* Cinematic publishing studio */
.public-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: min(920px, max(680px, calc(100svh - 78px)));
  overflow: hidden;
  padding: clamp(4rem, 8vw, 7rem) var(--page-gutter);
  background: var(--navy);
  color: #fff;
  text-align: center;
}
.hero-art {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 48%;
}
.public-hero::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3,12,24,.66) 0%, rgba(4,14,28,.38) 42%, rgba(4,14,28,.08) 100%),
    linear-gradient(180deg, rgba(3,11,22,.22), rgba(3,11,22,.08) 46%, rgba(3,11,22,.62));
  content: "";
}
.hero-copy {
  width: 100%;
  max-width: 1400px;
  margin-inline: auto;
  text-align: start;
}
.hero-copy .eyebrow {
  display: inline-block;
  margin-bottom: .45rem;
  color: #fff;
}
.eyebrow, .section-kicker {
  margin-bottom: .55rem;
  color: #31445a;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .16em;
  line-height: 1.3;
  text-transform: uppercase;
}
.hero-copy .eyebrow::before, .hero-copy .eyebrow::after {
  display: inline-block;
  width: clamp(24px, 4vw, 56px);
  height: 2px;
  margin: 0 .8rem .22rem;
  background: var(--red);
  content: "";
}
.hero-title {
  display: grid;
  justify-items: start;
  gap: .01em;
  margin: .95rem 0 1.35rem;
  color: #fff;
  font: 700 clamp(2.2rem, 7.2vw, 6.5rem)/.98 Georgia, "Times New Roman", serif;
  letter-spacing: -.04em;
}
.hero-title span { display: block; white-space: nowrap; }
.hero-title .hero-title-accent { color: #e12d4c; }
.hero-lede {
  max-width: 840px;
  margin: 0 0 1.75rem;
  color: #fff;
  font-size: clamp(1rem, 1.55vw, 1.18rem);
  font-weight: 560;
  line-height: 1.6;
  text-shadow: 0 2px 18px rgba(0,0,0,.55);
}
.hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: .8rem;
}
.primary-button, .secondary-button, .text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .75rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: .87rem;
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .18s, border-color .18s, color .18s, transform .18s;
}
.primary-button { background: var(--red); color: #fff; }
.primary-button:hover { transform: translateY(-1px); border-color: #f24a64; background: #e12b48; }
.secondary-button { border-color: #aebbc9; background: #fff; color: var(--ink-strong); }
.secondary-button:hover { border-color: var(--red); background: #f5f8fb; }
.hero-primary, .hero-secondary {
  min-height: 58px;
  padding: 1rem 1.55rem;
  font-size: .86rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.hero-primary { min-width: 250px; border-color: var(--red); }
.hero-secondary { min-width: 220px; border-color: #fff; }
.hero-assurance {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .6rem;
  max-width: 750px;
  margin: 1.25rem 0 0;
  color: #fff;
  font-size: .88rem;
  font-weight: 560;
}
.assurance-mark { color: var(--gold); font-size: 1rem; }

/* Three-step publishing path */
.journey-band { background: #fff; border-bottom: 1px solid var(--line); }
.journey-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.7rem var(--page-gutter) 1.9rem;
}
.journey-kicker {
  grid-column: 1 / -1;
  margin: 0 0 .85rem;
  color: var(--red-dark);
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.journey-row {
  display: grid;
  grid-template-columns: 38px minmax(0,1fr);
  gap: .7rem;
  padding: .8rem 1.15rem .1rem 0;
  border-top: 1px solid #bcc8d6;
}
.journey-number { color: var(--red); font-size: .82rem; font-weight: 850; letter-spacing: .08em; }
.journey-row strong { display: block; margin: -.1rem 0 .25rem; color: var(--ink-strong); font-size: .96rem; font-weight: 720; }
.journey-row p { margin: 0; color: var(--muted); font-size: .87rem; line-height: 1.5; }

/* Public home sections */
.home-section {
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(3.2rem, 6vw, 5.6rem) var(--page-gutter);
}
.section-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.2rem 2rem;
  margin-bottom: 1.6rem;
}
.section-heading-row h2 { max-width: 780px; margin: .3rem 0 0; font-size: clamp(1.9rem, 3.5vw, 3rem); }
.section-heading-row > p { max-width: 390px; margin: 0 0 .2rem; color: var(--muted); font-size: .96rem; }
.pathway-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); border-top: 1px solid #aebccc; }
.pathway-card {
  min-width: 0;
  padding: 1.45rem 1.2rem 1.5rem 0;
  border-bottom: 1px solid #aebccc;
}
.pathway-card + .pathway-card { padding-inline-start: 1.2rem; border-inline-start: 1px solid #d1d9e3; }
.pathway-icon { display: none; }
.pathway-index { margin: 0 0 .75rem; color: var(--red-dark); font-size: .72rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.pathway-card h3 { margin: 0 0 .55rem; font-size: 1.42rem; line-height: 1.16; }
.pathway-card > p:not(.pathway-index) { min-height: 7.4rem; margin: 0 0 .9rem; color: var(--muted); font-size: .93rem; line-height: 1.55; }
.inline-link, .hero-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: .3rem 0;
  border: 0;
  background: transparent;
  color: var(--red-dark);
  font-size: .87rem;
  font-weight: 750;
  text-align: start;
  white-space: nowrap;
  cursor: pointer;
}
.inline-link:hover, .hero-link:hover { color: var(--navy-mid); text-decoration: underline; }
.heartwork-band {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 1.35rem;
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(1.6rem, 3.5vw, 2.7rem) var(--page-gutter);
  border-inline-start: 4px solid var(--red);
  background: var(--navy);
  color: #fff;
}
.heartwork-band-symbol { display: none; }
.heartwork-band-copy .eyebrow { color: #fff; }
.heartwork-band h2 { max-width: 850px; margin: 0 0 .55rem; color: #fff; font-size: clamp(1.8rem, 3.1vw, 2.65rem); }
.heartwork-band-copy > p:last-child { max-width: 890px; margin: 0; color: #fff; font-size: .96rem; }
.heartwork-cta { min-width: 230px; border-color: var(--red); background: var(--red); color: #fff; }
.heartwork-cta:hover { background: #e12b48; }
.institutional-section { padding-top: 4rem; }
.principle-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 0 1.25rem; }
.principle-grid article { padding: 1.1rem 1rem 1.2rem 0; border-top: 2px solid var(--red); }
.principle-number { color: var(--red-dark); font-size: .77rem; font-weight: 850; letter-spacing: .14em; }
.principle-grid h3 { margin: .45rem 0; font-size: 1.25rem; }
.principle-grid p { margin: 0; color: var(--muted); font-size: .91rem; line-height: 1.55; }
.continuity-panel {
  display: grid;
  grid-template-columns: 1fr 1.2fr auto;
  align-items: center;
  gap: 1.3rem;
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.8rem var(--page-gutter);
  border-top: 1px solid #aebccc;
  border-bottom: 1px solid #aebccc;
  background: #e6f1f8;
}
.continuity-panel .eyebrow { margin-bottom: .35rem; }
.continuity-panel h2 { margin: 0; font-size: clamp(1.6rem,2.6vw,2.15rem); }
.continuity-panel p { margin: 0; color: var(--ink); font-size: .94rem; }
.continuity-panel .hero-link { color: var(--red-dark); }
.home-privacy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 1440px;
  margin: 2rem auto 3rem;
  padding: 1.5rem var(--page-gutter);
  border-inline-start: 4px solid var(--gold);
  background: #fff;
}
.home-privacy > div { display: flex; align-items: flex-start; gap: 1rem; }
.privacy-emblem { display: none; }
.home-privacy h2 { max-width: 760px; margin: .2rem 0 .4rem; font-size: 1.55rem; }
.home-privacy p:last-child { max-width: 850px; margin: 0; color: var(--muted); font-size: .92rem; }
.home-privacy .secondary-button { flex: 0 0 auto; }

/* Workbook studio */
.studio-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.6rem; margin-bottom: 1.7rem; }
.studio-heading h1 { max-width: 840px; margin: 0 0 .55rem; }
.intro-copy { max-width: 800px; margin: 0; color: var(--muted); font-size: 1.04rem; }
.principle-badge { flex: 0 0 auto; padding: .75rem 1rem; border: 1px solid #c1cddd; border-inline-start: 3px solid var(--gold); background: #fff; color: var(--ink-strong); font-size: .91rem; font-weight: 740; line-height: 1.35; }
.principle-star { display: none; }
.workflow-rail { display: flex; align-items: center; gap: .8rem; margin: 0 0 1.25rem; padding: .9rem 1rem; overflow-x: auto; border-block: 1px solid #b9c5d2; background: #fff; }
.workflow-step { display: inline-flex; align-items: center; gap: .55rem; flex: 0 0 auto; color: #40536a; font-size: .89rem; font-weight: 680; white-space: nowrap; }
.workflow-step b { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #8292a6; color: #263b52; font-size: .77rem; }
.workflow-step.active { color: var(--red-dark); }
.workflow-step.active b { border-color: var(--red); background: var(--red); color: #fff; }
.workflow-line { width: clamp(20px, 5vw, 72px); height: 1px; flex: 0 0 auto; background: #bfccd9; }
.setup-card { overflow: hidden; border: 1px solid #c7d1dd; background: #fff; }
.card-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; padding: 1.35rem var(--page-gutter) 1.1rem; border-bottom: 1px solid #c7d1dd; background: var(--navy); color: #fff; }
.card-heading h2, .source-heading h2, .components-section h2 { margin: .2rem 0 .25rem; font-size: clamp(1.45rem, 2.3vw, 1.9rem); }
.card-heading h2 { color: #fff; }
.card-heading .section-kicker { color: #fff; }
.form-note { color: #fff; font-size: .85rem; font-weight: 650; white-space: nowrap; }
.required-star { color: #f3c862; font-weight: 900; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1.15rem 1.25rem; padding: 1.4rem var(--page-gutter) 1.55rem; }
.field { display: grid; align-content: start; gap: .43rem; min-width: 0; color: var(--ink-strong); font-size: .93rem; font-weight: 720; }
.field input, .field select, .field textarea, .source-input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: .7rem .78rem;
  border: 1px solid #718399;
  border-radius: 2px;
  background: #fff;
  color: var(--ink-strong);
  font-weight: 450;
}
.field textarea { min-height: 100px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder, .source-input::placeholder { color: #4a5a6e; opacity: 1; }
.field small { color: #405168; font-size: .84rem; font-weight: 450; line-height: 1.45; }
.field-wide { grid-column: 1 / -1; }
.source-section { margin: 0 var(--page-gutter); padding: 1.4rem 0 1.55rem; border-top: 1px solid #c7d1dd; }
.source-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.source-heading h2 { margin-top: .2rem; }
.source-heading p { max-width: 780px; margin: 0; color: var(--muted); }
.source-count { flex: 0 0 auto; padding: .35rem .55rem; border: 1px solid #8a9aae; background: #f1f5f8; color: var(--ink-strong); font-size: .81rem; font-weight: 700; white-space: nowrap; }
.source-input { min-height: 210px; resize: vertical; line-height: 1.6; }
.source-actions { display: flex; align-items: center; gap: 1rem; margin-top: .8rem; }
.upload-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 42px;
  padding: .55rem .8rem;
  border: 1px solid var(--red);
  background: #fff;
  color: var(--red-dark);
  font-size: .87rem;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}
.upload-control input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-support, .language-note { color: var(--muted); font-size: .87rem; }
.language-note { margin: .7rem 0 0; }
.file-status { min-height: 1.35rem; margin: .25rem 0 0; color: var(--red-dark); font-size: .87rem; font-weight: 700; }
.components-section { margin: 0 var(--page-gutter); padding: 1.35rem 0 1.55rem; border-top: 1px solid #c7d1dd; }
.components-section > div:first-child > p { margin: .3rem 0 .9rem; color: var(--muted); }
.component-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .7rem; }
.check-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
  padding: .85rem;
  border: 1px solid #b7c4d2;
  background: #fff;
  cursor: pointer;
}
.check-card:has(input:checked) { border-color: var(--red); background: #fff8f8; }
.check-card input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--red); }
.check-card strong { display: block; color: var(--ink-strong); font-size: .9rem; }
.check-card small { display: block; margin-top: .15rem; color: var(--muted); font-size: .81rem; line-height: 1.35; }
.check-mark { display: none; }
.form-bottom { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem var(--page-gutter); background: var(--navy); color: #fff; }
.privacy-inline { display: flex; align-items: flex-start; gap: .55rem; max-width: 680px; margin: 0; color: #fff; font-size: .87rem; }
.privacy-inline > span:first-child { color: var(--gold); }
.form-bottom .primary-button { flex: 0 0 auto; }
.draft-workspace { margin-top: 1.4rem; padding: clamp(1rem, 2.4vw, 2rem); border: 1px solid #c7d1dd; background: #e8edf3; }
.draft-workspace[hidden] { display: none !important; }
.draft-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.draft-header h2 { margin: .2rem 0; }
.draft-header p { margin: 0; color: var(--muted); }
.save-status { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .65rem; border: 1px solid #8191a4; background: #fff; color: var(--ink-strong); font-size: .83rem; font-weight: 700; white-space: nowrap; }
.status-dot { width: .55rem; height: .55rem; border-radius: 50%; background: #257b59; }
.export-bar { margin-bottom: .9rem; padding: 1rem; border: 1px solid #c2ccd8; background: #fff; }
.export-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.export-actions .secondary-button, .import-button { min-height: 40px; padding: .55rem .72rem; font-size: .82rem; }
.import-button { position: relative; overflow: hidden; cursor: pointer; }
.import-button input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.export-note { margin: .75rem 0 0; color: var(--muted); font-size: .87rem; }
.approval-box { display: grid; gap: .5rem; margin: .8rem 0; padding: .9rem 1rem; border: 1px solid #a77b16; background: #fff8e6; color: #33280f; }
.approval-box label { display: flex; align-items: flex-start; gap: .65rem; font-weight: 650; }
.approval-box input { margin-top: .22rem; accent-color: var(--red); }
.export-gate { font-size: .86rem; font-weight: 720; }
.draft-pages { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,320px),1fr)); gap: 1rem; }
.book-page {
  position: relative;
  min-height: 430px;
  padding: 3rem 2.5rem 3.3rem;
  border: 1px solid #aebac8;
  background: #fff;
  color: #192638;
}
.cover-page { display: grid; align-content: center; text-align: center; background: var(--navy); color: #fff; }
.cover-decoration { position: absolute; inset: 16px; border: 1px solid rgba(255,255,255,.35); pointer-events: none; }
.cover-title { color: #fff; font-size: 2.4rem; }
.cover-subtitle { color: #fff; }
.cover-footer { display: flex; justify-content: space-between; gap: 1rem; position: absolute; inset-inline: 2rem; bottom: 2rem; color: #fff; font-size: .82rem; }
.page-label { color: var(--red-dark); font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.page-title { margin: .8rem 0 1rem; color: var(--ink-strong); font-size: 1.7rem; }
.page-content { min-height: 170px; white-space: pre-wrap; }
.writing-space { display: grid; gap: 1.25rem; margin-top: 1rem; }
.writing-line { min-height: 1px; border-bottom: 1px solid #bfc9d5; }
.page-number { position: absolute; inset-inline-end: 1.3rem; bottom: 1.05rem; color: #405168; font-size: .81rem; }
.remove-page { position: absolute; inset-inline-end: .8rem; top: .8rem; min-height: 34px; padding: .25rem .45rem; border: 1px solid #8d9caf; background: #fff; color: #24364a; font-size: .77rem; cursor: pointer; }
.draft-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .9rem; color: var(--muted); font-size: .86rem; }
.draft-footer p { margin: 0; }
.text-button { min-height: 38px; border: 1px solid #7d8ca0; background: transparent; color: var(--ink-strong); font-size: .84rem; }
.danger-text { border-color: #a71932; color: #a71932; }

/* Publishing Academy, responsibility, and stewardship */
.page-heading { max-width: 950px; margin: 0 0 1.8rem; }
.page-heading h1 { max-width: 900px; margin: 0 0 .55rem; }
.academy-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; background: #b8c4d2; border: 1px solid #b8c4d2; }
.learning-card { min-height: 230px; padding: 1.5rem; background: #fff; }
.learning-card h2 { margin: .75rem 0 .45rem; font-size: 1.55rem; }
.learning-card p { margin-bottom: .85rem; color: var(--muted); }
.academy-number { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 28px; border-bottom: 2px solid var(--red); color: var(--red-dark); font-size: .82rem; font-weight: 850; letter-spacing: .1em; }
.learning-card details { padding-top: .75rem; border-top: 1px solid #d8e0e8; }
.learning-card summary { color: var(--red-dark); font-size: .92rem; font-weight: 750; cursor: pointer; }
.learning-card details p { margin: .65rem 0 0; font-size: .92rem; }
.resource-panel { margin-top: 1.25rem; padding: 1.45rem; border: 1px solid #b8c4d2; background: #fff; }
.resource-panel h2 { margin: .25rem 0 1rem; font-size: 1.7rem; }
.resource-links { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .55rem; }
.resource-links a { display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-height: 54px; padding: .75rem; border: 1px solid #9eacbc; color: var(--ink-strong); font-size: .88rem; font-weight: 720; text-decoration: none; }
.resource-links a:hover { border-color: var(--red); background: #fff8f8; }
.resource-caveat { margin: .9rem 0 0; color: var(--muted); font-size: .84rem; }
.review-layout { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(250px,.85fr); align-items: start; gap: 1.1rem; }
.review-list { border: 1px solid #b8c4d2; background: #fff; }
.review-item { display: flex; gap: 1rem; padding: 1.25rem; border-bottom: 1px solid #d4dde7; }
.review-item:last-child { border-bottom: 0; }
.review-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-bottom: 2px solid var(--red); color: var(--red-dark); font-size: .8rem; font-weight: 850; }
.review-item h2 { margin: .05rem 0 .35rem; font-size: 1.3rem; }
.review-item p { margin: 0; color: var(--muted); }
.review-callout { padding: 1.4rem; border-top: 4px solid var(--red); background: var(--navy); color: #fff; }
.review-callout h2 { margin: .65rem 0 .5rem; color: #fff; font-size: 1.55rem; }
.review-callout p { color: #fff; }
.review-callout .secondary-button { border-color: #fff; color: var(--ink-strong); }
.callout-icon { color: var(--gold); font-size: 1.4rem; }
.stewardship-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; border: 1px solid #b8c4d2; background: #b8c4d2; }
.stewardship-card { padding: 1.4rem; background: #fff; }
.stewardship-symbol { display: none; }
.stewardship-card h2 { margin: .15rem 0 .5rem; font-size: 1.38rem; }
.stewardship-card p { margin: 0; color: var(--muted); }
.principle-panel { margin-top: 1.1rem; padding: clamp(1.4rem, 3vw, 2.4rem); border-inline-start: 4px solid var(--red); background: var(--navy); color: #fff; }
.principle-panel .eyebrow { color: #fff; }
.principle-panel h2 { max-width: 850px; margin: .4rem 0 .6rem; color: #fff; font-size: clamp(1.8rem,3.3vw,2.8rem); }
.principle-panel p:last-child { max-width: 850px; margin-bottom: 0; color: #fff; }

/* Shared footer and feedback */
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.1rem var(--page-gutter) 1.6rem;
  border-top: 1px solid #bfcbd8;
  color: var(--muted);
  font-size: .86rem;
}
.site-footer span:last-child { color: var(--ink-strong); font-weight: 750; }
.toast {
  position: fixed;
  inset-inline-end: 1rem;
  bottom: 1rem;
  z-index: 80;
  max-width: min(28rem, calc(100vw - 2rem));
  padding: .8rem 1rem;
  border: 1px solid #fff;
  border-inline-start: 4px solid var(--red);
  background: var(--navy);
  color: #fff;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Existing light, dark, and night viewing modes */
html[data-theme="dark"], html[data-theme="night"] {
  color-scheme: dark;
  --ink: #edf2f7;
  --ink-strong: #fff;
  --muted: #d3deea;
  --line: #34465a;
  --paper: #151f2b;
  --canvas: #0b1320;
  --navy: #07101c;
  --navy-mid: #102744;
  --focus: #ff7187;
}
html[data-theme="dark"] body, html[data-theme="night"] body { background: var(--canvas); color: var(--ink); }
html[data-theme="dark"] .topbar, html[data-theme="night"] .topbar { border-color: #2b3b4e; background: #101a26; color: #fff; }
html[data-theme="dark"] .brand, html[data-theme="night"] .brand,
html[data-theme="dark"] .brand-wording strong, html[data-theme="night"] .brand-wording strong { color: #fff; }
html[data-theme="dark"] .brand-wording small, html[data-theme="night"] .brand-wording small { color: #dbe5ef; }
html[data-theme="dark"] .language-select, html[data-theme="night"] .language-select,
html[data-theme="dark"] .icon-button, html[data-theme="night"] .icon-button,
html[data-theme="dark"] .tool-button, html[data-theme="night"] .tool-button,
html[data-theme="dark"] .menu-toggle, html[data-theme="night"] .menu-toggle { color: #fff; }
html[data-theme="dark"] .language-mark, html[data-theme="night"] .language-mark { color: #fff; }
html[data-theme="dark"] .menu-lines i, html[data-theme="night"] .menu-lines i { background: #fff; }
html[data-theme="dark"] .tool-divider, html[data-theme="night"] .tool-divider,
html[data-theme="dark"] .menu-toggle, html[data-theme="night"] .menu-toggle { border-color: #41536a; }
html[data-theme="dark"] .top-navigation, html[data-theme="night"] .top-navigation { border-color: #34465a; background: #131f2d; }
html[data-theme="dark"] .nav-button, html[data-theme="night"] .nav-button { border-color: #34465a; background: #131f2d; color: #fff; }
html[data-theme="dark"] .nav-button:hover, html[data-theme="night"] .nav-button:hover { background: #1c2d40; }
html[data-theme="dark"] .journey-band, html[data-theme="night"] .journey-band,
html[data-theme="dark"] .pathway-card, html[data-theme="night"] .pathway-card,
html[data-theme="dark"] .learning-card, html[data-theme="night"] .learning-card,
html[data-theme="dark"] .resource-panel, html[data-theme="night"] .resource-panel,
html[data-theme="dark"] .review-list, html[data-theme="night"] .review-list,
html[data-theme="dark"] .stewardship-grid, html[data-theme="night"] .stewardship-grid,
html[data-theme="dark"] .home-privacy, html[data-theme="night"] .home-privacy,
html[data-theme="dark"] .setup-card, html[data-theme="night"] .setup-card,
html[data-theme="dark"] .export-bar, html[data-theme="night"] .export-bar { background: #151f2b; border-color: #34465a; }
html[data-theme="dark"] .journey-row p, html[data-theme="night"] .journey-row p,
html[data-theme="dark"] .pathway-card > p:not(.pathway-index), html[data-theme="night"] .pathway-card > p:not(.pathway-index),
html[data-theme="dark"] .principle-grid p, html[data-theme="night"] .principle-grid p,
html[data-theme="dark"] .section-heading-row > p, html[data-theme="night"] .section-heading-row > p,
html[data-theme="dark"] .continuity-panel p, html[data-theme="night"] .continuity-panel p,
html[data-theme="dark"] .home-privacy p:last-child, html[data-theme="night"] .home-privacy p:last-child,
html[data-theme="dark"] .learning-card p, html[data-theme="night"] .learning-card p,
html[data-theme="dark"] .review-item p, html[data-theme="night"] .review-item p,
html[data-theme="dark"] .stewardship-card p, html[data-theme="night"] .stewardship-card p { color: #d3deea; }
html[data-theme="dark"] .journey-row strong, html[data-theme="night"] .journey-row strong,
html[data-theme="dark"] .pathway-card h3, html[data-theme="night"] .pathway-card h3,
html[data-theme="dark"] .principle-grid h3, html[data-theme="night"] .principle-grid h3,
html[data-theme="dark"] .home-privacy h2, html[data-theme="night"] .home-privacy h2,
html[data-theme="dark"] .continuity-panel h2, html[data-theme="night"] .continuity-panel h2,
html[data-theme="dark"] .learning-card h2, html[data-theme="night"] .learning-card h2,
html[data-theme="dark"] .resource-panel h2, html[data-theme="night"] .resource-panel h2,
html[data-theme="dark"] .review-item h2, html[data-theme="night"] .review-item h2,
html[data-theme="dark"] .stewardship-card h2, html[data-theme="night"] .stewardship-card h2 { color: #fff; }
html[data-theme="dark"] .continuity-panel, html[data-theme="night"] .continuity-panel { border-color: #34465a; background: #182c40; }
html[data-theme="dark"] .field input, html[data-theme="dark"] .field select, html[data-theme="dark"] .field textarea, html[data-theme="dark"] .source-input,
html[data-theme="night"] .field input, html[data-theme="night"] .field select, html[data-theme="night"] .field textarea, html[data-theme="night"] .source-input { border-color: #65778c; background: #0d1723; color: #fff; }
html[data-theme="dark"] .field input::placeholder, html[data-theme="dark"] .field textarea::placeholder, html[data-theme="dark"] .source-input::placeholder,
html[data-theme="night"] .field input::placeholder, html[data-theme="night"] .field textarea::placeholder, html[data-theme="night"] .source-input::placeholder { color: #d3deea; }
html[data-theme="dark"] .field, html[data-theme="night"] .field,
html[data-theme="dark"] .field small, html[data-theme="night"] .field small { color: #e7edf4; }
html[data-theme="dark"] .card-heading, html[data-theme="night"] .card-heading,
html[data-theme="dark"] .form-bottom, html[data-theme="night"] .form-bottom,
html[data-theme="dark"] .principle-panel, html[data-theme="night"] .principle-panel,
html[data-theme="dark"] .review-callout, html[data-theme="night"] .review-callout { background: #07101c; }
html[data-theme="dark"] .check-card, html[data-theme="night"] .check-card { border-color: #52657b; background: #151f2b; }
html[data-theme="dark"] .check-card:has(input:checked), html[data-theme="night"] .check-card:has(input:checked) { border-color: #f35c73; background: #2b1820; }
html[data-theme="dark"] .check-card strong, html[data-theme="night"] .check-card strong { color: #fff; }
html[data-theme="dark"] .check-card small, html[data-theme="night"] .check-card small,
html[data-theme="dark"] .file-support, html[data-theme="night"] .file-support,
html[data-theme="dark"] .language-note, html[data-theme="night"] .language-note { color: #d3deea; }
html[data-theme="dark"] .source-count, html[data-theme="night"] .source-count,
html[data-theme="dark"] .save-status, html[data-theme="night"] .save-status { border-color: #66788c; background: #182535; color: #fff; }
html[data-theme="dark"] .approval-box, html[data-theme="night"] .approval-box { border-color: #d6b45f; background: #322913; color: #fff2cc; }
html[data-theme="dark"] .secondary-button, html[data-theme="night"] .secondary-button,
html[data-theme="dark"] .text-button, html[data-theme="night"] .text-button { border-color: #8ea0b5; background: #172537; color: #fff; }
html[data-theme="dark"] .book-page, html[data-theme="night"] .book-page { border-color: #9aa6b4; background: #fff; color: #192638; }
html[data-theme="dark"] .site-footer, html[data-theme="night"] .site-footer { border-color: #34465a; color: #d3deea; }
html[data-theme="dark"] .site-footer span:last-child, html[data-theme="night"] .site-footer span:last-child { color: #fff; }

/* Responsive layout keeps controls and headings intact */
@media (max-width: 1120px) {
  .pathway-grid, .principle-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pathway-card:nth-child(3) { border-inline-start: 0; }
  .pathway-card > p:not(.pathway-index) { min-height: 0; }
  .continuity-panel { grid-template-columns: 1fr 1.1fr; }
  .continuity-panel .hero-link { grid-column: 1 / -1; }
  .top-tools { gap: .12rem; }
  .tool-button { padding-inline: .35rem; }
}
@media (max-width: 800px) {
  .topbar { flex-wrap: wrap; min-height: 72px; }
  .top-tools { gap: .12rem; }
  .top-navigation { inset-inline-end: 1rem; }
  .studio-heading { align-items: flex-start; }
  .principle-badge { display: none; }
  .resource-links { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .review-layout { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  :root { --page-gutter: 1rem; }
  .topbar { gap: .35rem; padding: .65rem 1rem; }
  .brand { flex: 1 1 100%; }
  .top-tools { justify-content: space-between; width: 100%; }
  .tool-divider { display: none; }
  .tool-button { min-width: 38px; padding: .25rem .35rem; }
  .tool-button [data-i18n] { display: none; }
  .language-select { max-width: 100px; }
  .icon-button { min-width: 34px; }
  .top-navigation { grid-template-columns: 1fr; width: min(420px, calc(100vw - 2rem)); }
  .nav-button:last-child { grid-column: auto; }
  .public-hero { min-height: min(780px, max(620px, calc(100svh - 116px))); padding-block: 4rem 3.5rem; }
  .hero-art { object-position: 63% center; }
  .public-hero::after {
    background:
      linear-gradient(90deg, rgba(3,12,24,.78), rgba(4,14,28,.42)),
      linear-gradient(180deg, rgba(3,11,22,.42), rgba(3,11,22,.62));
  }
  .hero-copy .eyebrow { font-size: .68rem; letter-spacing: .12em; }
  .hero-copy .eyebrow::before, .hero-copy .eyebrow::after { width: 18px; margin-inline: .38rem; }
  .hero-title { font-size: clamp(2.2rem, 10vw, 4rem); }
  .hero-lede { font-size: 1rem; }
  .hero-actions { align-items: stretch; flex-direction: column; width: min(100%, 340px); margin-inline: auto; }
  .hero-primary, .hero-secondary { width: 100%; min-width: 0; }
  .hero-assurance { max-width: 34rem; font-size: .83rem; }
  .journey-inner { grid-template-columns: 1fr; padding-block: 1.3rem; }
  .journey-kicker { margin-bottom: .35rem; }
  .journey-row { padding: .75rem 0; }
  .section-heading-row { display: block; }
  .section-heading-row > p { margin-top: .8rem; }
  .pathway-grid, .principle-grid { grid-template-columns: 1fr; }
  .pathway-card, .pathway-card + .pathway-card { padding: 1.1rem 0; border-inline-start: 0; }
  .pathway-card > p:not(.pathway-index) { min-height: 0; }
  .heartwork-band { grid-template-columns: 1fr; }
  .heartwork-cta { width: 100%; }
  .continuity-panel { grid-template-columns: 1fr; }
  .continuity-panel .hero-link { grid-column: auto; }
  .home-privacy, .home-privacy > div { align-items: flex-start; }
  .home-privacy { flex-direction: column; }
  .studio-heading { display: block; }
  .workflow-rail { gap: .55rem; padding-inline: .7rem; }
  .workflow-step { font-size: .81rem; }
  .workflow-step b { width: 26px; height: 26px; }
  .form-grid, .component-grid, .academy-grid, .stewardship-grid { grid-template-columns: 1fr; }
  .form-note { font-size: .78rem; }
  .source-heading { display: block; }
  .source-count { display: inline-flex; margin-top: .7rem; }
  .source-actions { align-items: flex-start; flex-direction: column; }
  .form-bottom, .draft-header, .draft-footer { align-items: stretch; flex-direction: column; }
  .form-bottom .primary-button { width: 100%; }
  .export-actions > * { flex: 1 1 45%; }
  .approval-box label { font-size: .9rem; }
  .book-page { min-height: 370px; padding: 2.6rem 1.5rem 3rem; }
  .resource-links { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media print {
  body { background: #fff !important; color: #000 !important; }
  .topbar, .site-footer, .studio-heading, .workflow-rail, #setupForm,
  .draft-header, .export-bar, .approval-box, .draft-footer, .remove-page, .toast { display: none !important; }
  .view { width: 100%; padding: 0; }
  .draft-workspace { margin: 0; padding: 0; border: 0; background: #fff; }
  .draft-pages { display: block; }
  .book-page { min-height: 0; margin: 0; border: 0; break-after: page; page-break-after: always; }
}
