.pdf-workbench-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(0, 103, 184, 0.12), transparent 28%),
    linear-gradient(180deg, #f5fbff 0%, #ffffff 55%);
}

.pdf-workbench-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  background: #ffffff;
  border: 1px solid #d8e5f1;
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(0, 78, 140, 0.08);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.pdf-workbench-eyebrow {
  display: inline-block;
  margin-bottom: 0.7rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #e8f3ff;
  color: #0067b8;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pdf-workbench-hero h1 {
  margin: 0 0 0.75rem;
  color: #14324a;
  font-size: clamp(2rem, 4vw, 3rem);
}

.pdf-workbench-hero p {
  margin: 0;
  max-width: 48rem;
  color: #4c6477;
  font-size: 1.02rem;
}

.pdf-workbench-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pdf-workbench-layout {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.pdf-workbench-sidebar,
.pdf-workbench-main {
  min-width: 0;
}

.pdf-workbench-panel,
.pdf-workbench-surface {
  background: #fff;
  border: 1px solid #d8e5f1;
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(0, 78, 140, 0.06);
}

.pdf-workbench-panel {
  padding: 1.25rem;
}

.pdf-workbench-panel + .pdf-workbench-panel {
  margin-top: 1rem;
}

.pdf-workbench-panel h2 {
  margin: 0 0 0.9rem;
  color: #14324a;
  font-size: 1.08rem;
}

.pdf-workbench-nav {
  display: grid;
  gap: 0.65rem;
}

.pdf-workbench-nav__item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid #d8e5f1;
  border-radius: 14px;
  background: #f9fcff;
  color: #14324a;
  text-align: left;
}

.pdf-workbench-nav__item.is-active {
  border-color: #0067b8;
  background: #eef6ff;
  box-shadow: inset 0 0 0 1px rgba(0, 103, 184, 0.08);
}

.pdf-workbench-nav__item span {
  font-weight: 700;
}

.pdf-workbench-nav__item small {
  color: #60788b;
}

.pdf-workbench-list {
  margin: 0 0 0 1rem;
  color: #4c6477;
}

.pdf-workbench-list li + li {
  margin-top: 0.45rem;
}

.pdf-workbench-surface {
  padding: 1.4rem;
}

.pdf-workbench-surface__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.pdf-workbench-surface__header h2 {
  margin: 0 0 0.45rem;
  color: #14324a;
}

.pdf-workbench-surface__header p {
  margin: 0;
  color: #4c6477;
}

.pdf-workbench-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 1rem;
  border: 1px solid #0067b8;
  border-radius: 12px;
  background: #0067b8;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.pdf-workbench-button:hover {
  color: #fff;
  background: #00599f;
}

.pdf-workbench-button--ghost {
  background: #fff;
  color: #0067b8;
}

.pdf-workbench-button--ghost:hover {
  background: #eef6ff;
  color: #00599f;
}

.pdf-workbench-button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.pdf-workbench-dropzone {
  border: 2px dashed #b8d2e5;
  border-radius: 18px;
  background: linear-gradient(180deg, #fcfeff 0%, #f5fbff 100%);
  padding: 2rem 1rem;
  text-align: center;
  color: #4c6477;
  margin-bottom: 1rem;
}

.pdf-workbench-dropzone.is-dragover {
  border-color: #0067b8;
  background: #eef6ff;
}

.pdf-workbench-drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(9, 24, 38, 0.62);
  pointer-events: none;
}

.pdf-workbench-drop-overlay.is-active {
  display: flex;
}

.pdf-workbench-drop-overlay__panel {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(440px, 94vw);
  padding: 1.35rem;
  border: 2px dashed #7bb7e4;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.24);
}

.pdf-workbench-drop-overlay__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #eef6ff;
  color: #0067b8;
  font-weight: 800;
}

.pdf-workbench-drop-overlay__panel strong,
.pdf-workbench-drop-overlay__panel span {
  display: block;
}

.pdf-workbench-drop-overlay__panel strong {
  color: #14324a;
  font-size: 1.05rem;
}

.pdf-workbench-drop-overlay__panel span {
  margin-top: 0.2rem;
  color: #4c6477;
}

.pdf-workbench-dropzone h3 {
  margin: 0 0 0.5rem;
  color: #14324a;
}

.pdf-workbench-dropzone p {
  margin: 0 0 1rem;
}

.pdf-workbench-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
}

.pdf-workbench-card {
  border: 1px solid #d8e5f1;
  border-radius: 18px;
  background: #fff;
  padding: 1rem;
}

.pdf-workbench-card h3 {
  margin: 0 0 0.8rem;
  color: #14324a;
  font-size: 1.05rem;
}

.pdf-workbench-file-list {
  display: grid;
  gap: 0.75rem;
}

.pdf-workbench-file-item {
  display: grid;
  gap: 0.75rem;
  padding: 0.95rem;
  border: 1px solid #d8e5f1;
  border-radius: 14px;
  background: #f9fcff;
}

.pdf-workbench-file-item.is-dragging {
  opacity: 0.5;
}

.pdf-workbench-file-item.is-drop-target {
  border-color: #0067b8;
  background: #eef6ff;
}

.pdf-workbench-file-layout {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: start;
}

.pdf-workbench-file-preview {
  position: relative;
  width: 86px;
  height: 112px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #d8e5f1;
  background:
    linear-gradient(180deg, #ffffff 0%, #f3f8fc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-workbench-file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pdf-workbench-file-preview-placeholder {
  text-align: center;
  color: #60788b;
  font-size: 0.8rem;
  line-height: 1.35;
  padding: 0.5rem;
}

.pdf-workbench-file-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.pdf-workbench-file-name {
  color: #14324a;
  font-weight: 700;
  word-break: break-word;
}

.pdf-workbench-file-meta {
  color: #60788b;
  font-size: 0.92rem;
}

.pdf-workbench-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pdf-workbench-mini-button {
  min-height: 30px;
  padding: 0.3rem 0.55rem;
  border: 1px solid #c9dceb;
  border-radius: 8px;
  background: #fff;
  color: #24516f;
  font-size: 0.86rem;
}

.pdf-workbench-mini-button:hover {
  background: #eef6ff;
}

.pdf-workbench-drag-handle {
  cursor: grab;
  border-color: #0067b8;
  color: #0067b8;
  font-weight: 700;
  touch-action: none;
  user-select: none;
}

.pdf-workbench-drag-handle:active {
  cursor: grabbing;
}

.pdf-workbench-status {
  min-height: 52px;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: #eef6ff;
  color: #24516f;
}

.pdf-workbench-status[data-state="error"] {
  background: #fff1f0;
  color: #a4382a;
}

.pdf-workbench-status[data-state="success"] {
  background: #edf9f0;
  color: #1d6c35;
}

.pdf-workbench-empty {
  padding: 1.2rem;
  border: 1px dashed #d8e5f1;
  border-radius: 14px;
  color: #60788b;
  text-align: center;
}

.pdf-workbench-placeholder {
  text-align: center;
  padding: 2rem 1rem;
}

.pdf-workbench-placeholder h2 {
  margin: 0 0 0.65rem;
  color: #14324a;
}

.pdf-workbench-placeholder p {
  margin: 0 auto 1rem;
  max-width: 36rem;
  color: #4c6477;
}

.pdf-workbench-field {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.pdf-workbench-form-grid {
  display: grid;
  gap: 0.8rem;
}

.pdf-workbench-form-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pdf-workbench-field label {
  color: #14324a;
  font-weight: 600;
}

.pdf-workbench-input,
.pdf-workbench-select,
.pdf-workbench-textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.75rem 0.9rem;
  border: 1px solid #c9dceb;
  border-radius: 12px;
  background: #fff;
  color: #14324a;
}

.pdf-workbench-textarea {
  min-height: 110px;
  resize: vertical;
}

.pdf-workbench-help {
  color: #60788b;
  font-size: 0.92rem;
}

.pdf-workbench-check,
.pdf-workbench-page-select {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #14324a;
  font-weight: 600;
}

.pdf-workbench-check {
  margin: 0 0 0.9rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #d8e5f1;
  border-radius: 12px;
  background: #f9fcff;
}

.pdf-workbench-check input,
.pdf-workbench-page-select input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: #0067b8;
}

.pdf-workbench-tabs {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid #d8e5f1;
  border-radius: 12px;
  background: #f5fbff;
  margin-bottom: 1rem;
}

.pdf-workbench-tab {
  min-height: 34px;
  padding: 0.4rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #24516f;
  font-weight: 700;
}

.pdf-workbench-tab.is-active {
  border-color: #0067b8;
  background: #fff;
  color: #0067b8;
  box-shadow: 0 6px 14px rgba(0, 78, 140, 0.08);
}

.pdf-workbench-option-stack {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.pdf-workbench-option-card {
  position: relative;
  display: grid;
  gap: 0.25rem;
  padding: 0.8rem;
  border: 1px solid #d8e5f1;
  border-radius: 12px;
  background: #f9fcff;
  color: #14324a;
  cursor: pointer;
}

.pdf-workbench-option-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pdf-workbench-option-card span {
  font-weight: 800;
  font-size: 0.9rem;
}

.pdf-workbench-option-card small {
  color: #60788b;
}

.pdf-workbench-option-card.is-selected {
  border-color: #0067b8;
  background: #eef6ff;
}

.pdf-workbench-estimate {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #d8e5f1;
  border-radius: 12px;
  background: #f9fcff;
  color: #14324a;
  font-weight: 800;
}

.pdf-workbench-page-strip {
  position: relative;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.pdf-workbench-page-card {
  position: relative;
  border: 1px solid #d8e5f1;
  border-radius: 14px;
  background: #f9fcff;
  padding: 0.75rem;
}

.pdf-workbench-page-card.is-pointer-dragging {
  position: relative;
  z-index: 20;
  opacity: 0.88;
  box-shadow: 0 18px 40px rgba(0, 78, 140, 0.24);
  pointer-events: none;
}

.pdf-workbench-page-card.is-insert-before::before,
.pdf-workbench-page-card.is-insert-after::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: #0067b8;
  box-shadow:
    0 0 0 5px rgba(0, 103, 184, 0.18),
    0 10px 22px rgba(0, 103, 184, 0.28);
  z-index: 30;
  top: -0.8rem;
  bottom: -0.8rem;
  width: 6px;
  pointer-events: none;
}

.pdf-workbench-page-card.is-insert-before::before {
  left: -0.8rem;
}

.pdf-workbench-page-card.is-insert-after::after {
  right: -0.8rem;
}

.pdf-workbench-page-card__top-actions {
  display: flex;
  justify-content: flex-end;
}

.pdf-workbench-page-card__preview {
  position: relative;
  width: 100%;
  aspect-ratio: 0.75;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #d8e5f1;
  background: linear-gradient(180deg, #ffffff 0%, #f3f8fc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.45rem 0 0.65rem;
}

.pdf-workbench-page-card__preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.pdf-workbench-page-card__label {
  color: #14324a;
  font-weight: 700;
}

.pdf-workbench-page-card__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-start;
  margin-top: 0.45rem;
}

.pdf-workbench-page-crop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.pdf-workbench-page-crop-grid.is-hidden {
  display: none;
}

.pdf-workbench-page-crop-grid label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #60788b;
  font-size: 0.78rem;
  font-weight: 700;
}

.pdf-workbench-page-crop-grid input {
  min-width: 0;
  width: 100%;
  min-height: 28px;
  padding: 0.2rem 0.25rem;
  border: 1px solid #c9dceb;
  border-radius: 8px;
  color: #14324a;
  font-size: 0.84rem;
  text-align: center;
}

.pdf-workbench-position-field {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  color: #60788b;
  font-size: 0.82rem;
  font-weight: 700;
}

.pdf-workbench-position-field input {
  width: 42px;
  min-height: 30px;
  padding: 0.25rem 0.3rem;
  border: 1px solid #c9dceb;
  border-radius: 8px;
  color: #14324a;
  text-align: center;
  font-size: 0.9rem;
}

.pdf-workbench-page-select {
  justify-content: center;
}

.pdf-preview-open {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: rgba(20, 50, 74, 0.82);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease, transform 0.15s ease;
  z-index: 2;
}

.pdf-preview-open svg {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.pdf-workbench-file-preview:hover .pdf-preview-open,
.pdf-workbench-file-preview:focus-within .pdf-preview-open,
.pdf-workbench-page-card__preview:hover .pdf-preview-open,
.pdf-workbench-page-card__preview:focus-within .pdf-preview-open {
  opacity: 1;
}

.pdf-preview-open:hover,
.pdf-preview-open:focus-visible {
  background: #0067b8;
  transform: translate(-50%, -50%) scale(1.04);
}

.pdf-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}

.pdf-preview-modal.is-open {
  display: flex;
}

.pdf-preview-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 24, 38, 0.72);
}

.pdf-preview-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(1280px, 98vw);
  max-height: 96vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #d8e5f1;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.pdf-preview-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #d8e5f1;
}

.pdf-preview-modal__header h2 {
  margin: 0;
  color: #14324a;
  font-size: 1rem;
}

.pdf-preview-modal__close {
  width: 38px;
  height: 38px;
  border: 1px solid #c9dceb;
  border-radius: 50%;
  background: #fff;
  color: #14324a;
  font-size: 1.4rem;
  line-height: 1;
}

.pdf-preview-modal__body {
  min-height: 0;
  padding: 0.75rem;
  overflow: auto;
  background: #f5f8fb;
  text-align: center;
}

.pdf-preview-modal__image {
  width: auto;
  max-width: 100%;
  max-height: calc(96vh - 78px);
  height: auto;
  border: 1px solid #d8e5f1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(0, 78, 140, 0.14);
}

.pdf-preview-modal-open {
  overflow: hidden;
}

.pdf-layer-editor-preview {
  min-height: 420px;
  max-height: 70vh;
  overflow: auto;
  border: 1px solid #d8e5f1;
  border-radius: 14px;
  background: #f5f8fb;
  padding: 1rem;
  text-align: center;
}

.pdf-layer-editor-preview svg {
  max-width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid #d8e5f1;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 78, 140, 0.12);
}

.pdf-layer-editor-preview [data-layer-id] {
  cursor: pointer;
}

.pdf-layer-editor-preview .is-layer-selected {
  filter: drop-shadow(0 0 4px rgba(0, 103, 184, 0.95)) drop-shadow(0 0 10px rgba(0, 103, 184, 0.35));
}

.pdf-layer-editor-list {
  display: grid;
  gap: 0.55rem;
  max-height: 420px;
  overflow: auto;
  padding-right: 0.2rem;
}

.pdf-layer-editor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #d8e5f1;
  border-radius: 12px;
  background: #f9fcff;
  cursor: pointer;
}

.pdf-layer-editor-row.is-deleted {
  opacity: 0.58;
}

.pdf-layer-editor-row.is-selected {
  border-color: #0067b8;
  background: #eef6ff;
  box-shadow: inset 0 0 0 1px rgba(0, 103, 184, 0.12);
}

.pdf-layer-editor-row strong,
.pdf-layer-editor-row span {
  display: block;
}

.pdf-layer-editor-row strong {
  color: #14324a;
  font-size: 0.92rem;
  word-break: break-word;
}

.pdf-layer-editor-row span {
  color: #60788b;
  font-size: 0.84rem;
}

@media (max-width: 960px) {
  .pdf-workbench-layout,
  .pdf-workbench-grid {
    grid-template-columns: 1fr;
  }

  .pdf-workbench-hero {
    flex-direction: column;
    padding: 1.5rem;
  }
}

@media (max-width: 520px) {
  .pdf-workbench-form-grid--two {
    grid-template-columns: 1fr;
  }

  .pdf-workbench-file-layout {
    grid-template-columns: 1fr;
  }

  .pdf-workbench-file-preview {
    width: 100%;
    max-width: 180px;
    height: 140px;
  }
}
