:root { color-scheme: light; --ink: #2d2f39; --muted: #61636f; --line: #d9dae3; --canvas: #f4f4fa; --red: #ef312f; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, label.select-files { cursor: pointer; }
a { color: inherit; }
button:disabled { opacity: .55; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #168274; outline-offset: 3px; }
.tools-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px max(24px, calc((100% - 1240px) / 2)); background: #fff; border-bottom: 1px solid var(--line); }
.logo { font-size: 25px; font-weight: 800; text-decoration: none; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
nav a { font-size: 15px; color: var(--muted); text-decoration: none; }
nav a:hover { text-decoration: underline; }
.directory { max-width: 1290px; margin: auto; padding: 38px 24px 64px; min-height: calc(100vh - 165px); }
h1 { font-size: 34px; line-height: 1.25; margin: 0 0 12px; }
h2 { font-size: 21px; margin: 0 0 16px; }
p { line-height: 1.6; }
.directory-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.directory-head p { margin: 0; color: var(--muted); }
.search-box { display: flex; align-items: center; gap: 12px; background: #fff; padding: 12px 16px; border: 1px solid var(--line); border-radius: 6px; width: 320px; max-width: 100%; }
.search-box input { border: 0; outline: none; width: 100%; min-width: 0; font-size: 16px; }
svg { width: 22px; height: 22px; flex: 0 0 auto; }
.categories { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.categories button { border: 0; background: transparent; color: var(--muted); padding: 12px 18px; border-bottom: 3px solid transparent; font-weight: 650; }
.categories button[aria-pressed="true"] { color: #c32027; border-color: var(--red); }
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.tool-card { display: flex; flex-direction: column; min-height: 216px; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.tool-card:hover { border-color: #acadb8; box-shadow: 0 4px 14px #2528330d; }
.tool-card .card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 21px; }
.tool-icon { width: 48px; height: 48px; border-radius: 6px; display: grid; place-items: center; flex: 0 0 auto; }
.tool-icon svg { width: 27px; height: 27px; }
.coral { color: #d3442c; background: #ffede7; }
.green { color: #568a32; background: #edf5e6; }
.blue { color: #426ea0; background: #eaf1fa; }
.gold { color: #8a7516; background: #fcf5d6; }
.rose { color: #a15186; background: #f7eaf3; }
.teal { color: #167568; background: #e4f4f0; }
.tool-card h2 { margin: 0 0 10px; font-size: 20px; line-height: 1.35; }
.tool-card p { margin: 0; color: var(--muted); font-size: 15px; }
.badge { font-size: 12px; color: #167568; background: #e4f4f0; padding: 4px 7px; border-radius: 4px; }
.badge.pending { background: #f0f0f4; color: var(--muted); }
.tools-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px 32px; padding: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.tool-main { max-width: 1240px; margin: auto; padding: 38px 24px 60px; min-height: calc(100vh - 165px); }
.tool-heading { text-align: center; margin-bottom: 30px; }
.tool-heading .tool-icon { margin: 0 auto 16px; }
.tool-heading p { margin: 0; color: var(--muted); }
.tool-upload { text-align: center; max-width: 620px; margin: 38px auto; }
.select-files { display: inline-flex; align-items: center; justify-content: center; gap: 14px; padding: 25px 36px; background: var(--red); color: #fff; border: 2px solid transparent; border-radius: 8px; min-height: 88px; font-size: 24px; font-weight: 750; max-width: 100%; box-shadow: 0 4px 10px #c2262220; }
.select-files.is-dragging { background: #ba2027; border: 2px dashed #fff; }
.drop-copy { color: var(--muted); margin: 14px 0; }
.file-limits, .tool-note { font-size: 14px; color: var(--muted); line-height: 1.6; }
.tool-note:empty { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.tool-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.document-stage { min-width: 0; }
.stage-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 16px; }
.stage-toolbar h2 { margin: 0; font-size: 19px; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: #fff; flex: 0 0 auto; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 12px; background: #fff; border-bottom: 1px solid var(--line); }
.file-row strong { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.page-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 16px; margin-top: 20px; }
.page-thumb { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 10px; min-width: 0; }
.page-thumb canvas, .page-thumb img { width: 100%; height: auto; display: block; }
.page-thumb .thumb-controls { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; }
.thumb-controls .icon-button { width: 28px; height: 28px; }
.thumb-controls svg { width: 16px; height: 16px; }
.thumb-controls { flex-wrap: wrap; }
.thumb-controls span { flex-basis: 100%; text-align: center; font-size: 13px; }
.page-thumb.selected { border-color: #168274; }
.canvas-editor { position: relative; width: 100%; background: #fff; border: 1px solid var(--line); touch-action: none; }
.canvas-editor canvas { display: block; width: 100%; height: auto; }
.canvas-editor .annotation-layer { position: absolute; inset: 0; }
.tool-options { border-left: 1px solid var(--line); padding-left: 24px; min-width: 0; }
.tool-options label, .password-dialog label { display: block; font-size: 14px; font-weight: 650; margin-bottom: 18px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="search"]), select, textarea { display: block; width: 100%; margin-top: 7px; padding: 11px 12px; background: #fff; border: 1px solid #bfc1cc; border-radius: 5px; color: var(--ink); font-size: 16px; }
input[type="color"] { height: 44px; padding: 4px !important; }
input[type="range"] { accent-color: var(--red); padding: 0 !important; }
textarea { resize: vertical; min-height: 120px; }
.tool-options .checkbox { display: flex; align-items: center; gap: 10px; }
.primary, .secondary { display: inline-flex; justify-content: center; align-items: center; gap: 10px; padding: 13px 20px; border: 0; border-radius: 6px; text-decoration: none; font-weight: 700; min-height: 48px; }
.primary { background: var(--red); color: #fff; width: 100%; }
.secondary { color: var(--ink); background: #fff; border: 1px solid var(--line); }
.tool-status { max-width: 740px; margin: 24px auto 0; text-align: center; color: #167568; overflow-wrap: anywhere; }
.tool-status.error { color: #ba2027; }
.downloads { display: grid; gap: 10px; margin-top: 18px; }
.downloads a { display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 6px; padding: 14px 12px; background: #176c5e; color: #fff; text-decoration: none; overflow-wrap: anywhere; }
.busy-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: #21232b66; }
.busy-overlay section, .password-dialog { width: min(100%, 440px); padding: 30px; background: #fff; border-radius: 8px; box-shadow: 0 16px 60px #1f22254d; text-align: center; }
.busy-overlay p { color: var(--muted); }
.spinner { display: block; margin: 0 auto 22px; width: 34px; height: 34px; border: 3px solid #e3e4eb; border-top-color: #ef312f; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
progress { width: 100%; accent-color: #168274; }
.dialog-actions { display: flex; gap: 12px; }
.dialog-actions .primary { width: auto; flex: 1; }
.password-dialog label { text-align: left; }
#passwordError { color: #ba2027; }
.signature-pad { width: 100%; aspect-ratio: 2.5; background: #fff; border: 1px solid var(--line); border-radius: 5px; touch-action: none; margin-bottom: 12px; }
.text-result { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; background: #fff; border: 1px solid var(--line); padding: 24px; border-radius: 6px; margin-top: 20px; }
.annotation-layer { cursor: crosshair; }
.compare-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.compare-grid figure { margin: 0; min-width: 0; }
.compare-grid canvas { width: 100%; height: auto; background: #fff; }
.compare-grid figcaption { font-size: 13px; text-align: center; color: var(--muted); margin: 8px 0; }
@media (max-width: 1080px) { .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .tool-workspace { grid-template-columns: minmax(0, 1fr) 310px; } }
@media (max-width: 800px) { .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tool-workspace { grid-template-columns: minmax(0, 1fr); } .tool-options { border-left: 0; padding: 24px 0 0; border-top: 1px solid var(--line); } }
@media (max-width: 520px) { .tools-header { padding: 18px 20px; gap: 16px; flex-wrap: wrap; } nav { gap: 18px; } .directory, .tool-main { padding: 28px 18px 48px; } h1 { font-size: 29px; } .tool-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; } .tool-card { min-height: 174px; padding: 20px; } .tool-card .card-top { margin-bottom: 14px; } .categories button { padding: 11px 12px; } .select-files { width: 100%; font-size: 22px; padding: 22px 16px; } .compare-grid { grid-template-columns: minmax(0, 1fr); } .tools-footer { justify-content: flex-start; } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
