/* PDF Tools Pro — styles for the shared extras, exact-size tools, Ask PDF, command bar and
   searchable OCR. Uses the app's existing design tokens. */
.tool-panel [hidden], .px-command [hidden], .px-moved [hidden] { display: none !important; }

/* Moved notice */
.px-moved { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 16px 0; padding: 12px 16px; border-radius: var(--radius-md, 12px); border: 1px solid rgba(99, 102, 241, 0.35); background: rgba(99, 102, 241, 0.1); color: var(--text); font-size: 13px; line-height: 1.45; }
.px-moved-text { flex: 1 1 320px; min-width: 0; }
.px-moved-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.px-moved-actions .btn { text-decoration: none; }

/* Shared bits */
.px-label { font-size: 12px; color: var(--text3); font-family: 'JetBrains Mono', monospace; margin: 14px 0 8px; letter-spacing: 0.04em; }
.px-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.px-chip { appearance: none; border: 1px solid var(--line2, rgba(255,255,255,0.13)); background: var(--bg2); color: var(--text2); border-radius: 999px; padding: 7px 14px; font: 600 13px/1.2 inherit; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.px-chip:hover { color: var(--text); border-color: rgba(99, 102, 241, 0.55); }
.px-chip.selected { color: #fff; background: rgba(99, 102, 241, 0.22); border-color: rgba(129, 140, 248, 0.8); }
.px-chip:focus-visible, .px-mode:focus-visible, .px-cite:focus-visible, .px-next-btn:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 2px; }
.px-input { width: 110px; padding: 8px 10px; border-radius: var(--r, 8px); border: 1px solid var(--line2, rgba(255,255,255,0.13)); background: var(--bg1, #0d1117); color: var(--text); font: 500 13px inherit; }
.px-hint { font-size: 12px; color: var(--text3); margin-top: 8px; line-height: 1.5; }
.px-link { appearance: none; border: 0; background: none; color: #a5b4fc; font: 600 12px inherit; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.px-link:hover { background: rgba(99, 102, 241, 0.12); }

/* Next-step bar */
.px-next { margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-md, 12px); border: 1px dashed rgba(129, 140, 248, 0.45); background: rgba(99, 102, 241, 0.06); }
.px-next-title { font-size: 13px; color: var(--text2); margin-bottom: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.px-next-title strong { color: var(--text); }
.px-next-row { display: flex; flex-wrap: wrap; gap: 8px; }
.px-next-btn { appearance: none; border: 1px solid var(--line2, rgba(255,255,255,0.13)); background: var(--bg2); color: var(--text); border-radius: var(--r, 8px); padding: 8px 12px; font: 600 13px inherit; cursor: pointer; }
.px-next-btn:hover { border-color: rgba(129, 140, 248, 0.8); background: rgba(99, 102, 241, 0.14); }

/* Target size (compress) and image resizer */
.px-target { margin: 4px 0 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.px-target .px-label { margin-top: 4px; }
.px-resize-preview { display: flex; gap: 14px; align-items: center; margin: 14px 0; flex-wrap: wrap; }
.px-resize-preview img { max-width: 180px; max-height: 180px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }

/* Ask PDF */
.px-ask-info { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.px-ask-info .px-hint { margin-top: 0; }
.px-ask-doc { font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.px-ask-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.px-mode { appearance: none; display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px 12px; border-radius: var(--r, 8px); border: 1px solid var(--line2, rgba(255,255,255,0.13)); background: var(--bg2); color: var(--text); cursor: pointer; font: inherit; }
.px-mode.selected { border-color: rgba(129, 140, 248, 0.85); background: rgba(99, 102, 241, 0.16); }
.px-mode:disabled { opacity: 0.45; cursor: not-allowed; }
.px-mode-label { font-weight: 700; font-size: 13px; }
.px-mode-sub { font-size: 11.5px; color: var(--text3); }
.px-consent { margin: 0 0 14px; padding: 14px 16px; border-radius: var(--radius-md, 12px); border: 1px solid rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.08); color: var(--text); font-size: 13px; line-height: 1.55; }
.px-consent .btn-row { margin-top: 12px; }
.px-thread { display: flex; flex-direction: column; gap: 14px; margin-bottom: 12px; }
.px-turn { display: flex; flex-direction: column; gap: 8px; }
.px-question { align-self: flex-end; max-width: 85%; padding: 10px 14px; border-radius: 14px 14px 4px 14px; background: rgba(99, 102, 241, 0.22); color: var(--text); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.px-answer { align-self: flex-start; max-width: 100%; padding: 12px 14px; border-radius: 14px 14px 14px 4px; background: var(--bg2); border: 1px solid var(--line); color: var(--text); font-size: 14px; line-height: 1.6; }
.px-answer-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.px-thinking { color: var(--text3); font-style: italic; }
.px-error { border-color: rgba(244, 63, 94, 0.45); color: #fecdd3; }
.px-not-found { border-style: dashed; }
.px-cite { appearance: none; display: inline-block; margin: 0 2px; padding: 1px 7px; border-radius: 999px; border: 1px solid rgba(129, 140, 248, 0.6); background: rgba(99, 102, 241, 0.16); color: #c7d2fe; font: 700 11.5px/1.5 'JetBrains Mono', monospace; cursor: pointer; vertical-align: baseline; }
.px-cite:hover { background: rgba(99, 102, 241, 0.32); }
.px-answer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.px-answer-actions .px-hint { margin: 0 auto 0 0; }
.px-sources { margin-top: 8px; font-size: 12.5px; color: var(--text2); }
.px-sources summary { cursor: pointer; color: var(--text3); }
.px-source { margin-top: 8px; line-height: 1.5; overflow-wrap: anywhere; }
.px-composer { display: flex; gap: 10px; align-items: flex-end; margin-top: 10px; }
.px-ask-input { flex: 1; min-height: 46px; resize: vertical; padding: 11px 14px; border-radius: var(--radius-md, 12px); border: 1px solid var(--line2, rgba(255,255,255,0.13)); background: var(--bg1, #0d1117); color: var(--text); font: 500 14px/1.45 inherit; }
.px-ask-input:focus { outline: none; border-color: rgba(129, 140, 248, 0.85); }
.px-preview { margin-top: 16px; padding: 12px; border-radius: var(--radius-md, 12px); border: 1px solid var(--line); background: var(--bg1, #0d1117); }
.px-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.px-preview canvas { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 6px; background: #fff; }
#askpdf-suggestions { margin: 4px 0 6px; }

/* Searchable OCR box */
.px-feature-box { margin-bottom: 18px; padding: 14px 16px; border-radius: var(--radius-md, 12px); border: 1px solid rgba(16, 185, 129, 0.35); background: rgba(16, 185, 129, 0.06); }
.px-feature-head { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
.px-feature-badge { font: 700 10px/1 'JetBrains Mono', monospace; padding: 4px 6px; border-radius: 6px; background: rgba(16, 185, 129, 0.18); color: #6ee7b7; }
.px-feature-box .btn-row { margin-top: 10px; }
.px-flash { animation: px-flash 1.6s ease-out; }
@keyframes px-flash { 0% { box-shadow: 0 0 0 0 rgba(129, 140, 248, 0.8); } 100% { box-shadow: 0 0 0 14px rgba(129, 140, 248, 0); } }

/* Command bar on home */
.px-command { margin: 14px 0 6px; padding: 12px; border-radius: var(--radius-lg, 18px); border: 1px solid var(--line2, rgba(255,255,255,0.13)); background: var(--surface-elevated, rgba(18, 22, 34, 0.88)); }
.px-command-row { display: flex; align-items: center; gap: 10px; }
.px-command-icon { font-size: 18px; }
.px-command-input { flex: 1; min-width: 0; padding: 11px 12px; border-radius: var(--radius-md, 12px); border: 1px solid transparent; background: var(--bg1, #0d1117); color: var(--text); font: 500 14px inherit; }
.px-command-input:focus { outline: none; border-color: rgba(129, 140, 248, 0.85); }
.px-command-plan { min-height: 0; margin: 8px 4px 0; font-size: 12.5px; color: var(--text2); }
.px-command-plan:empty { display: none; }
.px-command-result { margin-top: 10px; padding: 10px 12px; border-radius: var(--r, 8px); font-size: 13px; background: var(--bg2); border: 1px solid var(--line); }
.px-tone-success { border-color: rgba(16, 185, 129, 0.45); }
.px-tone-warn { border-color: rgba(245, 158, 11, 0.5); }
.px-tone-error { border-color: rgba(244, 63, 94, 0.5); color: #fecdd3; }
@media (max-width: 640px) {
   .px-command-row { flex-wrap: wrap; }
   .px-command-row .btn { width: 100%; justify-content: center; }
   .px-composer { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) { .px-flash { animation: none; } }

/* The per-tool free-usage pill has no copy for the new tools; hide it when empty. */
.usage-pill:empty { display: none !important; }
