/* Free PDF tool pages (made by site-gen/build.py from site-gen/tools.py). */
.tool-hero { text-align: center; max-width: 760px; margin: 0 auto; }
.tool-hero .lead { margin-bottom: 8px; }
.tool-hero .free { color: var(--muted); margin: 0 0 22px; }
/* Parts wait hidden until they are needed; without this the display rules below would show them from the start. */
#tool [hidden], #sign [hidden] { display: none !important; }
#tool { max-width: 620px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
#t-drop { border: 2px dashed var(--line); border-radius: 22px; padding: 34px 20px; display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; background: var(--panel); transition: border-color .15s, background .15s; }
#t-drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--panel)); }
#tool.has-files #t-drop { display: none; }
#t-drop .small, #tool .small { color: var(--muted); font-size: 14px; margin: 0; }
#t-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
#t-files li { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; background: var(--panel); }
#t-files .t-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
#t-files .t-info { color: var(--muted); font-size: 14px; white-space: nowrap; }
#t-files .t-row-tools { display: flex; gap: 4px; }
#t-files button { border: 0; background: none; color: var(--accent); font: inherit; font-size: 14px; padding: 4px 6px; border-radius: 8px; cursor: pointer; }
#t-files button:disabled { color: var(--line); cursor: default; }
#t-files button:focus-visible, #tool .btn:focus-visible, #t-form input:focus-visible, #t-form select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#t-form { display: flex; flex-direction: column; gap: 12px; }
#t-form .t-field { display: flex; flex-direction: column; gap: 4px; text-align: left; }
#t-form label { font-weight: 600; font-size: 15px; }
#t-form input, #t-form select { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); width: 100%; box-sizing: border-box; }
#t-form .hint { color: var(--muted); font-size: 13.5px; }
#t-form .t-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
#tool .btn { cursor: pointer; border: 0; font: inherit; font-weight: 600; }
#tool .btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
#tool .btn:disabled { opacity: .5; cursor: default; }
#t-status { text-align: center; margin: 0; color: var(--muted); }
#t-status.bad { color: #c62828; }
#tool.working #t-status::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%; vertical-align: -1px; animation: t-spin .8s linear infinite; }
@keyframes t-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #tool.working #t-status::before { animation: none; } }
#t-done { background: color-mix(in srgb, #1a7f37 12%, var(--panel)); border-radius: 22px; padding: 24px 20px; display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; }
#t-done b { font-size: 19px; }
#t-download { word-break: break-word; }
#t-offer { border: 1px solid var(--line); border-radius: 22px; padding: 16px 20px; display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--panel); }
#t-offer p { margin: 0; }
.tool-private { text-align: center; color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.tool-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 34px 0 6px; padding: 0; list-style: none; counter-reset: t; }
.tool-steps li { counter-increment: t; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; background: var(--panel); }
.tool-steps b { display: block; }
.tool-steps b::before { content: counter(t) ". "; color: var(--accent); }
.tool-steps span { color: var(--muted); font-size: 15px; }
.tool-more { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.tool-more a, .tool-grid a { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background: var(--panel); color: var(--ink); font-size: 15px; }
.tool-more a:hover, .tool-grid a:hover { border-color: var(--accent); text-decoration: none; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 10px 0 26px; }

/* The "Sign a PDF yourself" page (tools-sign.js). */
#sign { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
#sign.has-file #t-drop { display: none; }
#sign .small { color: var(--muted); font-size: 14px; margin: 0; }
#sign .btn { cursor: pointer; border: 0; font: inherit; font-weight: 600; }
#sign .btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
#sign .btn:disabled { opacity: .5; cursor: default; }
#sign.working #t-status::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%; vertical-align: -1px; animation: t-spin .8s linear infinite; }
@media (prefers-reduced-motion: reduce) { #sign.working #t-status::before { animation: none; } }
#s-work { display: flex; flex-direction: column; gap: 10px; }
#s-bar { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 6px 20px rgba(0, 0, 0, .08); }
#s-bar [data-add], .s-quiet, .s-tabs button { font: inherit; font-size: 14.5px; font-weight: 500; padding: 8px 12px; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--ink); cursor: pointer; }
#s-bar [data-add]:hover, .s-quiet:hover { border-color: var(--line); }
#s-bar [data-add][aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); border-color: var(--accent); color: var(--accent); }
#s-bar button:focus-visible, .s-item:focus-visible, #s-dialog button:focus-visible, #s-dialog input:focus-visible, #s-canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.s-quiet { color: var(--muted); }
.s-gap { flex: 1; }
#s-hint { text-align: center; }
#s-pages { display: flex; flex-direction: column; gap: 14px; }
.s-page { position: relative; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 2px 10px rgba(0, 0, 0, .06); overflow: hidden; user-select: none; -webkit-user-select: none; }
.s-page > img { display: block; width: 100%; height: 100%; pointer-events: none; }
#s-pages.armed .s-page { cursor: crosshair; }
.s-item { position: absolute; box-sizing: border-box; cursor: move; touch-action: none; outline: 1px dashed transparent; color: #000; display: flex; align-items: center; line-height: 1; }
.s-item:hover, .s-item.chosen { outline-color: #1d6fe0; background: rgba(29, 111, 224, .06); }
.s-item.s-picture img { width: 100%; height: 100%; object-fit: contain; object-position: left center; pointer-events: none; }
.s-item.s-check { justify-content: center; font-family: "Segoe UI Symbol", "Arial Unicode MS", sans-serif; }
.s-item .s-words { white-space: nowrap; padding-left: .17em; font-family: Helvetica, Arial, sans-serif; pointer-events: none; }
.s-item.editing .s-words { visibility: hidden; }
.s-item input { position: absolute; inset: 0; width: 100%; height: 100%; box-sizing: border-box; border: 0; padding: 0 0 0 .17em; margin: 0; background: #fffbe0; color: #000; font: inherit; font-family: Helvetica, Arial, sans-serif; }
.s-grip, .s-remove { display: none; position: absolute; }
.s-item.chosen .s-grip { display: block; right: -7px; bottom: -7px; width: 14px; height: 14px; border-radius: 50%; background: #1d6fe0; border: 2px solid #fff; cursor: nwse-resize; touch-action: none; }
.s-item.s-check .s-grip { display: none; }
.s-item.chosen .s-remove { display: block; right: -11px; top: -24px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #c62828; color: #fff; font: 600 15px/1 system-ui, sans-serif; cursor: pointer; padding: 0; }
.s-item.editing .s-grip, .s-item.editing .s-remove { display: none; }
#s-dialog { border: 1px solid var(--line); border-radius: 20px; padding: 22px; width: min(560px, calc(100vw - 32px)); background: var(--panel); color: var(--ink); }
#s-dialog::backdrop { background: rgba(0, 0, 0, .45); }
#s-dialog h2 { margin: 0 0 12px; font-size: 20px; }
.s-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.s-tabs button[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); color: var(--accent); }
#s-canvas, #s-typed { display: block; width: 100%; height: auto; background: #fff; border: 1px dashed #b9bec7; border-radius: 12px; touch-action: none; }
#s-canvas { cursor: crosshair; }
#s-type label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 4px; }
#s-name { font: inherit; width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); margin-bottom: 10px; }
#s-draw .small { margin-top: 6px; text-align: center; }
.s-dialog-actions { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
@media (max-width: 560px) { #s-bar { top: 4px; } #s-bar [data-add], .s-quiet { padding: 7px 9px; font-size: 13.5px; } #s-finish { width: 100%; } }
