.editor-state {
  min-height: calc(100vh - 72px);
  background: var(--paper);
}
.editor-topbar {
  position: sticky;
  top: 72px;
  z-index: 30;
  min-height: 70px;
  padding: 12px clamp(14px, 3vw, 26px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: rgba(250, 250, 247, .95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.file-title {
  min-width: 0;
  text-align: center;
  display: grid;
  gap: 3px;
}
#fileNameLabel {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 900;
}
#pageCountLabel {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.fit-toggle {
  min-height: 42px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}
.fit-toggle:hover {
  color: var(--indigo);
  border-color: rgba(67, 56, 202, .36);
  background: rgba(67, 56, 202, .07);
}
.fit-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
.editor-workspace {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 150px;
  height: calc(100vh - 142px);
  height: calc(100dvh - 142px);
  min-height: 460px;
}
.page-thumbs,
.tool-rail {
  background: var(--surface);
  border-color: var(--line);
}
.page-thumbs {
  border-right: 1px solid var(--line);
  overflow: auto;
}
.thumbnail-list {
  padding: 14px;
  display: grid;
  gap: 12px;
}
.thumb-button {
  width: 100%;
  padding: 7px;
  display: grid;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.thumb-button:focus-visible {
  outline: none;
}
.thumb-button:hover canvas,
.thumb-button:focus-visible canvas,
.thumb-button.is-current canvas {
  border-color: var(--indigo);
  box-shadow: 0 0 0 1px rgba(67, 56, 202, .22);
}
.thumb-button canvas {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  border: 1px solid rgba(10, 10, 15, .08);
  border-radius: 4px;
}
.document-area {
  min-width: 0;
  padding: clamp(18px, 3vw, 34px);
  display: grid;
  place-items: start center;
  overflow: auto;
}
.document-pages {
  width: max-content;
  min-width: 100%;
  display: grid;
  justify-items: center;
  gap: clamp(18px, 3vw, 30px);
}
.page-shell {
  position: relative;
  display: grid;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 18px 48px rgba(10, 10, 15, .16);
  border-radius: 2px;
}
.pdf-canvas {
  width: 100%;
  height: auto;
  display: block;
}
.overlay-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.page-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .78);
  color: var(--muted);
  font-weight: 800;
}
.page-loading[hidden] {
  display: none;
}
.placed-item {
  position: absolute;
  min-width: 34px;
  min-height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  cursor: move;
  touch-action: none;
  user-select: none;
}
.placed-item.is-selected {
  border-color: var(--indigo);
}
.placed-item img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  display: block;
}
.placed-text {
  width: 100%;
  height: 100%;
  padding: 2px 4px;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  font-size: var(--field-font-size, 16px);
  line-height: 1;
}
.placed-item[data-kind="text"] .placed-text {
  display: block;
  align-items: flex-start;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.15;
}
.placed-item[data-style="bold"] .placed-text {
  font-weight: 800;
}
.placed-item[data-style="italic"] .placed-text {
  font-style: italic;
}
.resize-handle {
  position: absolute;
  right: -9px;
  bottom: -9px;
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--indigo);
  box-shadow: 0 4px 10px rgba(10, 10, 15, .18);
  cursor: nwse-resize;
  display: none;
}
.delete-field {
  position: absolute;
  top: -13px;
  right: -13px;
  width: 26px;
  height: 26px;
  display: none;
  place-items: center;
  border: 1px solid rgba(10, 10, 15, .14);
  border-radius: 999px;
  background: var(--surface);
  color: var(--danger);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}
.edit-field {
  position: absolute;
  top: -13px;
  left: -13px;
  width: 26px;
  height: 26px;
  display: none;
  place-items: center;
  border: 1px solid rgba(10, 10, 15, .14);
  border-radius: 999px;
  background: var(--surface);
  color: var(--indigo);
  cursor: pointer;
}
.edit-field svg {
  width: 15px;
  height: 15px;
}
.placed-item.is-selected .resize-handle,
.placed-item.is-selected .delete-field,
.placed-item.is-selected .edit-field {
  display: grid;
  opacity: 1;
}
@media (hover: hover) and (pointer: fine) {
  .placed-item:not(.is-selected):hover {
    border-color: rgba(67, 56, 202, .36);
    box-shadow: 0 0 0 2px rgba(67, 56, 202, .08);
  }
  .placed-item:not(.is-selected):hover .resize-handle,
  .placed-item:not(.is-selected):hover .delete-field,
  .placed-item:not(.is-selected):hover .edit-field {
    display: grid;
    opacity: .58;
  }
  .placed-item:not(.is-selected):hover .delete-field:hover,
  .placed-item:not(.is-selected):hover .edit-field:hover,
  .placed-item:not(.is-selected):hover .resize-handle:hover {
    opacity: .92;
  }
}
.tool-rail {
  padding: 14px;
  border-left: 1px solid var(--line);
  display: grid;
  align-content: start;
  gap: 10px;
}
.tool-action {
  min-height: 58px;
  padding: 9px;
  display: grid;
  justify-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
}
.tool-action .inline-icon {
  width: 22px;
  height: 22px;
}
.tool-stamp-icon {
  width: 24px;
  height: 24px;
  color: currentColor;
}
.tool-action:hover {
  color: var(--indigo);
  border-color: rgba(67, 56, 202, .36);
  background: rgba(67, 56, 202, .07);
}
.tool-action small {
  color: var(--indigo);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.tool-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}
.editor-status {
  padding: 0 20px 18px;
  text-align: center;
}
.editor-status:empty {
  display: none;
}
.success-panel {
  margin: 0 auto;
  width: min(100% - 40px, 1040px);
  padding: clamp(20px, 4vw, 34px) 0 56px;
  display: grid;
  grid-template-columns: minmax(260px, .72fr) minmax(580px, 1fr);
  gap: 18px;
}
.success-panel[hidden] {
  display: none;
}
.success-copy,
.app-card {
  border-radius: 8px;
  padding: clamp(22px, 4vw, 34px);
}
.success-copy {
  background: var(--surface);
  border: 1px solid var(--line);
}
.success-check {
  width: 74px;
  height: 74px;
  margin-bottom: 12px;
}
.success-check circle,
.success-check path {
  fill: none;
  stroke: var(--ok);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 210;
  stroke-dashoffset: 210;
  animation: draw-word .9s ease forwards;
}
.success-copy h2,
.app-card h3 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
  letter-spacing: 0;
}
.success-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.app-card {
  background: var(--ink);
  color: #fff;
}
.app-promo-card {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(22px, 3vw, 32px);
  overflow: hidden;
}
.app-promo-device {
  display: flex;
  justify-content: center;
  align-self: stretch;
  min-height: 270px;
  margin: -8px 0 -30px;
}
.app-promo-device img {
  width: min(190px, 100%);
  height: auto;
  max-height: 340px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 22px 28px rgba(0, 0, 0, .34));
}
.app-promo-copy {
  min-width: 0;
}
.app-card p {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, .78);
}
.app-promo-card h3 {
  max-width: 520px;
  font-size: clamp(28px, 2.4vw, 34px);
  overflow-wrap: normal;
}
.app-promo-card p {
  max-width: 520px;
  font-size: 16px;
  line-height: 1.55;
}
.app-promo-card .store-row {
  align-items: flex-start;
  justify-content: flex-start;
  gap: 14px;
}
.app-promo-card .store-download-option {
  gap: 8px;
  width: 118px;
}
.app-promo-card .store-badge,
.app-promo-card .store-badge img {
  height: 36px;
  max-width: 118px;
}
.app-promo-card .desktop-store-qr {
  width: 84px;
}
body.desktop-download-context .app-promo-card .store-row {
  gap: 14px;
}
.app-mark,
.footer-mark {
  display: block;
  font-family: "Demo Great Vibes", "Demo Sacramento", cursive;
  font-weight: 400;
  line-height: 1;
}
.app-mark {
  margin-bottom: 12px;
  font-size: 64px;
}
.store-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.store-badge {
  height: 50px;
  display: inline-flex;
  align-items: center;
}
.store-badge img {
  width: auto;
  height: 50px;
  display: block;
}
@media (max-width: 1120px) {
  .success-panel {
    grid-template-columns: 1fr;
  }
  .app-promo-card {
    grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  }
}
@media (max-width: 720px) {
  .app-promo-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .app-promo-device {
    justify-content: center;
    min-height: 0;
    margin: -8px 0 6px;
  }
  .app-promo-device img {
    width: 144px;
    max-height: 270px;
  }
  .app-promo-card .store-row {
    justify-content: center;
    flex-wrap: wrap;
  }
}
