@font-face {
  font-family: "Action Cover Hand";
  src: url("assets/fonts/LXGWWenKaiLite-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

:root {
  --page-bg: #f4f0e8;
  --panel: #fffdf9;
  --paper: #fffaf0;
  --ink: #2f3b38;
  --muted: #6f7974;
  --line: #ded9ce;
  --accent: #6f9c68;
  --accent-soft: #e8f0e4;
  --error: #a84f45;
  --cover-cream: #fff8e8;
  --cover-green: #dce8d3;
  --cover-peach: #f3c9ae;
  --cover-ink: #33413b;
  --cover-muted: #6a756e;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow: 0 22px 60px rgb(74 65 53 / 0.10), 0 2px 8px rgb(74 65 53 / 0.05);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--page-bg);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 8% 5%, rgb(255 255 255 / 0.86), transparent 30rem),
    var(--page-bg);
}

button,
input,
select {
  font: inherit;
}

button,
select,
label[for="photo-input"] {
  -webkit-tap-highlight-color: transparent;
}

.workbench-shell {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.page-head,
.section-head,
.preview-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.page-head {
  margin-bottom: 24px;
}

.eyebrow,
.step-label {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: "Songti SC", "STSong", Georgia, serif;
  font-size: clamp(27px, 3vw, 38px);
  font-weight: 600;
  letter-spacing: 0.02em;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  font-weight: 650;
}

.privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.privacy-note span {
  color: var(--accent);
  font-size: 9px;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(520px, 1.45fr);
  gap: 22px;
  align-items: start;
}

.control-panel,
.preview-panel {
  min-width: 0;
  border: 1px solid rgb(86 78 66 / 0.10);
  border-radius: var(--radius-lg);
  background: rgb(255 253 249 / 0.94);
  box-shadow: var(--shadow);
}

.control-panel {
  padding: 24px;
}

.preview-panel {
  padding: 22px;
}

.section-head {
  align-items: center;
  padding-bottom: 19px;
  border-bottom: 1px solid var(--line);
}

.page-count,
.orientation-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #557150;
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.field-group {
  margin-top: 20px;
}

.page-nav-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.field-group label,
.field-label {
  display: block;
  margin-bottom: 8px;
  color: #46514d;
  font-size: 13px;
  font-weight: 650;
}

.page-nav-row .text-button {
  border: 1px solid #b8c6b5;
  border-radius: 12px;
  padding: 9px 12px;
}

.page-nav-row .text-button:disabled {
  color: var(--muted);
  border-color: #d8e0d7;
  cursor: not-allowed;
}

.field-group label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

input[type="text"],
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: #fff;
  padding: 10px 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input[type="text"]:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(111 156 104 / 0.15);
}

.drop-zone {
  display: flex !important;
  align-items: center;
  gap: 13px;
  min-height: 92px;
  margin: 0 !important;
  padding: 15px;
  border: 1px dashed #b9b8aa;
  border-radius: var(--radius-md);
  color: var(--ink) !important;
  background: #faf8f2;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--accent);
  background: #f3f7ef;
}

.drop-zone:active {
  transform: scale(0.99);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.upload-mark {
  display: grid;
  flex: 0 0 43px;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 50%;
  color: #52754d;
  background: var(--accent-soft);
  font-size: 25px;
  font-weight: 400;
}

.upload-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.upload-copy strong {
  font-size: 14px;
}

.upload-copy small,
.file-note,
.preview-note,
.status-line {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.file-note {
  margin: 7px 2px 0;
  overflow-wrap: anywhere;
}

.photo-guide {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #d7ddd0;
  border-radius: 14px;
  background: #f7f9f4;
}

.photo-guide[hidden] {
  display: none;
}

.photo-guide-title {
  color: #3f5f3c;
  font-size: 15px;
  line-height: 1.45;
}

.photo-guide-item {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding-top: 9px;
  border-top: 1px solid #e1e5dc;
  color: #4e5650;
  font-size: 14px;
  line-height: 1.55;
}

.photo-guide-item > span {
  color: #687268;
  font-weight: 700;
  white-space: nowrap;
}

.photo-guide-item p,
.photo-guide-item ul {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.photo-guide-item ul {
  display: grid;
  gap: 4px;
  padding-left: 1.15em;
}

.photo-guide-avoid {
  color: #75524c;
}

.photo-guide-variants {
  background: #f1f0fa;
  margin: 0 -5px -5px;
  padding: 10px 5px 5px;
  border-radius: 9px;
}

.photo-slot-intro {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.photo-slot-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.photo-slot-control {
  position: relative;
  display: flex !important;
  min-width: 0;
  min-height: 76px;
  align-items: center;
  gap: 10px;
  margin: 0 !important;
  padding: 11px;
  border: 1px dashed #b9b8aa;
  border-radius: 14px;
  color: var(--ink) !important;
  background: #faf8f2;
  cursor: pointer;
}

.photo-slot-control:hover,
.photo-slot-control:focus-within {
  border-color: var(--accent);
  background: #f3f7ef;
}

.photo-slot-control.has-photo {
  border-style: solid;
  border-color: #91ac8c;
  background: #f2f7ef;
}

.photo-slot-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.photo-slot-number {
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: #52754d !important;
  background: var(--accent-soft);
  font-size: 13px !important;
  font-weight: 750 !important;
}

.photo-slot-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.photo-slot-copy strong,
.photo-slot-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-slot-copy strong {
  font-size: 12px;
}

.photo-slot-copy small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.copy-fields {
  display: grid;
  grid-template-columns: 1fr;
}

.primary-button {
  width: 100%;
  min-height: 49px;
  margin-top: 22px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: #557c50;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgb(73 111 67 / 0.22);
  transition: background 160ms ease, transform 120ms ease, opacity 160ms ease;
}

.primary-button:hover:not(:disabled) {
  background: #476e43;
}

.primary-button:active:not(:disabled) {
  transform: scale(0.985);
}

.primary-button:disabled {
  color: #8a8e89;
  background: #e6e5df;
  box-shadow: none;
  cursor: not-allowed;
}

.status-line {
  min-height: 19px;
  margin: 7px 2px 0;
}

.status-line.is-error {
  color: var(--error);
}

.preview-toolbar {
  align-items: center;
  margin-bottom: 16px;
}

.preview-frame {
  display: grid;
  place-items: center;
  padding: clamp(10px, 2vw, 20px);
  border-radius: 18px;
  background: #e8e3da;
}

.page-preview {
  display: grid;
  container-type: inline-size;
  grid-template-rows: 73% 27%;
  width: min(100%, 700px);
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 18px 45px rgb(67 57 45 / 0.18);
}

.page-preview.is-canvas-preview {
  display: block;
}

.page-preview.is-canvas-preview > :not(.family-page-canvas) {
  display: none;
}

.family-page-canvas,
.family-page-canvas > canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
}

.family-page-canvas[hidden] {
  display: none;
}

.page-preview.is-how-final-cover,
.page-preview.is-how-final-surface[data-page-type="inside-front"],
.page-preview.is-how-final-surface[data-page-type="inside-back"],
.page-preview.is-how-final-surface[data-page-type="cover-back"] {
  grid-template-rows: 1fr;
}

.how-cover-collage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fbf7f0;
}

.how-cover-blob,
.how-cover-photo,
.how-cover-arc,
.how-cover-dot,
.how-cover-underline {
  position: absolute;
}

.how-cover-blob {
  opacity: 0.98;
}

.how-cover-blob-a {
  top: -13.1%;
  left: -10.6%;
  width: 39.4%;
  height: 35%;
  border-radius: 52% 48% 44% 56% / 48% 55% 45% 52%;
  background: #fff0d6;
  transform: rotate(5deg);
}

.how-cover-blob-b {
  top: -8.1%;
  right: -6.9%;
  width: 32.5%;
  height: 31.3%;
  border-radius: 47% 53% 55% 45% / 52% 44% 56% 48%;
  background: #f3eaf8;
  transform: rotate(-8deg);
}

.how-cover-blob-c {
  right: -6.9%;
  bottom: -6.3%;
  width: 25.6%;
  height: 27.5%;
  border-radius: 51% 49% 45% 55% / 55% 47% 53% 45%;
  background: #fbe4e8;
}

.how-cover-title {
  position: absolute;
  z-index: 2;
  top: 6.3%;
  right: 8%;
  left: 8%;
  margin: 0;
  color: #3f3936;
  font-family: "Chalkboard", "Arial Rounded MT Bold", "Action Cover Hand", sans-serif;
  font-size: 13.75cqi;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.how-cover-underline {
  z-index: 2;
  top: 23.2%;
  left: 40.6%;
  width: 18.8%;
  height: 1.2%;
  border-radius: 999px;
  background: #4d9f97;
  transform: rotate(-4deg);
}

.how-cover-photo {
  z-index: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #716b65;
  background: linear-gradient(145deg, #e9e1d8, #d9d1c8);
  font: 700 4cqi/1 "Avenir Next", sans-serif;
}

.how-cover-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.how-cover-photo > span {
  position: absolute;
}

.how-cover-photo.has-photo img {
  opacity: 1;
}

.how-cover-photo.has-photo > span {
  display: none;
}

.how-cover-photo-1 {
  top: 35%;
  left: 12.19%;
  width: 28.13%;
  height: 28.13%;
  border-radius: 48% 52% 46% 54% / 51% 45% 55% 49%;
}

.how-cover-photo-2 {
  top: 31.56%;
  left: 53.13%;
  width: 28.75%;
  height: 28.13%;
  border-radius: 53% 47% 55% 45% / 45% 54% 46% 55%;
}

.how-cover-photo-3 {
  top: 66.09%;
  left: 17.34%;
  width: 27.81%;
  height: 28.44%;
  border-radius: 46% 54% 48% 52% / 55% 45% 53% 47%;
}

.how-cover-photo-4 {
  top: 63.91%;
  left: 56.41%;
  width: 28.44%;
  height: 27.81%;
  border-radius: 54% 46% 52% 48% / 47% 55% 45% 53%;
}

.how-cover-arc {
  z-index: 2;
  border: max(2px, 0.63cqi) solid;
  border-right-color: transparent !important;
  border-bottom-color: transparent !important;
  border-radius: 50%;
}

.how-cover-arc-a {
  top: 59.4%;
  left: 11.6%;
  width: 10.6%;
  height: 10.3%;
  border-color: #f2a93b;
  transform: rotate(198deg);
}

.how-cover-arc-b {
  top: 50%;
  right: 10.3%;
  width: 12.2%;
  height: 12.2%;
  border-color: #7a82be;
  transform: rotate(20deg);
}

.how-cover-dot {
  z-index: 2;
  border-radius: 50%;
}

.how-cover-dot-a {
  top: 67.5%;
  right: 14.8%;
  width: 2.4%;
  aspect-ratio: 1;
  background: #f26f63;
}

.how-cover-dot-b {
  bottom: 6.3%;
  left: 15.6%;
  width: 3.1%;
  aspect-ratio: 1;
  background: #54a69d;
}

.photo-stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #d8d3c9;
}

.photo-backdrop,
.preview-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.photo-backdrop {
  inset: -4%;
  width: 108%;
  height: 108%;
  object-fit: cover;
  filter: blur(18px) saturate(0.75) brightness(0.94);
  transform: scale(1.06);
}

.preview-photo {
  z-index: 1;
  object-fit: contain;
}

.photo-stage.has-photo .photo-backdrop {
  opacity: 0.78;
}

.photo-stage.has-photo .preview-photo {
  opacity: 1;
}

.empty-photo {
  position: absolute;
  inset: 0;
  display: grid;
  z-index: 2;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 30px;
  color: #6c746f;
  text-align: center;
  background:
    radial-gradient(circle at center, rgb(255 255 255 / 0.5), transparent 45%),
    linear-gradient(145deg, #dfe7dc, #d9d1c4);
}

.empty-photo span {
  margin-bottom: 5px;
  font-size: 34px;
  opacity: 0.65;
}

.empty-photo strong {
  font-size: clamp(14px, 1.6vw, 18px);
}

.empty-photo small {
  font-size: clamp(10px, 1.2vw, 13px);
}

.photo-stage.has-photo .empty-photo {
  display: none;
}

.sound-sticker {
  position: absolute;
  z-index: 3;
  top: 5.5%;
  right: 4.5%;
  max-width: 42%;
  padding: 1.6% 2.5%;
  border-radius: 999px;
  color: #503d31;
  background: rgb(255 244 205 / 0.94);
  box-shadow: 0 4px 12px rgb(51 41 30 / 0.14);
  font-family: "Avenir Next Rounded", "Arial Rounded MT Bold", sans-serif;
  font-size: clamp(10px, 1.65vw, 18px);
  font-weight: 700;
  line-height: 1.1;
  transform: rotate(2deg);
}

.sound-sticker:empty {
  display: none;
}

.text-stage {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 3.7% 7.5% 4.2%;
  background: var(--page-lower-bg, var(--paper));
}

.english-command {
  display: flex;
  align-items: baseline;
  gap: 0.32em;
  min-width: 0;
  margin: 0;
  color: #35403d;
  font-family: "Avenir Next Rounded", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  line-height: 1.04;
  white-space: nowrap;
}

.state-label {
  margin: 0 0 4%;
  color: var(--page-ink, var(--ink));
  font-size: clamp(10px, 1.5vw, 17px);
  font-weight: 650;
  letter-spacing: 0.015em;
}

#action-word {
  color: var(--action-accent, var(--accent));
  font-size: clamp(26px, 5.2vw, 58px);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.page-preview[data-page-type="emotion"] #action-word,
.page-preview[data-page-type="family-state"] #action-word {
  color: var(--page-ink, var(--ink));
}

.page-preview[data-page-type="family-state"] .english-command {
  justify-content: center;
  text-align: center;
}

.page-preview[data-page-type="family-state"] .text-stage {
  align-items: center;
  text-align: center;
}

.page-preview[data-page-type="family-state"] #action-word {
  font-size: clamp(22px, 4.3vw, 49px);
}

.page-preview[data-page-type="cue"],
.page-preview[data-page-type="reveal"] {
  --page-ink: #28766e;
  --page-lower-bg: #fffdf7;
}

.page-preview[data-page-type="cue"] .photo-stage {
  margin: 6% 12% 3%;
  border: 10px solid #fff;
  border-radius: 5cqi;
  background: #ddeee8;
  box-shadow: 0 12px 28px rgb(40 118 110 / 0.15);
}

.page-preview[data-page-type="cue"] .preview-photo {
  object-fit: cover;
}

.page-preview[data-page-type="cue"] .photo-backdrop {
  display: none;
}

.page-preview[data-page-type="cue"] .text-stage,
.page-preview[data-page-type="reveal"] .text-stage {
  margin: 2% 5% 4%;
  padding: 3% 5%;
  border-radius: 5cqi;
  box-shadow: 0 8px 20px rgb(40 60 56 / 0.09);
}

.page-preview[data-page-type="cue"] .state-label {
  color: #28766e;
  font-size: clamp(9px, 1.35vw, 15px);
  text-align: right;
}

.page-preview[data-page-type="reveal"] .photo-stage {
  margin: 4% 5% 1%;
  border-radius: 5cqi;
  box-shadow: 0 12px 28px rgb(40 60 56 / 0.16);
}

.page-preview[data-page-type="cue"] .english-command,
.page-preview[data-page-type="reveal"] .english-command {
  justify-content: flex-start;
  white-space: normal;
}

.page-preview[data-page-type="cue"] #action-word,
.page-preview[data-page-type="reveal"] #action-word {
  color: #28766e;
  font-size: clamp(22px, 4.2vw, 48px);
}

.page-preview[data-page-type="reveal"] #action-word {
  color: #d65f52;
}

.page-preview.is-state-portrait {
  position: relative;
  display: block;
  background: var(--page-lower-bg, #fbf7f0);
}

.page-preview.is-state-portrait .photo-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: transparent;
}

.page-preview.is-state-portrait .photo-stage::before,
.page-preview.is-state-portrait .photo-stage::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.page-preview.is-state-portrait .photo-stage::before {
  inset: 18% 7% 7% 7%;
  border-radius: 46% 54% 48% 52% / 52% 42% 58% 48%;
  background: color-mix(in srgb, var(--action-accent) 22%, white);
  transform: rotate(-2deg);
}

.page-preview.is-state-portrait .photo-stage::after {
  right: 7%;
  bottom: 8%;
  width: 7%;
  aspect-ratio: 1;
  border: clamp(3px, 0.8cqw, 8px) solid var(--action-accent);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  transform: rotate(32deg);
}

.page-preview.is-state-portrait .text-stage {
  position: absolute;
  z-index: 4;
  inset: 0;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 7% 9%;
  text-align: left;
  pointer-events: none;
  background: transparent;
}

.page-preview.is-state-portrait .english-command {
  order: 1;
  color: var(--page-ink, var(--ink));
  font-family: "Chalkboard", "Arial Rounded MT Bold", sans-serif;
}

.page-preview.is-state-portrait .state-label {
  order: 2;
  margin: 1.5% 0 0;
  font-size: clamp(11px, 2.2cqw, 21px);
}

.page-preview.is-state-portrait .state-label::after {
  display: block;
  width: 7em;
  height: clamp(3px, 0.75cqw, 7px);
  margin-top: 18%;
  border-radius: 999px;
  background: var(--action-accent);
  content: "";
  transform: rotate(-2deg);
}

.page-preview.is-state-portrait .chinese-copy {
  display: none;
}

.page-preview.is-state-portrait[data-layout-variant="layout-b"] .text-stage {
  align-items: flex-end;
  text-align: right;
}

.page-preview.is-state-portrait[data-layout-variant="layout-b"] .english-command {
  justify-content: flex-end;
}

.page-preview.is-state-portrait[data-layout-variant="layout-b"] .state-label::after {
  margin-left: auto;
}

.page-preview.is-state-portrait.is-cutout-subject .photo-backdrop {
  display: none;
}

.page-preview.is-state-portrait.is-cutout-subject .preview-photo {
  inset: 15% 7% 2%;
  z-index: 2;
  width: 86%;
  height: 83%;
  object-fit: contain;
  filter: drop-shadow(0 1.4cqw 1.8cqw rgb(63 57 54 / 0.1));
}

.page-preview.is-state-portrait.is-scene-glass .photo-backdrop {
  inset: 17% 5% 4%;
  width: 90%;
  height: 79%;
  border-radius: 45% 55% 48% 52% / 50% 44% 56% 50%;
}

.page-preview.is-state-portrait.is-scene-glass .preview-photo {
  inset: 21% 9% 8%;
  z-index: 2;
  width: 82%;
  height: 71%;
  border-radius: 12%;
}

.page-preview.is-interaction-scene {
  grid-template-rows: 70% 30%;
  background: var(--page-lower-bg, #fbf7f0);
}

.page-preview.is-interaction-scene .photo-stage {
  border-radius: 0 0 7% 7%;
  background: var(--page-lower-bg, #fbf7f0);
}

.page-preview.is-interaction-scene .preview-photo {
  inset: 6% 5% 7%;
  width: 90%;
  height: 87%;
  border-radius: 7%;
  filter: drop-shadow(0 1cqw 1.7cqw rgb(63 57 54 / 0.14));
}

.page-preview.is-interaction-scene .photo-backdrop {
  inset: -4%;
  width: 108%;
  height: 108%;
}

.page-preview.is-interaction-scene .text-stage {
  position: relative;
  align-items: center;
  padding: 4% 8% 6%;
  text-align: center;
}

.page-preview.is-interaction-scene .text-stage::before,
.page-preview.is-interaction-scene .text-stage::after {
  position: absolute;
  width: 2.2%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--action-accent);
  content: "";
}

.page-preview.is-interaction-scene .text-stage::before {
  top: 22%;
  left: 9%;
}

.page-preview.is-interaction-scene .text-stage::after {
  right: 9%;
  bottom: 18%;
  width: 3%;
}

.page-preview.is-interaction-scene .english-command {
  justify-content: center;
  color: var(--page-ink, var(--ink));
  text-align: center;
}

.page-preview.is-interaction-scene #action-word {
  color: var(--page-ink, var(--ink));
  font-family: "Chalkboard", "Arial Rounded MT Bold", sans-serif;
  font-size: clamp(23px, 5.2cqw, 54px);
}

.page-preview.is-interaction-scene .chinese-copy {
  color: var(--action-accent);
  font-weight: 600;
}

.pending-page-preview {
  gap: 7%;
  background:
    radial-gradient(circle at 15% 20%, #edf8f6 0 14%, transparent 14.5%),
    radial-gradient(circle at 84% 78%, #fff0d6 0 16%, transparent 16.5%),
    #fbf7f0;
}

.pending-page-kicker,
.pending-page-title,
.pending-page-note {
  margin: 0;
}

.pending-page-kicker {
  color: #748078;
  font-size: clamp(9px, 1.2vw, 14px);
  font-family: "Avenir Next", sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.pending-page-title {
  color: #3f3936;
  font-size: clamp(22px, 4.2vw, 48px);
  font-weight: 700;
}

.pending-page-note {
  color: #756c67;
  font-size: clamp(12px, 1.8vw, 20px);
}

#command-tail {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(13px, 2.35vw, 28px);
  font-weight: 600;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
}

.chinese-copy {
  margin: 3% 0 0;
  color: #505956;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: clamp(12px, 1.9vw, 22px);
  line-height: 1.25;
}

.cover-front-copy {
  align-items: flex-start;
  padding: 3% 7.5% 4%;
  color: var(--cover-ink);
  background: var(--cover-cream);
  font-family: "Action Cover Hand", "Songti SC", serif;
}

.cover-title-en,
.cover-title-zh {
  margin: 0;
  line-height: 0.96;
}

.cover-title-en {
  color: #587c55;
  font-size: clamp(27px, 5vw, 58px);
  transform: rotate(-1deg);
}

.cover-title-zh {
  align-self: flex-end;
  margin-top: 3%;
  color: #bd7158;
  font-size: clamp(14px, 2.45vw, 29px);
  transform: rotate(1deg);
}

.page-preview[data-page-type="inside-front"],
.page-preview[data-page-type="inside-back"],
.page-preview[data-page-type="cover-back"] {
  grid-template-rows: 1fr;
}

.page-preview.has-optional-photo[data-page-type="inside-front"],
.page-preview.has-optional-photo[data-page-type="inside-back"],
.page-preview.has-optional-photo[data-page-type="cover-back"] {
  grid-template-rows: 73% 27%;
}

.page-preview.has-optional-photo .message-cover {
  padding: 3.5% 8%;
}

.page-preview.has-optional-photo .inside-front-en,
.page-preview.has-optional-photo .inside-back-en,
.page-preview.has-optional-photo .back-statement {
  font-size: clamp(21px, 4.2vw, 48px);
}

.page-preview.has-optional-photo .inside-front-zh,
.page-preview.has-optional-photo .inside-back-zh,
.page-preview.has-optional-photo .creator-credit {
  margin-top: 2%;
  font-size: clamp(11px, 1.8vw, 20px);
}

.message-cover {
  position: relative;
  display: grid;
  min-width: 0;
  height: 100%;
  padding: 12%;
  place-content: center;
  overflow: hidden;
  color: var(--cover-ink);
  text-align: center;
  font-family: "Action Cover Hand", "Songti SC", serif;
}

.inside-front-preview {
  background: var(--cover-green);
}

.inside-front-en,
.inside-front-zh,
.inside-back-en,
.inside-back-zh,
.back-statement,
.creator-credit {
  position: relative;
  z-index: 1;
  margin: 0;
}

.page-preview.is-how-final-surface .message-cover {
  display: block;
  padding: 0;
  color: #3f3936;
  background-color: #fbf7f0;
  font-family: "Chalkboard", "Noteworthy", "Action Cover Hand", "Songti SC", sans-serif;
}

.page-preview.is-how-final-surface .inside-front-preview {
  background:
    radial-gradient(ellipse 32% 30% at 4% 3%, #fff0d6 0 98%, transparent 100%),
    radial-gradient(ellipse 27% 29% at 95% 4%, #f1e9f7 0 98%, transparent 100%),
    radial-gradient(ellipse 26% 29% at 3% 96%, #e4f3ef 0 98%, transparent 100%),
    radial-gradient(ellipse 24% 28% at 96% 96%, #fbe4e8 0 98%, transparent 100%),
    #fbf7f0;
}

.page-preview.is-how-final-surface .inside-front-en,
.page-preview.is-how-final-surface .inside-front-zh,
.page-preview.is-how-final-surface .inside-back-en,
.page-preview.is-how-final-surface .inside-back-zh,
.page-preview.is-how-final-surface .inside-back-note,
.page-preview.is-how-final-surface .back-statement,
.page-preview.is-how-final-surface .back-accent-line {
  position: absolute;
  right: 7%;
  left: 7%;
  margin: 0;
  line-height: 1;
  text-align: center;
}

.page-preview.is-how-final-surface .inside-front-en {
  top: 35.9%;
  color: #3f3936;
  font-size: 5.25cqi;
  font-weight: 400;
  transform: translateY(-50%);
}

.page-preview.is-how-final-surface .inside-front-zh {
  top: 51.6%;
  color: #4d9f97;
  font-size: 15.6cqi;
  font-weight: 700;
  overflow-wrap: anywhere;
  transform: translateY(-50%);
}

.page-preview.is-how-final-surface .inside-front-zh:empty::after {
  content: "\00a0";
}

.page-preview.is-how-final-surface .inside-front-preview.is-long-name .inside-front-zh {
  font-size: 11cqi;
}

.page-preview.is-how-final-surface .inside-front-preview.is-very-long-name .inside-front-zh {
  right: 12%;
  left: 12%;
  font-size: 7.5cqi;
  line-height: 1.08;
}

.how-owner-underline {
  position: absolute;
  top: 62.2%;
  left: 40.9%;
  width: 18.1%;
  height: 0.88%;
  border-radius: 999px;
  background: #f2a93b;
  transform: rotate(-4deg);
}

.how-owner-dots {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 31.25% 70%, #f26f63 0 1.35%, transparent 1.5%),
    radial-gradient(circle at 40% 73.75%, #7a82be 0 1%, transparent 1.15%),
    radial-gradient(circle at 58.75% 72.5%, #54a69d 0 1.15%, transparent 1.3%),
    radial-gradient(circle at 67.5% 68.1%, #f2a93b 0 1.45%, transparent 1.6%);
  pointer-events: none;
}

.page-preview.is-how-final-surface .inside-back-preview {
  background:
    radial-gradient(ellipse 33% 31% at 4% 96%, #e4f3ef 0 98%, transparent 100%),
    radial-gradient(ellipse 29% 27% at 96% 3%, #fff0d6 0 98%, transparent 100%),
    #fbf7f0;
}

.page-preview.is-how-final-surface .inside-back-en {
  top: 87.5%;
  color: #3f3936;
  font-family: "Noteworthy", "Chalkboard", "Songti SC", serif;
  font-size: 2.25cqi;
  font-weight: 400;
  transform: translateY(-50%);
}

.page-preview.is-how-final-surface .inside-back-zh {
  display: none;
}

.page-preview.is-how-final-surface .inside-back-note {
  top: 91.25%;
  color: #756c67;
  font-family: "Noteworthy", "Avenir Next", sans-serif;
  font-size: 1.75cqi;
  transform: translateY(-50%);
}

.how-credit-dots {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 40.6% 82.5%, #f2a93b 0 0.6%, transparent 0.75%),
    radial-gradient(circle at 46.9% 82.5%, #f26f63 0 0.6%, transparent 0.75%),
    radial-gradient(circle at 53.1% 82.5%, #7a82be 0 0.6%, transparent 0.75%),
    radial-gradient(circle at 59.4% 82.5%, #54a69d 0 0.6%, transparent 0.75%);
  pointer-events: none;
}

.page-preview.is-how-final-surface .cover-back-preview {
  background:
    radial-gradient(ellipse 43% 39% at 11% 94%, #e4f3ef 0 98%, transparent 100%),
    radial-gradient(ellipse 39% 37% at 94% 4%, #fff0d6 0 98%, transparent 100%),
    radial-gradient(ellipse 57% 38% at 51% 62%, #fbe9ed 0 98%, transparent 100%),
    radial-gradient(circle at 13.1% 15.6%, #f2a93b 0 2.1%, transparent 2.25%),
    radial-gradient(circle at 26.9% 11.8%, #54a69d 0 1.35%, transparent 1.5%),
    radial-gradient(circle at 38.8% 18.1%, #7a82be 0 1.65%, transparent 1.8%),
    radial-gradient(circle at 84.4% 27.8%, #f26f63 0 1.9%, transparent 2.05%),
    radial-gradient(circle at 80% 65%, #4ea7c5 0 1.45%, transparent 1.6%),
    radial-gradient(circle at 68.4% 82.5%, #f2a93b 0 2.35%, transparent 2.5%),
    radial-gradient(circle at 40.6% 86.9%, #d95f69 0 1.65%, transparent 1.8%),
    radial-gradient(circle at 15.9% 70.3%, #7a82be 0 1.45%, transparent 1.6%),
    #fbf7f0;
}

.page-preview.is-how-final-surface .back-statement {
  top: 26.6%;
  right: auto;
  left: 12.8%;
  width: auto;
  color: #3f3936;
  font-family: "Noteworthy", "Chalkboard", sans-serif;
  font-size: 10.13cqi;
  font-weight: 400;
  text-align: left;
}

.page-preview.is-how-final-surface .back-accent-line {
  top: 40.9%;
  right: auto;
  left: 26.9%;
  width: auto;
  color: #4d9f97;
  font-family: "Noteworthy", "Chalkboard", sans-serif;
  font-size: 15.13cqi;
  font-weight: 700;
  text-align: left;
}

.page-preview.is-how-final-surface .creator-credit:empty {
  display: none;
}

.inside-front-en {
  max-width: 100%;
  color: var(--cover-ink);
  font-size: clamp(34px, 8.4vw, 92px);
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.inside-front-zh {
  margin-top: 5%;
  color: var(--cover-muted);
  font-size: clamp(15px, 3vw, 34px);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.inside-front-preview.is-long-name .inside-front-en {
  font-size: clamp(27px, 6.2vw, 70px);
}

.inside-front-preview.is-very-long-name .inside-front-en {
  font-size: clamp(22px, 4.8vw, 54px);
}

.motion-doodle,
.repeat-arc {
  position: absolute;
  width: 23%;
  height: 13%;
  border: 3px solid rgb(83 117 80 / 0.22);
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
}

.motion-doodle-a {
  top: 13%;
  left: 9%;
  transform: rotate(20deg);
}

.motion-doodle-b {
  right: 8%;
  bottom: 14%;
  transform: rotate(198deg);
}

.inside-back-preview {
  background: var(--cover-peach);
}

.inside-back-en {
  color: var(--cover-ink);
  font-size: clamp(43px, 10vw, 112px);
  line-height: 0.95;
}

.inside-back-zh {
  margin-top: 5%;
  color: #7d5f52;
  font-size: clamp(17px, 3.3vw, 38px);
}

.repeat-arc {
  top: 16%;
  right: 12%;
  width: 30%;
  height: 22%;
  border-color: rgb(255 248 232 / 0.8);
  border-right-color: transparent;
  transform: rotate(24deg);
}

.cover-back-preview {
  background: var(--cover-cream);
}

.back-statement {
  width: min(100%, 74%);
  margin: auto;
  color: var(--cover-ink);
  font-size: clamp(28px, 6.8vw, 76px);
  line-height: 1.05;
}

.creator-credit {
  position: absolute;
  right: 8%;
  bottom: 7.5%;
  left: 8%;
  color: var(--cover-muted);
  font-size: clamp(10px, 1.7vw, 19px);
  line-height: 1.2;
}

.preview-note {
  margin: 10px 2px 0;
  text-align: right;
}

.paired-spread-preview,
.page-turn-preview {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid #d8d2c8;
  border-radius: 18px;
  background: linear-gradient(145deg, #f7f2e9, #ebe4d9);
}

.paired-spread-preview[hidden],
.page-turn-preview[hidden] {
  display: none;
}

.page-turn-sequence {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.page-turn-opening > strong {
  display: block;
  margin: 0 0 7px;
  color: #50625e;
  font-size: 11px;
}

.page-turn-arrow {
  color: #28766e;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.spread-photo-placeholder.is-fixed-blank {
  background: #fffdf7;
}

.spread-photo-placeholder.is-fixed-blank::before,
.spread-photo-placeholder.is-fixed-blank::after {
  display: none;
}

.paired-spread-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.paired-spread-head h3 {
  margin: 2px 0 0;
  font-size: 17px;
}

.paired-spread-head > span {
  color: var(--muted);
  font-size: 11px;
}

.paired-spread-pages {
  display: grid;
  position: relative;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  padding: 7px;
  border-radius: 12px;
  background: #d8d0c5;
  box-shadow: 0 12px 24px rgb(67 57 45 / 0.12);
}

.paired-spread-pages::after {
  position: absolute;
  z-index: 4;
  top: 7px;
  bottom: 38px;
  left: 50%;
  width: 8px;
  background: linear-gradient(90deg, rgb(61 50 40 / 0.12), rgb(255 255 255 / 0.45), rgb(61 50 40 / 0.12));
  content: "";
  pointer-events: none;
  transform: translateX(-50%);
}

.spread-surface {
  min-width: 0;
  margin: 0;
  padding: 5px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #fffdf8;
}

.spread-surface.is-current {
  border-color: #829e7c;
}

.spread-canvas-host,
.spread-page-canvas,
.spread-photo-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 1;
}

.spread-canvas-host {
  overflow: hidden;
  background: #f6f1e8;
}

.spread-page-canvas {
  height: auto;
}

.spread-photo-placeholder {
  display: grid;
  position: relative;
  place-content: center;
  justify-items: center;
  gap: 4px;
  overflow: hidden;
  color: #5f6762;
  text-align: center;
  background:
    radial-gradient(ellipse 45% 38% at 50% 52%, color-mix(in srgb, var(--spread-accent) 20%, white) 0 98%, transparent 100%),
    #faf7f0;
}

.spread-photo-placeholder::before,
.spread-photo-placeholder::after {
  position: absolute;
  border-radius: 50%;
  background: var(--spread-accent);
  content: "";
  opacity: 0.72;
}

.spread-photo-placeholder::before {
  top: 12%;
  right: 13%;
  width: 4.5%;
  aspect-ratio: 1;
}

.spread-photo-placeholder::after {
  bottom: 10%;
  left: 12%;
  width: 7%;
  aspect-ratio: 1;
}

.spread-photo-placeholder span {
  font-size: clamp(16px, 4cqw, 30px);
  opacity: 0.65;
}

.spread-photo-placeholder strong {
  font-size: clamp(10px, 2.5cqw, 16px);
}

.spread-photo-placeholder small {
  font-size: clamp(8px, 1.8cqw, 11px);
}

.spread-surface figcaption {
  min-width: 0;
  margin-top: 6px;
  overflow: hidden;
  color: #514b47;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-library {
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid rgb(86 78 66 / 0.1);
  border-radius: var(--radius-lg);
  background: rgb(255 253 249 / 0.94);
  box-shadow: var(--shadow);
}

.library-head,
.editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.library-head > p {
  max-width: 28rem;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.book-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.book-card {
  display: flex;
  min-width: 0;
  min-height: 225px;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
  background: linear-gradient(145deg, #fffdf8, #f5f0e5);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.book-card:nth-child(2) {
  background: linear-gradient(145deg, #fffaf3, #f4eef5);
}

.book-card.is-final-edition {
  border-color: #b7ccc6;
  background: linear-gradient(145deg, #f7fbf9, #e8f1ee);
}

.book-card.is-final-edition .book-card-kicker,
.book-card.is-final-edition .book-card-action {
  color: #3f756d;
}

.book-card:hover {
  border-color: #9baa92;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgb(74 65 53 / 0.1);
}

.book-card-kicker {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.book-card strong {
  font-family: "Action Cover Hand", "Songti SC", serif;
  font-size: clamp(25px, 3vw, 36px);
  font-weight: 400;
}

.book-card-zh {
  margin-top: 2px;
  color: #62725f;
  font-size: 16px;
}

.book-card small {
  margin-top: 16px;
  color: var(--muted);
  line-height: 1.5;
}

.book-card-action {
  margin-top: auto;
  padding-top: 20px;
  color: #52754d;
  font-size: 13px;
  font-weight: 700;
}

.local-note {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.final-edition-shell {
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid rgb(86 78 66 / 0.1);
  border-radius: var(--radius-lg);
  background: rgb(255 253 249 / 0.96);
  box-shadow: var(--shadow);
}

.final-edition-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.final-edition-count {
  padding: 8px 12px;
  border-radius: 999px;
  color: #3f756d;
  background: #e5f1ed;
  font-size: 13px;
  white-space: nowrap;
}

.final-edition-intro {
  max-width: 58rem;
  margin: 20px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.final-edition-downloads {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.final-download-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 15px;
  border: 1px solid #cbd8c7;
  border-radius: 15px;
  color: #466643;
  background: #f5f8f2;
  text-decoration: none;
}

.final-download-card:hover {
  border-color: #8eaa88;
  background: #eef5ea;
}

.final-download-card strong {
  font-size: 13px;
}

.final-download-card span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.final-edition-pages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.final-page-card {
  min-width: 0;
  margin: 0;
}

.final-page-card img,
.final-page-fallback {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f3efe7;
  object-fit: cover;
}

.final-page-fallback {
  padding: 16px;
  place-content: center;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.final-page-card figcaption {
  display: grid;
  gap: 2px;
  margin-top: 8px;
  color: var(--ink);
  font-size: 12px;
}

.final-page-card figcaption span {
  color: var(--muted);
  font-size: 10px;
}

.editor-topbar {
  margin-bottom: 18px;
  padding: 14px 4px;
}

.book-progress {
  display: grid;
  grid-template-columns: minmax(170px, auto) minmax(140px, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin: 0 0 18px;
  padding: 15px 17px;
  border: 1px solid #d7dfd2;
  border-radius: 17px;
  background: rgb(248 250 245 / 0.94);
}

.book-progress-copy {
  display: grid;
  gap: 3px;
}

.book-progress-copy strong {
  font-size: 14px;
}

.book-progress-copy span {
  color: var(--muted);
  font-size: 12px;
}

.book-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7df;
}

.book-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.compact-button {
  min-height: 38px;
  padding: 7px 15px;
}

.book-review-panel {
  padding: clamp(20px, 4vw, 38px);
  border: 1px solid rgb(86 78 66 / 0.1);
  border-radius: var(--radius-lg);
  background: rgb(255 253 249 / 0.96);
  box-shadow: var(--shadow);
}

.review-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.review-summary {
  margin: 20px 0 12px;
  color: #46514d;
  line-height: 1.6;
}

.book-overview-intro {
  display: grid;
  gap: 6px;
  margin-top: 20px;
  padding: 15px 17px;
  border-left: 4px solid var(--accent);
  border-radius: 0 14px 14px 0;
  background: #f4f7f0;
}

.book-overview-intro strong {
  font-size: 18px;
}

.book-overview-intro p {
  margin: 0;
  color: #46514d;
  font-size: 15px;
  line-height: 1.6;
}

.missing-page-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.surface-overview-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(130px, auto);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #faf8f2;
  text-align: left;
  cursor: pointer;
}

.surface-overview-row:hover {
  border-color: #9baa92;
  background: #f4f7f0;
}

.surface-overview-row.is-ready {
  background: #f3f7ef;
}

.surface-overview-order {
  color: #7c786e;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.surface-overview-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.surface-overview-copy strong {
  font-size: 15px;
  line-height: 1.45;
}

.surface-overview-meta,
.surface-overview-status {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.surface-overview-status {
  color: #8a5e31;
  text-align: right;
}

.surface-overview-row.is-ready .surface-overview-status {
  color: #557150;
}

.missing-page-button,
.review-ready-note {
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #faf8f2;
  text-align: left;
}

.missing-page-button {
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.missing-page-button:hover {
  border-color: #9baa92;
  background: #f4f7f0;
}

.missing-page-button strong {
  font-size: 13px;
}

.missing-page-button span,
.review-ready-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.review-ready-note {
  grid-column: 1 / -1;
  color: #557150;
  background: #f3f7ef;
}

.review-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.review-actions .primary-button {
  min-width: min(100%, 250px);
  margin: 0;
}

.print-preparation {
  padding: clamp(20px, 4vw, 38px);
  border: 1px solid rgb(86 78 66 / 0.1);
  border-radius: var(--radius-lg);
  background: rgb(255 253 249 / 0.96);
  box-shadow: var(--shadow);
}

.print-preparation-head,
.print-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.print-preparation-head {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.print-status {
  margin: 18px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.print-status.is-error {
  color: var(--error);
}

.print-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.print-actions button {
  flex: 1 1 220px;
  width: auto;
  min-width: min(100%, 220px);
  min-height: 46px;
  margin: 0;
}

.whole-book-preview {
  margin-top: 24px;
}

.print-sheet {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.print-page-card {
  min-width: 0;
  margin: 0;
}

.print-page-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f3efe7;
  object-fit: contain;
}

.print-page-card figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.text-button,
.danger-link {
  border: 0;
  color: #557150;
  background: transparent;
  cursor: pointer;
}

.text-button {
  padding: 10px 0;
  font-weight: 650;
}

.save-status {
  min-width: 10rem;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.save-status.is-dirty {
  color: #9a6c35;
}

.book-field-list,
.field-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.layout-check-control {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #faf8f2;
}

.layout-check-control[hidden] {
  display: none;
}

.layout-check-control label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  font-weight: 700;
  cursor: pointer;
}

.layout-check-control input {
  width: 19px;
  height: 19px;
  margin: 0;
  accent-color: var(--accent);
}

.layout-check-control label:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.62;
}

.layout-check-control p {
  margin: 0 0 0 29px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.action-row {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: 10px;
  margin-top: 22px;
}

.action-row .primary-button,
.secondary-button {
  min-height: 49px;
  margin: 0;
  border-radius: 14px;
  font-weight: 700;
}

.save-control {
  display: grid;
  align-content: start;
  gap: 6px;
}

.save-control .secondary-button {
  width: 100%;
}

.save-inline-status {
  min-height: 1.4em;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.save-inline-status.is-error {
  color: var(--error);
}

.save-inline-status.is-saved {
  color: #557150;
}

.secondary-button {
  border: 1px solid #b9c7b4;
  color: #4d6c49;
  background: #f5f8f2;
  cursor: pointer;
}

.danger-link {
  width: 100%;
  margin-top: 14px;
  padding: 7px;
  color: #8d5b54;
  font-size: 12px;
}

@media (max-width: 900px) {
  .workbench-shell {
    width: min(720px, calc(100% - 28px));
    padding-top: 24px;
  }

  .workbench-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .preview-panel {
    order: 2;
  }

  .final-edition-pages {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .print-sheet {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .final-edition-downloads {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .paired-spread-preview,
  .page-turn-preview {
    margin-top: 16px;
    padding: 10px;
  }

  .paired-spread-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .paired-spread-pages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
  }

  .paired-spread-pages::after {
    top: 4px;
    bottom: 34px;
    width: 5px;
  }

  .spread-surface {
    padding: 3px;
  }

  .spread-surface figcaption {
    font-size: 8px;
  }

  .page-turn-sequence {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-turn-arrow {
    text-align: center;
    transform: rotate(90deg);
  }
}

@media (max-width: 560px) {
  .workbench-shell {
    width: calc(100% - 20px);
    padding: 18px 0 30px;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .privacy-note {
    white-space: normal;
  }

  .control-panel,
  .preview-panel {
    padding: 17px;
    border-radius: 20px;
  }

  .section-head,
  .preview-toolbar {
    gap: 12px;
  }

  .preview-frame {
    padding: 8px;
  }

  .preview-note {
    text-align: left;
  }

  .photo-guide {
    padding: 13px;
  }

  .photo-guide-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    font-size: 14px;
  }

  .photo-guide-item > span {
    white-space: normal;
  }

  .book-list,
  .action-row,
  .photo-slot-list,
  .missing-page-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .surface-overview-row {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 9px;
    padding: 13px;
  }

  .surface-overview-copy strong,
  .book-overview-intro p {
    font-size: 16px;
  }

  .surface-overview-status {
    grid-column: 2;
    text-align: left;
  }

  .final-edition-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
  }

  .final-edition-head .text-button {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .final-edition-pages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .print-sheet {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .print-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .print-actions button {
    width: 100%;
    flex: none;
  }

  .book-progress {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .book-progress-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .book-card {
    min-height: 200px;
  }

  .library-head,
  .editor-topbar,
  .review-panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .save-status {
    min-width: 0;
    text-align: left;
  }
}

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

@media print {
  @page {
    size: 160mm 160mm;
    margin: 0;
  }

  body {
    min-width: 0;
    background: #fff;
  }

  .workbench-shell {
    width: auto;
    margin: 0;
    padding: 0;
  }

  .page-head,
  .book-library,
  .final-edition-shell,
  .editor-topbar,
  .book-progress,
  .book-review-panel,
  .workbench-grid,
  .print-preparation-head,
  .print-status,
  .print-actions {
    display: none !important;
  }

  .editor-shell,
  .print-preparation,
  .whole-book-preview,
  .print-sheet {
    display: block !important;
    padding: 0;
    border: 0;
    background: #fff;
    box-shadow: none;
  }

  .print-page-card {
    width: 160mm;
    height: 160mm;
    break-after: page;
    page-break-after: always;
  }

  .print-page-card:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .print-page-card img {
    width: 160mm;
    height: 160mm;
    border: 0;
    border-radius: 0;
  }

  .print-page-card figcaption {
    display: none;
  }
}
