[hidden] {
  display: none !important;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin: 12px 0 24px;
}
.hero-actions .button { margin: 0; }
.desktop-editor-link {
  display: none;
}
html[data-device="desktop"] .desktop-editor-link {
  display: inline-flex;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.create-page {
  max-width: 1600px;
  margin: auto;
  padding: 24px 40px 0;
}
.editor-gate {
  max-width: 760px;
  margin: 50px auto 100px;
  text-align: center;
}
.editor-gate > img {
  margin: 0 auto 28px;
  border-radius: 18px;
}
.editor-gate h1 {
  max-width: none;
  font-size: 3rem;
  line-height: 1.12;
}
.editor-gate p {
  font-size: 1.2rem;
  max-width: 52ch;
  margin: 24px auto;
}
.editor-gate .store-badges {
  justify-content: center;
}
.editor-app {
  font-size: 1rem;
  line-height: 1.5;
}
.editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}
.editor-heading h1 {
  font-size: 2.3rem;
  line-height: 1.15;
  max-width: none;
  margin: 0 0 8px;
}
.editor-heading p {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 1.05rem;
}
.editor-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.editor-app button,
.editor-app select,
.editor-app input {
  font: inherit;
}
.editor-app button {
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 16px;
  min-height: 46px;
  background: var(--paper);
  color: var(--foreground);
  font-weight: 600;
  line-height: 1.4;
}
.editor-app button:hover:not(:disabled) {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 7%, var(--paper));
}
.editor-app button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.editor-app .editor-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}
.editor-app .editor-primary:hover:not(:disabled) {
  background: var(--primary);
  filter: brightness(0.94);
}
.editor-primary span {
  margin-left: 12px;
}
.editor-app :is(button, input, select, summary, a):focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
}
.editor-app input:invalid {
  border-color: #a23824;
}
.editor-notice {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper);
  margin-bottom: 20px;
  color: var(--muted-foreground);
}
.editor-error {
  padding: 16px 20px;
  background: #fff0e7;
  color: #8a2516;
  border: 1px solid #ba6f54;
  border-radius: 6px;
  margin: 0 0 20px;
  font-size: 1.05rem;
}
.editor-workspace {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.editor-controls {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 0;
}
.control-section {
  padding: 22px;
  border-bottom: 1px solid var(--border);
}
.control-section:last-child {
  border-bottom: 0;
}
.control-section h2 {
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-heading h2 {
  margin: 0;
}
.editor-app .quiet-button {
  padding: 7px 9px;
  border-color: transparent;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: 1rem;
}
.add-photos,
.wide-button {
  width: 100%;
}
.editor-help {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--muted-foreground);
  margin: 12px 0 0;
}
.photo-list {
  padding: 0;
  margin: 18px 0 0;
  list-style: none;
  max-height: 248px;
  overflow: auto;
}
.photo-list li + li {
  margin-top: 8px;
}
.photo-list button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 9px !important;
}
.photo-list button[aria-pressed="true"] {
  border: 2px solid var(--primary);
  padding: 8px !important;
  background: color-mix(in srgb, var(--primary) 8%, var(--paper));
}
.photo-list img {
  width: 52px;
  height: 44px;
  object-fit: cover;
  border-radius: 3px;
}
.photo-list button > span {
  min-width: 0;
}
.photo-list strong {
  font-size: 1rem;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-list span span {
  display: block;
  color: var(--muted-foreground);
  font-size: 1rem;
  font-weight: 400;
}
.editor-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 14px 0;
}
.editor-field > span {
  font-size: 1rem;
  font-weight: 600;
}
.editor-app :is(input:not([type="checkbox"]):not([type="range"]), select) {
  background: var(--background);
  color: var(--foreground);
  border: 1px solid #687e8d;
  border-radius: 5px;
  min-height: 46px;
  padding: 9px 10px;
  width: 100%;
  min-width: 0;
}
.editor-app select {
  cursor: pointer;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field-row .editor-field {
  margin: 10px 0;
}
.size-presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}
.size-presets button {
  padding: 8px;
}
.orientation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 15px 0;
}
.orientation button[aria-pressed="true"] {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}
.editor-app details {
  margin-top: 18px;
}
.editor-app summary {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 0;
  font-size: 1rem;
  font-weight: 600;
}
.crop-preview {
  max-width: 100%;
  width: 100%;
  overflow: hidden;
  margin: 12px auto 16px;
  background: #e3e8ea;
}
.crop-preview img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}
.editor-field input[type="range"] {
  width: 100%;
  min-height: 32px;
  accent-color: var(--primary);
}
.editor-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 1rem;
  margin-top: 18px;
  cursor: pointer;
}
.editor-check input {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--primary);
}
.sheet-workspace {
  min-width: 0;
  border-radius: 8px;
  background: #e4e9eb;
  border: 1px solid #cbd4d9;
  padding: 24px;
  position: sticky;
  top: 16px;
}
.sheet-toolbar {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  color: #405366;
}
.sheet-toolbar > span {
  white-space: nowrap;
  font-size: 1rem;
}
.sheet-title {
  min-width: 0;
  max-width: 340px;
}
.editor-app .sheet-title input {
  background: transparent;
  border-color: transparent;
  font-family: "Bricolage Display", Manrope, sans-serif;
  font-size: 1.3rem;
  color: #182c40;
}
.editor-app .sheet-title input:hover {
  border-color: #687e8d;
}
.paper-stage {
  max-width: 500px;
  margin: auto;
  min-height: 280px;
}
.print-paper {
  background: #fff;
  position: relative;
  box-shadow:
    0 4px 8px #20324514,
    0 18px 36px #20324519;
  width: 100%;
  isolation: isolate;
}
.paper-margin {
  position: absolute;
  border: 1px dashed #b5bdc6;
  pointer-events: none;
}
.editor-app .paper-photo {
  position: absolute;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #e5e9e8;
}
.editor-app .paper-photo:hover:not(:disabled) {
  background: #e5e9e8;
}
.paper-photo img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}
.paper-photo.selected {
  outline: 2px solid #315f91;
  outline-offset: 2px;
}
.photo-loading,
.photo-failed {
  font-size: 16px;
  color: #34495a;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 8px;
}
.calibration {
  position: absolute;
  border-top: 1px solid #161b20;
  color: #161b20;
  height: 6px;
  font-size: 9px;
  white-space: nowrap;
  font-family: Arial, sans-serif;
  pointer-events: none;
}
.calibration:before,
.calibration:after {
  content: "";
  height: 6px;
  position: absolute;
  top: -3px;
  border-left: 1px solid #161b20;
}
.calibration:after {
  right: 0;
}
.calibration span {
  display: block;
  margin-top: 2px;
}
.page-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 26px 0 10px;
}
.page-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #34495a;
}
.editor-app .page-controls select {
  width: auto;
  min-width: 64px;
  background: #fff;
  color: #182c40;
}
.preview-note {
  text-align: center;
  font-size: 1rem;
  margin: 14px 0 0;
  color: #405366;
}
.printing-note {
  padding-top: 20px;
  border-top: 1px solid #b8c5cd;
  margin-top: 24px;
  color: #34495a;
  font-size: 1rem;
}
.printing-note > strong {
  font-family: "Bricolage Display", Manrope, sans-serif;
  font-size: 1.2rem;
  color: #182c40;
}
.printing-note p {
  margin: 6px 0 0;
}
.resolution-warning {
  color: #8d381b;
  font-size: 1rem;
  line-height: 1.5;
}
.sheet-workspace > .resolution-warning {
  text-align: center;
}
.editor-empty {
  text-align: center;
  max-width: 480px;
  margin: 15px auto 28px;
}
.empty-sheet {
  width: 160px;
  transform: rotate(-5deg);
  margin: 30px auto;
  box-shadow: 0 12px 28px #18324b24;
}
.empty-sheet img {
  width: 100%;
}
.editor-empty h2 {
  font-size: 2.65rem;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 28px 0 18px;
  color: #182c40;
}
.editor-empty p {
  color: #405366;
  font-size: 1.1rem;
  margin: 18px auto;
  max-width: 34ch;
}
.layout-blocked {
  text-align: center;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #182c40;
}
.layout-blocked h2 {
  font-size: 2rem;
}
.is-dragging {
  outline: 4px dashed var(--primary);
  outline-offset: 5px;
}
.editor-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  color: var(--muted-foreground);
  padding: 16px 0;
  font-size: 1rem;
}
.editor-bottom p {
  max-width: 65ch;
}
@media (min-width: 1440px) {
  .editor-workspace {
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 40px;
  }
  .paper-stage {
    max-width: 530px;
  }
}
@media (max-width: 1199px) {
  .create-page {
    padding: 20px 24px 0;
  }
  .editor-heading {
    align-items: flex-start;
  }
  .editor-heading h1 {
    font-size: 2rem;
  }
  .editor-workspace {
    gap: 20px;
    grid-template-columns: 310px minmax(0, 1fr);
  }
  .editor-file-actions {
    max-width: 400px;
  }
  .sheet-workspace {
    padding: 20px;
  }
  .sheet-toolbar {
    flex-wrap: wrap;
    gap: 4px;
  }
  .control-section {
    padding: 18px;
  }
  .editor-heading p {
    max-width: 26ch;
  }
}
@media (max-width: 1023px) {
  .editor-app {
    display: none;
  }
  .create-page {
    padding: 24px;
  }
  .editor-gate h1 {
    font-size: 2.5rem;
  }
  .editor-gate {
    margin-top: 25px;
  }
}
@media (prefers-color-scheme: dark) {
  .sheet-workspace {
    background: #253e50;
    border-color: #4d6372;
  }
  .sheet-toolbar,
  .sheet-toolbar > span,
  .preview-note,
  .printing-note,
  .editor-empty p,
  .page-controls label {
    color: #c8d6df;
  }
  .editor-app .sheet-title input,
  .printing-note > strong,
  .editor-empty h2,
  .layout-blocked {
    color: #f2f0e9;
  }
  .printing-note {
    border-color: #596d7d;
  }
  .editor-error {
    background: #442b25;
    color: #ffd4bd;
    border-color: #a77761;
  }
  .resolution-warning {
    color: #ffd0aa;
  }
  .editor-app input:invalid {
    border-color: #efad93;
  }
}
@media (prefers-reduced-motion: reduce) {
  .editor-app button {
    transition: none;
  }
}

/* Keep export actions and the sheet visible while adjusting controls. */
.editor-heading { position: sticky; top: 0; z-index: 5; background: var(--background); padding: 16px 0; margin-top: -16px; border-bottom: 1px solid var(--border); }
.editor-heading h1 { font-size: 2rem; }
.editor-heading p { max-width: 40ch; font-size: 1rem; }
.editor-file-actions { flex-shrink: 0; }
.sheet-workspace { top: 120px; padding: 24px 28px; }
.paper-stage { display: flex; justify-content: center; max-width: 100%; min-height: 0; }
.print-paper { flex-shrink: 1; }
.sheet-toolbar { margin-bottom: 18px; }
.editor-app .sheet-title input { border-color: #687e8d; font-size: 1.125rem; }
.page-controls { margin: 20px 0 8px; gap: 14px; }
.preview-note { font-size: 1rem; margin-top: 10px; }
.printing-note { margin-top: 20px; padding-top: 16px; }
.editor-empty { max-width: 480px; margin: 0 auto 20px; }
.empty-sheet { width: 115px; transform: rotate(-4deg); margin: 24px auto; }
.editor-empty h2 { font-size: 2.1rem; margin: 24px 0 16px; }
.editor-empty p { max-width: 38ch; font-size: 1.125rem; }
.editor-empty .editor-primary { min-width: 190px; min-height: 54px; font-size: 1.125rem; }
.editor-empty .editor-help { font-size: 1rem; margin: 16px auto 4px; }
.field-error { color: #8a2516; font-size: 1rem; line-height: 1.5; }
.editor-app input, .editor-app select, .editor-app summary, .editor-app button { scroll-margin-top: 140px; }
@media (prefers-color-scheme: dark) { .field-error { color: #ffd4bd; } }
@media (max-width: 1199px) { .editor-heading { gap: 20px; } .editor-heading h1 { font-size: 1.85rem; } .sheet-workspace { top: 150px; padding: 20px; } .editor-file-actions { max-width: 390px; } .editor-app input, .editor-app select, .editor-app summary, .editor-app button { scroll-margin-top: 170px; } }
@media (max-height: 740px) { .editor-heading, .sheet-workspace { position: static; } }

/* Enlarged text must never leave controls covered by a sticky header. */
.editor-app[data-tall-header] :is(.editor-heading, .sheet-workspace) { position: static; }
.editor-app[data-tall-header] :is(input, select, summary, button) { scroll-margin-top: 16px; }
