/* FreeTools Hub - PDF Editor */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: #f8fafc; color: #1e293b; line-height: 1.6; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

.site-header { background: linear-gradient(135deg, #1d4ed8, #7c3aed); color: #fff; padding: 40px 0 32px; }
.crumb { color: #dbeafe; text-decoration: none; font-size: .9rem; }
.crumb:hover { text-decoration: underline; }
.site-header h1 { font-size: 2rem; margin: 8px 0 4px; }
.site-header .sub { opacity: .92; }
.estimate-badge { display: inline-block; margin-top: 14px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.4); padding: 8px 16px; border-radius: 10px; font-weight: 700; font-size: .9rem; }

main.wrap { padding-top: 28px; padding-bottom: 40px; }
.card { background: #fff; border-radius: 14px; padding: 24px; margin-bottom: 20px; box-shadow: 0 2px 16px rgba(15,23,42,.06); }
.card h2 { font-size: 1.2rem; margin-bottom: 14px; }
.small-note { font-size: .8rem; color: #64748b; font-weight: 400; }
.note { font-size: .88rem; color: #64748b; margin-top: 10px; }
.error { color: #b91c1c; font-weight: 600; margin-top: 10px; }

/* Dropzone */
.dropzone { border: 2px dashed #c7d2fe; border-radius: 14px; padding: 40px 20px; text-align: center; cursor: pointer; background: #f8faff; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.dragover { border-color: #1d4ed8; background: #eff6ff; }
.dz-icon { font-size: 2.6rem; }

/* Toolbar */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tool { border: 2px solid #e2e8f0; background: #fff; border-radius: 10px; padding: 9px 14px; font-weight: 700; cursor: pointer; font-size: .9rem; color: #475569; }
.tool:hover { border-color: #93c5fd; }
.tool.active { border-color: #1d4ed8; color: #1d4ed8; background: #eff6ff; }
.tool.danger.active { border-color: #b91c1c; color: #b91c1c; background: #fef2f2; }
.toolopts { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: .9rem; color: #475569; }
.toolopts input[type=range] { vertical-align: middle; }
.swatches { display: inline-flex; gap: 6px; }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.sw.active { border-color: #1d4ed8; box-shadow: 0 0 0 2px #bfdbfe; }
.hint { margin-top: 12px; font-size: .88rem; color: #1d4ed8; background: #eff6ff; border-radius: 8px; padding: 8px 12px; }

/* Buttons */
.btn { border: none; border-radius: 10px; padding: 12px 22px; font-weight: 700; font-size: 1rem; cursor: pointer; }
.btn.primary { background: linear-gradient(135deg, #1d4ed8, #7c3aed); color: #fff; }
.btn.primary:disabled { opacity: .6; cursor: wait; }
.btn.small { padding: 7px 14px; font-size: .85rem; }
.btn.danger-outline { background: #fff; border: 2px solid #fecaca; color: #b91c1c; }
.btn.danger-outline:disabled { opacity: .4; cursor: not-allowed; }

/* Pages */
.pages-card { overflow-x: auto; }
.page-block { margin: 0 auto 26px; position: relative; max-width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.page-head strong { font-size: .95rem; }
.page-del { background: #fff; border: 2px solid #fecaca; color: #b91c1c; border-radius: 8px; padding: 4px 12px; font-weight: 700; cursor: pointer; font-size: .82rem; }
.page-wrap { position: relative; display: inline-block; box-shadow: 0 4px 24px rgba(15,23,42,.14); border-radius: 4px; overflow: hidden; line-height: 0; }
.page-wrap canvas { display: block; }
.ann-layer { position: absolute; inset: 0; line-height: 1.4; touch-action: none; }
.ann { position: absolute; }
.ann.selected { outline: 2px dashed #1d4ed8; outline-offset: 2px; }
.ann-text { cursor: move; padding: 2px 6px; min-width: 40px; min-height: 1.2em; color: #111; white-space: pre-wrap; word-break: break-word; }
.ann-text[contenteditable="true"] { outline: 2px solid #1d4ed8; background: rgba(255,255,255,.85); cursor: text; }
.ann-highlight { background: rgba(250, 204, 21, .45); cursor: move; }
.ann-rect { border: 3px solid; cursor: move; }
.ann-ellipse { border: 3px solid; border-radius: 50%; cursor: move; }
.ann-redact { background: #000; cursor: move; }
.ann-image img { display: block; max-width: 100%; pointer-events: none; }
.ann-draw { border: 2px dashed #1d4ed8; background: rgba(29,78,216,.08); pointer-events: none; }
.deleted-banner { background: #fef2f2; border: 2px dashed #fca5a5; border-radius: 10px; padding: 14px; margin-bottom: 26px; display: flex; justify-content: space-between; align-items: center; }
.deleted-banner button { background: #fff; border: 2px solid #e2e8f0; border-radius: 8px; padding: 6px 14px; font-weight: 700; cursor: pointer; }

/* FAQ */
.faq { border-bottom: 1px solid #f1f5f9; padding: 12px 0; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq p { margin-top: 8px; color: #475569; font-size: .94rem; }

.site-footer { text-align: center; padding: 28px 0 40px; color: #64748b; font-size: .9rem; }
.site-footer a { color: #1d4ed8; text-decoration: none; font-weight: 700; }

@media (max-width: 640px) {
  .card { padding: 18px; }
  .site-header h1 { font-size: 1.6rem; }
  .tool { padding: 8px 10px; font-size: .82rem; }
}
