.pdf-hero {
  background: #101820;
}

.pdf-workspace {
  background: #eef2f0;
}

.pdf-mode-bar {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.pdf-mode-button {
  min-height: 44px;
  padding: 9px 16px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.pdf-mode-button.is-active {
  background: var(--charcoal);
  color: #ffffff;
}

.pdf-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(300px, 0.72fr);
  gap: 18px;
  align-items: start;
}

.pdf-control-card,
.pdf-result-card {
  min-width: 0;
}

.pdf-drop-zone {
  display: grid;
  min-height: 190px;
  place-items: center;
  align-content: center;
  gap: 8px;
  margin: 24px 0 16px;
  padding: 28px;
  border: 1px dashed #9aa8a3;
  border-radius: 8px;
  background: #f8faf9;
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.pdf-drop-zone:hover,
.pdf-drop-zone:focus-within,
.pdf-drop-zone.is-dragover {
  border-color: var(--teal);
  background: #edf7f4;
}

.pdf-drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.pdf-drop-zone > span:last-of-type {
  color: var(--muted);
  font-size: 14px;
}

.pdf-drop-icon {
  display: grid;
  width: 52px;
  height: 62px;
  place-items: center;
  border: 2px solid var(--coral);
  border-radius: 5px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 900;
}

.pdf-file-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.pdf-file-summary span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
}

.pdf-file-list {
  display: grid;
  gap: 8px;
  min-height: 78px;
  margin-bottom: 20px;
}

.pdf-empty {
  display: grid;
  min-height: 78px;
  place-items: center;
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.pdf-file-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.pdf-file-index {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 6px;
  background: #ffece6;
  color: #a9402e;
  font-weight: 900;
}

.pdf-file-copy {
  min-width: 0;
}

.pdf-file-copy strong,
.pdf-file-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-file-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.pdf-file-actions {
  display: flex;
  gap: 4px;
}

.pdf-icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.pdf-icon-button:hover:not(:disabled) {
  border-color: var(--teal);
  color: var(--teal);
}

.pdf-icon-button:disabled {
  opacity: 0.32;
  cursor: default;
}

.pdf-result-card {
  position: sticky;
  top: 92px;
}

.pdf-result-visual {
  position: relative;
  width: min(210px, 72%);
  aspect-ratio: 0.82;
  margin: 24px auto;
}

.pdf-result-visual span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 14px 32px rgba(17, 22, 26, 0.09);
}

.pdf-result-visual span:nth-child(1) { transform: translate(-18px, 12px) rotate(-5deg); }
.pdf-result-visual span:nth-child(2) { transform: translate(16px, 8px) rotate(4deg); }
.pdf-result-visual span:nth-child(3) {
  border-top: 8px solid var(--coral);
  color: var(--coral);
  font-size: 28px;
  font-weight: 900;
}

.pdf-result-metrics {
  display: grid;
  gap: 0;
  margin: 22px 0;
}

.pdf-result-metrics div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.pdf-result-metrics dt { color: var(--muted); }
.pdf-result-metrics dd { margin: 0; font-weight: 900; text-align: right; }

.pdf-result-card .button {
  width: 100%;
}

.pdf-local-note {
  margin: 16px 0 0;
  padding: 14px;
  border-left: 3px solid var(--teal);
  background: #edf7f4;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  .pdf-layout { grid-template-columns: 1fr; }
  .pdf-result-card { position: static; }
}

@media (max-width: 560px) {
  .pdf-mode-bar { display: grid; width: 100%; }
  .pdf-drop-zone { min-height: 160px; padding: 20px 14px; }
  .pdf-file-row { grid-template-columns: 30px minmax(0, 1fr); }
  .pdf-file-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .pdf-icon-button { width: 40px; height: 38px; }
}
