/* ==========================================================================
   Free tools (/tools) — the browser-side file tools, in the CaminhoIT look.

   The tool interface (dropzone, options, results, PDF editor…) is built by
   assets/tools/js/core/harness.js and the modules in assets/tools/js/tools/.
   Everything here is scoped to .ctl, the wrapper the /tools pages put round
   their content, so none of it can leak into the rest of the site, and so it
   wins over Bootstrap's .btn / .progress, which share class names with it.

   The section below the "ported" line was carried over from the standalone
   CaminhoTools build (assets/css/site.css there) and scoped automatically;
   the colours are re-pointed at the CaminhoIT palette through the tokens.
   ========================================================================== */

.ctl {
  --violet-50:  #f6f5ff;
  --violet-100: var(--h-purple-soft, #eae8ff);
  --violet-200: #d4cdff;
  --violet-300: var(--h-purple-lite, #a99bff);
  --violet-500: var(--h-purple-2, #7659ff);
  --violet-600: var(--h-purple, #6245f5);
  --violet-700: #4f33e0;

  --ink:       var(--h-navy-ink, #101b3e);
  --ink-soft:  #34405e;
  --muted:     var(--h-text, #56617b);
  --faint:     #8b93a8;
  --line:      var(--cit-line, #e8ebf5);
  --line-soft: var(--cit-line-soft, #eff1f8);
  --surface:   var(--cit-white, #fff);
  --wash:      var(--h-alt, #f5f7fc);

  --tone-red-bg:    #feecec; --tone-red-fg:    #d9434a;
  --tone-green-bg:  #e3f7ef; --tone-green-fg:  #0f9a6b;
  --tone-blue-bg:   #e5f5fc; --tone-blue-fg:   #0a8cbd;
  --tone-violet-bg: var(--violet-100); --tone-violet-fg: var(--violet-600);
  --tone-amber-bg:  #fef3e1; --tone-amber-fg:  #c27712;
  --tone-pink-bg:   #fdeaf4; --tone-pink-fg:   #c93590;

  --ok: #0f9a6b;  --ok-bg: #e3f7ef;
  --warn: #b4700b; --warn-bg: #fef3e1;
  --bad: #cf2f35; --bad-bg: #feecec;

  --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 24px; --r-pill: 999px;
  --sh-xs: 0 1px 2px rgba(16,27,62,.05);
  --sh-sm: 0 1px 2px rgba(16,27,62,.04), 0 6px 16px rgba(16,27,62,.05);
  --sh-md: 0 2px 4px rgba(16,27,62,.04), 0 16px 34px rgba(16,27,62,.08);
  --sh-lg: 0 8px 20px rgba(16,27,62,.06), 0 28px 60px rgba(16,27,62,.12);
  --sh-violet: 0 10px 26px -12px rgba(98,69,245,.75);
  --header-h: var(--cit-header-h, 78px);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  color: var(--ink-soft);
}

html.dark .ctl {
  --violet-50:  #1b1840;
  --violet-100: #241f4d;
  --violet-200: #3a3378;
  --ink-soft:   #c9cde3;
  --faint:      #8a90ad;
  --line:       rgba(255,255,255,.10);
  --line-soft:  rgba(255,255,255,.06);
  --surface:    #12152e;
  --wash:       #0d0f24;
  --tone-red-bg:   rgba(217,67,74,.16);
  --tone-green-bg: rgba(19,185,129,.16);
  --tone-blue-bg:  rgba(10,164,216,.16);
  --tone-amber-bg: rgba(194,119,18,.18);
  --tone-pink-bg:  rgba(201,53,144,.16);
  --ok-bg: rgba(19,185,129,.16); --warn-bg: rgba(194,119,18,.18); --bad-bg: rgba(207,47,53,.16);
}

/* A small reset, only inside the tools. */
.ctl *, .ctl *::before, .ctl *::after { box-sizing: border-box; }
.ctl h1, .ctl h2, .ctl h3, .ctl h4, .ctl h5 { color: var(--ink); margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; }
.ctl p { margin: 0; }
.ctl ul, .ctl ol { margin: 0; padding: 0; }
.ctl img, .ctl canvas, .ctl video { max-width: 100%; height: auto; display: block; }
.ctl svg.icon { display: block; }
.ctl button, .ctl input, .ctl select, .ctl textarea { font: inherit; color: inherit; }
.ctl .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Bootstrap ships .btn and .progress too; keep its state colours out. */
.ctl .btn { --bs-btn-hover-bg: transparent; --bs-btn-active-bg: transparent; --bs-btn-hover-border-color: transparent; --bs-btn-active-border-color: transparent; line-height: 1.3; }
.ctl .btn-primary, .ctl .btn-primary:first-child:active, .ctl .btn-primary:focus-visible { --bs-btn-active-bg: var(--violet-700); background: linear-gradient(110deg, var(--violet-500), var(--violet-600)); color: #fff; border-color: transparent; }
.ctl .btn-primary:hover:not(:disabled) { background: linear-gradient(110deg, #8469ff, #5638ef); color: #fff; }
.ctl .btn-outline:hover, .ctl .btn-quiet:hover, .ctl .btn-ghost:hover { color: var(--violet-700); }
html.dark .ctl .btn-outline:hover, html.dark .ctl .btn-quiet:hover, html.dark .ctl .btn-ghost:hover { color: var(--h-purple-lite, #a99bff); }
.ctl .progress { height: auto; background: none; font-size: inherit; overflow: visible; border-radius: 0; display: block; }

/* --- /tools page layout (CaminhoIT side) ---------------------------------
   The hero, FAQ and closing band are the site's own (cit_kit_mast, _faq,
   _cta in includes/cit-page-kit.php); only the catalogue and the tool body
   sit inside .ctl. */

.ctl-sec { padding-block: clamp(40px, 5vw, 72px); }
.ctl .h-wrap { position: relative; }

/* Search + category chips, sticky under the site header while browsing. */
.ctl-bar {
  position: sticky; top: calc(var(--cit-header-h, 78px) + 10px); z-index: 20;
  display: grid; gap: 14px; padding: 16px; margin-bottom: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-md);
}
.ctl-search { position: relative; }
.ctl-search > .icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.ctl-search input {
  width: 100%; padding: 15px 52px 15px 52px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); font-size: 16.5px; color: var(--ink);
}
.ctl-search input::placeholder { color: var(--faint); }
.ctl-search input:focus { outline: none; border-color: var(--violet-300); box-shadow: 0 0 0 4px rgba(98,69,245,.14); }
.ctl-kbd {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font: 600 12px/1 var(--mono); color: var(--faint); border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 6px; padding: 4px 7px; background: var(--wash);
}

.ctl-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.ctl-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
}
.ctl-chip > span:last-child { font-size: 12px; font-weight: 700; color: var(--faint); }
.ctl-chip:hover { border-color: var(--violet-300); color: var(--violet-600); text-decoration: none; }
.ctl-chip.is-active { background: var(--violet-600); border-color: var(--violet-600); color: #fff; }
.ctl-chip.is-active > span:last-child { color: rgba(255,255,255,.8); }
.ctl .ctl-chip__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tone-violet-fg); }
.ctl .ctl-chip__dot.tone-red { background: var(--tone-red-fg); }   .ctl .ctl-chip__dot.tone-green { background: var(--tone-green-fg); }
.ctl .ctl-chip__dot.tone-blue { background: var(--tone-blue-fg); } .ctl .ctl-chip__dot.tone-amber { background: var(--tone-amber-fg); }
.ctl .ctl-chip__dot.tone-pink { background: var(--tone-pink-fg); }
.ctl .ctl-chip.is-active .ctl-chip__dot { background: #fff; }

.ctl-status { min-height: 22px; margin: 14px 4px 0; font-size: 14px; font-weight: 600; color: var(--muted); }

/* One section per category. */
.ctl-group { margin-top: clamp(24px, 3vw, 40px); scroll-margin-top: calc(var(--cit-header-h, 78px) + 190px); }
.ctl-group__head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.ctl-group__head > div { flex: 1; min-width: 220px; }
.ctl-group__head h2 { font-size: clamp(21px, 2.2vw, 27px); display: flex; align-items: center; gap: 10px; }
.ctl-group__head p { color: var(--muted); font-size: 15px; margin-top: 3px; }
.ctl-group__count { font-size: 13px; font-weight: 700; color: var(--violet-600); background: var(--violet-100); border-radius: 999px; padding: 3px 10px; letter-spacing: 0; }
.ctl-group__all { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 600; color: var(--violet-600); text-decoration: none; }
.ctl-group__all:hover { text-decoration: underline; }
html.dark .ctl-group__all, html.dark .ctl-group__count { color: var(--h-purple-lite, #a99bff); }
.ctl-group--popular { padding: clamp(18px, 2.4vw, 28px); border-radius: var(--r-xl); background: var(--wash); border: 1px solid var(--line-soft); }

.ctl-empty { text-align: center; padding: 56px 16px; }
.ctl-empty .tile { margin: 0 auto 16px; }
.ctl-empty h3 { font-size: 20px; }
.ctl-empty p { color: var(--muted); margin: 8px auto 0; max-width: 52ch; }
.ctl-empty__btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* Tool page: a heading over the working area, under the hero. */
.ctl .ctl-tool-head { margin-bottom: 18px; }
.ctl .ctl-tool-head h2 { font-size: clamp(20px, 2vw, 24px); }
.ctl #tool { scroll-margin-top: calc(var(--cit-header-h, 78px) + 12px); }
#tool { scroll-margin-top: calc(var(--cit-header-h, 78px) + 12px); }

@media (max-width: 640px) {
  .ctl-bar { padding: 12px; top: calc(var(--cit-header-h, 78px) + 6px); }
  .ctl-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -12px; padding-inline: 12px; }
  .ctl-chips::-webkit-scrollbar { display: none; }
  .ctl-kbd { display: none; }
  .ctl-search input { padding-right: 16px; font-size: 16px; }
}

/* --- ported ------------------------------------------------------------- */

.ctl .icon { width: 22px; height: 22px; flex: none; }
.ctl .icon-sm { width: 17px; height: 17px; }
.ctl .icon-xs { width: 14px; height: 14px; }
.ctl .icon-lg { width: 28px; height: 28px; }
.ctl .tile { width: 46px; height: 46px; border-radius: var(--r-md); display: inline-flex; align-items: center; justify-content: center; background: var(--violet-100); color: var(--violet-600); flex: none; transition: transform .18s ease; }
.ctl .tile-xs { width: 32px; height: 32px; border-radius: var(--r-sm); }
.ctl .tile-lg { width: 58px; height: 58px; border-radius: var(--r-lg); }
.ctl .tone-red { background: var(--tone-red-bg); color: var(--tone-red-fg); }
.ctl .tone-green { background: var(--tone-green-bg); color: var(--tone-green-fg); }
.ctl .tone-blue { background: var(--tone-blue-bg); color: var(--tone-blue-fg); }
.ctl .tone-violet { background: var(--tone-violet-bg); color: var(--tone-violet-fg); }
.ctl .tone-amber { background: var(--tone-amber-bg); color: var(--tone-amber-fg); }
.ctl .tone-pink { background: var(--tone-pink-bg); color: var(--tone-pink-fg); }
.ctl .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: var(--r-md); border: 1px solid transparent; font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap; transition: background .16s, border-color .16s, color .16s, transform .12s, box-shadow .16s; text-decoration: none; background: none; }
.ctl .btn:hover { text-decoration: none; }
.ctl .btn:active { transform: translateY(1px); }
.ctl .btn:disabled,
.ctl .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.ctl .btn-primary { background: var(--violet-600); color: #fff; box-shadow: var(--sh-violet); }
.ctl .btn-primary:hover:not(:disabled) { background: var(--violet-700); }
.ctl .btn-outline { background: var(--surface); color: var(--violet-600); border-color: var(--violet-200); }
.ctl .btn-outline:hover:not(:disabled) { border-color: var(--violet-600); background: var(--violet-50); }
.ctl .btn-ghost { color: var(--muted); }
.ctl .btn-ghost:hover:not(:disabled) { background: var(--line-soft); color: var(--ink); }
.ctl .btn-quiet { background: var(--line-soft); color: var(--ink-soft); border-color: var(--line); }
.ctl .btn-quiet:hover:not(:disabled) { background: var(--violet-50); border-color: var(--violet-200); color: var(--violet-700); }
.ctl .btn-lg { padding: 14px 26px; font-size: 16px; border-radius: var(--r-md); }
.ctl .btn-sm { padding: 8px 14px; font-size: 14px; border-radius: var(--r-sm); }
.ctl .btn-block { width: 100%; }
.ctl .tool-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); }
.ctl .tool-grid-wide { grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); }
.ctl .tool-card { display: flex; flex-direction: column; gap: 12px; padding: 22px 20px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); text-decoration: none; color: inherit; position: relative; transition: border-color .18s, box-shadow .18s, transform .18s; }
.ctl .tool-card:hover { text-decoration: none; border-color: var(--violet-200); box-shadow: var(--sh-md); transform: translateY(-3px); }
.ctl .tool-card:hover .tile { transform: scale(1.06); }
.ctl .tool-card-name { font-size: 16px; font-weight: 700; letter-spacing: -.015em; }
.ctl .tool-card-blurb { font-size: 13.5px; color: var(--muted); line-height: 1.55; flex: 1; }
.ctl .tool-card-cta { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--violet-600); margin-top: 2px; }
.ctl .tool-card:hover .tool-card-cta .icon-sm { transform: translateX(3px); }
.ctl .tool-card-cta .icon-sm { transition: transform .18s; }
.ctl .features { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--violet-50); border-radius: var(--r-xl); padding: 34px 12px; text-align: center; }
.ctl .feature { padding: 4px 22px; position: relative; }
.ctl .feature + .feature::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 1px; background: var(--violet-200); }
.ctl .feature .tile { background: var(--surface); margin: 0 auto 14px; box-shadow: var(--sh-xs); }
.ctl .feature h3 { font-size: 15.5px; margin-bottom: 6px; }
.ctl .feature p { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.ctl .tabs { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 34px; }
.ctl .tab { padding: 12px 18px; font-size: 14.5px; font-weight: 500; color: var(--muted); border: 0; background: none; cursor: pointer; position: relative; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; transition: color .15s, border-color .15s; }
.ctl .tab:hover { color: var(--ink); text-decoration: none; }
.ctl .tab.is-active { color: var(--violet-600); font-weight: 600; border-bottom-color: var(--violet-600); }
.ctl .cat-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(206px, 1fr)); }
.ctl .cat-card { display: flex; flex-direction: column; gap: 11px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); text-decoration: none; color: inherit; transition: border-color .18s, box-shadow .18s, transform .18s; }
.ctl .cat-card:hover { text-decoration: none; border-color: var(--violet-200); box-shadow: var(--sh-md); transform: translateY(-3px); }
.ctl .cat-card-top { display: flex; align-items: center; gap: 11px; }
.ctl .cat-card .tile { width: 34px; height: 34px; border-radius: 9px; }
.ctl .cat-card .icon { width: 18px; height: 18px; }
.ctl .cat-card h3 { font-size: 15.5px; }
.ctl .cat-card p { font-size: 13.5px; color: var(--muted); flex: 1; line-height: 1.55; }
.ctl .cat-card .count { font-size: 13px; font-weight: 600; color: var(--violet-600); }
.ctl .crumbs li { display: inline-flex; align-items: center; font-size: 13px; }
.ctl .crumbs a { color: var(--muted); text-decoration: none; }
.ctl .crumbs a:hover { color: var(--violet-600); }
.ctl .crumbs span { color: var(--ink-soft); font-weight: 500; }
.ctl .crumbs .sep { color: var(--faint); margin: 0 4px; transform: rotate(-90deg); }
.ctl .field { display: grid; gap: 6px; margin-bottom: 16px; }
.ctl .field label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.ctl .field .hint { font-size: 12.5px; color: var(--faint); }
.ctl .input,
.ctl .select,
.ctl .textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: 14.5px; transition: border-color .16s, box-shadow .16s; }
.ctl .textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.ctl .input:focus,
.ctl .select:focus,
.ctl .textarea:focus { outline: none; border-color: var(--violet-300); box-shadow: 0 0 0 3px rgba(108,62,244,.10); }
.ctl .select { appearance: none; padding-right: 34px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236E6A85' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.ctl .alert { padding: 14px 18px; border-radius: var(--r-md); font-size: 14.5px; margin-bottom: 22px; }
.ctl .alert-ok { background: var(--ok-bg); color: #10603E; border: 1px solid #BEE8D2; }
.ctl .alert-bad { background: var(--bad-bg); color: #92202A; border: 1px solid #F7CDCE; }
.ctl .tool-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 44px; align-items: start; }
.ctl .tool-main { min-width: 0; }
.ctl .tool-side { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 20px; }
.ctl .tool-title-row { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.ctl .tool-title-row h1 { font-size: clamp(26px, 3.6vw, 36px); }
.ctl .tool-intro { color: var(--muted); font-size: 16.5px; max-width: 66ch; line-height: 1.65; }
.ctl .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-sm); overflow: hidden; }
.ctl .panel-pad { padding: 26px; }
.ctl .panel + .panel { margin-top: 20px; }
.ctl .dropzone { border: 2px dashed var(--violet-200); border-radius: var(--r-lg); background: var(--wash); padding: 46px 24px; text-align: center; cursor: pointer; transition: border-color .16s, background .16s, transform .12s; display: grid; justify-items: center; gap: 6px; }
.ctl .dropzone:hover,
.ctl .dropzone:focus-visible { border-color: var(--violet-500); background: var(--violet-50); }
.ctl .dropzone.is-over { border-color: var(--violet-600); background: var(--violet-100); transform: scale(1.005); }
.ctl .dropzone .tile { margin-bottom: 10px; }
.ctl .dropzone h3 { font-size: 18px; }
.ctl .dropzone .sub { font-size: 14px; color: var(--violet-600); font-weight: 500; }
.ctl .dropzone .types { font-size: 12.5px; color: var(--faint); margin-top: 8px; }
.ctl .dropzone input[type=file] { display: none; }
.ctl .filelist { display: grid; gap: 8px; margin-top: 16px; }
.ctl .fileitem { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.ctl .fileitem .tile { width: 34px; height: 34px; border-radius: 9px; }
.ctl .fileitem .icon { width: 18px; height: 18px; }
.ctl .fileitem-meta { flex: 1; min-width: 0; }
.ctl .fileitem-name { font-size: 14px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctl .fileitem-sub { font-size: 12.5px; color: var(--faint); }
.ctl .fileitem .drag { cursor: grab; color: var(--faint); }
.ctl .fileitem.is-dragging { opacity: .45; }
.ctl .fileitem .x { width: 28px; height: 28px; border-radius: var(--r-sm); border: 0; background: none; color: var(--faint); cursor: pointer; display: grid; place-items: center; }
.ctl .fileitem .x:hover { background: var(--bad-bg); color: var(--bad); }
.ctl .opts { display: grid; gap: 18px; }
.ctl .opt-row { display: grid; gap: 7px; }
.ctl .opt-row > label,
.ctl .opt-label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.ctl .opt-help { font-size: 12.5px; color: var(--faint); line-height: 1.5; }
.ctl .opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; }
.ctl .segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--line-soft); padding: 4px; border-radius: var(--r-md); }
.ctl .segmented button { padding: 8px 14px; border: 0; background: none; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.ctl .segmented button:hover { color: var(--ink); }
.ctl .segmented button.is-on { background: var(--surface); color: var(--violet-600); font-weight: 600; box-shadow: var(--sh-xs); }
.ctl .range-row { display: flex; align-items: center; gap: 14px; }
.ctl input[type=range] { flex: 1; -webkit-appearance: none; appearance: none; height: 5px; border-radius: 3px; background: var(--violet-100); cursor: pointer; }
.ctl input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--violet-600); border: 3px solid #fff; box-shadow: var(--sh-sm); cursor: pointer; }
.ctl input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--violet-600); border: 3px solid #fff; box-shadow: var(--sh-sm); cursor: pointer; }
.ctl .range-val { min-width: 62px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13.5px; font-weight: 600; color: var(--violet-600); }
.ctl .check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.ctl .check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--violet-600); flex: none; }
.ctl .check span { font-size: 14px; color: var(--ink-soft); }
.ctl .colour-row { display: flex; align-items: center; gap: 10px; }
.ctl input[type=color] { width: 42px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; }
.ctl .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 22px; }
.ctl .progress { margin-top: 20px; }
.ctl .progress[hidden] { display: none; }
.ctl .progress-bar { height: 6px; border-radius: 3px; background: var(--violet-100); overflow: hidden; }
.ctl .progress-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--violet-600), var(--magenta)); border-radius: 3px; transition: width .25s ease; }
.ctl .progress-bar.is-indeterminate i { width: 40% !important; animation: slide 1.15s ease-in-out infinite; }
@keyframes slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.ctl .progress-label { font-size: 13.5px; color: var(--muted); margin-top: 9px; text-align: center; }
.ctl .results { display: grid; gap: 14px; }
.ctl .result-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.ctl .result-head .tile { background: var(--ok-bg); color: var(--ok); }
.ctl .result-head h3 { font-size: 17px; }
.ctl .result-head .stat { font-size: 13.5px; color: var(--ok); font-weight: 600; }
.ctl .result-head .spacer { flex: 1; }
.ctl .result-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.ctl .result-item img { width: 44px; height: 44px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--line-soft); flex: none; }
.ctl .result-item .fileitem-meta { flex: 1; min-width: 0; }
.ctl .result-scroll { max-height: 420px; overflow-y: auto; display: grid; gap: 8px; padding-right: 4px; }
.ctl .savings { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 700; background: var(--ok-bg); color: var(--ok); }
.ctl .savings.neutral { background: var(--line-soft); color: var(--muted); }
.ctl .tool-error { display: flex; gap: 12px; padding: 15px 18px; border-radius: var(--r-md); background: var(--bad-bg); border: 1px solid #F7CDCE; color: #92202A; font-size: 14.5px; margin-top: 18px; align-items: flex-start; }
.ctl .tool-error[hidden] { display: none; }
.ctl .tool-error .icon { flex: none; margin-top: 2px; }
.ctl .tool-warn { display: flex; gap: 12px; padding: 13px 16px; border-radius: var(--r-md); background: var(--warn-bg); border: 1px solid #F6DDB2; color: #7A4C08; font-size: 13.5px; margin-top: 14px; align-items: flex-start; }
.ctl .pagegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(122px, 1fr)); gap: 14px; margin-top: 18px; max-height: 560px; overflow-y: auto; padding: 4px; }
.ctl .pagethumb { border: 2px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 8px; cursor: pointer; text-align: center; position: relative; transition: border-color .15s, box-shadow .15s, transform .15s; }
.ctl .pagethumb:hover { border-color: var(--violet-300); box-shadow: var(--sh-sm); }
.ctl .pagethumb.is-on { border-color: var(--violet-600); background: var(--violet-50); }
.ctl .pagethumb.is-off { opacity: .42; }
.ctl .pagethumb canvas,
.ctl .pagethumb img { width: 100%; height: auto; border: 1px solid var(--line-soft); border-radius: 4px; background: var(--surface); display: block; }
.ctl .pagethumb .n { font-size: 12px; color: var(--muted); margin-top: 7px; font-weight: 600; }
.ctl .pagethumb .badge { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--violet-600); color: #fff; display: none; place-items: center; }
.ctl .pagethumb.is-on .badge { display: grid; }
.ctl .pagethumb .badge .icon { width: 12px; height: 12px; }
.ctl .pagethumb .mini { position: absolute; bottom: 30px; right: 6px; display: flex; gap: 3px; opacity: 0; transition: opacity .15s; }
.ctl .pagethumb:hover .mini { opacity: 1; }
.ctl .pagethumb .mini button { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line); background: rgba(255,255,255,.95); color: var(--ink-soft); cursor: pointer; display: grid; place-items: center; }
.ctl .pagethumb .mini button:hover { background: var(--violet-600); color: #fff; border-color: var(--violet-600); }
.ctl .pagethumb .mini .icon { width: 13px; height: 13px; }
.ctl .pagethumb.is-dragging { opacity: .4; }
.ctl .pagethumb.drop-before { box-shadow: -3px 0 0 var(--violet-600); }
.ctl .pagethumb.drop-after { box-shadow: 3px 0 0 var(--violet-600); }
.ctl .pagegrid-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.ctl .pagegrid-bar .count { font-size: 13.5px; color: var(--muted); margin-left: auto; }
.ctl .stage { position: relative; background: #F4F2FB; border-radius: var(--r-md); border: 1px solid var(--line); overflow: auto; max-height: 640px; display: grid; place-items: center; padding: 20px; }
.ctl .stage-inner { position: relative; line-height: 0; box-shadow: var(--sh-md); }
.ctl .stage-inner canvas { display: block; max-width: 100%; }
.ctl .overlay { position: absolute; inset: 0; cursor: crosshair; }
.ctl .crop-box { position: absolute; border: 2px solid var(--violet-600); box-shadow: 0 0 0 9999px rgba(23,20,43,.42); cursor: move; }
.ctl .crop-box .h { position: absolute; width: 12px; height: 12px; background: var(--surface); border: 2px solid var(--violet-600); border-radius: 3px; }
.ctl .crop-box .nw { left: -7px; top: -7px; cursor: nwse-resize; }
.ctl .crop-box .ne { right: -7px; top: -7px; cursor: nesw-resize; }
.ctl .crop-box .sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.ctl .crop-box .se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.ctl .mask-box { position: absolute; border: 1.5px solid var(--violet-600); background: rgba(108,62,244,.16); cursor: move; }
.ctl .mask-box .del { position: absolute; top: -11px; right: -11px; width: 22px; height: 22px; border-radius: 50%; background: var(--bad); color: #fff; border: 2px solid #fff; cursor: pointer; display: grid; place-items: center; padding: 0; }
.ctl .mask-box .del .icon { width: 11px; height: 11px; }
.ctl .pdfe-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--line-soft); margin-bottom: 4px; }
.ctl .pdfe-toolbar[hidden] { display: none; }
.ctl .pdfe-toolbar input[type=color] { width: 36px; height: 32px; }
.ctl .pdfe-toggle { width: 34px; height: 32px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink-soft); cursor: pointer; font-size: 15px; display: grid; place-items: center; padding: 0; transition: all .15s; }
.ctl .pdfe-toggle:hover { border-color: var(--violet-300); color: var(--violet-600); }
.ctl .pdfe-toggle.is-on { background: var(--violet-600); border-color: var(--violet-600); color: #fff; }
.ctl .pdfe-swatch { width: 22px; height: 22px; border-radius: 5px; border: 1px solid rgba(0,0,0,.14); cursor: pointer; padding: 0; }
.ctl .pdfe-swatch:hover { transform: scale(1.12); }
.ctl .pdfe-run { position: absolute; cursor: text; border-radius: 2px; outline: 1px dashed transparent; transition: background .12s, outline-color .12s; }
.ctl .overlay.shows-runs .pdfe-run:hover { background: rgba(108, 62, 244, .14); outline-color: var(--violet-500); }
.ctl .pdfe-text { position: absolute; white-space: pre; cursor: text; transform-origin: left top; pointer-events: auto; }
.ctl .pdfe-field { position: absolute; z-index: 3; margin: 0; padding: 0 3px; border: 1px solid var(--ok); border-radius: 3px; background: rgba(35, 147, 91, .08); color: var(--ink); font-family: inherit; outline: none; }
.ctl .pdfe-field:hover,
.ctl .pdfe-field:focus { background: rgba(35, 147, 91, .16); box-shadow: 0 0 0 2px rgba(35, 147, 91, .28); }
.ctl .pdfe-check { display: grid; place-items: center; cursor: pointer; color: var(--ok); padding: 0; }
.ctl .pdfe-editor { position: absolute; z-index: 5; margin: 0; padding: 0 1px; border: 0; outline: 2px solid var(--violet-600); outline-offset: 1px; border-radius: 2px; background: rgba(255, 255, 255, .82); white-space: pre; overflow: hidden; resize: none; box-shadow: 0 2px 10px rgba(23, 20, 43, .18); }
.ctl .pdfe-editor:focus { outline-color: var(--violet-600); }
.ctl .txt-area { width: 100%; min-height: 260px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); font-family: var(--mono); font-size: 13.5px; line-height: 1.65; resize: vertical; background: var(--surface); }
.ctl .txt-area:focus { outline: none; border-color: var(--violet-300); box-shadow: 0 0 0 3px rgba(108,62,244,.10); }
.ctl .txt-area.mono-out { background: #FBFAFF; }
.ctl .statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 12px; }
.ctl .stat-tile { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); text-align: center; }
.ctl .stat-tile b { display: block; font-size: 24px; font-weight: 700; color: var(--violet-600); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.ctl .stat-tile span { font-size: 12px; color: var(--muted); }
.ctl .swatch-row { display: flex; flex-wrap: wrap; gap: 10px; }
.ctl .swatch { width: 92px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); cursor: pointer; padding: 0; text-align: center; }
.ctl .swatch i { display: block; height: 52px; }
.ctl .swatch code { display: block; font-size: 11px; padding: 7px 4px; color: var(--muted); font-family: var(--mono); }
.ctl .swatch:hover { border-color: var(--violet-300); }
.ctl .side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.ctl .side-card h3 { font-size: 14.5px; margin-bottom: 12px; }
.ctl .side-card .privacy-icon { color: var(--ok); }
.ctl .side-card p { font-size: 13.5px; color: var(--muted); line-height: 1.62; }
.ctl .side-list { display: grid; gap: 2px; margin-top: 4px; }
.ctl .side-list a { display: flex; align-items: center; gap: 10px; padding: 8px 9px; margin: 0 -9px; border-radius: var(--r-sm); color: var(--ink-soft); text-decoration: none; font-size: 13.5px; }
.ctl .side-list a:hover { background: var(--violet-50); color: var(--violet-700); text-decoration: none; }
.ctl .side-list .tile { width: 30px; height: 30px; border-radius: 8px; }
.ctl .side-list .icon { width: 16px; height: 16px; }
.ctl .howto-steps { display: grid; gap: 14px; counter-reset: step; }
.ctl .howto-step { display: flex; gap: 14px; align-items: flex-start; }
.ctl .howto-step::before { counter-increment: step; content: counter(step); width: 27px; height: 27px; border-radius: 50%; flex: none; background: var(--violet-100); color: var(--violet-600); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.ctl .howto-step p { font-size: 14.5px; color: var(--ink-soft); line-height: 1.6; }
.ctl .toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; pointer-events: none; }
.ctl .toast { background: var(--ink); color: #fff; padding: 11px 18px; border-radius: var(--r-pill); font-size: 14px; box-shadow: var(--sh-lg); animation: ctl-pop .22s ease; display: flex; align-items: center; gap: 9px; }
.ctl .toast .icon-sm { color: #7DE0AE; }
@keyframes ctl-pop { from { opacity: 0; transform: translateY(10px); } }
@media (max-width: 1080px) {
.ctl .tool-layout { grid-template-columns: 1fr; gap: 32px; }
.ctl .tool-side { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 900px) {
.ctl .features { grid-template-columns: repeat(2, 1fr); gap: 26px 0; padding: 30px 8px; }
.ctl .feature:nth-child(odd)::before { display: none; }
.ctl .feature:nth-child(n+3) { padding-top: 26px; border-top: 1px solid var(--violet-200); }
}
@media (max-width: 640px) {
.ctl .wrap { padding-inline: 18px; }
.ctl .tool-grid,
.ctl .tool-grid-wide,
.ctl .cat-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ctl .tool-card { padding: 16px 14px; gap: 9px; }
.ctl .tool-card-name { font-size: 14.5px; }
.ctl .tool-card-blurb { font-size: 12.5px; }
.ctl .tile { width: 40px; height: 40px; }
.ctl .panel-pad { padding: 18px; }
.ctl .dropzone { padding: 32px 16px; }
.ctl .pagegrid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.ctl .tabs { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.ctl .tabs::-webkit-scrollbar { display: none; }
.ctl .tab { white-space: nowrap; }
}
@media (max-width: 420px) {
.ctl .features { grid-template-columns: 1fr; }
.ctl .feature::before { display: none !important; }
.ctl .feature:nth-child(n+2) { padding-top: 24px; border-top: 1px solid var(--violet-200); }
}
@media print {
.ctl .tool-side,
.ctl .actions,
.ctl .dropzone { display: none !important; }
}

.ctl [hidden] { display: none !important; }

/* ---------------------------------------------------------------------------
   Network tools (assets/tools/js/core/net.js)
   --------------------------------------------------------------------------- */
.ctl .net-form { display: flex; gap: 10px; flex-wrap: wrap; }
.ctl .net-form .net-input { flex: 1 1 260px; font-family: var(--mono); font-size: 15px; padding: 13px 15px; }
.ctl .net-form .select { flex: 0 0 auto; width: auto; }
.ctl .net-form .btn { flex: 0 0 auto; }
.ctl .net-examples { margin-top: 10px; font-size: 13px; color: var(--muted); }
.ctl .net-examples button { border: 0; background: none; padding: 0; font: inherit; font-family: var(--mono); color: var(--violet-600); cursor: pointer; }
.ctl .net-examples button:hover { text-decoration: underline; }
.ctl .net-out { margin-top: 22px; display: grid; gap: 18px; }
.ctl .net-out:empty { display: none; }
.ctl .net-busy { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.ctl .net-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--violet-100); border-top-color: var(--violet-600); animation: net-spin .8s linear infinite; }
@keyframes net-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ctl .net-spin { animation-duration: 2.4s; } }

.ctl .net-hero { padding: 20px 22px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--wash); }
.ctl .net-hero.is-ok   { background: var(--ok-bg);   border-color: transparent; }
.ctl .net-hero.is-warn { background: var(--warn-bg); border-color: transparent; }
.ctl .net-hero.is-bad  { background: var(--bad-bg);  border-color: transparent; }
.ctl .net-hero-big { font-family: var(--mono); font-size: clamp(20px, 3.4vw, 30px); font-weight: 700; color: var(--ink); letter-spacing: -.01em; word-break: break-all; }
.ctl .net-hero.is-ok .net-hero-big { color: var(--ok); }
.ctl .net-hero.is-warn .net-hero-big { color: var(--warn); }
.ctl .net-hero.is-bad .net-hero-big { color: var(--bad); }
.ctl .net-hero-sub { margin-top: 6px; font-size: 14px; color: var(--ink-soft); }

.ctl .net-sec { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 16px 18px; }
.ctl .net-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.ctl .net-sec-head h3 { font-size: 15px; font-weight: 700; color: var(--ink); margin: 0; }
.ctl .net-kv { display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.ctl .net-kv dt { color: var(--muted); }
.ctl .net-kv dd { margin: 0; color: var(--ink); display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; min-width: 0; word-break: break-word; }
.ctl .net-kv dd > div { flex-basis: 100%; }
.ctl .net-kv dd.is-mono { font-family: var(--mono); font-size: 13.5px; }
@media (max-width: 560px) { .ctl .net-kv { grid-template-columns: 1fr; gap: 2px; } .ctl .net-kv dd { margin-bottom: 8px; } }
.ctl .net-copy { border: 0; background: none; padding: 2px; color: var(--muted); cursor: pointer; border-radius: 6px; line-height: 0; }
.ctl .net-copy:hover { color: var(--violet-600); background: var(--violet-50); }

.ctl .net-badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; background: var(--line-soft); color: var(--ink-soft); white-space: nowrap; }
.ctl .net-badge.is-ok   { background: var(--ok-bg);   color: var(--ok); }
.ctl .net-badge.is-warn { background: var(--warn-bg); color: var(--warn); }
.ctl .net-badge.is-bad  { background: var(--bad-bg);  color: var(--bad); }

.ctl .net-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ctl .net-checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink); padding: 9px 12px; border-radius: var(--r-sm); background: var(--wash); }
.ctl .net-checks-ico { flex: 0 0 auto; line-height: 0; margin-top: 1px; }
.ctl .net-checks li.is-ok   .net-checks-ico { color: var(--ok); }
.ctl .net-checks li.is-warn .net-checks-ico { color: var(--warn); }
.ctl .net-checks li.is-bad  .net-checks-ico { color: var(--bad); }
.ctl .net-checks li.is-info .net-checks-ico { color: var(--muted); }
.ctl .net-checks li.is-bad  { background: var(--bad-bg); }
.ctl .net-checks li.is-warn { background: var(--warn-bg); }

.ctl .net-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ctl .net-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.ctl .net-table td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; color: var(--ink); }
.ctl .net-table td.mono { font-family: var(--mono); word-break: break-all; }
.ctl .net-table td.num { text-align: right; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.ctl .net-table tr:last-child td { border-bottom: 0; }
.ctl .net-grade { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; font-size: 34px; font-weight: 800; flex: 0 0 auto; }
.ctl .net-grade.is-ok { background: var(--ok-bg); color: var(--ok); }
.ctl .net-grade.is-warn { background: var(--warn-bg); color: var(--warn); }
.ctl .net-grade.is-bad { background: var(--bad-bg); color: var(--bad); }
.ctl .net-raw { max-height: 360px; overflow: auto; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-word; background: var(--wash); border-radius: var(--r-sm); padding: 12px; margin: 10px 0 0; color: var(--ink-soft); }
.ctl .net-sec details summary { cursor: pointer; font-size: 13.5px; color: var(--violet-600); font-weight: 600; }
.ctl .net-cta { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 16px 18px; border-radius: var(--r-md); background: var(--violet-50); color: var(--ink); font-size: 14px; }
.ctl .net-cta p { margin: 0; flex: 1 1 280px; }
