/* Ferramentas client-side (tools-extra.js) — complementa tools.css */
.cwx .cw-btn--ghost { display: inline-flex; }
.cwx .cw-field-row.cwx-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.cwx .cwx-row--2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important; }
.cwx textarea { min-height: 7rem; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; line-height: 1.45; }
.cwx textarea.cwx-prose { font-family: inherit; font-size: .95rem; }
.cwx .cwx-help { font-size: .76rem; color: var(--cw-muted); font-weight: 600; margin: -.15rem 0 0; }
.cwx-checks { display: flex; flex-wrap: wrap; gap: .45rem .6rem; margin: 0 0 1rem; }
.cwx-check {
  display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
  font-weight: 700; font-size: .84rem; color: #334155;
  background: #fff; border: 1.5px solid var(--cw-line); border-radius: var(--cw-radius-sm);
  padding: .45rem .65rem; user-select: none;
}
.cwx-check:has(input:checked) { border-color: rgba(232,185,49,.75); background: #fffbeb; }
.cwx-check input { width: 1rem; height: 1rem; accent-color: #2A4578; margin: 0; }
.cwx-tabs { display: inline-flex; flex-wrap: wrap; gap: 0; margin: 0 0 1.1rem; border: 1.5px solid var(--cw-line-strong); border-radius: var(--cw-radius-sm); overflow: hidden; }
.cwx-tabs button {
  border: 0; background: #fff; font: inherit; font-weight: 800; font-size: .84rem; color: #334155;
  padding: .6rem 1rem; cursor: pointer; border-right: 1.5px solid var(--cw-line);
}
.cwx-tabs button:last-child { border-right: 0; }
.cwx-tabs button.is-on { background: var(--cw-navy); color: #fff; }
.cwx-range { display: flex; align-items: center; gap: .7rem; }
.cwx-range input[type=range] { flex: 1; accent-color: #2A4578; padding: 0; border: 0; }
.cwx-range output { min-width: 2.6rem; text-align: right; font-weight: 800; color: var(--cw-navy); }
.cwx-list { display: grid; gap: .4rem; }
.cwx-item {
  display: flex; align-items: center; gap: .6rem; justify-content: space-between;
  background: #0F1B3D; color: #e2e8f0; border-radius: var(--cw-radius-sm); padding: .6rem .8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; word-break: break-all;
}
.cwx-item button, .cwx-mini {
  flex: none; border: 1px solid rgba(232,185,49,.45); background: rgba(255,255,255,.08); color: #fff;
  font: inherit; font-weight: 800; font-size: .74rem; padding: .3rem .6rem; cursor: pointer; border-radius: 6px;
  font-family: 'Jura', system-ui, sans-serif;
}
.cwx-kv { display: grid; gap: .4rem; }
.cwx-kv__row {
  display: grid; grid-template-columns: minmax(110px, 180px) 1fr auto; gap: .6rem; align-items: center;
  background: #fff; border: 1.5px solid var(--cw-line); border-radius: var(--cw-radius-sm); padding: .55rem .75rem;
}
.cwx-kv__row small { font-weight: 800; color: var(--cw-muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
.cwx-kv__row code { font-size: .88rem; color: var(--cw-navy); font-weight: 700; word-break: break-all; background: none; }
.cwx-kv__row .cwx-mini { background: var(--cw-navy); border-color: var(--cw-navy); }
@media (max-width: 560px) { .cwx-kv__row { grid-template-columns: 1fr auto; } .cwx-kv__row small { grid-column: 1 / -1; } }
.cwx-meter { height: 10px; border-radius: 99px; background: #e2e8f0; overflow: hidden; }
.cwx-meter > i { display: block; height: 100%; border-radius: 99px; transition: width .35s ease, background .35s ease; }
.cwx-badge { display: inline-block; font-size: .7rem; font-weight: 800; padding: .18rem .5rem; border-radius: 99px; letter-spacing: .03em; vertical-align: middle; }
.cwx-badge--ok { background: #D1FAE5; color: #065F46; }
.cwx-badge--bad { background: #FEE2E2; color: #991B1B; }
.cwx-badge--warn { background: #FEF3C7; color: #92400E; }
.cwx-badge--info { background: #E0E7FF; color: #1E3A8A; }
.cwx-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.cwx-table th, .cwx-table td { padding: .55rem .65rem; text-align: left; border-bottom: 1px solid var(--cw-line); vertical-align: top; }
.cwx-table th { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--cw-muted); background: #f8fafc; }
.cwx-table td { font-weight: 600; color: var(--cw-navy); word-break: break-word; }
.cwx-table td code { font-size: .84rem; }
.cwx-diff { background: #0F1B3D; color: #e2e8f0; border-radius: var(--cw-radius-sm); overflow: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; line-height: 1.5; max-height: 32rem; }
.cwx-diff div { padding: 0 .8rem; white-space: pre-wrap; word-break: break-word; }
.cwx-diff .d-add { background: rgba(16,185,129,.22); }
.cwx-diff .d-del { background: rgba(239,68,68,.22); }
.cwx-diff .d-eq { opacity: .72; }
.cwx-diff ins { background: rgba(16,185,129,.55); text-decoration: none; border-radius: 2px; }
.cwx-diff del { background: rgba(239,68,68,.55); text-decoration: none; border-radius: 2px; }
.cwx-diff .d-ln { display: inline-block; min-width: 2.2rem; color: #94a3b8; user-select: none; }
.cwx-hl { background: #fff; border: 1.5px solid var(--cw-line-strong); border-radius: var(--cw-radius-sm); padding: .8rem .9rem; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; line-height: 1.6; max-height: 22rem; overflow: auto; }
.cwx-hl mark { background: #FDE68A; color: #0B1220; border-radius: 3px; padding: 0 1px; box-shadow: 0 0 0 1px #E8B931; }
.cwx-hl mark:nth-of-type(even) { background: #BFDBFE; box-shadow: 0 0 0 1px #60A5FA; }
.cwx-swatch { height: 5.5rem; border-radius: var(--cw-radius); border: 1.5px solid var(--cw-line-strong); display: flex; align-items: flex-end; justify-content: space-between; padding: .6rem .8rem; font-weight: 800; }
.cwx-palette { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: .35rem; }
.cwx-palette button { height: 3rem; border: 1px solid var(--cw-line); border-radius: 6px; cursor: pointer; font: inherit; font-size: .68rem; font-weight: 800; }
.cwx-qr { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; }
.cwx-qr canvas, .cwx-qr img { background: #fff; border: 1.5px solid var(--cw-line-strong); border-radius: var(--cw-radius-sm); max-width: 100%; height: auto; image-rendering: pixelated; }
.cwx-totp { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.cwx-totp__code { font-size: clamp(2rem, 7vw, 2.8rem); font-weight: 800; letter-spacing: .12em; font-variant-numeric: tabular-nums; color: #fff; }
.cwx-ring { --p: 100; width: 54px; height: 54px; border-radius: 50%; background: conic-gradient(#E8B931 calc(var(--p) * 1%), rgba(255,255,255,.18) 0); display: grid; place-items: center; }
.cwx-ring span { width: 42px; height: 42px; border-radius: 50%; background: #1e3a5f; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: .9rem; }
.cwx-cheat { display: grid; gap: 1rem; }
.cwx-cheat section { background: #fff; border: 1.5px solid var(--cw-line); border-radius: var(--cw-radius); padding: .9rem 1rem; }
.cwx-cheat h3 { margin: 0 0 .6rem; font-size: 1rem; color: var(--cw-navy); }
.cwx-cheat__row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: .3rem .8rem; padding: .45rem 0; border-top: 1px dashed var(--cw-line); align-items: start; }
.cwx-cheat__row:first-of-type { border-top: 0; }
.cwx-cheat__row code { background: #0F1B3D; color: #e2e8f0; padding: .3rem .5rem; border-radius: 6px; font-size: .8rem; word-break: break-word; cursor: copy; display: block; }
.cwx-cheat__row span { font-size: .84rem; color: #334155; font-weight: 600; line-height: 1.45; }
@media (max-width: 640px) { .cwx-cheat__row { grid-template-columns: 1fr; } }
.cwx-http { display: grid; gap: .55rem; }
.cwx-http details { background: #fff; border: 1.5px solid var(--cw-line); border-left: 5px solid #2A4578; border-radius: var(--cw-radius-sm); padding: .65rem .85rem; }
.cwx-http details[data-c="2"] { border-left-color: #059669; }
.cwx-http details[data-c="3"] { border-left-color: #2563eb; }
.cwx-http details[data-c="4"] { border-left-color: #d97706; }
.cwx-http details[data-c="5"] { border-left-color: #dc2626; }
.cwx-http summary { cursor: pointer; font-weight: 800; color: var(--cw-navy); list-style: none; display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.cwx-http summary b { font-size: 1.1rem; min-width: 2.6rem; }
.cwx-http summary small { color: var(--cw-muted); font-weight: 600; width: 100%; }
.cwx-http details p { margin: .55rem 0 0; font-size: .88rem; line-height: 1.55; color: #334155; }
.cwx-preview { background: #fff; border: 1.5px solid var(--cw-line-strong); border-radius: var(--cw-radius-sm); padding: 1rem 1.15rem; max-height: 28rem; overflow: auto; line-height: 1.6; }
.cwx-preview img { max-width: 100%; }
.cwx-preview pre { background: #0F1B3D; color: #e2e8f0; padding: .7rem; border-radius: 6px; overflow: auto; }
.cwx-preview table { border-collapse: collapse; }
.cwx-preview td, .cwx-preview th { border: 1px solid var(--cw-line-strong); padding: .3rem .5rem; }
.cwx-chmod { width: 100%; border-collapse: collapse; text-align: center; font-weight: 700; }
.cwx-chmod th, .cwx-chmod td { padding: .55rem; border-bottom: 1px solid var(--cw-line); }
.cwx-chmod th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--cw-muted); }
.cwx-chmod td:first-child { text-align: left; color: var(--cw-navy); }
.cwx-chmod input { width: 1.2rem; height: 1.2rem; accent-color: #2A4578; }
.cwx-warn { background: #fffbeb; border: 1.5px solid #fcd34d; border-radius: var(--cw-radius-sm); padding: .75rem .9rem; font-size: .88rem; color: #78350f; font-weight: 600; line-height: 1.5; }
.cwx-warn ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.cwx-sr { position: absolute; left: -9999px; }
