.album-workspace {
  color: var(--ui-ink, #31484a);
  font:
    15px/1.7 Inter,
    'PingFang SC',
    sans-serif;
}
.workspace-heading {
  max-width: 1480px;
  margin: auto;
  padding: 28px 32px 18px;
}
.workspace-heading h1 {
  font:
    36px/1.4 'Songti SC',
    serif;
  margin: 18px 0 8px;
}
.workspace-heading p {
  margin: 0;
  color: var(--ui-muted, #687b78);
}
.workspace-layout {
  max-width: 1480px;
  margin: auto;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 28px;
  padding: 0 32px 65px;
}
.workspace-panel,
.workspace-result {
  min-width: 0;
}
.workspace-panel {
  padding: 20px;
  border: 1px solid var(--ui-line, #cfdfd6);
  border-radius: 22px;
  background: var(--ui-card-surface, #ffffff70);
}
.album-workspace fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 23px;
  min-width: 0;
}
.album-workspace legend {
  font-weight: 600;
  margin-bottom: 12px;
}
.workspace-upload {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px dashed var(--ui-line, #cfdfd6);
  border-radius: 14px;
  cursor: pointer;
}
.workspace-upload span,
.workspace-note,
.planner-choice small {
  font-size: 12px;
  color: var(--ui-muted, #687b78);
}
.workspace-upload input {
  max-width: 100%;
  font-size: 12px;
}
#photo-list {
  max-height: 260px;
  overflow: auto;
  padding: 0;
  list-style: none;
}
#photo-list li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}
#photo-list img {
  width: 42px;
  height: 50px;
  object-fit: contain;
  border-radius: 4px;
}
#photo-list .photo-name {
  font-size: 12px;
  overflow-wrap: anywhere;
}
#photo-list .photo-actions {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
#photo-list button {
  padding: 1px 6px;
  min-height: 22px;
  font-size: 11px;
}
.workspace-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}
.album-workspace input[type='text'],
.album-workspace input[type='number'],
.album-workspace select,
.album-workspace textarea {
  width: 100%;
  box-sizing: border-box;
  color: inherit;
  font: inherit;
  border: 1px solid #dbe8e1;
  background: #ffffffb8;
  border-radius: 10px;
  padding: 9px 11px;
}
.album-workspace textarea {
  resize: vertical;
  line-height: 1.8;
}
.album-workspace button {
  color: inherit;
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--ui-line, #cfdfd6);
  border-radius: 999px;
  background: var(--ui-card-surface, #ffffff80);
  padding: 8px 14px;
  transition:
    background 0.2s,
    border-color 0.2s;
}
.album-workspace button:hover:not(:disabled) {
  background: var(--ui-hover-surface, #ffffffbd);
  border-color: var(--ui-control-line, #acc8ba);
}
.album-workspace button:active:not(:disabled) {
  transform: translateY(1px);
}
.album-workspace button:disabled {
  opacity: 0.45;
  cursor: default;
}
.album-workspace :focus-visible {
  outline: 2px solid #6d9785;
  outline-offset: 3px;
}
.workspace-primary {
  width: 100%;
  margin-top: 18px;
  background: #dceee4b3 !important;
}
.workspace-check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 15px;
  font-size: 13px;
}
.planner-choice {
  display: flex;
  gap: 10px;
  align-items: start;
  padding: 11px 0;
  cursor: pointer;
}
.planner-choice input {
  margin-top: 6px;
}
.planner-choice span,
.planner-choice small {
  display: block;
}
.saved-plans {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}
.saved-plans button[aria-pressed='true'] {
  background: #e0eee5b8;
  border-color: var(--ui-control-line, #acc8ba);
}
#status {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.workspace-result {
  border-radius: 22px;
  padding: 18px 0;
}
.workspace-result-heading {
  padding: 0 18px;
}
.workspace-result-heading h2 {
  font:
    26px 'Songti SC',
    serif;
  margin: 0;
}
.workspace-result-heading p {
  font-size: 13px;
  color: var(--ui-muted, #687b78);
}
.workspace-empty {
  display: grid;
  place-items: center;
  min-height: 500px;
  border: 1px dashed var(--ui-line, #cfdfd6);
  border-radius: 22px;
  color: var(--ui-muted, #687b78);
  padding: 25px;
  text-align: center;
}
.workspace-result .album-scene {
  position: relative;
  width: 100%;
  height: 680px;
  --page-width: min(26vw, 360px);
  --page-height: calc(var(--page-width) * 1.416666667);
}
.workspace-result .album-caption {
  padding: 0 20px;
  bottom: 65px;
}
.workspace-result .album-controls {
  bottom: 15px;
}
.workspace-result .album-controls button {
  font-size: 13px;
}
.workspace-result .handwritten {
  font-family: 'Songti SC', serif;
}
.workspace-result .album-status {
  font-size: 11px;
}
.writing-panel {
  margin: 20px 18px;
  padding: 20px;
  background: var(--ui-card-surface, #ffffff70);
  border: 1px solid var(--ui-line, #cfdfd6);
  border-radius: 18px;
}
.writing-panel h3 {
  font:
    23px 'Songti SC',
    serif;
  margin: 0;
}
.writing-panel textarea {
  margin-top: 12px;
}
.workspace-downloads {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 15px 18px;
}
.workspace-result > .workspace-note {
  padding: 0 18px;
}
.workspace-heading .brand:hover {
  color: var(--ui-ink);
  text-decoration: underline;
}
.workspace-heading .brand:active {
  transform: translateY(1px);
}
@media (max-width: 900px) {
  .workspace-layout {
    grid-template-columns: 1fr;
  }
  .workspace-result .album-scene {
    --page-width: 36vw;
    height: 610px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .album-workspace button {
    transition: none;
  }
  .album-workspace button:active {
    transform: none;
  }
}

.cover-previews {
  display: flex;
  gap: 24px;
  padding: 16px;
}
.cover-previews figure {
  margin: 0;
  max-width: 220px;
}
.cover-previews img {
  display: block;
  width: 100%;
  box-shadow: 0 5px 18px #31484a20;
}
.cover-previews figcaption {
  margin-top: 8px;
}

/* Custom visible upload surface; the native input remains keyboard accessible. */
.album-workspace .workspace-upload {
  position: relative;
  align-items: flex-start;
  gap: 12px;
  transition:
    background 0.2s,
    border-color 0.2s;
}
.album-workspace .workspace-upload-title {
  font-size: 16px;
  font-weight: 600;
  color: inherit;
}
.album-workspace .workspace-upload input[type='file'] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.album-workspace .workspace-upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 22px;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  background: var(--ui-card-surface);
  font: inherit;
  color: inherit;
}
.album-workspace .workspace-upload:hover {
  background: var(--ui-hover-surface);
  border-color: var(--ui-control-line);
}
.album-workspace .workspace-upload:active {
  background: var(--ui-card-surface);
}
.album-workspace .workspace-upload:focus-within {
  outline: 2px solid #6d9785;
  outline-offset: 3px;
}
.album-workspace fieldset:disabled .workspace-upload {
  opacity: 0.45;
  cursor: default;
}
.album-workspace select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23243838' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 18px;
  background-position: right 15px center;
}
.album-workspace [hidden] {
  display: none !important;
}
.generation-progress {
  padding: 15px 18px;
  margin: 16px 0 22px;
  border: 1px solid var(--ui-line);
  border-radius: 15px;
  background: var(--ui-card-surface);
}
.progress-heading {
  display: flex;
  gap: 15px;
  align-items: baseline;
  justify-content: space-between;
  font-size: 14px;
}
#progress-elapsed {
  font-size: 12px;
  white-space: nowrap;
  color: var(--ui-muted);
  font-variant-numeric: tabular-nums;
}
.generation-progress progress {
  display: block;
  width: 100%;
  height: 7px;
  margin: 14px 0 9px;
  accent-color: #8fb8aa;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
}
.generation-progress progress::-webkit-progress-bar {
  background: #dbe8e1;
}
.generation-progress progress::-webkit-progress-value {
  background: #8fb8aa;
  transition: width 0.2s;
}
#progress-count {
  font-size: 12px;
  margin: 0;
}
#progress-history {
  font-size: 11px;
  color: var(--ui-muted);
  padding-left: 18px;
  margin: 9px 0 0;
}
@media (prefers-reduced-motion: reduce) {
  .album-workspace .book-writing-hit,
  .generation-progress progress::-webkit-progress-value {
    transition: none;
  }
}

.workspace-result > .generation-progress {
  position: static;
  margin: 14px 18px 22px;
  background: var(--ui-hover-surface, #f6fbf8ed);
}
#progress-history {
  max-height: 34px;
  overflow: auto;
}

/* Paper-face editing follows the same perspective and animation as the album. */
.rotating-book-editor .album-book,
.rotating-book-editor .album-book * {
  pointer-events: none;
}
.rotating-book-editor .album-flat-page::after,
.rotating-book-editor .album-cover-inner::after {
  pointer-events: none;
}
.album-workspace .book-writing-hit {
  position: absolute;
  pointer-events: auto;
  cursor: text;
  padding: 0;
  margin: 0;
  min-height: 0;
  box-sizing: border-box;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  transform: none;
  backface-visibility: hidden;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.album-workspace .book-writing-hit:hover:not(:disabled),
.album-workspace .book-writing-hit:focus-visible {
  background: transparent;
  border-color: transparent;
  transform: none;
  outline: none;
}
.album-workspace .book-writing-input {
  position: absolute;
  pointer-events: auto;
  box-sizing: border-box;
  resize: none;
  margin: 0;
  padding: 0 3px;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  color: #303d38;
  font-family: PhotoJournalHand, cursive;
  overflow: hidden;
  box-shadow: none;
}
.album-workspace .book-writing-input[aria-invalid='true'] {
  border-color: #b36253;
}
.album-workspace .book-edit-done {
  position: absolute;
  bottom: 65px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  z-index: 5;
}
.album-workspace .book-edit-done:active {
  transform: translateX(-50%);
}
.rotating-book-editor {
  min-width: 0;
  overflow: visible;
}
.rotating-book-editor .album-scene[data-editing='true'] .album-controls {
  z-index: 6;
}
/* Keep progress above the book instead of floating over its paper. */
.rotating-book-editor .album-scene {
  height: min(680px, calc(100vh - 160px));
  min-height: 500px;
  --page-width: min(25vw, calc((100vh - 280px) / 1.416666667), 350px);
  --page-height: calc(var(--page-width) * 1.416666667);
}
.generation-progress[data-stage='complete'] #progress-history {
  display: none;
}

.album-workspace .book-writing-hit:active:not(:disabled) {
  transform: none;
}

/* Hover follows just the printed wave; the editor has no area-sized frame. */
.album-workspace .book-writing-hit {
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
}
.album-workspace .book-writing-hit svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  opacity: 0;
  pointer-events: none;
}
.album-workspace .book-writing-hit polyline {
  fill: none;
  stroke: #527f6e;
  stroke-width: 3;
}
.album-workspace .book-writing-hit:hover svg,
.album-workspace .book-writing-hit:focus-visible svg {
  opacity: 1;
}
.album-workspace .book-writing-input:focus,
.album-workspace .book-writing-input:focus-visible {
  outline: none;
  outline-offset: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.book-page-overlay {
  position: absolute;
  left: 0;
  top: 0;
  width: 900px;
  height: 1275px;
  transform-origin: 0 0;
  pointer-events: none;
  z-index: 3;
}
.book-page-overlay .book-writing-hit svg {
  pointer-events: none;
}

.print-settings {
  border-top: 1px solid var(--ui-line);
  margin-top: 20px;
  padding-top: 16px;
}
.print-settings h3 {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 14px;
}
.print-settings summary {
  cursor: pointer;
  font-size: 13px;
  padding: 8px 0;
}
.print-settings details > .workspace-field {
  margin-top: 12px;
}
.print-settings input,
.print-settings select {
  width: 100%;
  min-width: 0;
}
.print-settings input:invalid {
  border-color: #b87b70;
}
.album-workspace .workspace-cover-picker {
  margin: 22px 0;
  padding-top: 18px;
  border-top: 1px solid var(--ui-line);
}
.workspace-cover-picker > .workspace-field {
  max-width: 320px;
}
.workspace-cover-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  gap: 16px 10px;
  margin: 12px 0;
}
.workspace-cover-options button {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 4px !important;
  min-width: 0;
  white-space: normal;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  box-shadow: none;
}
.workspace-cover-options button[aria-pressed='true'] {
  border-color: var(--ui-green);
  background: var(--ui-hover-surface);
}
.workspace-cover-options img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 148/210;
  object-fit: contain;
  box-shadow: 2px 3px 6px #25372e20;
}
.workspace-cover-options span {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 3.2em;
  font-size: 10px;
  line-height: 1.6;
  margin-top: 5px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.workspace-draft {
  margin: 1rem 0;
  padding: 0.85rem;
  border: 1px solid var(--border, #c9dcd5);
  border-radius: 12px;
  background: #f5faf7;
}

.workspace-draft p {
  margin: 0 0 0.65rem;
}

.workspace-draft [data-stage='error'] {
  color: #9b3434;
}

.workspace-draft button {
  margin: 0.25rem 0.35rem 0 0;
}

@media (max-width: 700px), (pointer: coarse) and (max-width: 1100px) {
  .workspace-heading {
    padding: 22px 16px 16px;
  }
  .workspace-heading h1 {
    font-size: 29px;
  }
  .workspace-layout {
    padding: 0 12px 40px;
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .workspace-panel {
    padding: 16px;
  }
  .album-workspace input[type='text'],
  .album-workspace select {
    font-size: 16px;
    min-height: 44px;
  }
  #photo-list button {
    min-height: 44px;
    min-width: 44px;
  }
  .rotating-book-editor {
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }
  .rotating-book-editor .album-scene {
    --page-width: calc((100vw - 64px) / 2);
    height: 430px;
    min-height: 400px;
  }
  .rotating-book-editor .album-scene[data-editing='true'] {
    --page-width: max(600px, calc(100vw - 48px));
    width: calc(var(--page-width) * 2 + 48px);
    height: calc(var(--page-height) + 150px);
    min-height: 0;
  }
  .album-workspace .book-edit-done.is-touch-edit {
    position: fixed;
    z-index: 50;
    left: 50%;
    bottom: calc(var(--keyboard-inset, 0px) + max(12px, env(safe-area-inset-bottom)));
    min-height: 44px;
    background: #e2f5ef;
  }
  .workspace-cover-options span {
    white-space: normal;
  }
}

@media (max-width: 700px), (pointer: coarse) and (max-width: 1100px) {
  .book-edit-done.is-touch-edit::before {
    content: attr(data-edit-hint);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 12px;
    color: #31484a;
    background: #f5faf7ee;
    padding: 3px 8px;
    border-radius: 8px;
    pointer-events: none;
  }
}

@media (max-width: 700px), (pointer: coarse) and (max-width: 1100px) {
  .rotating-book-editor .album-scene[data-editing='true'] .album-book {
    transform: none !important;
  }
}

@media (max-width: 700px), (pointer: coarse) and (max-width: 1100px) {
  .album-workspace .book-edit-done.is-touch-edit,
  .album-workspace .book-edit-done.is-touch-edit:active {
    width: 110px;
    margin-left: -55px;
    transform: none;
    font-size: 16px;
    color: #31484a;
  }
}

.album-workspace .book-writing-hit:focus-visible,
.album-workspace .book-writing-input:focus-visible {
  outline: 3px solid #285e51;
  outline-offset: -3px;
}
.album-workspace .language-picker {
  margin-top: 12px;
}

/* Zoom the physical paper while editing; printed type remains 11 pt. The zoom
   follows the selected area's font, so landscape pages are equally readable. */
.rotating-book-editor {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.rotating-book-editor .album-scene[data-editing='true'] {
  --page-width: var(--editing-page-width, 700px);
  width: calc(var(--page-width) * 2 + 48px);
  height: calc(var(--page-height) + 150px);
  min-height: 0;
}
.rotating-book-editor .album-scene[data-editing='true'] .album-book {
  transform: none !important;
}
.album-workspace .book-edit-done.is-touch-edit {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(var(--keyboard-inset, 0px) + max(12px, env(safe-area-inset-bottom)));
  min-height: 44px;
  background: #e2f5ef;
}

.workspace-heading {
  position: relative;
}
.workspace-heading .brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.album-workspace .language-picker {
  position: absolute;
  right: 32px;
  top: 28px;
  margin: 0;
}
@media (max-width: 760px) {
  .album-workspace .language-picker {
    right: 16px;
    top: 22px;
  }
}

@media (min-width: 1100px) {
  .rotating-book-editor .album-scene[data-format='a4-landscape']:not([data-editing='true']) {
    --page-width: min(30vw, 470px);
  }
}

@media (max-width: 700px) {
  .workspace-cover-options {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px 6px;
  }
}

/* A compact reserve pool: placed photographs live on the book itself. */
#photo-list.photo-pool {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  list-style: none;
  max-height: 480px;
}
#photo-list.photo-pool .photo-pool-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: #ffffff80;
  cursor: grab;
}
#photo-list.photo-pool .photo-pool-card:active {
  cursor: grabbing;
}
#photo-list.photo-pool .photo-pool-card img {
  width: 100%;
  height: 112px;
  object-fit: contain;
  border-radius: 5px;
  background: #f1f2ec;
}
.photo-pool-actions {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
}
.album-workspace .photo-pool-actions button {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  margin: 0;
  padding: 2px;
  font-size: 17px;
  line-height: 1;
}
#photo-list.photo-pool .photo-drag-over {
  border: 2px solid var(--ui-green);
}
.photo-edit-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 12px 0;
}
.photo-edit-toolbar[hidden] {
  display: none;
}
.album-workspace .photo-edit-toolbar button {
  margin: 0;
  min-height: 40px;
  padding: 7px 18px;
}
.rotating-book-editor .album-scene[data-photo-mode='true'] .album-book {
  transform: none !important;
}
.album-workspace .book-photo-hit {
  position: absolute;
  display: block;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 3px solid transparent;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  pointer-events: auto;
  cursor: grab;
  z-index: 2;
}
.album-workspace .book-photo-hit:hover,
.album-workspace .book-photo-hit:focus-visible {
  border-color: #3c7969;
  background: #3c796910;
  outline: none;
}
.book-photo-hit span {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 12px;
  background: #fffffff0;
  border-radius: 5px;
  font-size: 28px;
  line-height: 1.4;
  color: #345a4e;
  opacity: 0;
  pointer-events: none;
}
.book-photo-hit:hover span,
.book-photo-hit:focus-visible span {
  opacity: 1;
}
.is-dragging-photo .book-photo-hit {
  border: 4px dashed #4b8d76;
  background: #4b8d7610;
}
.album-workspace .book-photo-hit.photo-drag-over {
  border: 7px solid #28785e;
  background: #4b8d7633;
}
.photo-replace-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: 85dvh;
  padding: 28px;
  border: 1px solid var(--ui-line);
  border-radius: 18px;
  color: var(--ui-ink);
  background: #f8faf5;
  box-shadow: 0 18px 70px #152d2630;
}
.photo-replace-dialog::backdrop {
  background: #182d2755;
}
.photo-replace-dialog h2 {
  margin: 0 45px 20px 0;
  font-size: 24px;
}
.photo-replace-dialog p {
  font-size: 14px;
  color: var(--ui-muted);
}
.album-workspace .photo-dialog-close {
  position: absolute;
  right: 15px;
  top: 15px;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 25px;
}
.photo-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 20px;
}
.album-workspace .photo-choice-grid button {
  min-width: 0;
  margin: 0;
  padding: 5px;
  border-radius: 8px;
}
.photo-choice-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}
.photo-replace-dialog summary {
  cursor: pointer;
  margin-top: 18px;
  font-size: 14px;
}
.photo-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.album-workspace .photo-dialog-footer button {
  margin: 0;
}
@media (max-width: 700px) {
  .photo-replace-dialog {
    padding: 20px;
  }
  .photo-choice-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .album-workspace .photo-pool-actions button {
    width: 40px;
    min-height: 40px;
  }
}

.workspace-live-upload {
  margin-top: 18px;
  background: #edf4eb88;
}
.workspace-live-upload small {
  font: 11px/1.4 system-ui;
  letter-spacing: 1px;
  border: 1px solid #a6bca7;
  border-radius: 20px;
  padding: 3px 9px;
  vertical-align: middle;
}
.live-pending {
  padding-left: 18px;
  font-size: 12px;
  color: #82704b;
  overflow-wrap: anywhere;
}
.live-pending li {
  margin: 8px 0;
}
.live-pending select {
  width: 100%;
  font-size: 12px;
  margin-top: 6px;
}
.live-upload-help {
  font-size: 12px;
  margin: 10px 0 18px;
}
.live-upload-help summary {
  cursor: pointer;
  color: #617766;
}
.book-live-layer {
  position: absolute;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}
.book-live-layer video {
  position: absolute;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
}
.book-live-toolbar {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 12px 0;
}
.book-live-toolbar[hidden] {
  display: none;
}
.book-live-toolbar button {
  font-size: 12px;
  min-height: 44px;
  padding: 8px 15px;
  border-radius: 24px;
  color: #315a40;
  background: #eef5e7;
  border: 1px solid #b5cbb3;
  cursor: pointer;
}

/* Album setup and the book share one work surface. */
.workspace-heading,
.workspace-layout {
  max-width: 1280px;
}
.workspace-heading {
  display: flex;
  align-items: center;
  gap: 26px;
  padding-bottom: 24px;
}
.workspace-heading h1 {
  margin: 0;
  border-inline-start: 1px solid var(--ui-line);
  padding-inline-start: 24px;
  font-size: 20px;
}
.workspace-layout {
  align-items: start;
}
.workspace-panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 18px 16px 0 0;
}
.workspace-fold {
  margin: 12px 0;
  border-bottom: 1px solid var(--ui-line);
}
.workspace-fold > summary {
  padding: 10px 0;
  cursor: pointer;
  font-size: 14px;
}
.workspace-fold[open] {
  padding-bottom: 12px;
}
.workspace-panel p:empty,
.workspace-result-heading p:empty,
#photo-list:empty {
  display: none;
}
#planner-controls .planner-choice:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-inline-end: 14px;
  padding: 4px 0;
}
.planner-choice input {
  margin: 0;
  accent-color: var(--ui-ink);
}
.planner-choice strong {
  font-size: 14px;
  font-weight: 500;
}
.album-workspace .workspace-primary {
  background: var(--ui-ink, #31484a) !important;
  color: white;
}
.workspace-draft {
  padding: 0;
  background: transparent;
  border: 0;
}
.workspace-result-heading {
  padding: 0 0 16px;
}
.workspace-empty {
  min-height: clamp(270px, 40vh, 410px);
  background: var(--ui-card-surface);
  border: 0;
  border-radius: 8px;
}
.selected-cover {
  display: block;
  height: clamp(184px, 31vh, 290px);
  max-width: 85%;
  object-fit: contain;
  box-shadow: 2px 4px 9px #243d341f;
}
.workspace-cover-options {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 3px 3px 10px;
  scrollbar-width: thin;
}
.workspace-cover-options button {
  flex: 0 0 78px;
  scroll-snap-align: start;
}
.workspace-cover-options span {
  min-height: 0;
  font-size: 12px;
}
@media (max-width: 900px) {
  .workspace-panel {
    padding: 0;
  }
  .workspace-heading {
    gap: 12px;
    padding-inline-end: 100px;
  }
  .workspace-heading h1 {
    font-size: 16px;
    padding-inline-start: 12px;
  }
  .workspace-result {
    padding-top: 0;
  }
}

.import-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--ui-line);
  border-radius: 12px;
}
.album-workspace .import-box .workspace-upload {
  justify-content: center;
  align-items: center;
  min-height: 40px;
  margin: 0;
  border: 0;
  padding: 0;
}
.album-workspace .import-box .workspace-upload-button {
  padding: 4px 12px;
  font-size: 14px;
}
.workspace-draft:has(#draft-status:empty) {
  display: none;
}

.workspace-export > summary {
  width: fit-content;
  cursor: pointer;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  padding: 7px 18px;
}
.workspace-export[open] > summary {
  margin-bottom: 12px;
}

.album-workspace .album-book {
  transform: none !important;
}
.workspace-cover-picker {
  min-inline-size: 0;
  max-inline-size: 100%;
}
.cover-scroll-controls {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.cover-scroll-controls button {
  padding: 0;
  width: 32px;
  height: 32px;
  font: 22px/1 sans-serif;
}

/* The editor becomes visible with both inside pages in their reading position. */
#workspace-book:not([data-ready='true']) {
  visibility: hidden;
}

#book-stage {
  position: relative;
}
html.restoring-album {
  scroll-behavior: auto;
  overflow-anchor: none;
}
.album-refresh-frame {
  position: fixed;
  z-index: 5;
  pointer-events: none;
}
