/* GlassPDF — /tools/pdf/ */

.gp-hero .section-head { margin-bottom: 0; }
.gp-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 20px;
}
.gp-app { padding-top: 0; }
.gp-app:has(.gp-workspace.has-file) .gp-hero {
  padding-bottom: 4px;
}
.gp-app:has(.gp-workspace.has-file) .gp-hero .section-head p,
.gp-app:has(.gp-workspace.has-file) .gp-hero-actions {
  display: none;
}
.gp-app:has(.gp-workspace.has-file) .gp-hero h1 {
  font-size: clamp(22px, 4vw, 32px);
  margin-bottom: 0;
}

.gp-workspace {
  padding: clamp(16px, 3vw, 24px);
  border-radius: var(--radius-xl);
  min-height: 320px;
}
.gp-workspace.has-file #gpEmpty { display: none; }
.gp-workspace:not(.has-file) #gpLayoutInner { display: none !important; }

.gp-empty { padding: 8px 0; }
.gp-drop {
  border: 2px dashed var(--glass-border, rgba(255,255,255,.45));
  border-radius: var(--radius-lg);
  padding: clamp(32px, 6vw, 48px) 24px;
  text-align: center;
  cursor: pointer;
  color: var(--text-soft);
  transition: border-color .2s, background .2s;
}
.gp-drop:hover, .gp-drop.is-drag, .gp-drop:focus-visible {
  border-color: var(--accent);
  background: var(--accent-grad-soft);
  outline: none;
}
.gp-drop svg { opacity: .55; margin-bottom: 12px; }
.gp-drop p { margin: 0 0 6px; color: var(--text); }
.gp-muted { font-size: 13px; color: var(--text-soft); margin: 0; }

.gp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .gp-layout { grid-template-columns: 1fr; }
}

.gp-page-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.gp-page-label,
.gp-zoom-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  min-width: 3.5em;
  text-align: center;
}
.gp-toolbar-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
}

.gp-mode-bar {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.gp-mode {
  border: 1px solid var(--border);
  background: var(--glass-bg, rgba(255,255,255,.35));
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.gp-mode.is-active {
  border-color: var(--accent);
  background: var(--accent-grad-soft);
  color: var(--accent);
}

.gp-stage-wrap {
  position: relative;
  margin: 0 auto;
  width: 100%;
  max-width: 100%;
  max-height: min(72vh, 900px);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  background: #525659;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  /* Keep scrollbars visible when zoomed (macOS overlay scrollbars can hide) */
  scrollbar-gutter: stable;
}
.gp-stage-wrap::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.gp-stage-wrap::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.35);
  border-radius: 8px;
}
.gp-stage-wrap::-webkit-scrollbar-track {
  background: rgba(0,0,0,.2);
}
.gp-stage {
  position: relative;
  display: inline-block;
  vertical-align: top;
  min-width: 100%;
  line-height: 0;
}
.gp-stage-wrap canvas {
  display: block;
  max-width: none !important;
  width: auto;
  height: auto;
}
.gp-overlay {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}
.gp-draw-layer {
  position: absolute;
  top: 0;
  left: 0;
  cursor: crosshair;
  /* Allow trackpad/touch pan; disable only while actively drawing (JS) */
  touch-action: pan-x pan-y;
}
.gp-draw-layer.is-drawing {
  touch-action: none;
}
.gp-draw-layer[hidden] { display: none !important; }
.gp-marquee {
  position: absolute;
  border: 2px dashed rgba(10, 132, 255, 0.95);
  background: rgba(10, 132, 255, 0.18);
  pointer-events: none;
}
.gp-marquee.is-white {
  border-color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.35);
}
.gp-marquee.is-black {
  border-color: rgba(0,0,0,.85);
  background: rgba(0,0,0,.25);
}
.gp-snap-guide {
  position: absolute;
  pointer-events: none;
  background: rgba(255, 59, 48, 0.75);
  z-index: 2;
}
.gp-snap-guide.is-v {
  top: 0;
  bottom: 0;
  width: 1px;
}
.gp-snap-guide.is-h {
  left: 0;
  right: 0;
  height: 1px;
}
.gp-place-mark {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(10,132,255,.25);
  pointer-events: auto;
  cursor: grab;
  z-index: 3;
}
.gp-place-mark:active { cursor: grabbing; }
.gp-text-preview {
  position: absolute;
  transform: translateY(-100%);
  margin-top: -2px;
  white-space: pre-wrap;
  line-height: 1.15;
  pointer-events: none;
  z-index: 3;
  text-shadow: 0 0 2px rgba(255,255,255,.9);
  max-width: 80%;
}
.gp-font-note {
  font-size: 12px;
  line-height: 1.35;
  margin: -4px 0 10px;
}
.gp-text-hit {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  border-radius: 2px;
  background: transparent;
}
.gp-text-hit:hover { background: rgba(10, 132, 255, 0.12); }
.gp-text-hit.is-selected {
  background: rgba(10, 132, 255, 0.28);
  outline: 1.5px solid rgba(10, 132, 255, 0.85);
}

.gp-side-title {
  font-size: 14px;
  font-weight: 800;
  margin: 0 0 8px;
}
.gp-hint { margin: 0 0 12px; font-size: 13px; line-height: 1.4; }
.gp-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 10px;
}
.gp-field input,
.gp-field select,
.gp-field textarea {
  font: inherit;
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--bg, #fff);
}
.gp-field textarea { resize: vertical; }
.gp-field input[type="color"] {
  padding: 2px;
  height: 36px;
  cursor: pointer;
}
.gp-selection-text {
  font-size: 13.5px;
  line-height: 1.45;
  margin: 0 0 14px;
  max-height: 96px;
  overflow: auto;
  word-break: break-word;
}
.gp-font-info {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--glass-bg, rgba(255,255,255,.35));
}
.gp-font-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-soft);
  margin-bottom: 4px;
}
.gp-font-detail { font-size: 13px; font-weight: 600; }

.gp-fieldset {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin: 0 0 12px;
}
.gp-fieldset legend {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-soft);
  padding: 0 6px;
}
.gp-full { width: 100%; margin-top: 8px; }
.gp-full:first-of-type { margin-top: 0; }

.gp-status {
  font-size: 13px;
  margin: 8px 0 0;
  color: var(--text-soft);
}
.gp-status.is-ok { color: #0a7a3e; }
.gp-status.is-err { color: #c0392b; }
.gp-verify {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
}
.gp-verify.is-pass {
  background: rgba(10, 122, 62, 0.12);
  color: #0a7a3e;
}
.gp-verify.is-fail {
  background: rgba(192, 57, 43, 0.12);
  color: #c0392b;
}

.gp-trust { padding-top: 8px; }

.gp-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 20, 40, 0.45);
  display: grid;
  place-items: center;
  padding: 20px;
}
.gp-help-overlay[hidden] { display: none !important; }
.gp-help-modal {
  width: min(560px, 100%);
  max-height: min(80vh, 640px);
  overflow: auto;
  padding: 20px 22px;
  border-radius: var(--radius-xl);
}
.gp-help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.gp-help-head h2 { margin: 0; font-size: 18px; }
.gp-help-body p { font-size: 14px; line-height: 1.5; color: var(--text-soft); }
.gp-help-body strong { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .gp-drop { transition: none; }
}
