:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #203037;
  background: #edf1f2;
  font-synthesis: none;
}
select#language {
  min-height: 37px;
  border: 1px solid #cbd7d9;
  border-radius: 4px;
  background: #fff;
  color: #253c43;
  padding: 0 7px;
  font-size: 12px;
}
.short-label {
  display: none;
}
.sheet h2.long-title {
  font-size: clamp(18px, 2vw, 30px);
  overflow-wrap: anywhere;
}
.file-review details {
  margin-top: 9px;
}
.file-review summary {
  cursor: pointer;
  font-weight: 750;
  color: #236d59;
}
.file-review pre {
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #fff;
  padding: 9px;
  border: 1px solid #d7e4dc;
  font-size: 11px;
}
.book-scope {
  margin: 18px 0 22px;
  border-top: 1px solid #d9e3e5;
  padding-top: 15px;
}
.book-scope summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
}
.book-scope summary::marker { color: #316e55; }
.book-scope p {
  color: #56666c;
  font-size: 12px;
  line-height: 1.45;
}
.book-scope .field { margin-bottom: 9px; }
.book-scope .quiet { width: 100%; margin-bottom: 9px; }
.scope-list {
  max-height: 220px;
  overflow: auto;
  border: 1px solid #d7e2e4;
  border-radius: 4px;
  background: #fff;
}
.scope-person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
}
.scope-person + .scope-person { border-top: 1px solid #edf1f2; }
.scope-person:hover { background: #f1f7f4; }
.scope-person input { flex: 0 0 auto; }
.brand .brand-name {
  border: 0;
  padding: 0;
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}
.cover .cover-title,
.cover .cover-subtitle {
  max-width: 55%;
  position: relative;
  z-index: 1;
}
.cover .cover-art {
  right: 5%;
  top: 24%;
  width: 42%;
  height: 46%;
  border: 0;
  border-radius: 0;
  opacity: 0.48;
}
.cover .cover-art::before,
.cover .cover-art::after {
  display: none;
}
.cover .cover-art svg {
  width: 100%;
  height: 100%;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}
a {
  color: inherit;
}
.topbar {
  height: 68px;
  background: #fff;
  border-bottom: 1px solid #dce3e5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 850;
  white-space: nowrap;
}
.brand img {
  width: 29px;
  height: 29px;
}
.brand span {
  font-size: 13px;
  font-weight: 650;
  color: #6c7c81;
  border-left: 1px solid #d5dcde;
  padding-left: 11px;
  margin-left: 2px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 11px;
}
.account-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 180px;
}
.account-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-save-top {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.project-save-icon {
  font-size: 16px;
  line-height: 1;
}
.project-state-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #2c8063;
}
.project-save-top[data-status="dirty"] .project-state-dot { background: #b06f2e; }
.account-icon {
  position: relative;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.account-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 3px;
  width: 4px;
  height: 4px;
  border: 1.3px solid currentColor;
  border-radius: 50%;
  transform: translateX(-50%);
}
.account-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 8px;
  height: 4px;
  border: 1.3px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  transform: translateX(-50%);
}
.beta-tag {
  font-size: 12px;
  color: #267055;
  background: #e6f3eb;
  padding: 7px 10px;
  border-radius: 4px;
  font-weight: 750;
}
.mobile-offer-status { display: none; }
.primary,
.quiet {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 8px 14px;
  font-weight: 750;
}
.primary {
  background: #236d59;
  color: #fff;
}
.primary:hover {
  background: #1a5948;
}
.quiet {
  background: #fff;
  color: #253c43;
  border-color: #cbd7d9;
}
.quiet:hover {
  background: #f4f7f7;
}
.workspace {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  min-height: calc(100vh - 68px);
}
.editor {
  background: #fff;
  border-right: 1px solid #dce3e5;
  padding: 29px 24px 48px;
  overflow-y: auto;
}
.section-heading > span,
.modal-eyebrow {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #66827b;
  font-weight: 850;
}
.section-heading h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  line-height: 1.1;
  margin: 8px 0;
}
.section-heading p {
  color: #718084;
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 24px;
}
.section-heading.small h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  margin: 7px 0 18px;
}
.field {
  display: block;
  font-size: 12px;
  font-weight: 750;
  color: #465a5f;
  margin: 0 0 17px;
}
[hidden] { display: none !important; }
.field input,
.field select {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 9px 10px;
  background: #fff;
  border: 1px solid #ccd8da;
  border-radius: 4px;
  color: #203037;
  min-height: 39px;
}
.field input:focus,
.field select:focus {
  outline: 2px solid #81b6a3;
}
.format-field { border: 0; padding: 0; margin: 0 0 17px; min-width: 0; }
.format-field legend { font-size: 12px; font-weight: 750; color: #465a5f; margin-bottom: 7px; }
.template-field { border: 0; padding: 0; margin: 0 0 17px; min-width: 0; }
.template-field legend { font-size: 12px; font-weight: 750; color: #465a5f; margin-bottom: 8px; }
.template-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.template-picker label { position: relative; min-width: 0; cursor: pointer; }
.template-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.template-choice {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
  padding: 7px 5px 6px;
  border: 1px solid #ccd8da;
  border-radius: 4px;
  background: #fff;
  color: #405259;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.15;
  text-align: center;
}
.template-picker input:checked + .template-choice { border-color: #276550; box-shadow: inset 0 0 0 1px #276550; color: #174c3d; background: #f4f9f7; }
.template-picker input:focus-visible + .template-choice { outline: 2px solid #81b6a3; outline-offset: 2px; }
.template-sheet { position: relative; display: block; width: 42px; height: 58px; overflow: hidden; border: 1px solid #cdd6d4; background: #faf9f5; box-shadow: 0 2px 5px rgba(28, 49, 45, .12); }
.template-sheet i, .template-sheet b, .template-sheet em { position: absolute; display: block; margin: 0; }
.template-sheet-heritage { border-left: 4px solid #245744; }
.template-sheet-heritage i { left: 10px; top: 11px; width: 21px; height: 23px; background: #173f31; border: 1px solid #b7843e; }
.template-sheet-heritage b { left: 7px; right: 4px; top: 40px; height: 3px; background: #245744; }
.template-sheet-heritage em { left: 12px; right: 9px; top: 47px; height: 1px; background: #b7843e; }
.template-sheet-modern i { left: 5px; right: 5px; top: 8px; height: 1px; background: #b7843e; }
.template-sheet-modern b { left: 5px; top: 22px; width: 27px; height: 8px; border-top: 3px solid #245744; border-bottom: 3px solid #245744; }
.template-sheet-modern em { left: 0; right: 0; bottom: 0; height: 14px; background: #245744; }
.template-sheet-botanical { background: #14261f; border-color: #355a4c; }
.template-sheet-botanical i { left: 8px; right: 8px; top: 8px; height: 22px; border: 1px solid #b7843e; background: #263d31; }
.template-sheet-botanical b { left: 0; right: 0; bottom: 0; height: 20px; background: #245744; }
.template-sheet-botanical em { left: 7px; right: 7px; bottom: 11px; height: 2px; background: #f4f0e6; }
.format-segments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid #ccd8da; border-radius: 4px; overflow: hidden; }
.format-segments label { position: relative; min-width: 0; cursor: pointer; }
.format-segments label + label { border-left: 1px solid #ccd8da; }
.format-segments input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.format-segments span { display: grid; place-items: center; min-height: 39px; padding: 5px; font-size: 12px; line-height: 1.2; text-align: center; color: #334850; }
.format-segments input:checked + span { color: #fff; background: #276550; font-weight: 750; }
.format-segments input:focus-visible + span { outline: 2px solid #81b6a3; outline-offset: -2px; }
.person-fields {
  margin: -5px 0 17px;
  border-top: 1px solid #e5e9e9;
  border-bottom: 1px solid #e5e9e9;
}
.person-fields summary {
  padding: 11px 0;
  color: #236d59;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.person-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 10px;
}
.person-field-grid .field:last-child { grid-column: 1 / -1; }
.divider {
  height: 1px;
  background: #e5e9e9;
  margin: 24px 0;
}
.palette-row {
  display: flex;
  gap: 10px;
  margin-top: 11px;
}
.swatch {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #c6d1d1;
  padding: 0;
}
.swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 2px #243b40;
}
.page-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
}
.page-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #dde5e6;
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
  font-weight: 750;
  cursor: grab;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.page-list li.dragging {
  opacity: 0.5;
}
.page-list .grip {
  color: #9daeb0;
}
.page-list .num {
  color: #77908a;
  font-size: 11px;
}
.page-list .chapter-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chart-row { gap: 5px !important; }
.chart-row:not([draggable="true"]) { cursor: default !important; }
.chart-row .grip { flex: none; }
.chart-row-select {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  color: #29443e;
  text-align: left;
  font: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.chart-row-select[aria-current="true"] { color: #17634f; }
.chart-row:has(.chart-row-select[aria-current="true"]) { border-color: #327665; background: #f1f8f5; }
.chart-row-action, .chart-row-remove {
  flex: none;
  width: 26px;
  height: 26px;
  border: 1px solid #d6e0dd;
  border-radius: 3px;
  background: #fff;
  color: #5a6b68;
  font-size: 20px;
  line-height: 20px;
  cursor: pointer;
}
.chart-row-action { font-size: 17px; }
.chart-row-action:disabled { opacity: 0.35; cursor: default; }
#add-chart { margin: 12px 0 18px; }
.chart-capacity {
  margin: -9px 0 14px;
  padding-left: 18px;
  color: #27664f;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  position: relative;
}
.chart-capacity::before {
  content: "";
  position: absolute;
  left: 1px;
  top: .34em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2c8063;
}
.chart-capacity[data-status="invalid"] { color: #9b3e32; }
.chart-capacity[data-status="invalid"]::before { background: #b74b3f; }
.chart-row[data-status="invalid"] { border-color: #d9a39d; background: #fff7f5; }
.chart-photo-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 17px;
  color: #334d50;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.chart-photo-toggle input {
  flex: none;
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #236d59;
}
.chart-photo-toggle input:focus-visible { outline: 2px solid #81b6a3; outline-offset: 2px; }
.import-summary {
  display: grid;
  gap: 4px;
  font-size: 12px;
}
.import-summary span {
  color: #738287;
}
.link-button {
  border: 0;
  background: none;
  padding: 8px 0;
  color: #236d59;
  text-align: left;
  font-weight: 800;
  font-size: 12px;
}
.preview-area {
  min-width: 0;
  padding: 25px 28px 48px;
}
.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1140px;
  margin: 0 auto 20px;
}
.preview-head > div:first-child {
  display: grid;
  gap: 3px;
}
.preview-actions { display: flex; align-items: center; gap: 8px; }
.cancel-render { color: #8b3434; border-color: #cfa9a9; }
.cancel-render:hover { background: #fff4f4; }
.preview-head strong {
  font-size: 14px;
}
.preview-head span {
  font-size: 12px;
  color: #74858a;
}
.book-check {
  width: min(100%, 960px);
  margin: -4px auto 16px;
  padding: 12px 0;
  border-top: 1px solid #d2dcde;
  border-bottom: 1px solid #d2dcde;
}
.book-check header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.book-check header strong { font-size: 12px; color: #29423e; }
.book-check header span { font-size: 11px; color: #6a7c80; text-align: right; }
.book-check[data-state="checking"] header span { color: #7a5d2c; }
.book-check[data-state="current"] header span { color: #24634f; }
.book-check dl {
  display: grid;
  grid-template-columns: .55fr 1fr 1.55fr 1.25fr 1.35fr;
  gap: 0;
  margin: 0;
}
.book-check dl > div {
  min-width: 0;
  padding: 0 12px;
  border-left: 1px solid #dbe3e4;
}
.book-check dl > div:first-child { padding-left: 0; border-left: 0; }
.book-check dt {
  margin-bottom: 4px;
  color: #718185;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.book-check dd {
  position: relative;
  margin: 0;
  padding-left: 13px;
  color: #344b4d;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.book-check dd::before {
  content: "";
  position: absolute;
  left: 0;
  top: .34em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa7a9;
}
.book-check dd[data-status="ready"]::before { background: #2c8063; }
.book-check dd[data-status="warning"]::before { background: #b37a34; }
.pages {
  display: grid;
  gap: 26px;
  justify-items: center;
}
.field textarea {
  display: block;
  width: 100%;
  min-height: 138px;
  margin-top: 7px;
  padding: 10px;
  resize: vertical;
  background: #fff;
  border: 1px solid #ccd8da;
  border-radius: 4px;
  color: #203037;
  font: inherit;
  font-weight: 400;
  line-height: 1.5;
}
.field textarea:focus { outline: 2px solid #81b6a3; }
.dedication-field textarea { min-height: 82px; }
.foreword-field textarea { min-height: 116px; }
.photo-status, .send-notice { color: #667a7d; font-size: 12px; line-height: 1.5; }
.photo-status { margin: -10px 0 14px; }
.photo-crop:not([hidden]) { display: flex; align-items: flex-start; gap: 16px; margin: 1px 0 18px; }
.photo-crop-preview { flex: 0 0 88px; height: 108px; overflow: hidden; background: #e9efec; }
.photo-crop-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-crop-controls { flex: 1; min-width: 0; }
.photo-crop-controls label { display: block; margin-bottom: 7px; color: #375453; font-size: 12px; font-weight: 600; }
.photo-crop-controls input { display: block; width: 100%; margin: 3px 0 0; accent-color: #1e715d; }
.photo-crop-controls .link-button { padding: 0; font-size: 12px; }
.album-add { display: block; position: relative; border: 1px solid #b8cec5; color: #24634f; padding: 11px 12px; font-size: 12px; font-weight: 800; cursor: pointer; margin: 0 0 14px; }
.album-add:focus-within { outline: 2px solid #81b6a3; }
.album-add input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.album-list { list-style: none; margin: 0 0 18px; padding: 0; }
.album-list li { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid #e0e7e6; }
.album-list img { display: block; width: 66px; height: 76px; object-fit: contain; background: #edf1ee; }
.album-details { min-width: 0; }
.album-details label { display: block; color: #465a5f; font-size: 11px; font-weight: 700; }
.album-details input { width: 100%; min-height: 34px; margin-top: 4px; padding: 6px 8px; border: 1px solid #ccd8da; border-radius: 4px; color: #203037; }
.album-quality { display: block; margin-top: 5px; color: #687c79; font-size: 11px; }
.album-controls { display: flex; gap: 5px; margin-top: 6px; }
.album-controls button { width: 28px; height: 28px; border: 1px solid #d8e2df; background: #fff; color: #236d59; padding: 0; font-size: 16px; }
.album-controls button:disabled { opacity: .4; }
.local-draft { border-top: 1px solid #dce5e3; margin-top: 12px; padding-top: 13px; display: grid; gap: 6px; }
.local-draft label { display: flex; align-items: flex-start; gap: 8px; color: #294840; font-size: 12px; font-weight: 700; line-height: 1.4; }
.local-draft label span { color: #294840; }
.local-draft input { margin: 2px 0 0; accent-color: #24634f; }
.local-draft #draft-status { color: #63777a; font-size: 11px; line-height: 1.4; }
.draft-actions:not([hidden]) { display: flex; flex-wrap: wrap; gap: 10px; }
.draft-actions .link-button { font-size: 11px; padding: 0; }
.print-check { border-top: 1px solid #dce5e3; padding-top: 15px; color: #506467; font-size: 12px; line-height: 1.45; }
.print-check strong { color: #294840; font-size: 12px; }
.print-check[data-status="warning"] strong { color: #9b4c32; }
.print-check p { margin: 5px 0 0; }
.print-check ul { margin: 7px 0 0; padding-left: 17px; }
.print-check li + li { margin-top: 4px; }
.send-notice { border-left: 2px solid #b78848; padding-left: 10px; margin: 18px 0; }
.preview-command { width: 100%; min-height: 42px; }
.pdf-toolbar {
  width: min(100%, 960px);
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #465a5f;
  font-size: 13px;
}
.pdf-toolbar button {
  width: 32px;
  height: 32px;
  border: 1px solid #cbd7d9;
  border-radius: 4px;
  background: white;
  color: #253c43;
  font-size: 24px;
  line-height: 1;
}
.pdf-toolbar button:disabled { opacity: .4; }
.pdf-view-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-right: 8px;
  border: 1px solid #cbd7d9;
  border-radius: 4px;
  overflow: hidden;
}
.pdf-toolbar .pdf-view-mode button {
  width: auto;
  min-width: 60px;
  height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 0;
  background: #fff;
  font-size: 11px;
  font-weight: 750;
}
.pdf-toolbar .pdf-view-mode button + button { border-left: 1px solid #cbd7d9; }
.pdf-toolbar .pdf-view-mode button[aria-pressed="true"] { background: #295f4e; color: #fff; }
.pdf-toolbar select {
  margin-left: 14px;
  padding: 5px 8px;
  border: 1px solid #cbd7d9;
  border-radius: 4px;
  background: white;
}
.pdf-stage {
  position: relative;
  display: block;
  width: min(100%, 960px);
  min-height: 520px;
  height: calc(100vh - 285px);
  margin: 0 auto;
  background: #e9edf0;
  border: 1px solid #dce3e5;
  overflow: auto;
  padding: 20px;
}
.pdf-canvases { display: flex; align-items: center; justify-content: center; gap: 4px; min-width: min-content; min-height: 100%; }
.pdf-stage canvas { display: block; flex: none; max-width: none; box-shadow: 0 7px 27px #182d3529; background: #fff; }
.preview-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  background: #ffffffed;
  color: #526a6c;
  font-size: 14px;
}
.preview-placeholder[hidden] { display: none; }
.preview-progress { display: grid; justify-items: center; gap: 14px; max-width: 320px; }
.preview-progress strong { color: #314f50; font-size: 14px; font-weight: 700; }
.preview-progress > span { min-height: 18px; color: #718486; font-variant-numeric: tabular-nums; }
.preview-progress-sheet {
  width: 116px;
  aspect-ratio: 210 / 297;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 22px 18px;
  background: #fff;
  border: 1px solid #cbd6d4;
  border-left: 5px solid #316e55;
  box-shadow: 0 10px 26px #203b3a1c;
}
.preview-progress-sheet i { display: block; height: 3px; background: #d8e0dd; }
.preview-progress-sheet i:first-child { width: 52%; height: 30px; justify-self: center; border: 1px solid #bdcbc6; background: #eef2ef; }
.preview-progress-sheet i:nth-child(3) { width: 78%; }
.preview-progress-sheet i:nth-child(4) { width: 58%; }
.preview-placeholder[data-busy="true"] .preview-progress-sheet i { animation: preview-pulse 1.4s ease-in-out infinite alternate; }
@keyframes preview-pulse { from { opacity: .42; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .preview-placeholder[data-busy="true"] .preview-progress-sheet i { animation: none; } }
@media (max-width: 850px) {
  .book-check dl { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
  .book-check dl > div { border-left: 0; padding: 0 8px 0 0; }
  .book-check dl > div:last-child { grid-column: 1 / -1; }
  .pdf-view-mode { display: none; }
  .pdf-stage { height: 78vh; min-height: 500px; }
}
@media (max-width: 540px) {
  .book-check header { display: grid; gap: 3px; }
  .book-check header span { text-align: left; }
  .person-field-grid { grid-template-columns: minmax(0, 1fr); }
  .person-field-grid .field:last-child { grid-column: auto; }
  .pdf-stage { height: 70vh; min-height: 440px; }
}
.sheet {
  position: relative;
  width: min(100%, 1100px);
  aspect-ratio: 297/210;
  background: #fff;
  box-shadow: 0 9px 30px #182d3520;
  overflow: hidden;
  color: var(--ink);
}
.sheet-inner {
  position: absolute;
  inset: 0;
  padding: 5.4% 6.2%;
  display: flex;
  flex-direction: column;
}
.sheet::after {
  content: "FAMISTRY BETA PREVIEW  •  FAMISTRY BETA PREVIEW";
  position: absolute;
  left: -11%;
  top: 45%;
  width: 122%;
  transform: rotate(-24deg);
  font-weight: 900;
  font-size: clamp(15px, 3vw, 36px);
  letter-spacing: 2px;
  text-align: center;
  color: #294b3b22;
  pointer-events: none;
  white-space: nowrap;
}
.sheet-number {
  margin-top: auto;
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
}
.sheet.cover {
  background: var(--paper);
}
.cover .sheet-inner {
  padding: 6% 7%;
}
.cover-top {
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--accent);
}
.cover-rule {
  width: 70px;
  height: 3px;
  background: var(--accent);
  margin-top: 19px;
}
.cover-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 5vw, 76px);
  line-height: 1.06;
  max-width: 75%;
  margin: 14% 0 15px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.cover-subtitle {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--accent);
  font-size: clamp(15px, 2vw, 27px);
  max-width: 70%;
  line-height: 1.3;
}
.cover-art {
  position: absolute;
  right: 8%;
  top: 19%;
  width: 19%;
  height: 42%;
  border: 2px solid var(--accent);
  border-radius: 50% 50% 0 0;
  opacity: 0.65;
}
.cover-art::before,
.cover-art::after {
  content: "";
  position: absolute;
  border: 1px solid var(--accent);
  border-radius: 50% 50% 0 0;
  inset: 12% 15% 0;
}
.cover-art::after {
  inset: 27% 30% 0;
}
.cover-foot {
  margin-top: auto;
  border-top: 1px solid var(--accent);
  padding-top: 14px;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.sheet h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: clamp(24px, 3vw, 43px);
  margin: 2px 0 8px;
}
.sheet-kicker {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 850;
}
.sheet-lead {
  color: #69777b;
  font-size: 12px;
  line-height: 1.5;
  margin: 0 0 12px;
}
.chart-frame {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-top: 1px solid #dae2df;
  border-bottom: 1px solid #dae2df;
  padding: 10px 0;
}
.chart-frame svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.person-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
}
.person-card {
  stroke: var(--accent);
  stroke-width: 1.2;
  fill: var(--card);
}
.person-name {
  font-family: Georgia, "Times New Roman", serif;
  fill: var(--ink);
  font-size: 12px;
  font-weight: bold;
}
.person-years {
  fill: #66777b;
  font-size: 9px;
}
.person-marker {
  fill: var(--accent);
}
.roster {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 20px;
  overflow: hidden;
  margin-top: 17px;
}
.roster-person {
  min-width: 0;
  padding: 8px 0;
  border-top: 1px solid #d9e3df;
}
.roster-person strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.roster-person small {
  display: block;
  color: #6c777a;
  font-size: 10px;
  margin-top: 3px;
}
.roster-person p {
  font-size: 10px;
  line-height: 1.4;
  margin: 5px 0;
  color: #4f6064;
}
.print-note {
  text-align: center;
  color: #75878a;
  font-size: 12px;
  margin: 23px 0;
}
.theme-forest {
  --paper: #f1f5ee;
  --ink: #1b3730;
  --accent: #316e55;
  --card: #f4faf4;
}
.theme-ink {
  --paper: #f5f6f6;
  --ink: #222d35;
  --accent: #344b5f;
  --card: #f5f8fa;
}
.theme-rose {
  --paper: #faf2f1;
  --ink: #443039;
  --accent: #9c5b63;
  --card: #fff8f8;
}
.template-modern .cover-title,
.template-modern h2,
.template-modern .roster-person strong,
.template-modern .person-name {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 750;
}
.template-modern .cover-art {
  border-radius: 2px;
  transform: rotate(14deg);
}
.template-botanical .cover-art {
  border-radius: 50% 0 50% 0;
  transform: rotate(-22deg);
}
.compact .person-name {
  font-size: 11px;
}
.import-dialog {
  width: min(620px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
  border: 0;
  border-radius: 7px;
  padding: 31px;
  box-shadow: 0 25px 75px #15292c55;
}
.import-dialog::backdrop {
  background: #15292c88;
}
.dialog-close {
  float: right;
  border: 0;
  background: #eef3f3;
  border-radius: 4px;
  font-size: 24px;
  width: 33px;
  height: 33px;
  line-height: 20px;
  color: #425658;
}
.import-dialog h2 {
  font:
    normal 30px Georgia,
    serif;
  margin: 8px 0;
}
.import-dialog p {
  font-size: 13px;
  line-height: 1.6;
  color: #55696e;
}
.payload-dialog .payload-summary {
  margin: 20px 0 12px;
  padding: 14px 0;
  border-top: 1px solid #d7e4dc;
  border-bottom: 1px solid #d7e4dc;
  color: #253c43;
  font-weight: 700;
}
.payload-dialog .payload-excluded { margin-bottom: 20px; }
.payload-exact summary { cursor: pointer; color: #236d59; font-size: 13px; font-weight: 750; }
.payload-dialog pre {
  max-height: min(58vh, 560px);
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid #d7e4dc;
  background: #f7faf8;
  padding: 13px;
  font-size: 11px;
  line-height: 1.5;
}
.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 19px 0;
}
.review-grid > div {
  background: #f3f7f6;
  padding: 14px;
  border-left: 3px solid #5a9a7c;
}
.review-grid strong {
  font-size: 13px;
}
.review-grid p {
  margin: 4px 0 0;
}
.file-warning {
  border-left: 3px solid #d29a56;
  padding: 4px 0 4px 12px;
}
.file-picker {
  display: block;
  position: relative;
  border: 1px dashed #9bb5ae;
  background: #f8fbf9;
  padding: 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.file-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}
.file-review {
  background: #edf6f0;
  border-radius: 4px;
  padding: 12px;
  font-size: 12px;
  margin-top: 12px;
  line-height: 1.5;
}
.consent {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12px;
  margin: 17px 0;
  line-height: 1.5;
}
.consent input {
  margin-top: 2px;
}
.dialog-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.error {
  color: #a53737 !important;
  min-height: 1em;
  margin-bottom: 0 !important;
}
.account-dialog {
  width: min(92vw, 450px);
  max-height: calc(100dvh - 38px);
  overflow: auto;
  border: 0;
  border-radius: 7px;
  padding: 29px;
  color: #203037;
  box-shadow: 0 24px 80px #172d3540;
}
.account-dialog::backdrop { background: #1b2c3199; }
.account-dialog h2 { margin: 7px 0 8px; font: 700 26px/1.2 Georgia, serif; }
.account-intro, .account-member p { color: #596b70; font-size: 13px; line-height: 1.5; }
.account-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin: 22px 0 18px;
  padding: 3px;
  border-radius: 5px;
  background: #edf2f1;
}
.account-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #607175;
  font-weight: 750;
}
.account-tabs button[aria-selected="true"] { background: #fff; color: #225b49; box-shadow: 0 1px 4px #243b3b18; }
#account-form .field { margin-bottom: 13px; }
#account-form .primary { width: 100%; margin-top: 4px; }
.account-note, .account-legal { color: #718085; font-size: 11px; line-height: 1.45; }
.account-legal { margin-bottom: 7px; }
.account-legal-links { display: flex; gap: 14px; font-size: 11px; color: #24674d; }
.account-error { min-height: 18px; font-size: 12px; }
.account-notice { min-height: 18px; color: #24674d; font-size: 12px; }
.account-link { display: block; width: 100%; margin-top: 10px; border: 0; background: transparent; color: #24674d; font-size: 12px; text-decoration: underline; }
.account-identity { display: flex; align-items: center; gap: 13px; margin: 24px 0 15px; }
.account-identity > div { min-width: 0; }
.account-identity .large { width: 38px; height: 38px; flex-basis: 38px; color: #24674d; }
.account-identity .large::before { top: 7px; width: 9px; height: 9px; border-width: 2px; }
.account-identity .large::after { bottom: 5px; width: 19px; height: 10px; border-width: 2px; border-bottom: 0; }
.account-identity strong, .account-identity span { display: block; }
.account-identity strong { overflow-wrap: anywhere; }
.account-identity span { margin-top: 3px; color: #718085; font-size: 11px; }
.account-member .quiet { width: 100%; margin-top: 8px; }
.account-data { margin: 21px 0; padding-top: 17px; border-top: 1px solid #dfe7e6; }
.account-data h3 { margin: 0 0 8px; font-size: 13px; }
.account-data .quiet { display: flex; align-items: center; justify-content: center; gap: 8px; }
.account-data .quiet::before { content: "\2193"; font-size: 16px; line-height: 1; }
.account-delete-open { width: 100%; margin-top: 10px; border: 0; background: transparent; color: #9b3030; font-size: 12px; text-decoration: underline; }
.account-delete-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid #e6d6d6; }
.account-delete-form h3 { margin: 0 0 7px; color: #7e2525; font-size: 14px; }
.account-delete-form .field { margin: 13px 0; }
.account-delete-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.account-delete-actions .quiet { margin: 0; }
.account-delete-actions .danger { border: 0; border-radius: 4px; background: #a53737; color: #fff; font-weight: 750; }
@media (max-width: 400px) {
  .account-delete-actions { grid-template-columns: 1fr; }
}
.account-orders { margin: 21px 0; padding-top: 17px; border-top: 1px solid #dfe7e6; }
.account-orders h3 { margin: 0 0 8px; font-size: 13px; }
.account-notifications { display: grid; gap: 9px; margin: 21px 0; padding-top: 17px; border-top: 1px solid #dfe7e6; }
.account-notifications h3 { margin: 0; font-size: 13px; }
.account-notifications label { display: flex; align-items: center; gap: 9px; color: #30484d; font-size: 13px; }
.account-notifications input { width: 17px; height: 17px; accent-color: #24765d; }
.account-orders ol { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.account-order { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; padding: 9px 10px; border: 1px solid #dce5e3; border-radius: 4px; background: #f8faf9; font-size: 11px; }
.account-order strong { font-size: 12px; color: #294b41; }
.account-order span { color: #68797d; }
@media (max-width: 850px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .editor {
    border-right: 0;
    border-bottom: 1px solid #dce3e5;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
  }
  .editor > .divider {
    grid-column: 1/-1;
    margin: 10px 0 18px;
  }
  .section-heading {
    grid-column: 1/-1;
  }
  .palette-row {
    margin-bottom: 10px;
  }
  .page-list {
    grid-column: 1/-1;
  }
  .album-add, .album-list { grid-column: 1/-1; }
  .import-summary {
    grid-column: 1/-1;
  }
  .preview-area {
    padding: 22px 12px;
  }
  .sheet {
    min-width: 0;
  }
}
@media (max-width: 540px) {
  .topbar {
    padding: 0 12px;
    height: 60px;
  }
  .brand span,
  .beta-tag,
  .full-label {
    display: none;
  }
  .short-label {
    display: inline;
  }
  .top-actions {
    gap: 5px;
  }
  .top-actions button {
    font-size: 11px;
    padding: 7px 8px;
    white-space: nowrap;
  }
  .account-button { width: 36px; padding: 7px 9px !important; }
  .account-label { display: none; }
  .editor {
    padding: 20px 15px;
    grid-template-columns: 1fr;
  }
  .review-grid {
    grid-template-columns: 1fr;
  }
  .sheet .sheet-inner {
    padding: 5%;
  }
  .sheet-kicker {
    font-size: 7px;
  }
  .sheet h2 {
    font-size: 19px;
  }
  .sheet-lead {
    font-size: 8px;
    margin-bottom: 4px;
  }
  .roster {
    gap: 2px 7px;
    margin-top: 5px;
  }
  .roster-person strong {
    font-size: 7px;
  }
  .roster-person small,
  .roster-person p {
    font-size: 6px;
  }
  .cover-title {
    margin-top: 16%;
    font-size: 29px;
  }
  .cover-subtitle {
    font-size: 13px;
  }
  .cover-top,
  .cover-foot {
    font-size: 8px;
  }
  .preview-head {
    padding: 0 4px;
  }
  .preview-head span {
    max-width: 190px;
  }
  }
@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }
  html,
  body {
    background: #fff !important;
  }
  .topbar,
  .mobile-offer-status,
  .editor,
  .preview-head,
  .print-note {
    display: none !important;
  }
  .workspace,
  .preview-area,
  .pages {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .sheet {
    width: 297mm !important;
    height: 210mm !important;
    aspect-ratio: auto !important;
    break-after: page;
    page-break-after: always;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .sheet:last-child {
    break-after: auto;
    page-break-after: auto;
  }
  .sheet::after {
    display: none !important;
  }
  .sheet .sheet-inner {
    padding: 16mm 18mm;
  }
  .cover .sheet-inner {
    padding: 17mm 20mm;
  }
  .cover-title {
    font-size: 58pt;
  }
  .cover-subtitle {
    font-size: 22pt;
  }
  .sheet h2 {
    font-size: 30pt;
  }
  .sheet-kicker {
    font-size: 9pt;
  }
  .sheet-lead {
    font-size: 10pt;
  }
  .roster-person strong {
    font-size: 11pt;
  }
  .roster-person small,
  .roster-person p {
    font-size: 8pt;
  }
}

/* The studio chrome stays restrained so the actual printed page carries the color. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  box-shadow: 0 1px 0 #dce3e5;
}
.brand-name { color: #213c35 !important; font-size: 16px !important; }
.brand-product { color: #8a5e4e !important; }
.workspace { grid-template-columns: minmax(320px, 356px) minmax(0, 1fr); }
@media (min-width: 851px) {
  /* Колонки прокручиваются каждая сама по себе: разворот книги не уезжает,
     пока читатель листает настройки. */
  .workspace { height: calc(100vh - 64px); min-height: 0; overflow: hidden; }
  .preview-area { min-height: 0; overflow-y: auto; }
}
.editor { padding: 26px 28px 52px; }
.section-heading h1 { font-size: 27px; }
.section-heading p { margin-bottom: 21px; }
.section-heading.small h2 { font-size: 19px; }
.field { margin-bottom: 15px; }
.field input, .field select, .field textarea { font-weight: 500; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible,
button:focus-visible, select:focus-visible, .page-scrubber:focus-visible {
  outline: 2px solid #b78848;
  outline-offset: 2px;
}
.page-list li { padding: 6px 7px 6px 10px; min-height: 43px; }
.page-list li:focus-within { border-color: #b78848; }
.chapter-move { display: flex; gap: 2px; flex: 0 0 auto; }
.chapter-move button {
  width: 25px;
  height: 27px;
  border: 0;
  border-radius: 3px;
  color: #395c51;
  background: #eff4f1;
  font-size: 17px;
  line-height: 1;
  padding: 0;
}
.chapter-move button:hover:not(:disabled) { background: #d9e7df; }
.chapter-move button:disabled { background: transparent; }
.preview-area {
  background: #e9edf0;
  padding: 21px 30px 40px;
  min-height: calc(100vh - 64px);
}
.preview-head {
  max-width: 1060px;
  min-height: 49px;
  margin-bottom: 11px;
}
.preview-head > div:first-child { margin-right: auto; }
.preview-head strong { font-size: 15px; }
#refresh-preview { color: #213f34; border-color: #b78848; white-space: nowrap; }
.pdf-toolbar { margin-bottom: 5px; }
.pdf-toolbar button { display: grid; place-items: center; }
.page-scrubber {
  display: block;
  width: min(100%, 600px);
  height: 14px;
  margin: 0 auto 12px;
  accent-color: #2d6a55;
  cursor: pointer;
}
.page-scrubber:disabled { cursor: default; opacity: .45; }
.pdf-stage {
  width: min(100%, 1060px);
  height: calc(100vh - 198px);
  min-height: 600px;
  background: #dce3e6;
  border-color: #cfd9dd;
  padding: 22px;
}
.pdf-stage canvas { box-shadow: 0 12px 38px #18313830, 0 0 0 1px #becacc; }
.preview-placeholder { background: #f2f5f3ef; }
.mobile-view-nav { display: none; }
@media (max-width: 850px) {
  .workspace { display: block; }
  .mobile-view-nav {
    position: sticky;
    top: 64px;
    z-index: 19;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #fff;
    border-bottom: 1px solid #dce3e5;
    padding: 5px 12px 0;
  }
  .mobile-view-nav button {
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    min-height: 42px;
    color: #576c6d;
    font-size: 13px;
    font-weight: 750;
  }
  .mobile-view-nav button[aria-pressed="true"] { color: #235a47; border-bottom-color: #b78848; }
  .workspace[data-mobile-view="preview"] .editor,
  .workspace[data-mobile-view="editor"] .preview-area { display: none; }
  .editor { display: block; min-height: calc(100vh - 111px); max-width: 680px; width: 100%; margin: 0 auto; }
  .preview-area { min-height: calc(100vh - 111px); padding: 16px 12px 26px; }
  .pdf-stage { height: calc(100vh - 255px); min-height: 440px; }
}
@media (max-width: 540px) {
  .topbar { height: 58px; padding: 0 12px; }
  .mobile-offer-status {
    position: sticky;
    top: 58px;
    z-index: 20;
    display: block;
    min-height: 30px;
    padding: 7px 12px;
    border-bottom: 1px solid #cfe0d6;
    background: #e6f3eb;
    color: #267055;
    font-size: 11px;
    font-weight: 750;
    line-height: 16px;
    text-align: center;
  }
  .mobile-view-nav { top: 88px; }
  .top-actions { gap: 6px; }
  .top-actions button { min-height: 36px; }
  .top-actions #export-button { background: #235d49; }
  .editor { padding: 24px 18px 40px; }
  .preview-head { gap: 8px; align-items: start; }
  .preview-head > div:first-child { max-width: 53%; }
  .preview-head span { display: block; font-size: 11px; line-height: 1.35; }
  .preview-actions { display: grid; gap: 4px; }
  #refresh-preview, #cancel-render { padding: 5px 7px; font-size: 11px; white-space: normal; max-width: 90px; }
  .pdf-toolbar { gap: 8px; }
  .pdf-toolbar select { margin-left: 3px; }
  .page-scrubber { width: min(100%, 310px); }
  .pdf-stage { padding: 12px; height: calc(100vh - 244px); min-height: 360px; }
  .import-dialog { padding: 22px; }
}
@media (max-width: 360px) {
  .topbar { padding: 0 7px; gap: 7px; }
  .brand img { width: 25px; height: 25px; }
  .top-actions { min-width: 0; gap: 3px; }
  select#language { width: 64px; min-width: 0; padding: 0 3px; }
  .account-button { width: 32px; padding-inline: 7px !important; }
}
@media (max-width: 420px) {
  .project-save-top { width: 36px; padding-inline: 8px !important; justify-content: center; }
  .project-save-top .short-label { display: none; }
  .project-save-top .project-state-dot { position: absolute; margin: -21px -25px 0 0; }
}

.preview-pages {
  width: min(100%, 1140px);
  min-width: 0;
  margin: 0 auto;
}
.page-strip {
  scrollbar-width: thin;
}
.page-thumb {
  display: grid;
  justify-items: center;
  align-content: center;
  flex: none;
  gap: 3px;
  width: 66px;
  height: 88px;
  padding: 4px;
  border: 1px solid #bfcdd0;
  border-radius: 3px;
  background: #fff;
  color: #375257;
}
.page-thumb:hover { border-color: #789887; }
.page-thumb[aria-current="page"] {
  border-color: #24674d;
  box-shadow: inset 0 0 0 1px #24674d;
}
.page-thumb.is-visible:not([aria-current="page"]) { border-color: #86a99b; background: #f1f6f3; }
.page-thumb canvas {
  display: block;
  max-width: 46px;
  max-height: 62px;
  background: #fff;
}
.page-thumb span { font-size: 10px; line-height: 1; }

@media (min-width: 851px) {
  .preview-area {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 16px;
  }
  .preview-head, .pdf-toolbar, .page-scrubber, .print-note, #render-error { flex-shrink: 0; }
  .preview-pages {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
    flex: 1;
    min-height: 0;
  }
  .page-strip {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-height: 0;
    padding: 2px 4px 2px 1px;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .pdf-stage { width: 100%; height: 100%; min-height: 0; margin: 0; }
  .print-note { margin: 10px 0 0; }
}

@media (max-width: 850px) {
  .page-strip {
    display: flex;
    gap: 7px;
    padding: 2px 2px 8px;
    margin-bottom: 6px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .page-thumb { width: 56px; height: 78px; }
  .page-thumb canvas { max-height: 52px; }
  .pdf-stage { width: 100%; }
}
