/* Mingmist Tools v1.4 — PDF editing workspace */
.pdf-editor-shell {
  display: grid;
  grid-template-columns: 176px minmax(420px, 1fr) 286px;
  min-height: 720px;
  border: 1px solid var(--border);
  background: var(--border);
  gap: 1px;
}
.editor-page-column,
.editor-main-column,
.editor-inspector-column {
  min-width: 0;
  background: var(--surface);
}
.editor-page-column,
.editor-inspector-column {
  display: flex;
  flex-direction: column;
}
.editor-column-head {
  min-height: 54px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.editor-column-head strong { font-size: .9rem; }
.editor-column-head span { color: var(--muted); font-size: .76rem; }
.editor-page-rail {
  padding: 12px;
  overflow: auto;
  display: grid;
  gap: 10px;
  align-content: start;
}
.editor-page-thumb {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}
.editor-page-thumb:hover,
.editor-page-thumb.selected { border-color: var(--mist-teal, #1b4f4d); }
.editor-page-thumb.selected { box-shadow: inset 3px 0 0 var(--mist-teal, #1b4f4d); }
.editor-page-thumb canvas { max-width: 100%; height: auto; border: 1px solid var(--border); background: #fff; }
.editor-page-thumb span { font-size: .78rem; font-weight: 750; }
.editor-page-thumb small { min-height: 16px; color: var(--muted); font-size: .68rem; }
.editor-page-limit { margin: 4px 0; color: var(--muted); font-size: .75rem; line-height: 1.45; }

.editor-main-column { display: flex; min-width: 0; flex-direction: column; }
.editor-source-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.editor-source-bar .field { flex: 1 1 250px; }
.editor-source-bar input[type="file"] { max-width: 100%; }
.editor-source-info { color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.editor-toolbar-group { display: inline-flex; flex-wrap: wrap; gap: 4px; padding-right: 8px; margin-right: 2px; border-right: 1px solid var(--border); }
.editor-toolbar-group:last-child { border-right: 0; }
.editor-tool {
  min-height: 36px;
  padding: 6px 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 750;
}
.editor-tool:hover { border-color: var(--border); background: var(--surface); color: var(--text); }
.editor-tool.active { border-color: var(--mist-teal, #1b4f4d); background: var(--surface); color: var(--text); }
.editor-tool:disabled { opacity: .45; }
.editor-navigation {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}
.editor-page-control,
.editor-zoom-control { display: flex; align-items: center; gap: 7px; }
.editor-page-control input { width: 70px; min-height: 34px; padding: 5px 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-align: center; }
.editor-zoom-control input { width: 130px; }
.editor-zoom-control span { width: 45px; color: var(--muted); font-size: .78rem; }
.editor-mode-readout { color: var(--muted); font-size: .8rem; }
.editor-mode-readout strong { color: var(--text); }
.editor-stage-wrap {
  flex: 1 1 auto;
  min-height: 540px;
  padding: 28px;
  overflow: auto;
  background:
    linear-gradient(45deg, color-mix(in srgb, var(--border) 42%, transparent) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(-45deg, color-mix(in srgb, var(--border) 42%, transparent) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(45deg, transparent 75%, color-mix(in srgb, var(--border) 42%, transparent) 75%) 0 0 / 18px 18px,
    linear-gradient(-45deg, transparent 75%, color-mix(in srgb, var(--border) 42%, transparent) 75%) 0 0 / 18px 18px,
    var(--surface-2);
}
.editor-canvas-stage {
  position: relative;
  width: fit-content;
  margin: 0 auto;
  line-height: 0;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 16px 40px rgba(11, 22, 40, .14);
}
.editor-canvas-stage canvas { display: block; max-width: none; }
#editor-overlay-canvas { position: absolute; inset: 0; touch-action: none; }
#editor-overlay-canvas[data-mode="select"] { cursor: default; }
#editor-overlay-canvas[data-mode="text"],
#editor-overlay-canvas[data-mode="image"],
#editor-overlay-canvas[data-mode="symbol"] { cursor: copy; }
#editor-overlay-canvas[data-mode="rect"],
#editor-overlay-canvas[data-mode="ellipse"],
#editor-overlay-canvas[data-mode="line"],
#editor-overlay-canvas[data-mode="arrow"],
#editor-overlay-canvas[data-mode="freehand"] { cursor: crosshair; }
.editor-footer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}
.editor-footer-bar .actions { margin: 0; }

.editor-inspector-scroll { padding: 14px; overflow: auto; }
.editor-inspector-section { padding: 0 0 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.editor-inspector-section:last-child { border-bottom: 0; margin-bottom: 0; }
.editor-inspector-section h3 { margin: 0 0 11px; font-size: .88rem; }
.editor-inspector-section textarea { min-height: 88px; font-family: var(--sans); }
.editor-inspector-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.editor-inspector-grid .field + .field { margin-top: 0; }
.editor-inspector-grid .full { grid-column: 1 / -1; }
.editor-inspector input[type="range"] { width: 100%; }
.editor-inspector input[type="color"] { width: 100%; height: 40px; padding: 3px; border: 1px solid var(--border); background: var(--surface); }
.editor-object-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.editor-object-list { display: grid; gap: 6px; }
.editor-object-list > p { margin: 0; padding: 13px; color: var(--muted); background: var(--surface-2); font-size: .8rem; }
.editor-object-list button {
  min-width: 0;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 1px 8px;
  padding: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}
.editor-object-list button:hover,
.editor-object-list button.selected { border-color: var(--mist-teal, #1b4f4d); }
.editor-object-list button span { grid-row: 1 / span 2; color: var(--muted); font-family: var(--mono); font-size: .7rem; }
.editor-object-list button strong { overflow: hidden; text-overflow: ellipsis; font-size: .78rem; }
.editor-object-list button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .7rem; }
.editor-project-actions { display: grid; gap: 8px; }
.editor-project-actions .button { width: 100%; }
.editor-limit-note { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }

@media (max-width: 1120px) {
  .pdf-editor-shell { grid-template-columns: 150px minmax(360px, 1fr); }
  .editor-inspector-column { grid-column: 1 / -1; }
  .editor-inspector-scroll { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .editor-inspector-section { border-bottom: 0; border-right: 1px solid var(--border); padding: 0 18px 0 0; margin: 0; }
  .editor-inspector-section:last-child { border-right: 0; }
}

@media (max-width: 760px) {
  .pdf-editor-shell { display: flex; flex-direction: column; min-height: 0; }
  .editor-page-column { order: 2; }
  .editor-main-column { order: 1; }
  .editor-inspector-column { order: 3; }
  .editor-page-rail { grid-auto-flow: column; grid-auto-columns: 112px; overflow-x: auto; overflow-y: hidden; }
  .editor-page-thumb { width: 112px; }
  .editor-page-limit { width: 180px; }
  .editor-stage-wrap { min-height: 420px; padding: 14px; }
  .editor-toolbar { overflow-x: auto; flex-wrap: nowrap; }
  .editor-toolbar-group { flex-wrap: nowrap; flex: 0 0 auto; }
  .editor-navigation { align-items: flex-start; }
  .editor-mode-readout { flex: 1 0 100%; }
  .editor-inspector-scroll { display: block; }
  .editor-inspector-section { border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 16px; margin: 0 0 16px; }
  .editor-footer-bar { align-items: stretch; flex-direction: column; }
  .editor-footer-bar .actions { width: 100%; }
  .editor-footer-bar .button { flex: 1 1 auto; }
}
