/* GCE PDF Editor — Acrobat-like shell */
.gce-pdf-ed {
  --pe-bg: #f4f6f9;
  --pe-panel: #ffffff;
  --pe-ink: #111827;
  --pe-muted: #64748b;
  --pe-line: #e2e8f0;
  --pe-blue: #2563eb;
  --pe-blue-soft: #dbeafe;
  --pe-rail: #1e293b;
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  flex-direction: column;
  background: var(--pe-bg);
  color: var(--pe-ink);
  font-family: Inter, "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.gce-pdf-ed.is-open { display: flex; }

/* ── Title bar ── */
.gce-pdf-ed-chrome {
  flex: 0 0 auto;
  background: var(--pe-panel);
  border-bottom: 1px solid var(--pe-line);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
.gce-pdf-ed-titlebar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px 0;
  min-height: 48px;
}
.gce-pdf-ed-brand {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
  flex: 0 0 auto;
}
.gce-pdf-ed-title { min-width: 0; flex: 0 1 280px; }
.gce-pdf-ed-title b {
  display: block;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gce-pdf-ed-title small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--pe-muted);
}
.gce-pdf-ed-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}
.gce-pdf-ed-title small.is-saved .gce-pdf-ed-dot { background: #22c55e; }
.gce-pdf-ed-title small.is-dirty .gce-pdf-ed-dot { background: #f59e0b; }
.gce-pdf-ed-title small.is-saved { color: #166534; }
.gce-pdf-ed-title small.is-dirty { color: #a16207; }

.gce-pdf-ed-tabs {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 0;
}
.gce-pdf-ed-tab {
  border: none;
  background: transparent;
  color: var(--pe-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 14px 12px;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}
.gce-pdf-ed-tab:hover { color: var(--pe-ink); background: #f8fafc; }
.gce-pdf-ed-tab.is-active {
  color: var(--pe-blue);
  background: #f8fafc;
}
.gce-pdf-ed-tab.is-active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--pe-blue);
}

.gce-pdf-ed-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding-bottom: 8px;
}
.gce-pdf-ed-btn {
  border: 1px solid var(--pe-line);
  background: #fff;
  color: var(--pe-ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.gce-pdf-ed-btn:hover { background: #f8fafc; }
.gce-pdf-ed-btn.is-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--pe-muted);
}
.gce-pdf-ed-btn.is-primary {
  background: var(--pe-blue);
  border-color: var(--pe-blue);
  color: #fff;
  padding: 8px 16px;
}
.gce-pdf-ed-btn.is-primary:hover { filter: brightness(0.95); }
.gce-pdf-ed-btn:disabled { opacity: 0.5; cursor: default; }
.gce-pdf-ed-btn svg { width: 15px; height: 15px; }

/* ── Ribbon ── */
.gce-pdf-ed-ribbon {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  padding: 8px 10px 10px;
  overflow-x: auto;
  background: #f8fafc;
  border-top: 1px solid #eef2f7;
}
.gce-pdf-ed-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  border-right: 1px solid var(--pe-line);
  flex: 0 0 auto;
}
.gce-pdf-ed-group:last-child { border-right: none; }
.gce-pdf-ed-group > span {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.02em;
  color: var(--pe-muted);
  order: 2;
}
.gce-pdf-ed-tools {
  display: flex;
  align-items: stretch;
  gap: 4px;
  order: 1;
}
.gce-pdf-ed-tool {
  width: 64px;
  min-height: 56px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--pe-ink);
  font: inherit;
  font-size: 10.5px;
  font-weight: 650;
  padding: 6px 4px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 1.15;
  text-align: center;
}
.gce-pdf-ed-tool svg {
  width: 22px;
  height: 22px;
  color: #334155;
  flex: 0 0 auto;
}
.gce-pdf-ed-tool:hover {
  background: #fff;
  border-color: var(--pe-line);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.gce-pdf-ed-tool.is-active {
  background: var(--pe-blue-soft);
  border-color: #93c5fd;
  color: #1e3a8a;
}
.gce-pdf-ed-tool.is-active svg { color: #1d4ed8; }
.gce-pdf-ed-tool.is-wide { width: 78px; }

.gce-pdf-ed-swatch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}
.gce-pdf-ed-color {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.gce-pdf-ed-size {
  width: 88px;
  accent-color: var(--pe-blue);
}

/* ── Body ── */
.gce-pdf-ed-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 52px 168px minmax(0, 1fr) 300px;
  background: #e8edf5;
}

.gce-pdf-ed-rail {
  background: var(--pe-rail);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
}
.gce-pdf-ed-rail-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.gce-pdf-ed-rail-btn svg { width: 18px; height: 18px; }
.gce-pdf-ed-rail-btn:hover { background: rgba(148, 163, 184, 0.12); color: #e2e8f0; }
.gce-pdf-ed-rail-btn.is-active {
  background: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
}

.gce-pdf-ed-thumbs {
  overflow: auto;
  background: #0f172a;
  border-right: 1px solid #1e293b;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gce-pdf-ed-thumbs-head {
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 4px 6px;
}
.gce-pdf-ed-thumb {
  border: 2px solid transparent;
  border-radius: 8px;
  background: #1e293b;
  padding: 5px;
  cursor: pointer;
  text-align: center;
}
.gce-pdf-ed-thumb.is-active { border-color: #3b82f6; box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35); }
.gce-pdf-ed-thumb canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 3px;
  background: #fff;
}
.gce-pdf-ed-thumb small {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
}

.gce-pdf-ed-stage-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 28px 28px;
  background:
    radial-gradient(circle at 20% 0%, rgba(59, 130, 246, 0.08), transparent 40%),
    #dbe3ef;
}
.gce-pdf-ed-float-nav {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.gce-pdf-ed-float-nav button {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #334155;
  font-weight: 800;
  cursor: pointer;
}
.gce-pdf-ed-float-nav button:hover { background: #f1f5f9; }
.gce-pdf-ed-float-nav span {
  font-size: 12px;
  font-weight: 750;
  color: #334155;
  min-width: 92px;
  text-align: center;
}

.gce-pdf-ed-stage {
  position: relative;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
  background: #fff;
  line-height: 0;
}
.gce-pdf-ed-stage canvas { display: block; }
.gce-pdf-ed-stage .gce-pdf-ed-page { position: relative; z-index: 1; }
.gce-pdf-ed-stage .gce-pdf-ed-anno {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: crosshair;
}
.gce-pdf-ed-stage.is-hand .gce-pdf-ed-anno { cursor: grab; }
.gce-pdf-ed-stage.is-hand.is-panning .gce-pdf-ed-anno { cursor: grabbing; }

.gce-pdf-ed-note-pin {
  position: absolute;
  z-index: 3;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border: none;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: #fbbf24;
  color: #78350f;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.35);
}
.gce-pdf-ed-note-pin span {
  display: block;
  transform: rotate(45deg);
}

/* ── Right panels ── */
.gce-pdf-ed-side {
  background: var(--pe-panel);
  border-left: 1px solid var(--pe-line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.gce-pdf-ed-props,
.gce-pdf-ed-comments-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.gce-pdf-ed-props { flex: 0 0 auto; border-bottom: 1px solid var(--pe-line); }
.gce-pdf-ed-comments-wrap { flex: 1; min-height: 0; }
.gce-pdf-ed-side-head {
  padding: 12px 14px 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--pe-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gce-pdf-ed-side-head em {
  font-style: normal;
  font-size: 11px;
  font-weight: 750;
  color: var(--pe-muted);
  background: #f1f5f9;
  padding: 2px 7px;
  border-radius: 999px;
}
.gce-pdf-ed-prop-body {
  padding: 4px 14px 14px;
  display: grid;
  gap: 10px;
}
.gce-pdf-ed-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--pe-muted);
  margin-bottom: 4px;
}
.gce-pdf-ed-field-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.gce-pdf-ed-field select,
.gce-pdf-ed-field input[type="number"] {
  border: 1px solid var(--pe-line);
  border-radius: 8px;
  padding: 7px 8px;
  font: inherit;
  font-size: 12.5px;
  background: #fff;
  color: var(--pe-ink);
}
.gce-pdf-ed-field select { flex: 1; }
.gce-pdf-ed-field input[type="number"] { width: 64px; }
.gce-pdf-ed-style-btns {
  display: flex;
  gap: 4px;
}
.gce-pdf-ed-style-btns button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--pe-line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
  color: #334155;
}
.gce-pdf-ed-style-btns button.is-active {
  background: var(--pe-blue-soft);
  border-color: #93c5fd;
  color: #1e3a8a;
}
.gce-pdf-ed-align {
  display: flex;
  gap: 4px;
}
.gce-pdf-ed-align button {
  flex: 1;
  height: 32px;
  border: 1px solid var(--pe-line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  color: #475569;
  display: grid;
  place-items: center;
}
.gce-pdf-ed-align button.is-active {
  background: var(--pe-blue-soft);
  border-color: #93c5fd;
  color: #1e3a8a;
}
.gce-pdf-ed-align button svg { width: 16px; height: 16px; }

.gce-pdf-ed-comments {
  flex: 1;
  overflow: auto;
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gce-pdf-ed-comment {
  background: #f8fafc;
  border: 1px solid var(--pe-line);
  border-radius: 12px;
  padding: 10px 12px;
}
.gce-pdf-ed-comment b {
  display: block;
  font-size: 12px;
  color: var(--pe-ink);
  margin-bottom: 4px;
}
.gce-pdf-ed-comment p {
  margin: 0;
  font-size: 12.5px;
  color: #475569;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
}
.gce-pdf-ed-comment button {
  margin-top: 8px;
  border: none;
  background: transparent;
  color: #dc2626;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.gce-pdf-ed-empty {
  margin: 20px 8px;
  text-align: center;
  color: var(--pe-muted);
  font-size: 12.5px;
  line-height: 1.45;
}
.gce-pdf-ed-reply {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--pe-line);
}
.gce-pdf-ed-reply input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--pe-line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 12.5px;
}

@media (max-width: 1100px) {
  .gce-pdf-ed-body {
    grid-template-columns: 52px 0 minmax(0, 1fr) 260px;
  }
  .gce-pdf-ed-thumbs { display: none; }
}
@media (max-width: 860px) {
  .gce-pdf-ed-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) 220px;
  }
  .gce-pdf-ed-rail,
  .gce-pdf-ed-thumbs { display: none; }
  .gce-pdf-ed-side { border-left: none; border-top: 1px solid var(--pe-line); }
}
