/* PDF workspace: stage-based entry and source/output review. */
body[data-tool^='pdf-'] main {
  max-width: 1600px;
}
.pdf-primary {
  display: inline-block;
  border: 0;
  border-radius: 9px;
  background: #4763d8;
  color: #fff;
  padding: 14px 20px;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}
.pdf-ghost {
  border: 1px solid #e0e5ef;
  border-radius: 7px;
  background: #fff;
  color: #69758d;
  padding: 9px 12px;
  cursor: pointer;
}
.pdf-primary:disabled,
.pdf-ghost:disabled {
  opacity: 0.45;
  cursor: default;
}
.pdf-empty {
  text-align: center;
  max-width: 980px;
  margin: 35px auto 55px;
}
.pdf-empty h1 {
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -1.4px;
  margin: 0 0 18px;
}
.pdf-empty > p {
  max-width: 680px;
  margin: 14px auto;
  color: #778299;
  font-size: 16px;
  line-height: 1.75;
}
.pdf-drop {
  background: #fff;
  border: 1.5px dashed #cbd4ea;
  border-radius: 18px;
  padding: 45px 20px;
  margin: 30px 0 20px;
}
.pdf-drop.dragging {
  border-color: #4763d8;
  background: #edf1ff;
}
.pdf-empty-art {
  display: block;
  width: 64px;
  margin: 0 auto 20px;
}
.pdf-drop .pdf-primary {
  font-size: 18px;
  min-width: 230px;
  padding: 19px;
}
.pdf-drop p {
  color: #8993a4;
  font-size: 13px;
  margin: 17px 0 0;
}
.pdf-trust {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 26px;
  color: #7b879b;
  font-size: 12px;
}
.pdf-text-button {
  background: none;
  color: #4763d8;
  border: 0;
  font-weight: 600;
  padding: 20px;
  cursor: pointer;
}
.pdf-filebar {
  display: flex;
  align-items: center;
  gap: 13px;
  background: #fff;
  border: 1px solid #e2e6ef;
  padding: 15px 18px;
  border-radius: 12px;
  margin-bottom: 20px;
  min-width: 0;
}
.pdf-filebar > div:first-of-type {
  min-width: 0;
}
.pdf-filebar strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
}
.pdf-filebar small {
  display: block;
  color: #8b95a7;
  margin-top: 5px;
}
.pdf-fileglyph {
  background: #fff0e7;
  color: #bf825e;
  font-size: 11px;
  padding: 11px 9px;
  border-radius: 6px;
  font-weight: 700;
}
.pdf-file-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.pdf-work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}
.pdf-main {
  min-width: 0;
}
.pdf-compare {
  border: 1px solid #e0e6f0;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.pdf-review-head {
  padding: 17px 20px;
  border-bottom: 1px solid #e6eaf1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pdf-review-head h2 {
  font-size: 14px;
  margin: 0;
}
.pdf-review-head p {
  font-size: 12px;
  color: #8893a5;
  margin: 6px 0 0;
  line-height: 1.6;
}
#pdf-badge {
  font-size: 11px;
  background: #eef3fa;
  color: #7383a0;
  padding: 7px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.pdf-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.pdf-split > section {
  min-width: 0;
}
.pdf-output-pane {
  border-left: 1px solid #e5eaf2;
}
.pdf-pane-head {
  min-height: 50px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #e7eaf2;
}
.pdf-pane-head h3 {
  font-size: 12px;
  white-space: nowrap;
  margin: 0;
  color: #536079;
}
.pdf-page-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8e97a9;
  font-size: 12px;
}
.pdf-page-controls button {
  border: 0;
  background: none;
  color: #7f8ca3;
  font-size: 19px;
  cursor: pointer;
  min-width: 28px;
  height: 30px;
}
.pdf-page-controls input {
  width: 48px;
  padding: 6px;
  text-align: center;
  border: 1px solid #e1e7ef;
  border-radius: 5px;
  color: #6f7b91;
  min-width: 0;
}
.pdf-paper-area {
  background: #edf0f5;
  min-height: 520px;
  padding: 24px 20px;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
#pdf-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  background: white;
  box-shadow: 0 3px 15px #253b5d12;
}
#pdf-preview-note {
  width: 100%;
  font-size: 12px;
  color: #7e889c;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.pdf-output-tabs,
.pdf-mobile-tabs {
  display: flex;
  gap: 3px;
}
.pdf-output-tabs {
  background: #f1f3f9;
  border-radius: 6px;
  padding: 3px;
}
.pdf-output-tabs button,
.pdf-mobile-tabs button {
  padding: 6px 9px;
  border: 0;
  border-radius: 5px;
  background: none;
  font-size: 11px;
  color: #8590a7;
  cursor: pointer;
}
.pdf-output-tabs button[aria-pressed='true'] {
  background: white;
  color: #516dc6;
}
.pdf-mobile-tabs button[aria-pressed='true'] {
  background: #eaf0ff;
  color: #4661c7;
}
.pdf-mobile-tabs {
  display: none;
}
#pdf-output {
  box-sizing: border-box;
  display: block;
  border: 0;
  border-radius: 0;
  width: 100%;
  min-height: 520px;
  padding: 24px 22px;
  font:
    13px/1.9 Consolas,
    monospace;
  resize: vertical;
  color: #56647b;
  background: #fff;
  outline-offset: -3px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.pdf-rendered {
  min-height: 520px;
  padding: 24px 22px;
  color: #59677d;
  font-size: 14px;
  line-height: 1.85;
  overflow-wrap: anywhere;
}
.pdf-rendered h2 {
  font-size: 25px;
}
.pdf-rendered h3 {
  font-size: 20px;
}
.pdf-rendered h4 {
  font-size: 17px;
}
.pdf-page-marker {
  color: #9aa5b4;
  font-size: 11px;
  border-bottom: 1px solid #e4eaf1;
  padding-bottom: 10px;
}
.pdf-result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 20px;
  border-top: 1px solid #e4e9f1;
}
.pdf-result-actions p {
  font-size: 12px;
  color: #8490a4;
  line-height: 1.7;
}
.pdf-result-actions > div {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.pdf-result-actions button,
.pdf-result-actions a {
  font-size: 12px;
}
.pdf-warnings {
  margin: 18px 0;
  background: #fffbf1;
  border: 1px solid #f0e3c5;
  border-radius: 10px;
  padding: 16px 20px;
  color: #8e7548;
}
.pdf-warnings h3 {
  font-size: 14px;
  margin: 0 0 8px;
}
.pdf-warnings p,
.pdf-warnings li {
  font-size: 12px;
  line-height: 1.8;
}
.pdf-warnings ul {
  padding-left: 18px;
}
.pdf-warnings button {
  color: #8e7548;
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px;
}
.pdf-settings {
  background: #fff;
  border: 1px solid #e2e6ef;
  border-radius: 14px;
  padding: 22px;
}
.pdf-settings summary {
  font-size: 17px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
  margin-bottom: 22px;
}
.pdf-settings summary::-webkit-details-marker {
  display: none;
}
.pdf-settings fieldset {
  display: grid;
  gap: 18px;
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0 0 20px;
}
.pdf-settings label:not(.pdf-checkbox) {
  display: grid;
  gap: 9px;
  font-size: 12px;
  color: #59687f;
  font-weight: 600;
}
.pdf-settings select,
.pdf-settings input[type='text'] {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 11px;
  border: 1px solid #dfe5ef;
  border-radius: 7px;
  background: #fff;
  color: #6d7b90;
  font-size: 12px;
}
.pdf-hint {
  margin: -12px 0 0;
  color: #929daf;
  font-size: 11px;
  line-height: 1.7;
}
.pdf-checkbox {
  font-size: 12px;
  color: #7e899d;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.6;
}
.pdf-checkbox input {
  accent-color: #4763d8;
}
.pdf-settings .pdf-primary,
.pdf-settings .pdf-ghost {
  width: 100%;
  margin: 7px 0;
}
.pdf-settings-note {
  border-top: 1px solid #e6eaf1;
  padding-top: 15px;
  color: #8c97aa;
  font-size: 11px;
  line-height: 1.9;
}
.pdf-settings-note svg {
  width: 13px;
  height: 13px;
  vertical-align: middle;
}
.pdf-status {
  font-size: 13px;
  color: #667991;
  line-height: 1.8;
  margin: 20px 0;
}
.pdf-compare[data-view='output'] .pdf-output-pane {
  display: block;
}
@media (max-width: 1200px) {
  .pdf-split {
    grid-template-columns: 1fr;
  }
  .pdf-mobile-tabs {
    display: flex;
  }
  .pdf-review-head > #pdf-badge {
    display: none;
  }
  .pdf-output-pane {
    display: none;
    border-left: 0;
  }
  .pdf-compare[data-view='output'] .pdf-original {
    display: none;
  }
  .pdf-review-head {
    padding: 15px;
  }
  .pdf-review-head p {
    max-width: 40ch;
  }
}
@media (max-width: 850px) {
  .pdf-work-grid {
    display: flex;
    flex-direction: column;
  }
  .pdf-settings {
    order: -1;
    width: 100%;
    box-sizing: border-box;
    padding: 18px;
  }
  .pdf-settings summary {
    font-size: 15px;
    margin-bottom: 0;
  }
  .pdf-settings summary:after {
    content: '＋';
    float: right;
    color: #8694a9;
  }
  .pdf-settings details[open] summary {
    margin-bottom: 20px;
  }
  .pdf-settings details[open] summary:after {
    content: '−';
  }
  .pdf-filebar {
    padding: 12px;
    gap: 9px;
  }
  .pdf-filebar strong {
    font-size: 12px;
  }
  .pdf-filebar small {
    font-size: 10px;
  }
  .pdf-file-actions {
    gap: 4px;
  }
  .pdf-file-actions button {
    padding: 8px;
    font-size: 11px;
  }
  .pdf-main {
    width: 100%;
  }
  .pdf-empty {
    margin: 20px auto;
  }
  .pdf-empty > p {
    font-size: 14px;
  }
  .pdf-drop {
    padding: 30px 16px;
  }
  .pdf-drop .pdf-primary {
    font-size: 16px;
    min-width: 210px;
  }
  .pdf-trust {
    gap: 12px;
  }
  .pdf-result-actions {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }
  .pdf-result-actions > div > * {
    flex: 1;
    text-align: center;
  }
  .pdf-result-actions p {
    margin: 0;
  }
  .pdf-paper-area {
    min-height: 400px;
    padding: 18px;
  }
  #pdf-output,
  .pdf-rendered {
    min-height: 400px;
  }
  .pdf-pane-head {
    padding: 10px 12px;
  }
  .pdf-review-head h2 {
    font-size: 13px;
  }
  .pdf-review-head p {
    font-size: 11px;
  }
  .pdf-settings input[type='text'],
  .pdf-settings select {
    font-size: 16px;
  }
  .pdf-output-tabs button {
    font-size: 10px;
    padding: 6px 7px;
  }
  .pdf-fileglyph {
    padding: 9px 7px;
  }
}

@media (max-width: 850px) {
  .pdf-pane-head h3 {
    white-space: normal;
  }
  .pdf-page-controls {
    gap: 3px;
  }
  .pdf-review-head > div:first-child {
    min-width: 0;
  }
  .pdf-mobile-tabs {
    flex-shrink: 0;
  }
}

.pdf-settings label.pdf-checkbox {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  margin: 0;
  font-weight: 400;
  line-height: 1.65;
}
.pdf-checkbox input[type='checkbox'] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  flex: 0 0 16px;
  margin: 0;
  padding: 0;
}
.pdf-mobile-tabs button,
.pdf-output-tabs button {
  width: auto;
}
.pdf-page-controls button {
  width: auto;
}
.pdf-image-output {
  min-width: 0;
  background: white;
  border: 1px solid #e0e4ed;
  border-radius: 16px;
  overflow: hidden;
}
.pdf-image-results {
  list-style: none;
  padding: 24px;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: 20px;
}
.pdf-image-results li {
  min-width: 0;
  padding: 16px;
  background: #f7f8fb;
  border: 1px solid #e2e6ee;
  border-radius: 12px;
}
.pdf-image-results img {
  display: block;
  width: 100%;
  height: 230px;
  object-fit: contain;
  background: #eceef3;
}
.pdf-image-results h3 {
  margin: 16px 0 6px;
  font-size: 16px;
}
.pdf-image-results p {
  color: #687184;
  font-size: 13px;
}
.pdf-image-results a {
  display: inline-block;
  color: #3658cc;
  padding: 8px 0;
}
.pdf-image-output .pdf-result-actions {
  flex-wrap: wrap;
  gap: 12px;
}
