.pdf-upload {
  display: inline-block;
  padding: 0.65rem;
  border: 1px dashed #aaa;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
}
.pdf-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #eee;
  padding: 12px 0;
  gap: 12px;
}
.pdf-file small {
  display: block;
  color: #666;
  margin: 4px 0;
}
.pdf-file button {
  text-align: left;
  overflow-wrap: anywhere;
}
#pdf-reader {
  max-width: none;
  width: 100vw;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  box-sizing: border-box;
  color: #24212c;
  background: #fff;
}
#pdf-reader[open] {
  display: flex;
  flex-direction: column;
}
#pdf-reader button {
  font-size: 13px;
  padding: 7px 10px;
}
#pdf-reader button:disabled {
  opacity: 0.4;
}
#pdf-reader button:focus-visible,
#pdf-reader input:focus-visible,
#pdf-reader textarea:focus-visible,
#pdf-reader select:focus-visible {
  outline: 2px solid #4300a5;
  outline-offset: 2px;
}
.pdf-reader-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: #350099;
  color: white;
}
.pdf-reader-head strong {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pdf-reader-head button {
  background: white;
  color: #350099;
}
.pdf-controls {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  padding: 7px 12px;
  border-bottom: 1px solid #ddd;
}
.pdf-controls label {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-weight: 400;
}
.pdf-controls input {
  width: 60px;
  padding: 5px;
}
.pdf-controls button[aria-pressed="true"] {
  background: #350099;
  color: white;
}
.pdf-reader-grid {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
}
.pdf-scroll {
  overflow: auto;
  background: #e7e6e9;
  padding: 16px;
  position: relative;
}
#pdf-sheet {
  position: relative;
  isolation: isolate;
  background: #fff;
  box-shadow: 0 1px 6px #0003;
  margin: 0 auto;
}
#pdf-sheet canvas {
  display: block;
}
#pdf-sheet .textLayer {
  position: absolute;
  inset: 0;
  z-index: 1;
}
#pdf-sheet .textLayer ::selection {
  background: #9bbcff99;
}
.pdf-marks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.pdf-mark {
  position: absolute;
  mix-blend-mode: multiply;
  background: #ffd54466;
}
.pdf-mark.private {
  background: #a58cff66;
}
.pdf-draw {
  position: absolute;
  inset: 0;
  z-index: 3;
  cursor: crosshair;
  touch-action: none;
}
.pdf-draw div {
  position: absolute;
  border: 2px solid #4300a5;
  background: #a58cff33;
}
.pdf-discussion {
  overflow: auto;
  padding: 12px;
  border-left: 1px solid #ddd;
  font-size: 13px;
}
.pdf-layers {
  display: flex;
  gap: 12px;
  position: sticky;
  top: -12px;
  background: white;
  padding: 10px 0;
  z-index: 4;
}
.pdf-layers label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  font-weight: 600;
}
.pdf-layers input {
  width: auto;
  margin: 0;
}
#pdf-reader .form-hint {
  font-size: 12px;
  line-height: 1.5;
  color: #625d69;
}
#pdf-composer {
  background: #f5f1fc;
  padding: 12px;
  border-radius: 5px;
  margin: 12px 0;
}
#pdf-reader textarea,
#pdf-reader select {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  padding: 7px;
  margin: 5px 0 10px;
}
#pdf-reader label {
  display: block;
}
#pdf-reader .pdf-controls label,
#pdf-reader .pdf-layers label {
  display: flex;
}
#pdf-reader blockquote {
  font-size: 12px;
  line-height: 1.5;
  border-left: 3px solid #bca9df;
  padding-left: 8px;
  margin: 8px 0;
  white-space: pre-wrap;
  max-height: 180px;
  overflow: auto;
}
#pdf-reader p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.pdf-form-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.pdf-annotation {
  border: 1px solid #e1dce9;
  border-left: 3px solid #e2bc25;
  border-radius: 4px;
  margin: 10px 0;
  padding: 10px;
}
.pdf-annotation.private {
  border-left-color: #8b65ca;
}
.pdf-annotation header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pdf-annotation small {
  display: block;
  color: #756c80;
  font-size: 11px;
}
.pdf-annotation > strong {
  display: block;
  margin: 5px 0;
}
.pdf-reply {
  border-top: 1px solid #eee;
  margin-top: 8px;
  padding-top: 8px;
}
.pdf-annotation p {
  line-height: 1.5;
}
.pdf-reply-form {
  margin-top: 8px;
}
#pdf-status {
  color: #65005a;
  font-size: 13px;
}
@media (max-width: 850px) {
  .pdf-reader-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(180px, 1fr) minmax(160px, 38%);
  }
  .pdf-discussion {
    border-left: 0;
    border-top: 1px solid #ddd;
  }
  .pdf-reader-head {
    padding: 5px 8px;
  }
  .pdf-reader-head button {
    font-size: 11px !important;
  }
  .pdf-controls {
    padding: 4px;
  }
  .pdf-layers {
    padding: 5px 0;
  }
  .pdf-scroll {
    padding: 10px;
  }
}
