/* PDF text editor */
.wrap-wide { max-width: 1440px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.editor { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.editor > .dropzone { margin: 20px; width: auto; max-width: none; }
.editor > .notice { margin: 0 20px 20px; }

.ed-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ed-file { display: flex; flex-direction: column; min-width: 0; }
.ed-file strong { font: 700 15px/1.3 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }
.ed-file span { font-size: 13px; color: var(--muted); }
.ed-hint { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 13px; }
.ed-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.edits-count { font-size: 13px; color: var(--muted); padding: 0 6px; font-variant-numeric: tabular-nums; }

.ed-body { display: flex; flex-wrap: wrap; align-items: flex-start; background: var(--stage); }
.ed-thumbs { flex: 0 0 128px; align-self: stretch; padding: 14px 12px; display: flex; flex-direction: column; gap: 12px; align-items: center; background: var(--surface); border-right: 1px solid var(--line); }
.thumb { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 5px; border: 2px solid transparent; border-radius: 8px; background: none; cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 600; }
.thumb canvas { display: block; width: 88px; height: auto; background: #fff; box-shadow: 0 1px 3px rgba(20, 23, 28, .2); }
.thumb.is-current { border-color: var(--accent); color: var(--accent-text); }
.ed-stage { flex: 999 1 520px; min-width: 0; padding: 20px 16px 28px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pg-label { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pdf-page { position: relative; background: #fff; box-shadow: 0 2px 10px rgba(20, 23, 28, .14); margin-bottom: 14px; }
.pdf-page canvas { display: block; }
.text-layer { position: absolute; inset: 0; }

.tb { position: absolute; border-radius: 2px; cursor: text; outline: 1.5px dashed transparent; outline-offset: 2px; color: transparent; white-space: pre; line-height: 1; }
.tb:hover, .tb:focus-visible { outline-color: var(--warm); }
.tb.is-locked { cursor: not-allowed; }
.tb.is-locked:hover { outline-color: var(--line-strong); }
.tb.is-selected { outline: 2px solid var(--accent); outline-offset: 2px; }
.tb::after { content: attr(data-tip); position: absolute; left: -2px; bottom: calc(100% + 8px); padding: 4px 8px; border-radius: 6px; background: #15171C; color: #fff; font: 500 12px/1.3 var(--font-body); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 4; }
.tb:hover::after { opacity: 1; }
.tb.is-selected::after, .tb.is-editing::after { display: none; }
.tb-cover { position: absolute; left: -2px; top: -1px; bottom: -1px; min-width: calc(100% + 4px); padding-left: 2px; display: flex; align-items: center; }
.tb-cover span { white-space: pre; line-height: 1; }
.tb-input { position: absolute; left: -4px; top: -3px; height: calc(100% + 6px); min-width: calc(100% + 8px); padding: 0 2px; border: 2px solid var(--accent); border-radius: 3px; outline: none; line-height: 1; box-shadow: 0 0 0 4px rgba(43, 89, 217, .18); }

.float-bar { position: absolute; z-index: 6; display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 10px; background: var(--surface); color: var(--ink); box-shadow: 0 6px 20px rgba(20, 23, 28, .22); white-space: nowrap; }
.font-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 7px; background: var(--surface-2); font-size: 12px; font-weight: 600; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.font-chip .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-ok { background: var(--ok); }
.dot-match { background: var(--warm); }
.dot-bad { background: var(--danger); }
.float-bar .btn { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }

.ed-panel { flex: 1 0 290px; max-width: 100%; align-self: stretch; padding: 18px; background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; }
.ed-panel-inner { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 18px; }
.ed-panel h2 { font-size: 16px; font-weight: 700; }
.panel-empty { display: flex; flex-direction: column; gap: 10px; color: var(--muted); font-size: 14px; }
.font-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.font-name { font-size: 19px; line-height: 1.2; overflow-wrap: anywhere; }
.status-pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-match { background: var(--warm-soft); color: var(--warm-text); }
.pill-bad { background: var(--danger-soft); color: var(--danger); }
.font-card p { font-size: 13px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.input-color { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
.input-color input[type="color"] { width: 30px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; }
.input-color span { font: 500 14px var(--font-body); font-variant-numeric: tabular-nums; }
.toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.toggle { width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; font: 700 15px var(--font-body); }
.toggle[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.panel-text { font-size: 13px; color: var(--muted); }
.edit-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.edit-list li { display: flex; gap: 6px; align-items: baseline; color: var(--muted); }
.edit-list b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loading { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 14px; }

@media (max-width: 900px) {
  .ed-thumbs { display: none; }
  .ed-panel { border-left: 0; border-top: 1px solid var(--line); }
  .ed-panel-inner { position: static; }
}
