/* ============================================================
   Toolora — lightweight stylesheet
   Mobile-first. No frameworks, no webfonts, no blocking assets.
   ============================================================ */

:root {
  --bg:        #f4f6fb;
  --surface:   #ffffff;
  --surface-2: #f8fafc;
  --border:    #e2e8f0;
  --text:      #0f172a;
  --text-soft: #64748b;
  --brand:     #1d4ed8;
  --brand-dk:  #1e40af;
  --brand-lt:  #eff6ff;
  --accent:    #7c3aed;
  --accent-lt: #f5f3ff;
  --ok:        #047857;
  --ok-bg:     #ecfdf5;
  --err:       #b91c1c;
  --err-bg:    #fef2f2;
  --radius:    14px;
  --shadow:    0 1px 2px rgba(15, 23, 42, .06), 0 4px 12px rgba(15, 23, 42, .05);
  --tap:       52px;              /* minimum comfortable tap target */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0b1120;
    --surface:   #111a2e;
    --surface-2: #16213a;
    --border:    #24324f;
    --text:      #e7ecf5;
    --text-soft: #94a3b8;
    --brand:     #4d82f3;
    --brand-dk:  #6b9bff;
    --brand-lt:  #16233f;
    --accent:    #a78bfa;
    --accent-lt: #241c3d;
    --ok:        #34d399;
    --ok-bg:     #0d2a22;
    --err:       #fca5a5;
    --err-bg:    #2b1416;
    --shadow:    0 1px 2px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 20;
  background: var(--brand); color: #fff; padding: 12px 18px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- header ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  padding-top: 12px; padding-bottom: 12px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  text-decoration: none; color: var(--brand);
  font-size: 20px; letter-spacing: -.02em;
}
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand-text { color: var(--text); font-weight: 500; }
.brand-text strong { font-weight: 800; color: var(--brand); }
.brand-tag { margin: 0; font-size: 13px; color: var(--text-soft); }

@media (max-width: 420px) { .brand-tag { display: none; } }

/* ---------- page furniture ---------- */

main { padding-top: 26px; padding-bottom: 48px; }

.page-title {
  margin: 0 0 6px;
  font-size: 24px; line-height: 1.25; letter-spacing: -.02em; font-weight: 700;
}
.page-sub { margin: 0 0 22px; color: var(--text-soft); font-size: 15px; }

.back-link {
  display: inline-block; margin-bottom: 16px; padding: 8px 2px;
  color: var(--brand); text-decoration: none; font-weight: 600; font-size: 15px;
}
.back-link:hover { text-decoration: underline; }

/* ---------- tool grid ---------- */

.section-head {
  margin: 30px 0 12px;
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-soft);
}
.section-head:first-of-type { margin-top: 4px; }

.tool-grid { display: grid; gap: 12px; }

/* Both grids hold an even number of tools, so a plain 2-up split leaves no
   orphan card. On phones it stays one column and priority comes from order. */
@media (min-width: 620px) {
  .tool-grid { grid-template-columns: 1fr 1fr; }
}

.tool-card {
  display: flex; align-items: center; gap: 14px;
  min-height: 78px; padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
  transition: border-color .12s, transform .12s;
}
.tool-card:hover  { border-color: var(--brand); }
.tool-card:active { transform: scale(.99); }
.tool-card:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.tool-icon {
  flex: none; width: 44px; height: 44px; border-radius: 11px;
  background: var(--brand-lt);
  display: grid; place-items: center;
}
.tool-icon.alt { background: var(--accent-lt); }
.tool-icon svg { width: 26px; height: 26px; fill: var(--brand); }
.tool-icon.alt svg { fill: var(--accent); }
.tool-icon .fold   { fill: var(--surface); opacity: .85; }
.tool-icon .stroke { fill: none; stroke: var(--surface); stroke-width: 2;
                     stroke-linecap: round; stroke-linejoin: round; }
.tool-icon .dash   { fill: none; stroke: var(--brand-lt); stroke-width: 1.5;
                     stroke-dasharray: 3 2.5; }
.tool-icon .glyph  { fill: var(--brand-lt); font: 700 9px/1 sans-serif; text-anchor: middle; }
.tool-icon .glyph.small { font-size: 6.5px; }

.tool-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tool-name { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.tool-desc { font-size: 13.5px; color: var(--text-soft); }
.tool-go   { margin-left: auto; font-size: 26px; color: var(--text-soft); line-height: 1; }

/* ---------- trust strip ---------- */

.trust-row {
  list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px;
  margin: 26px 0 0; padding: 16px 4px 0;
  border-top: 1px solid var(--border);
  font-size: 13.5px; color: var(--text-soft);
}
.trust-row li { display: flex; align-items: center; gap: 7px; }
.trust-ico { font-size: 14px; }

/* ---------- dropzone ---------- */

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 30px 18px;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer; text-align: center;
  transition: border-color .12s, background .12s;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--brand); background: var(--brand-lt); }
.dropzone:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(29, 78, 216, .25); }
.dropzone.is-over { border-color: var(--brand); background: var(--brand-lt); }

.drop-ico { width: 30px; height: 30px; margin-bottom: 2px; }
.drop-ico .stroke { fill: none; stroke: var(--brand); stroke-width: 2;
                    stroke-linecap: round; stroke-linejoin: round; }
.drop-cta  { font-size: 19px; font-weight: 700; color: var(--brand); }
.drop-hint { font-size: 13.5px; color: var(--text-soft); }

/* ---------- selected files ---------- */

.file-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }

.file-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
}
.file-meta { min-width: 0; flex: 1; }
.file-name {
  display: block; font-size: 14.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-size { display: block; font-size: 12.5px; color: var(--text-soft); }

.icon-btn {
  flex: none; width: 44px; height: 44px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-soft); font-size: 16px; line-height: 1; cursor: pointer;
}
.icon-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.icon-btn:disabled { opacity: .35; cursor: default; }

/* ---------- options ---------- */

.options { margin-top: 16px; }
.opt-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }

.segmented { display: flex; gap: 8px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  flex: 1; min-height: 46px; padding: 0 6px;
  display: grid; place-items: center; text-align: center;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); font-size: 15px; font-weight: 600; cursor: pointer;
}
.segmented input:checked + label { border-color: var(--brand); background: var(--brand-lt); color: var(--brand); }
.segmented input:focus-visible + label { outline: 3px solid var(--brand); outline-offset: 2px; }
.segmented-4 label { font-size: 14px; }

/* stacked radios (Split PDF) */
.radio-stack { display: grid; gap: 8px; }
.radio-row {
  display: flex; align-items: flex-start; gap: 11px;
  min-height: var(--tap); padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 11px;
  background: var(--surface); cursor: pointer;
}
.radio-row input { margin: 3px 0 0; width: 19px; height: 19px; accent-color: var(--brand); flex: none; }
.radio-row:has(input:checked) { border-color: var(--brand); background: var(--brand-lt); }
.radio-row:focus-within { outline: 3px solid var(--brand); outline-offset: 2px; }
.radio-row span { display: flex; flex-direction: column; gap: 2px; }
.radio-row strong { font-size: 15px; font-weight: 650; }
.radio-row small  { font-size: 13px; color: var(--text-soft); }

.text-input {
  width: 100%; min-height: var(--tap); padding: 12px 14px;
  font: inherit; font-size: 16px;      /* 16px stops iOS zooming on focus */
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 11px;
}
.text-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29, 78, 216, .2); }

#range-wrap { margin-top: 14px; }
.opt-help { margin: 8px 0 0; font-size: 13px; color: var(--text-soft); }
.opt-help code {
  font-size: 12.5px; padding: 1px 5px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--border);
}

/* ---------- buttons ---------- */

.btn {
  font: inherit; font-weight: 650; cursor: pointer;
  border-radius: 12px; border: 1px solid transparent;
  padding: 0 20px; min-height: var(--tap);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
}
.btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.btn-block { display: flex; width: 100%; margin-top: 18px; }

.btn-primary { background: var(--brand); color: #fff; font-size: 17px; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dk); }
.btn-primary:disabled { opacity: .55; cursor: default; }

.btn-download { background: var(--ok); color: #fff; font-size: 17px; }
.btn-download:hover { filter: brightness(1.08); }

.btn-ghost {
  background: var(--surface); color: var(--text);
  border-color: var(--border); min-height: 44px; padding: 0 14px; font-size: 15px;
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- progress + status ---------- */

.progress { margin-top: 18px; }
.progress-bar {
  height: 8px; border-radius: 99px; background: var(--border); overflow: hidden;
}
.progress-bar span {
  display: block; height: 100%; width: 0; background: var(--brand);
  transition: width .15s linear;
}
.progress-text { margin: 8px 0 0; font-size: 13.5px; color: var(--text-soft); text-align: center; }

.status { margin: 14px 0 0; font-size: 14.5px; min-height: 0; }
.status:empty { margin: 0; }
.status.is-error {
  color: var(--err); background: var(--err-bg);
  border: 1px solid currentColor; border-radius: 10px; padding: 12px 14px;
}

/* ---------- result ---------- */

.result {
  margin-top: 18px; padding: 18px;
  background: var(--ok-bg); border: 1px solid var(--ok); border-radius: var(--radius);
}
.result-title { margin: 0 0 4px; font-size: 17px; font-weight: 700; color: var(--ok); }
.result-sub   { margin: 0 0 14px; font-size: 14px; color: var(--text-soft); }
.result .btn-download { width: 100%; }
.result-note  { margin: 12px 0 0; font-size: 13px; color: var(--text-soft); }
.result-note a { color: var(--brand); }

.page-grid {
  display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  margin-top: 14px;
}
.page-thumb {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  min-height: var(--tap); padding: 9px 8px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  text-decoration: none; color: var(--brand);
  font-size: 13px; font-weight: 600; text-align: center;
}
.page-thumb:hover { border-color: var(--brand); }
.page-thumb img {
  width: 100%; height: 84px; object-fit: contain;
  border-radius: 5px; background: #fff;
}
.thumb-label {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.thumb-meta { font-size: 11.5px; font-weight: 500; color: var(--text-soft); }

/* ---------- reader ---------- */

.reader { margin-top: 18px; }
.reader-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px; margin-bottom: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
}
.reader-spacer { flex: 1; }
.pg-label { font-size: 14px; color: var(--text-soft); white-space: nowrap; }
#pg-num {
  width: 54px; padding: 7px 6px; font: inherit; font-size: 14px; text-align: center;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px;
}

.reader-stage {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px;
  padding: 10px; overflow: auto; max-height: 78vh; text-align: center;
}
#reader-canvas {
  max-width: 100%; height: auto; background: #fff;
  box-shadow: 0 1px 6px rgba(15, 23, 42, .18); border-radius: 3px;
}

/* ---------- footer ---------- */

.privacy-note {
  margin: 22px 0 0; padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px;
  font-size: 13px; color: var(--text-soft);
}

.site-footer {
  border-top: 1px solid var(--border); padding: 18px 0 28px;
  font-size: 13px; color: var(--text-soft); text-align: center;
}
.site-footer p { margin: 0; }

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ============================================================
   Content pages — About / Privacy / Terms / Contact / FAQ
   ============================================================ */

.doc-page { padding-bottom: 12px; }
.doc-updated { margin: -10px 0 24px; font-size: 13px; color: var(--text-soft); }

.doc-page h2 {
  margin: 30px 0 10px; font-size: 19px; font-weight: 700; letter-spacing: -.01em;
}
.doc-page h2:first-of-type { margin-top: 22px; }
.doc-page p  { margin: 0 0 14px; color: var(--text); }
.doc-page ul, .doc-page ol { margin: 0 0 14px; padding-left: 22px; }
.doc-page li { margin-bottom: 6px; }
.doc-page a  { color: var(--brand); }
.doc-page a:hover { text-decoration: none; }
.doc-page strong { font-weight: 650; }

/* FAQ accordion — plain <details>, no JS needed, fully crawlable */

.faq-item {
  border: 1px solid var(--border); border-radius: 11px;
  background: var(--surface); margin-bottom: 10px; overflow: hidden;
}
.faq-item summary {
  padding: 14px 16px; cursor: pointer; font-weight: 650; font-size: 15px;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 20px; color: var(--text-soft); flex: none; line-height: 1; }
.faq-item[open] summary::after { content: '\2212'; }
.faq-item summary:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; border-radius: 6px; }
.faq-item p { padding: 0 16px 16px; margin: 0; color: var(--text-soft); font-size: 14.5px; }

/* footer link row */

.foot-links {
  list-style: none; display: flex; flex-wrap: wrap; justify-content: center;
  gap: 6px 4px; margin: 0 0 10px; padding: 0; font-size: 13.5px;
}
.foot-links a { color: var(--text-soft); text-decoration: none; padding: 4px 6px; }
.foot-links a:hover { color: var(--brand); text-decoration: underline; }
.foot-links li:not(:last-child)::after { content: '\00b7'; margin-left: 8px; color: var(--border); }

/* homepage editorial sections (real, unique content — not just tool cards) */

.info-section { margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--border); }
.info-section h2 { margin: 0 0 8px; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.info-section > p.section-lede { margin: 0 0 18px; color: var(--text-soft); font-size: 14.5px; max-width: 60ch; }

.why-grid { display: grid; gap: 14px; margin-top: 4px; }
@media (min-width: 620px) { .why-grid { grid-template-columns: 1fr 1fr 1fr; } }
.why-card { padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.why-card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 650; }
.why-card p  { margin: 0; font-size: 13.5px; color: var(--text-soft); }

.faq-more { margin: 14px 0 0; font-size: 14px; }

/* ============================================================
   Homepage — hero, search, recently-used
   ============================================================ */

.hero { padding: 6px 0 4px; }
.hero-title {
  margin: 0 0 8px; font-size: 30px; line-height: 1.15;
  letter-spacing: -.02em; font-weight: 800;
}
.hero-sub { margin: 0 0 22px; color: var(--text-soft); font-size: 16px; max-width: 46ch; }

.search-wrap { position: relative; margin-bottom: 12px; }
.search-input {
  width: 100%; min-height: var(--tap); padding: 0 16px;
  font: inherit; font-size: 16px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow);
}
.search-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29, 78, 216, .2); }

.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 5;
  display: grid; gap: 8px; padding: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
  max-height: 60vh; overflow-y: auto;
}
.search-results[hidden] { display: none; }
.search-results .tool-card { min-height: 62px; padding: 10px 12px; box-shadow: none; }
.search-empty { margin: 0; padding: 10px 6px; font-size: 14px; color: var(--text-soft); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.chip {
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  padding: 8px 14px; min-height: 44px;
  color: var(--text-soft); background: var(--surface);
  border: 1px solid var(--border); border-radius: 99px;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }

/* ============================================================
   Tool pages — breadcrumbs, intro, how-to, related tools
   ============================================================ */

.breadcrumbs {
  list-style: none; display: flex; flex-wrap: wrap; align-items: center;
  gap: 4px; margin: 0 0 14px; padding: 0; font-size: 13px; color: var(--text-soft);
}
.breadcrumbs a { color: var(--text-soft); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand); text-decoration: underline; }
.breadcrumbs li:not(:last-child)::after { content: '/'; margin-left: 4px; color: var(--border); }
.breadcrumbs li[aria-current] { color: var(--text); font-weight: 600; }

.tool-intro { margin: 0 0 22px; color: var(--text-soft); font-size: 15px; max-width: 62ch; }

.how-to { margin: 30px 0; padding-top: 24px; border-top: 1px solid var(--border); }
.how-to h2 { margin: 0 0 12px; font-size: 17px; font-weight: 700; }
.how-to ol { margin: 0; padding-left: 22px; }
.how-to li { margin-bottom: 6px; font-size: 14.5px; color: var(--text-soft); }

.related-tools { margin: 30px 0 0; padding-top: 24px; border-top: 1px solid var(--border); }
.related-tools h2 { margin: 0 0 12px; font-size: 17px; font-weight: 700; }
.related-grid { display: grid; gap: 10px; }
@media (min-width: 560px) { .related-grid { grid-template-columns: repeat(3, 1fr); } }
.related-grid .tool-card { min-height: 62px; padding: 10px 12px; }

/* ============================================================
   Sign PDF — draw pad and typed-signature preview
   ============================================================ */

.sign-pad {
  display: block; width: 100%; height: 180px;
  background: #fff; border: 2px dashed var(--border); border-radius: 12px;
  touch-action: none; cursor: crosshair;
}
.sign-preview {
  margin-top: 10px; padding: 18px 14px; min-height: 60px;
  display: flex; align-items: center;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  font: italic 34px cursive; color: #111827; word-break: break-word;
}

/* ============================================================
   Edit PDF — annotation toolbar and page canvas
   ============================================================ */

.editor-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 10px; margin-bottom: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
}
.editor-tools, .editor-colors { display: flex; gap: 6px; }

.etool {
  width: 42px; height: 42px; font-size: 18px; line-height: 1;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface-2); cursor: pointer;
}
.etool.active { border-color: var(--brand); background: var(--brand-lt); }

.ecolor {
  width: 28px; height: 28px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 2px solid var(--surface);
}
.ecolor.active { box-shadow: 0 0 0 2px var(--brand); }

.editor-pagebar {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-bottom: 10px; font-size: 14px; color: var(--text-soft);
}

.editor-stage {
  text-align: center; margin: 0 auto 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px;
  padding: 10px; overflow: auto; max-height: 78vh;
}
.editor-canvas-wrap { position: relative; display: inline-block; }
#editor-base { display: block; background: #fff; box-shadow: 0 1px 6px rgba(15, 23, 42, .18); }
#editor-overlay { position: absolute; left: 0; top: 0; touch-action: none; cursor: crosshair; }

.editor-text-input {
  position: absolute; z-index: 5; font: 20px sans-serif;
  border: 1px dashed var(--brand); border-radius: 4px;
  background: rgba(255, 255, 255, .92); padding: 2px 5px; min-width: 60px;
}

/* ============================================================
   Image Cropper
   ============================================================ */

.cropper-stage {
  position: relative; display: inline-block; max-width: 100%;
  margin: 0 auto 16px; text-align: center;
}
#cropper-img {
  display: block; max-width: 100%; max-height: 65vh; border-radius: 8px;
  -webkit-user-drag: none; user-select: none;
}
.cropper-box {
  position: absolute; border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55);
  cursor: move; touch-action: none;
}
.cropper-handle {
  position: absolute; width: 18px; height: 18px; margin: -9px;
  background: #fff; border: 2px solid var(--brand); border-radius: 50%;
  touch-action: none;
}
.cropper-handle[data-h="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.cropper-handle[data-h="ne"] { right: 0; top: 0; margin-right: -9px; margin-left: 0; cursor: nesw-resize; }
.cropper-handle[data-h="sw"] { left: 0; bottom: 0; margin-bottom: -9px; margin-top: 0; cursor: nesw-resize; }
.cropper-handle[data-h="se"] { right: 0; bottom: 0; margin: -9px; cursor: nwse-resize; }

/* ============================================================
   Utility / calculator tools
   ============================================================ */

.calc-result {
  margin-top: 18px; padding: 16px 18px;
  background: var(--brand-lt); border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 17px; line-height: 1.5; color: var(--text);
}
.calc-result strong { font-weight: 700; }
.calc-sub { font-size: 13.5px; font-weight: 500; color: var(--text-soft); }

.calc-pane { margin-top: 4px; display: grid; gap: 12px; }
.calc-pane .opt-label:not(:first-child) { margin-top: 4px; }

.calc-textarea {
  width: 100%; min-height: 180px; padding: 12px 14px; resize: vertical;
  font: inherit; font-size: 15px; line-height: 1.5;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
}
.calc-textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29, 78, 216, .2); }
.calc-textarea[readonly] { background: var(--surface-2); }

.calc-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px;
  margin-top: 14px;
}
.stat-tile {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 6px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
}
.stat-tile strong { font-size: 20px; font-weight: 700; color: var(--brand); }
.stat-tile span { font-size: 12px; color: var(--text-soft); }

.uc-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.uc-row select { flex: 1; min-height: var(--tap); }
.uc-eq { font-weight: 700; color: var(--text-soft); flex: none; }

.qr-output { margin-top: 18px; text-align: center; }
.qr-output canvas {
  max-width: 100%; height: auto; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; padding: 8px;
}
