/* ==========================================================================
   Devsly Developer Workbench Layer (tool-workbench.css)
   Unified Linear / Vercel-grade design system across all 80 Devsly tools.
   - Brand hue locked to #0066cc (210 deg); actions-only accent budget.
   - Full Light + Dark WCAG 2.2 AA contrast (>= 4.5:1 text, >= 3:1 UI).
   - 0px horizontal overflow from 360px mobile to 2560px desktop.
   - Scoped to `body .twb-container` so homepage, community, admin and
     custom full-bleed tools (/convert, /network/webhook-tester) stay untouched.
   ========================================================================== */

:root {
    --twb-canvas: #f5f7fa;
    --twb-surface: #ffffff;
    --twb-subtle: #f1f5f9;
    --twb-hover: #f8fafc;
    --twb-ink: #0f172a;
    --twb-ink-2: #334155;
    --twb-muted: #526071;
    --twb-line: rgba(15, 23, 42, 0.10);
    --twb-line-2: rgba(15, 23, 42, 0.18);
    --twb-accent: #0066cc;
    --twb-accent-hover: #0052a3;
    --twb-accent-soft: #eff6ff;
    --twb-accent-border: #bfdbfe;
    --twb-btn-bg: #0066cc;
    --twb-btn-hover: #0052a3;
    --twb-btn-fg: #ffffff;
    --twb-ok: #047857;
    --twb-ok-bg: rgba(4, 120, 87, 0.09);
    --twb-ok-border: rgba(4, 120, 87, 0.28);
    --twb-warn: #92400e;
    --twb-warn-bg: rgba(180, 83, 9, 0.09);
    --twb-warn-border: rgba(180, 83, 9, 0.28);
    --twb-danger: #b91c1c;
    --twb-danger-bg: rgba(185, 28, 28, 0.09);
    --twb-danger-border: rgba(185, 28, 28, 0.28);
    --twb-code-bg: #0f172a;
    --twb-code-fg: #e2e8f0;
    --twb-r-ctrl: 8px;
    --twb-r-card: 12px;
    --twb-r-panel: 16px;
    --twb-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --twb-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --twb-shadow-pop: 0 14px 36px -6px rgba(15, 23, 42, 0.18), 0 4px 12px -2px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] {
    --twb-canvas: #0b1120;
    --twb-surface: #111827;
    --twb-subtle: #172033;
    --twb-hover: #1e293b;
    --twb-ink: #f8fafc;
    --twb-ink-2: #cbd5e1;
    --twb-muted: #94a3b8;
    --twb-line: rgba(148, 163, 184, 0.15);
    --twb-line-2: rgba(148, 163, 184, 0.26);
    --twb-accent: #60a5fa;
    --twb-accent-hover: #93c5fd;
    --twb-accent-soft: rgba(37, 99, 235, 0.18);
    --twb-accent-border: rgba(96, 165, 250, 0.36);
    --twb-btn-bg: #2563eb;
    --twb-btn-hover: #1d4ed8;
    --twb-btn-fg: #ffffff;
    --twb-ok: #34d399;
    --twb-ok-bg: rgba(52, 211, 153, 0.14);
    --twb-ok-border: rgba(52, 211, 153, 0.34);
    --twb-warn: #fbbf24;
    --twb-warn-bg: rgba(251, 191, 36, 0.14);
    --twb-warn-border: rgba(251, 191, 36, 0.34);
    --twb-danger: #f87171;
    --twb-danger-bg: rgba(248, 113, 113, 0.14);
    --twb-danger-border: rgba(248, 113, 113, 0.34);
    --twb-code-bg: #090f1d;
    --twb-code-fg: #e2e8f0;
    --twb-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.32);
    --twb-shadow-pop: 0 20px 44px -8px rgba(0, 0, 0, 0.62), 0 4px 12px -2px rgba(0, 0, 0, 0.38);
}

/* ---------- Page Canvas & Container Alignment ---------- */
body:has(.twb-container) {
    background-color: var(--twb-canvas);
    color: var(--twb-ink);
}

body:has(.twb-container) .site-content {
    padding-top: 8px;
    padding-bottom: 40px;
}

body .twb-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

@media (max-width: 640px) {
    body .twb-container {
        padding: 0 12px;
    }

    body .twb-container .twb-head-actions {
        width: 100%;
        gap: 6px;
    }

    body .twb-container .twb-act-btn {
        min-height: 34px;
        padding: 0 10px;
        font-size: 12px;
    }

    body .twb-container .twb-act-btn kbd {
        display: none;
    }
}

/* Quiet top LinkedIn bar on tool pages so workbench sits higher above the fold */
body:has(.twb-container) .li-invite-bar {
    background: var(--twb-surface);
    border-bottom: 1px solid var(--twb-line);
    animation: none;
}

body:has(.twb-container) .li-invite-inner {
    max-width: 1200px;
    padding: 5px 20px;
    font-size: 12.5px;
    color: var(--twb-ink-2);
}

body:has(.twb-container) .li-invite-btn {
    color: var(--twb-accent);
    border-color: var(--twb-accent-border);
    padding: 2px 10px;
}

/* ---------- Breadcrumb & Capability Strip ---------- */
body .twb-container > .breadcrumb {
    margin: 6px 0 8px;
    padding: 0;
    font-size: 12.5px;
    color: var(--twb-muted);
    gap: 8px 12px;
}

body .twb-container > .breadcrumb a {
    color: var(--twb-ink-2);
    font-weight: 500;
}

body .twb-container > .breadcrumb a:hover {
    color: var(--twb-accent);
}

body .twb-container > .breadcrumb li[aria-current="page"] {
    color: var(--twb-ink);
    font-weight: 600;
}

body .twb-container > .breadcrumb .bc-tag {
    height: 24px;
    padding: 0 9px;
    font-size: 12px;
    font-family: var(--font-mono);
}

body .twb-container > .breadcrumb .bc-tag-mcp {
    color: var(--twb-accent);
    background: var(--twb-accent-soft);
    border-color: var(--twb-accent-border);
}

body .twb-container > .breadcrumb .bc-tag-api {
    color: var(--twb-ok);
    background: var(--twb-ok-bg);
    border-color: var(--twb-ok-border);
}

/* ---------- Flat Linear-Grade Workbench Header (replaces 150px gradient box) ---------- */
body .twb-container > .tool-header.twb-header {
    background: var(--twb-surface);
    color: var(--twb-ink);
    border: 1px solid var(--twb-line);
    border-radius: var(--twb-r-card);
    padding: 14px 18px 12px;
    margin: 0 0 14px;
    display: flex;
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    text-align: left !important;
}

.twb-head-top {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between !important;
    gap: 12px 16px;
    flex-wrap: wrap;
}

.twb-head-id {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    flex: 1 1 380px;
}

.twb-head-ico {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: var(--twb-r-card);
    background: var(--twb-accent-soft);
    border: 1px solid var(--twb-accent-border);
    color: var(--twb-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-top: 2px;
}

.twb-head-copy {
    min-width: 0;
    flex: 1;
}

body .twb-container > .tool-header.twb-header h1 {
    color: var(--twb-ink);
    font-size: 21px;
    line-height: 26px;
    font-weight: 700;
    justify-content: flex-start !important;
    text-align: left !important;
    letter-spacing: -0.02em;
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

body .twb-container > .tool-header.twb-header .badge.badge-accent {
    background: var(--twb-subtle);
    color: var(--twb-ink-2);
    border: 1px solid var(--twb-line);
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
}

.twb-trust-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
    white-space: nowrap;
}

.twb-trust-local {
    background: var(--twb-ok-bg);
    color: var(--twb-ok);
    border: 1px solid var(--twb-ok-border);
}

.twb-trust-server {
    background: var(--twb-subtle);
    color: var(--twb-ink-2);
    border: 1px solid var(--twb-line-2);
}

body .twb-container > .tool-header.twb-header p.twb-head-desc {
    color: var(--twb-ink-2);
    font-size: 13.5px;
    line-height: 20px;
    margin: 4px 0 0;
    max-width: 78ch;
}

.twb-head-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.twb-act-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 11px;
    border-radius: var(--twb-r-ctrl);
    border: 1px solid var(--twb-line-2);
    background: var(--twb-surface);
    color: var(--twb-ink-2);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: border-color 140ms var(--twb-ease), color 140ms var(--twb-ease),
                background-color 140ms var(--twb-ease), transform 140ms var(--twb-ease);
}

.twb-act-btn:hover {
    border-color: var(--twb-accent);
    color: var(--twb-accent);
    background: var(--twb-accent-soft);
}

.twb-act-btn:active {
    transform: scale(0.97);
}

.twb-act-btn:focus-visible {
    outline: 2px solid var(--twb-accent);
    outline-offset: 2px;
}

.twb-sample-btn {
    border-color: var(--twb-accent-border);
    background: var(--twb-accent-soft);
    color: var(--twb-accent);
}

.twb-sample-btn:hover {
    background: var(--twb-btn-bg);
    border-color: var(--twb-btn-bg);
    color: #ffffff;
}

.twb-sample-btn:hover kbd {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.32);
    color: #ffffff;
}

.twb-header {
    animation: twbEnter 180ms var(--twb-ease);
}

@keyframes twbEnter {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Quick Switcher Modal (Pinned + Recent Tools, Alt+R) ---------- */
.twb-sw-dialog {
    width: min(500px, 100%);
    background: var(--twb-surface);
    color: var(--twb-ink);
    border: 1px solid var(--twb-line-2);
    border-radius: var(--twb-r-panel);
    box-shadow: var(--twb-shadow-pop);
    overflow: hidden;
    animation: twbSlideIn 160ms var(--twb-ease);
}

.twb-sw-body {
    padding: 12px 16px 16px;
    max-height: min(68vh, 460px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.twb-sw-sec-title {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--twb-muted);
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.twb-sw-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.twb-sw-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 11px;
    border-radius: var(--twb-r-ctrl);
    border: 1px solid transparent;
    background: var(--twb-hover);
    color: var(--twb-ink);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.twb-sw-item:hover,
.twb-sw-item:focus-visible {
    background: var(--twb-accent-soft);
    border-color: var(--twb-accent-border);
    color: var(--twb-accent);
    outline: none;
}

.twb-sw-item-left {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.twb-sw-item-left i {
    width: 16px;
    text-align: center;
    color: var(--twb-accent);
    flex: none;
}

.twb-sw-item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.twb-sw-item-meta {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--twb-muted);
    flex: none;
}

.twb-sw-empty {
    font-size: 12.5px;
    color: var(--twb-muted);
    padding: 8px 10px;
    border-radius: var(--twb-r-ctrl);
    background: var(--twb-subtle);
}

.twb-sw-foot {
    padding: 10px 16px;
    border-top: 1px solid var(--twb-line);
    background: var(--twb-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--twb-ink-2);
}

.twb-sw-foot a {
    color: var(--twb-accent);
    font-weight: 600;
    text-decoration: none;
}

.twb-sw-foot a:hover {
    text-decoration: underline;
}

.twb-act-btn kbd {
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 1px 5px;
    border-radius: var(--twb-r-ctrl);
    background: var(--twb-subtle);
    border: 1px solid var(--twb-line);
    color: var(--twb-ink-2);
}

.twb-fav-btn.is-pinned {
    background: var(--twb-warn-bg);
    border-color: var(--twb-warn-border);
    color: var(--twb-warn);
}

.twb-fav-btn.is-pop {
    animation: twbPop 240ms var(--twb-ease);
}

@keyframes twbPop {
    0% { transform: scale(1); }
    45% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

/* ---------- Workflow Sibling Quick-Switch Rail ---------- */
.twb-rail {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--twb-line);
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.twb-rail::-webkit-scrollbar {
    display: none;
}

.twb-rail-lbl {
    flex: none;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--twb-muted);
    margin-right: 4px;
}

.twb-rail-chip {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--twb-line);
    background: var(--twb-hover);
    color: var(--twb-ink-2);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 120ms ease, color 120ms ease, background-color 120ms ease;
}

.twb-rail-chip i {
    font-size: 12px;
    color: var(--twb-muted);
}

.twb-rail-chip:hover {
    border-color: var(--twb-accent-border);
    background: var(--twb-accent-soft);
    color: var(--twb-accent);
}

.twb-rail-chip:hover i {
    color: var(--twb-accent);
}

.twb-rail-chip.is-active {
    background: var(--twb-accent-soft);
    border-color: var(--twb-accent-border);
    color: var(--twb-accent);
    font-weight: 600;
}

.twb-mini-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 14px;
    margin: 6px 0 12px;
    padding: 8px 12px;
    background: var(--twb-surface);
    border: 1px solid var(--twb-line);
    border-radius: var(--twb-r-card);
}

.twb-mini-bar .twb-rail {
    padding-top: 0;
    border-top: 0;
    flex: 1 1 280px;
}

.twb-rail-chip.is-active i {
    color: var(--twb-accent);
}

/* ---------- Cross-Tool Pipeline Arrival Ribbon & Output Pipeline Bar ---------- */
.twb-arrived {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: var(--twb-r-ctrl);
    background: var(--twb-ok-bg);
    border: 1px solid var(--twb-ok-border);
    color: var(--twb-ink);
    font-size: 13px;
    animation: twbSlideIn 180ms var(--twb-ease);
}

.twb-arrived-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.twb-arrived-main i {
    color: var(--twb-ok);
    flex: none;
}

.twb-arrived-close {
    background: none;
    border: none;
    color: var(--twb-ink-2);
    cursor: pointer;
    min-width: 30px;
    min-height: 30px;
    border-radius: var(--twb-r-ctrl);
}

.twb-arrived-close:hover {
    background: var(--twb-line);
    color: var(--twb-ink);
}

.twb-pipe {
    margin: 14px 0 6px;
    padding: 12px 14px;
    border-radius: var(--twb-r-card);
    background: var(--twb-surface);
    border: 1px solid var(--twb-accent-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px 14px;
    flex-wrap: wrap;
    animation: twbSlideIn 180ms var(--twb-ease);
}

.twb-pipe[hidden] {
    display: none !important;
}

.twb-pipe-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.twb-pipe-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--twb-ink);
    font-variant-numeric: tabular-nums;
}

.twb-pipe-meta i {
    color: var(--twb-ok);
}

.twb-pipe-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: var(--twb-r-ctrl);
    border: 1px solid var(--twb-btn-bg);
    background: var(--twb-btn-bg);
    color: var(--twb-btn-fg);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease;
}

.twb-pipe-copy:hover {
    background: var(--twb-btn-hover);
    border-color: var(--twb-btn-hover);
}

.twb-pipe-copy.is-copied {
    background: var(--twb-ok);
    border-color: var(--twb-ok);
    color: #ffffff;
}

.twb-pipe-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.twb-pipe-lbl {
    font-size: 12px;
    font-weight: 600;
    color: var(--twb-muted);
    margin-right: 2px;
}

.twb-pipe-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 34px;
    padding: 0 11px;
    border-radius: var(--twb-r-ctrl);
    border: 1px solid var(--twb-line-2);
    background: var(--twb-hover);
    color: var(--twb-ink);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 120ms ease, color 120ms ease, background-color 120ms ease;
}

.twb-pipe-btn:hover {
    border-color: var(--twb-accent);
    background: var(--twb-accent-soft);
    color: var(--twb-accent);
}

.twb-pipe-btn i {
    font-size: 12px;
    color: var(--twb-accent);
}

@keyframes twbSlideIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Output update visual confirmation pulse */
.twb-flash {
    animation: twbFlash 380ms var(--twb-ease);
}

@keyframes twbFlash {
    0%   { box-shadow: 0 0 0 0 rgba(0, 102, 204, 0.34); }
    45%  { box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.22); }
    100% { box-shadow: 0 0 0 0 rgba(0, 102, 204, 0); }
}

/* Gliding active tab ink indicator */
.twb-ink-host {
    position: relative !important;
}

.twb-ink {
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    border-radius: var(--twb-r-ctrl);
    background: var(--twb-btn-bg);
    border: 1px solid var(--twb-btn-bg);
    pointer-events: none;
    z-index: 0;
    transition: transform 180ms var(--twb-ease), width 180ms var(--twb-ease), opacity 140ms ease;
}

.twb-ink-host > button {
    position: relative;
    z-index: 1;
}

body .twb-container .twb-ink-host.twb-ink-active > button.active {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--twb-btn-fg) !important;
    box-shadow: none !important;
}

/* ---------- Non-Blocking Accessible Toast Stack ---------- */
.twb-toast-wrap {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 2100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(360px, calc(100vw - 24px));
    pointer-events: none;
}

.twb-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: var(--twb-r-card);
    background: #0f172a;
    color: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: var(--twb-shadow-pop);
    font-size: 13px;
    line-height: 18px;
    font-weight: 500;
    animation: twbToastIn 180ms var(--twb-ease);
}

.twb-toast.is-out {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 150ms ease, transform 150ms ease;
}

.twb-toast-ico {
    flex: none;
    font-size: 14px;
}

.twb-toast-success .twb-toast-ico { color: #34d399; }
.twb-toast-error .twb-toast-ico   { color: #f87171; }
.twb-toast-warning .twb-toast-ico { color: #fbbf24; }
.twb-toast-info .twb-toast-ico    { color: #60a5fa; }

.twb-toast-msg {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.twb-toast-x {
    flex: none;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 13px;
}

.twb-toast-x:hover {
    color: #ffffff;
}

@keyframes twbToastIn {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Keyboard Shortcuts HUD Modal ---------- */
.twb-kbd-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2050;
    background: rgba(15, 23, 42, 0.58);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: twbFadeIn 150ms ease;
}

.twb-kbd-backdrop[hidden] {
    display: none !important;
}

.twb-kbd-dialog {
    width: min(460px, 100%);
    background: var(--twb-surface);
    color: var(--twb-ink);
    border: 1px solid var(--twb-line-2);
    border-radius: var(--twb-r-panel);
    box-shadow: var(--twb-shadow-pop);
    overflow: hidden;
    animation: twbSlideIn 160ms var(--twb-ease);
}

.twb-kbd-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--twb-line);
}

.twb-kbd-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--twb-ink);
}

.twb-kbd-close {
    width: 32px;
    height: 32px;
    border-radius: var(--twb-r-ctrl);
    border: 1px solid var(--twb-line);
    background: transparent;
    color: var(--twb-ink-2);
    cursor: pointer;
}

.twb-kbd-close:hover {
    background: var(--twb-subtle);
    color: var(--twb-ink);
}

.twb-kbd-list {
    padding: 10px 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.twb-kbd-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid var(--twb-line);
    font-size: 13px;
    color: var(--twb-ink-2);
}

.twb-kbd-row:last-child {
    border-bottom: none;
}

.twb-kbd-keys {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.twb-kbd-keys kbd {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: var(--twb-r-ctrl);
    background: var(--twb-subtle);
    border: 1px solid var(--twb-line-2);
    color: var(--twb-ink);
}

@keyframes twbFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ==========================================================================
   SCOPED LEGACY TOOL MODERNIZATION (body .twb-container ...)
   Normalizes all 69 templated tool pages into one crisp, WCAG 2.2 AA,
   0px-overflow Light + Dark Developer Workbench without altering tool JS IDs.
   ========================================================================== */

/* 1. Eliminate redundant 2nd hero banners & decorative particle blobs that pushed
      inputs 800-1423px below the fold and caused desktop/mobile overflow */
body .twb-container .hero-section,
body .twb-container .tool-hero,
body .twb-container .tool-hero-enhanced,
body .twb-container .validator-hero-ultimate,
body .twb-container .builder-header,
body .twb-container .pg-header,
body .twb-container .sp-header,
body .twb-container .http-headers-container > .page-header,
body .twb-container .hm-hero,
body .twb-container .ts-hero,
body .twb-container .cc-header,
body .twb-container .seo-intro,
body .twb-container .hero-bg-animation,
body .twb-container .hero-bg-animation .particle,
body .twb-container .hero-bg-animation .code-rain {
    display: none !important;
}

/* 2. Remove double nested container padding & outdated pastel page gradients */
body .twb-container .container {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}

body .twb-container .json-csv-page,
body .twb-container .json-xml-page,
body .twb-container .json-yaml-page,
body .twb-container .case-converter-page,
body .twb-container .timestamp-page,
body .twb-container .date-diff-page,
body .twb-container .date-formatter-page,
body .twb-container .json-diff-page,
body .twb-container .dockerfile-tool,
body .twb-container .database-tool,
body .twb-container .json-interface-page,
body .twb-container .interface-tool,
body .twb-container .ai-humanizer-tool,
body .twb-container .summarizer-tool,
body .twb-container .curl-converter-tool,
body .twb-container .formatter-tool,
body .twb-container .minifier-tool,
body .twb-container .color-converter-tool,
body .twb-container .ip-location-tool,
body .twb-container .dns-lookup-tool,
body .twb-container .whois-tool,
body .twb-container .port-scanner-tool,
body .twb-container .http-headers-tool,
body .twb-container .http-headers-container,
body .twb-container .websocket-tool,
body .twb-container .api-tester-tool,
body .twb-container .speed-test-tool,
body .twb-container .load-testing-tool,
body .twb-container .hash-tool,
body .twb-container .base64-tool,
body .twb-container .url-tool,
body .twb-container .hex-tool,
body .twb-container .html-escape-tool,
body .twb-container .html-tool,
body .twb-container .js-escape-tool,
body .twb-container .json-tool,
body .twb-container .html-editor-tool,
body .twb-container .html-to-text-tool,
body .twb-container .converter-tool,
body .twb-container .spam-analyzer-tool,
body .twb-container .meta-extractor-tool,
body .twb-container .sitemap-tool,
body .twb-container .sitemap-generator-tool,
body .twb-container .obfuscator-tool,
body .twb-container .jwt-tool,
body .twb-container .jwt-decoder-tool,
body .twb-container .linter-tool,
body .twb-container .js-linter-tool,
body .twb-container .console-tool,
body .twb-container .console-runner-tool,
body .twb-container .docker-compose-tool,
body .twb-container .docker-compose-builder,
body .twb-container .compose-builder,
body .twb-container .k8s-tool,
body .twb-container .regex-builder-tool,
body .twb-container .qr-tool,
body .twb-container .qr-generator-tool,
body .twb-container .uuid-tool,
body .twb-container .uuid-generator-tool,
body .twb-container .password-tool,
body .twb-container .pg-container,
body .twb-container .sp-container,
body .twb-container .my-ip-tool {
    background: transparent !important;
    background-image: none !important;
    min-height: 0 !important;
    max-width: 100% !important;
    padding: 0 0 16px !important;
    margin: 0 !important;
}

body .twb-container .converter-container,
body .twb-container .timestamp-container,
body .twb-container .tool-container,
body .twb-container .tool-container-enhanced,
body .twb-container .interface-container,
body .twb-container .validator-workspace,
body .twb-container .main-workspace,
body .twb-container .case-converter-container,
body .twb-container .date-diff-container,
body .twb-container .formatter-container,
body .twb-container .json-diff-container,
body .twb-container .pg-info-container,
body .twb-container .icg-tool {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box;
}

body .twb-container .seo-content,
body .twb-container .tool-guide,
body .twb-container .content-section,
body .twb-container .info-section,
body .twb-container .developer-guide,
body .twb-container .seo-section,
body .twb-container .cc-seo,
body .twb-container .icg-content,
body .twb-container .dk-content {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

/* Keep line-number gutter beside the SQL editor in SQL Formatter instead of stacking above */
body .twb-container .code-editor-wrapper.with-lines {
    display: flex !important;
    align-items: stretch;
}

body .twb-container .code-editor-wrapper.with-lines > .line-numbers {
    flex-shrink: 0;
}

body .twb-container .code-editor-wrapper.with-lines > .code-editor {
    flex: 1 1 auto;
    min-width: 0;
}

/* 3. Crisp unified Workbench Card Surfaces (Light + Dark) */
body .twb-container .tool-section,
body .twb-container .tool-main,
body .twb-container .converter-card,
body .twb-container .converter-interface,
body .twb-container .validator-workspace,
body .twb-container .settings-section,
body .twb-container .color-picker-section,
body .twb-container .converter-section,
body .twb-container .lookup-form,
body .twb-container .info-card,
body .twb-container .input-section,
body .twb-container .output-section,
body .twb-container .editor-panel,
body .twb-container .verify-section,
body .twb-container .compare-section,
body .twb-container .config-panel,
body .twb-container .preview-panel,
body .twb-container .form-card,
body .twb-container .result-card,
body .twb-container .results-card,
body .twb-container .results-section,
body .twb-container .batch-container,
body .twb-container .options-panel,
body .twb-container .options-card,
body .twb-container .controls-panel,
body .twb-container .pg-card,
body .twb-container .sp-card {
    background: var(--twb-surface);
    color: var(--twb-ink);
    border: 1px solid var(--twb-line);
    border-radius: var(--twb-r-card);
    min-width: 0;
}

body .twb-container .tool-section {
    padding: 20px;
    margin-bottom: 16px;
}

/* Compact live clock on Timestamp Converter */
body .twb-container .current-time-display {
    background: var(--twb-surface);
    color: var(--twb-ink);
    border: 1px solid var(--twb-accent-border);
    border-radius: var(--twb-r-card);
    padding: 14px 18px;
    margin-bottom: 16px;
}

body .twb-container .current-time-label {
    color: var(--twb-muted);
    margin-bottom: 4px;
}

body .twb-container .current-time-value {
    color: var(--twb-accent);
    font-size: 28px;
    font-variant-numeric: tabular-nums;
}

body .twb-container .current-date-value {
    color: var(--twb-ink-2);
    font-size: 14px;
}

/* WordPress Hash & IP Info primary hero panels -> crisp surface with readable contrast */
body .twb-container .hash-input-section,
body .twb-container .ip-main-display {
    background: var(--twb-surface);
    color: var(--twb-ink);
    border: 1px solid var(--twb-accent-border);
    border-radius: var(--twb-r-card);
    padding: 20px;
    max-width: 100%;
}

body .twb-container .hash-input-section::before,
body .twb-container .ip-main-display::after {
    display: none;
}

body .twb-container .hash-input-section h3,
body .twb-container .hash-input-section label,
body .twb-container .ip-main-display .your-ip-label,
body .twb-container .ip-main-display .ip-value {
    color: var(--twb-ink);
}

body .twb-container .ip-main-display .ip-value {
    color: var(--twb-accent);
    font-variant-numeric: tabular-nums;
}

body .twb-container .ip-main-display .btn-light {
    background: var(--twb-subtle);
    color: var(--twb-ink);
    border: 1px solid var(--twb-line-2);
    min-height: 38px;
    box-shadow: none;
    transform: none;
}

body .twb-container .ip-main-display .btn-light:hover {
    background: var(--twb-accent-soft);
    border-color: var(--twb-accent);
    color: var(--twb-accent);
    transform: none;
    box-shadow: none;
}

/* 4. Mode Switchers & Tabs (Responsive, 0 overflow on 390px, WCAG AA Light + Dark) */
body .twb-container .mode-switcher,
body .twb-container .mode-tabs,
body .twb-container .format-tabs,
body .twb-container .interface-tabs,
body .twb-container .guide-tabs,
body .twb-container .tab-buttons,
body .twb-container .tabs-header,
body .twb-container .test-profiles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: var(--twb-subtle);
    border: 1px solid var(--twb-line);
    border-radius: var(--twb-r-card);
    padding: 4px;
    width: auto;
    max-width: 100%;
    margin-bottom: 14px;
    box-sizing: border-box;
}

body .twb-container .mode-btn,
body .twb-container .mode-tab,
body .twb-container .format-tab,
body .twb-container .guide-tab,
body .twb-container .tab-btn,
body .twb-container .profile-btn,
body .twb-container .query-type-btn,
body .twb-container .sidebar-tab {
    background: transparent;
    background-image: none;
    color: var(--twb-ink-2);
    border: 1px solid transparent;
    border-radius: var(--twb-r-ctrl);
    min-height: 36px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    max-width: 100%;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

body .twb-container .mode-btn:hover,
body .twb-container .mode-tab:hover,
body .twb-container .format-tab:hover,
body .twb-container .guide-tab:hover,
body .twb-container .tab-btn:hover,
body .twb-container .profile-btn:hover,
body .twb-container .query-type-btn:hover,
body .twb-container .sidebar-tab:hover {
    color: var(--twb-ink);
    background: var(--twb-surface);
    transform: none;
    box-shadow: none;
}

body .twb-container .mode-btn.active,
body .twb-container .mode-tab.active,
body .twb-container .format-tab.active,
body .twb-container .guide-tab.active,
body .twb-container .tab-btn.active,
body .twb-container .profile-btn.active,
body .twb-container .query-type-btn.active,
body .twb-container .sidebar-tab.active {
    background: var(--twb-btn-bg) !important;
    background-image: none !important;
    color: var(--twb-btn-fg) !important;
    border-color: var(--twb-btn-bg) !important;
    box-shadow: none;
}

/* 5. Unified Accessible Primary & Secondary Buttons (>= 5.17:1 Light & Dark) */
body .twb-container .btn-primary,
body .twb-container .process-btn,
body .twb-container .lookup-btn,
body .twb-container .generate-btn,
body .twb-container .decode-btn,
body .twb-container .run-btn,
body .twb-container .send-btn,
body .twb-container .scan-btn,
body .twb-container .lint-btn,
body .twb-container .extract-btn,
body .twb-container .btn-analyze,
body .twb-container .cta-button,
body .twb-container .cta-button-modern,
body .twb-container .sp-fetch-btn,
body .twb-container .hm-btn-primary,
body .twb-container .ts-btn-primary,
body .twb-container .cc-btn-primary {
    background: var(--twb-btn-bg) !important;
    background-image: none !important;
    color: var(--twb-btn-fg) !important;
    border: 1px solid var(--twb-btn-bg) !important;
    border-radius: var(--twb-r-ctrl);
    min-height: 40px;
    font-weight: 600;
    box-shadow: none;
    transition: background-color 140ms var(--twb-ease), border-color 140ms var(--twb-ease), transform 100ms ease;
}

body .twb-container .btn-primary:hover,
body .twb-container .process-btn:hover,
body .twb-container .lookup-btn:hover,
body .twb-container .generate-btn:hover,
body .twb-container .decode-btn:hover,
body .twb-container .run-btn:hover,
body .twb-container .send-btn:hover,
body .twb-container .scan-btn:hover,
body .twb-container .lint-btn:hover,
body .twb-container .extract-btn:hover,
body .twb-container .btn-analyze:hover,
body .twb-container .cta-button:hover,
body .twb-container .cta-button-modern:hover,
body .twb-container .sp-fetch-btn:hover,
body .twb-container .hm-btn-primary:hover,
body .twb-container .ts-btn-primary:hover,
body .twb-container .cc-btn-primary:hover {
    background: var(--twb-btn-hover) !important;
    background-image: none !important;
    border-color: var(--twb-btn-hover) !important;
    color: #ffffff !important;
    transform: none;
}

body .twb-container .btn-primary:active,
body .twb-container .process-btn:active,
body .twb-container .lookup-btn:active,
body .twb-container .generate-btn:active,
body .twb-container .lint-btn:active {
    transform: scale(0.98);
}

body .twb-container .btn-secondary,
body .twb-container .btn-outline,
body .twb-container .btn-outline-primary,
body .twb-container .btn-icon,
body .twb-container .swap-btn,
body .twb-container .copy-btn,
body .twb-container .btn-copy,
body .twb-container .my-ip-btn,
body .twb-container .toolbar-btn,
body .twb-container .type-btn,
body .twb-container .add-param-btn {
    background: var(--twb-surface);
    color: var(--twb-ink);
    border: 1px solid var(--twb-line-2);
    border-radius: var(--twb-r-ctrl);
    min-height: 36px;
    font-weight: 600;
    transition: border-color 120ms ease, color 120ms ease, background-color 120ms ease;
}

body .twb-container .btn-secondary:hover,
body .twb-container .btn-outline:hover,
body .twb-container .btn-outline-primary:hover,
body .twb-container .btn-icon:hover,
body .twb-container .swap-btn:hover,
body .twb-container .copy-btn:hover,
body .twb-container .btn-copy:hover,
body .twb-container .my-ip-btn:hover,
body .twb-container .toolbar-btn:hover,
body .twb-container .type-btn:hover,
body .twb-container .add-param-btn:hover {
    border-color: var(--twb-accent);
    color: var(--twb-accent);
    background: var(--twb-accent-soft);
    transform: none;
}

body .twb-container .btn-success {
    background: #047857;
    border-color: #047857;
    color: #ffffff;
}

body .twb-container .btn-success:hover {
    background: #065f46;
    border-color: #065f46;
    color: #ffffff;
}

/* 6. Inputs, Textareas, Selects, Labels, Checkboxes (Full Light + Dark WCAG AA) */
body .twb-container textarea,
body .twb-container input[type="text"],
body .twb-container input[type="url"],
body .twb-container input[type="email"],
body .twb-container input[type="password"],
body .twb-container input[type="number"],
body .twb-container input[type="search"],
body .twb-container input[type="date"],
body .twb-container input[type="datetime-local"],
body .twb-container input[type="time"],
body .twb-container select {
    background-color: var(--twb-surface);
    color: var(--twb-ink);
    border: 1px solid var(--twb-line-2);
    border-radius: var(--twb-r-ctrl);
    max-width: 100%;
    box-sizing: border-box;
}

body .twb-container textarea:focus,
body .twb-container input:focus,
body .twb-container select:focus {
    outline: none;
    border-color: var(--twb-accent);
    box-shadow: 0 0 0 3px var(--twb-accent-soft);
}

body .twb-container textarea::placeholder,
body .twb-container input::placeholder {
    color: var(--twb-muted);
    opacity: 1;
}

body .twb-container label,
body .twb-container .form-label,
body .twb-container .control-label,
body .twb-container .option-item,
body .twb-container .setting-item,
body .twb-container .control-checkbox,
body .twb-container .checkbox-group,
body .twb-container .pg-option {
    color: var(--twb-ink);
}

body .twb-container label small,
body .twb-container .setting-item small,
body .twb-container .form-hint,
body .twb-container .subtitle,
body .twb-container .example-description {
    color: var(--twb-ink-2);
}

body .twb-container .language-card,
body .twb-container .js-seg-btn,
body .twb-container .js-chip,
body .twb-container .preset-btn,
body .twb-container .template-card {
    background: var(--twb-subtle);
    color: var(--twb-ink);
    border: 1px solid var(--twb-line-2);
}

body .twb-container .language-card.active,
body .twb-container .js-seg-btn.active {
    background: var(--twb-accent-soft);
    border-color: var(--twb-accent);
    color: var(--twb-ink);
}

body .twb-container .language-card.active .language-icon {
    filter: none !important;
}

/* Cancel legacy negative top-margin pull-ups on database tools now that duplicate heroes are removed */
body .twb-container .database-tool .tool-container,
body .twb-container .tool-container-enhanced,
body .twb-container .validator-workspace,
body .twb-container .query-builder-unlimited {
    margin-top: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Range sliders contrast */
body .twb-container input[type="range"] {
    accent-color: var(--twb-btn-bg);
}

/* 7. Full Dark Mode Rescue for Legacy Hardcoded White Cards, Tables, Headings & Copy */
[data-theme="dark"] body .twb-container h1,
[data-theme="dark"] body .twb-container h2,
[data-theme="dark"] body .twb-container h3,
[data-theme="dark"] body .twb-container h4,
[data-theme="dark"] body .twb-container .section-title,
[data-theme="dark"] body .twb-container .tool-section-title,
[data-theme="dark"] body .twb-container .panel-title,
[data-theme="dark"] body .twb-container .pg-title,
[data-theme="dark"] body .twb-container .section-title-gradient {
    color: var(--twb-ink);
    -webkit-text-fill-color: var(--twb-ink);
    background: none;
}

[data-theme="dark"] body .twb-container p,
[data-theme="dark"] body .twb-container li,
[data-theme="dark"] body .twb-container td,
[data-theme="dark"] body .twb-container th,
[data-theme="dark"] body .twb-container .stat-label,
[data-theme="dark"] body .twb-container .detail-item span {
    color: var(--twb-ink-2);
}

[data-theme="dark"] body .twb-container th,
[data-theme="dark"] body .twb-container strong,
[data-theme="dark"] body .twb-container .stat-value,
[data-theme="dark"] body .twb-container .detail-item strong {
    color: var(--twb-ink);
}

[data-theme="dark"] body .twb-container table,
[data-theme="dark"] body .twb-container thead,
[data-theme="dark"] body .twb-container tbody,
[data-theme="dark"] body .twb-container tr,
[data-theme="dark"] body .twb-container td,
[data-theme="dark"] body .twb-container th {
    background-color: var(--twb-surface);
    border-color: var(--twb-line);
}

[data-theme="dark"] body .twb-container thead th,
[data-theme="dark"] body .twb-container tr:nth-child(even) td {
    background-color: var(--twb-subtle);
}

[data-theme="dark"] body .twb-container .seo-content,
[data-theme="dark"] body .twb-container .tool-guide,
[data-theme="dark"] body .twb-container .content-section,
[data-theme="dark"] body .twb-container .info-section,
[data-theme="dark"] body .twb-container .feature-card,
[data-theme="dark"] body .twb-container .use-case-card,
[data-theme="dark"] body .twb-container .faq-item,
[data-theme="dark"] body .twb-container .example-box,
[data-theme="dark"] body .twb-container .example-card,
[data-theme="dark"] body .twb-container .best-practices,
[data-theme="dark"] body .twb-container .security-analysis,
[data-theme="dark"] body .twb-container .algorithm-visualization,
[data-theme="dark"] body .twb-container .stat-item,
[data-theme="dark"] body .twb-container .detail-item,
[data-theme="dark"] body .twb-container .converter-panel,
[data-theme="dark"] body .twb-container .input-panel,
[data-theme="dark"] body .twb-container .output-panel,
[data-theme="dark"] body .twb-container .batch-input,
[data-theme="dark"] body .twb-container .batch-output,
[data-theme="dark"] body .twb-container .compare-box,
[data-theme="dark"] body .twb-container .panel-header,
[data-theme="dark"] body .twb-container .section-header,
[data-theme="dark"] body .twb-container .workspace-toolbar,
[data-theme="dark"] body .twb-container .code-block-header,
[data-theme="dark"] body .twb-container .highlight-item,
[data-theme="dark"] body .twb-container .guide-content,
[data-theme="dark"] body .twb-container .info-box,
[data-theme="dark"] body .twb-container .card {
    background-color: var(--twb-surface);
    background-image: none;
    color: var(--twb-ink);
    border-color: var(--twb-line);
}

[data-theme="dark"] body .twb-container .panel-header,
[data-theme="dark"] body .twb-container .section-header,
[data-theme="dark"] body .twb-container .workspace-toolbar,
[data-theme="dark"] body .twb-container .code-block-header,
[data-theme="dark"] body .twb-container .detail-item,
[data-theme="dark"] body .twb-container .use-case-card {
    background-color: var(--twb-subtle);
}

/* Ensure light mode headings & gradient-text headings pass >= 4.5:1 cleanly */
body .twb-container .section-title-gradient,
body .twb-container .seo-content h2,
body .twb-container .seo-content h3,
body .twb-container .tool-guide h2,
body .twb-container .tool-guide h3,
body .twb-container .content-section h2,
body .twb-container .content-section h3,
body .twb-container .info-section h2,
body .twb-container .info-section h3 {
    color: var(--twb-ink);
    -webkit-text-fill-color: var(--twb-ink);
    background: none;
}

/* 8. Compact Editorial Styling for SEO / Reference Guides Below the Workbench */
body .twb-container .seo-content,
body .twb-container .tool-guide,
body .twb-container .content-section,
body .twb-container .info-section {
    background: var(--twb-surface);
    border: 1px solid var(--twb-line);
    border-radius: var(--twb-r-card);
    padding: 24px 28px;
    margin-top: 20px;
}

body .twb-container .seo-content h2,
body .twb-container .tool-guide h2,
body .twb-container .content-section h2 {
    font-size: 19px;
    line-height: 26px;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin: 0 0 12px;
}

body .twb-container .seo-content h3,
body .twb-container .tool-guide h3,
body .twb-container .content-section h3 {
    font-size: 15.5px;
    line-height: 22px;
    font-weight: 600;
    margin: 20px 0 8px;
}

body .twb-container .seo-content p,
body .twb-container .tool-guide p,
body .twb-container .content-section p {
    font-size: 14.5px;
    line-height: 1.62;
    color: var(--twb-ink-2);
    max-width: 74ch;
}

/* 9. Bulletproof 0px Overflow Protection (Desktop 1280px & Mobile 360px/390px) */
body .twb-container .tool-main,
body .twb-container .converter-grid,
body .twb-container .converter-container,
body .twb-container .generator-container,
body .twb-container .builder-container,
body .twb-container .builder-grid,
body .twb-container .validator-main-area,
body .twb-container .editor-grid,
body .twb-container .two-column,
body .twb-container .split-container,
body .twb-container .example-grid,
body .twb-container .examples-grid,
body .twb-container .example-container,
body .twb-container .diff-grid,
body .twb-container .compare-inputs,
body .twb-container .batch-container {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

body .twb-container .tool-main > *,
body .twb-container .converter-grid > *,
body .twb-container .converter-container > *,
body .twb-container .generator-container > *,
body .twb-container .builder-container > *,
body .twb-container .builder-grid > *,
body .twb-container .validator-main-area > *,
body .twb-container .example-grid > *,
body .twb-container .examples-grid > *,
body .twb-container .example-container > *,
body .twb-container .example-output,
body .twb-container .example-input,
body .twb-container .input-panel,
body .twb-container .output-panel,
body .twb-container .input-section,
body .twb-container .output-section,
body .twb-container .qr-output-section,
body .twb-container .builder-card,
body .twb-container .builder-right-column,
body .twb-container .builder-left-column {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

body .twb-container pre,
body .twb-container .code-block pre,
body .twb-container .example-output pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

body .twb-container code {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

body .twb-container pre code {
    word-break: break-word;
}

body .twb-container table,
body .twb-container .data-table {
    width: 100%;
    max-width: 100%;
}

body .twb-container .section-header,
body .twb-container .panel-header,
body .twb-container .tool-section-header,
body .twb-container .section-actions,
body .twb-container .output-actions,
body .twb-container .tool-actions,
body .twb-container .pg-actions,
body .twb-container .date-input-group,
body .twb-container .search-group,
body .twb-container .param-row,
body .twb-container .input-group,
body .twb-container .verify-inputs,
body .twb-container .compare-item,
body .twb-container .quick-actions {
    flex-wrap: wrap;
    min-width: 0;
    max-width: 100%;
}

body .twb-container .param-input,
body .twb-container .date-input-group input,
body .twb-container .input-group input,
body .twb-container .search-group input {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 820px) {
    body .twb-container .tool-main,
    body .twb-container .converter-grid,
    body .twb-container .converter-container,
    body .twb-container .generator-container,
    body .twb-container .builder-container,
    body .twb-container .builder-grid,
    body .twb-container .validator-main-area,
    body .twb-container .editor-container,
    body .twb-container .editor-main,
    body .twb-container .batch-container,
    body .twb-container .compare-inputs,
    body .twb-container .example-grid,
    body .twb-container .examples-grid,
    body .twb-container .example-container,
    body .twb-container .diff-grid,
    body .twb-container .features-grid,
    body .twb-container .feature-grid,
    body .twb-container .use-cases-grid,
    body .twb-container .tips-grid,
    body .twb-container .formatting-rules,
    body .twb-container .technique-cards,
    body .twb-container .claims-grid,
    body .twb-container .concepts-grid,
    body .twb-container .structure-grid,
    body .twb-container .versions-grid,
    body .twb-container .analysis-options,
    body .twb-container .controls-grid,
    body .twb-container .stats-grid,
    body .twb-container .form-row,
    body .twb-container .options-grid,
    body .twb-container .case-cards,
    body .twb-container .cases-grid,
    body .twb-container [style*="minmax(300px"],
    body .twb-container [style*="minmax(280px"],
    body .twb-container [style*="minmax(250px"] {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px;
    }

    body .twb-container .preset-buttons,
    body .twb-container .preset-selector,
    body .twb-container .presets,
    body .twb-container .results-tabs,
    body .twb-container .validator-tabs,
    body .twb-container .minifier-presets {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        max-width: 100% !important;
    }

    body .twb-container .tool-section,
    body .twb-container .seo-content,
    body .twb-container .tool-guide,
    body .twb-container .content-section,
    body .twb-container .hash-input-section,
    body .twb-container .color-picker-section,
    body .twb-container .converter-section,
    body .twb-container .input-section,
    body .twb-container .qr-output-section,
    body .twb-container .builder-card,
    body .twb-container .lookup-form {
        padding: 14px !important;
    }

    body .twb-container > .tool-header.twb-header {
        padding: 12px 14px 10px;
    }

    body .twb-container > .tool-header.twb-header h1 {
        font-size: 18px;
        line-height: 24px;
    }

    body .twb-container .search-group,
    body .twb-container .date-input-group,
    body .twb-container .hash-result {
        flex-direction: column;
        align-items: stretch;
    }

    body .twb-container .mode-switcher {
        width: 100%;
        justify-content: flex-start;
    }

    body .twb-container .mode-btn,
    body .twb-container .tab-btn {
        font-size: 12px;
        padding: 6px 10px;
        white-space: normal;
        text-align: center;
    }
}

/* ==========================================================================
   10. UNIVERSAL OVERFLOW, CODE-BLOCK & LIGHT/DARK WCAG 2.2 AA HARDENING
   Overrides legacy inline <style> rules and inline style="..." attributes
   that appear in <body> after <head> stylesheets.
   ========================================================================== */

/* Keep every tool cleanly framed inside the canonical 1200px site container
   (matches .container & footer pixel-for-pixel; never stretches full-screen on 1920px/2560px) */
body .twb-container {
    min-width: 0;
    width: 100%;
    max-width: 1200px !important;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

@media (max-width: 820px) {
    body .twb-container table,
    body .twb-container .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

body .twb-container .hero-glow,
body .twb-container .hero-particles,
body .twb-container .particle,
body .twb-container .bg-decoration {
    display: none !important;
}

body .twb-container .twb-ink-host {
    overflow: hidden;
}

body .twb-container .validator-side-panel {
    position: static !important;
    right: auto !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    border-radius: 0 0 var(--twb-r-card) var(--twb-r-card) !important;
    box-sizing: border-box;
}

body .twb-container .hash-input-section,
body .twb-container .hash-output-section,
body .twb-container .verify-section,
body .twb-container .wp-hash-info,
body .twb-container .tool-content,
body .twb-container .tool-container {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* Code blocks & inline code contrast (fixes light-on-light code blocks across HTML/CSS/JS/JSON tools) */
body .twb-container pre,
body .twb-container .code-example,
body .twb-container .code-example pre {
    background: #0f172a !important;
    color: #f1f5f9 !important;
    border: 1px solid #1e293b !important;
    border-radius: var(--twb-r-ctrl);
}

body .twb-container .code-example .code-example-header {
    background: #1e293b !important;
    color: #f8fafc !important;
    border-bottom: 1px solid #334155 !important;
}

body .twb-container pre code,
body .twb-container .code-example pre code {
    background: transparent !important;
    color: #f1f5f9 !important;
}

body .twb-container :not(pre) > code {
    background: var(--twb-subtle) !important;
    color: var(--twb-ink) !important;
    padding: 1px 6px;
    border-radius: var(--twb-r-ctrl);
}

body .twb-container .js-seg-btn:has(input:checked) {
    background: var(--twb-btn-bg) !important;
    border-color: var(--twb-btn-bg) !important;
    color: #ffffff !important;
}

body .twb-container .js-seg-btn:has(input:checked) code,
body .twb-container .js-seg-btn.active code {
    background: transparent !important;
    color: #ffffff !important;
}

/* Light + Dark WCAG 2.2 AA contrast normalization for legacy inline colored headings & gray text */
body .twb-container .seo-content h2,
body .twb-container .seo-content h3,
body .twb-container .seo-content h4,
body .twb-container .developer-guide h2,
body .twb-container .developer-guide h3,
body .twb-container .developer-guide h4,
body .twb-container .tool-guide h2,
body .twb-container .tool-guide h3,
body .twb-container .tool-guide h4,
body .twb-container .info-section h2,
body .twb-container .info-section h3,
body .twb-container .info-section h4,
body .twb-container .content-section h2,
body .twb-container .content-section h3,
body .twb-container .content-section h4,
body .twb-container .seo-section h2,
body .twb-container .seo-section h3,
body .twb-container .seo-section h4,
body .twb-container .cheatsheet-category h4,
body .twb-container .security-note h4,
body .twb-container .warning-box h4,
body .twb-container .security-warning-box h4,
body .twb-container .faq-item h4,
body .twb-container .benefit-card h4,
body .twb-container .feature-card h4,
body .twb-container .tip-card h4,
body .twb-container .info-card h4,
body .twb-container .pattern-category h4,
body .twb-container .regex-builder-tool .builder-section h2,
body .twb-container .regex-builder-tool .builder-section h3,
body .twb-container .regex-builder-tool .builder-section h4,
body .twb-container .regex-builder-tool .builder-section label {
    color: var(--twb-ink) !important;
    -webkit-text-fill-color: var(--twb-ink) !important;
}

body .twb-container .algorithm-visualization h4 {
    color: #f1f5f9 !important;
    -webkit-text-fill-color: #f1f5f9 !important;
}

body .twb-container .seo-content div[style*="#1a1a1a"] p,
body .twb-container .seo-content div[style*="#1a1a1a"] strong,
body .twb-container .seo-content div[style*="#1a1a1a"] code,
body .twb-container .seo-content div[style*="#1a1a1a"] span,
body .twb-container .seo-content div[style*="#1f2937"] p,
body .twb-container .seo-content div[style*="#1f2937"] strong,
body .twb-container .seo-content div[style*="#1f2937"] code,
body .twb-container .seo-content div[style*="#1f2937"] span,
body .twb-container .seo-content div[style*="#111827"] p,
body .twb-container .seo-content div[style*="#111827"] strong,
body .twb-container .seo-content div[style*="#111827"] code,
body .twb-container .seo-content div[style*="#0f172a"] p,
body .twb-container .seo-content div[style*="#0f172a"] strong,
body .twb-container .seo-content div[style*="#0f172a"] code {
    background: transparent !important;
    color: #e2e8f0 !important;
}

body .twb-container .palette-label,
body .twb-container #execution-status,
body .twb-container #issue-count,
body .twb-container .history-type,
body .twb-container .example-urls,
body .twb-container .match-item small,
body .twb-container .ttl-value {
    color: var(--twb-ink-2) !important;
}

body .twb-container #stop-btn:disabled {
    color: var(--twb-muted) !important;
    opacity: 1 !important;
    border-color: var(--twb-line-2) !important;
}

body .twb-container .code-output-pro > div[style*="#94a3b8"],
body .twb-container .code-output > div[style*="#94a3b8"],
body .twb-container .code-output-pro .empty-state,
body .twb-container .code-output-pro .empty-state p {
    color: var(--twb-muted) !important;
}

body .twb-container .api-tester-container .empty-text {
    color: #a3a3a3 !important;
}

body .twb-container .sp-export-btn {
    background: #047857 !important;
    border-color: #047857 !important;
    color: #ffffff !important;
}

body .twb-container .sp-export-btn:hover {
    background: #065f46 !important;
    border-color: #065f46 !important;
    color: #ffffff !important;
}

body .twb-container .query-type-btn.active small {
    color: rgba(255, 255, 255, 0.92) !important;
}

body .twb-container .record-type-badge.type-a     { background: #dcfce7 !important; color: #166534 !important; }
body .twb-container .record-type-badge.type-aaaa  { background: #ede9fe !important; color: #5b21b6 !important; }
body .twb-container .record-type-badge.type-cname { background: #ffedd5 !important; color: #9a3412 !important; }
body .twb-container .record-type-badge.type-mx    { background: #fee2e2 !important; color: #991b1b !important; }
body .twb-container .record-type-badge.type-txt   { background: #dbeafe !important; color: #1e40af !important; }
body .twb-container .record-type-badge.type-ns    { background: #fef3c7 !important; color: #92400e !important; }
body .twb-container .record-type-badge.type-soa   { background: #f3e8ff !important; color: #6b21a8 !important; }

html[data-theme="dark"] body .twb-container .record-type-badge.type-a     { background: rgba(22, 163, 74, 0.25) !important; color: #bbf7d0 !important; }
html[data-theme="dark"] body .twb-container .record-type-badge.type-aaaa  { background: rgba(139, 92, 246, 0.28) !important; color: #ede9fe !important; }
html[data-theme="dark"] body .twb-container .record-type-badge.type-cname { background: rgba(234, 88, 12, 0.28) !important; color: #fed7aa !important; }
html[data-theme="dark"] body .twb-container .record-type-badge.type-mx    { background: rgba(220, 38, 38, 0.28) !important; color: #fecaca !important; }
html[data-theme="dark"] body .twb-container .record-type-badge.type-txt   { background: rgba(37, 99, 235, 0.28) !important; color: #dbeafe !important; }
html[data-theme="dark"] body .twb-container .record-type-badge.type-ns    { background: rgba(217, 119, 6, 0.28) !important; color: #fef3c7 !important; }
html[data-theme="dark"] body .twb-container .record-type-badge.type-soa   { background: rgba(147, 51, 234, 0.28) !important; color: #f3e8ff !important; }

body .twb-container .qr-placeholder p,
body .twb-container .history-grid p {
    color: var(--twb-ink-2) !important;
}

body .twb-container .seo-content p,
body .twb-container .seo-content li,
body .twb-container .developer-guide p,
body .twb-container .developer-guide li,
body .twb-container .info-section p,
body .twb-container .info-section li,
body .twb-container .seo-section p,
body .twb-container .seo-section li,
body .twb-container .tool-guide p,
body .twb-container .tool-guide li,
body .twb-container .content-section p,
body .twb-container .content-section li,
body .twb-container .regex-builder-tool .builder-section p,
body .twb-container .regex-builder-tool .builder-section li {
    color: var(--twb-ink-2) !important;
}

body .twb-container .pg-option-icon,
body .twb-container .pg-option-label {
    color: var(--twb-ink-2) !important;
}

body .twb-container .pg-option input:checked ~ .pg-option-box .pg-option-icon,
body .twb-container .pg-option input:checked ~ .pg-option-box .pg-option-label,
body .twb-container .pg-option input:checked + .pg-option-box .pg-option-icon,
body .twb-container .pg-option input:checked + .pg-option-box .pg-option-label {
    color: #ffffff !important;
}

body .twb-container .type-tab.active,
body .twb-container .sp-tab.active,
body .twb-container .add-container-btn,
body .twb-container .add-stage-btn {
    background: var(--twb-btn-bg) !important;
    color: #ffffff !important;
    border-color: var(--twb-btn-bg) !important;
}

body .twb-container .type-tab.active *,
body .twb-container .sp-tab.active * {
    color: #ffffff !important;
}

body .twb-container .remove-container {
    background: #b91c1c !important;
    color: #ffffff !important;
    border-color: #b91c1c !important;
}

body .twb-container .column-key {
    color: #1d4ed8 !important;
    background: #eff6ff !important;
}

body .twb-container .slider-value {
    color: var(--twb-accent) !important;
    background: var(--twb-subtle) !important;
}

body .twb-container .quick-domains button,
body .twb-container .example-domains button,
body .twb-container .preset-domains button,
body .twb-container .example-urls button {
    color: var(--twb-accent) !important;
    background: var(--twb-surface) !important;
    border: 1px solid var(--twb-line-2) !important;
}

/* SQL Validator intentionally-dark workbench panel contrast fixes (both Light and Dark page modes) */
body .twb-container .sql-validator-ultimate .section-title-gradient {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

body .twb-container .sql-validator-ultimate .toolbar-btn,
body .twb-container .sql-validator-ultimate .toolbar-select {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

body .twb-container .sql-validator-ultimate .toolbar-btn:hover,
body .twb-container .sql-validator-ultimate .toolbar-select:hover {
    background-color: #1e293b !important;
    color: #ffffff !important;
    border-color: #60a5fa !important;
}

body .twb-container .sql-validator-ultimate .sql-editor,
body .twb-container .sql-validator-ultimate textarea.code-editor {
    background-color: #0a0e27 !important;
    color: #f1f5f9 !important;
    border: none !important;
    border-radius: 0 !important;
}

body .twb-container .sql-validator-ultimate .sql-editor::placeholder,
body .twb-container .sql-validator-ultimate textarea.code-editor::placeholder {
    color: #94a3b8 !important;
}

body .twb-container .validator-workspace .query-type-badge,
body .twb-container .validator-workspace .tab-badge.info {
    color: #93c5fd !important;
    background: rgba(59, 130, 246, 0.22) !important;
}

body .twb-container .validator-workspace .tab-badge {
    background: #1d4ed8 !important;
    color: #ffffff !important;
}

body .twb-container .validator-workspace .panel-tab,
body .twb-container .validator-workspace .panel-tab span,
body .twb-container .validator-workspace .results-tab,
body .twb-container .validator-workspace .results-tab span,
body .twb-container .validator-workspace .tab-btn,
body .twb-container .validator-workspace .tab-btn span,
body .twb-container .validator-workspace .side-section p,
body .twb-container .validator-workspace .empty-state p {
    color: #cbd5e1 !important;
}

body .twb-container .validator-workspace .panel-tab.active,
body .twb-container .validator-workspace .panel-tab.active span,
body .twb-container .validator-workspace .results-tab.active,
body .twb-container .validator-workspace .results-tab.active span,
body .twb-container .validator-workspace .tab-btn.active,
body .twb-container .validator-workspace .tab-btn.active span {
    color: #ffffff !important;
}

/* API Tester intentionally-dark pane contrast */
body .twb-container .api-tester-container .tab-btn,
body .twb-container .api-tester-container .page-tab {
    color: #cbd5e1 !important;
}

body .twb-container .api-tester-container .tab-btn.active,
body .twb-container .api-tester-container .page-tab.active {
    color: #ffffff !important;
}

body .twb-container .api-tester-container input[type="text"],
body .twb-container .api-tester-container input[type="url"],
body .twb-container .api-tester-container input[type="password"],
body .twb-container .api-tester-container select,
body .twb-container .api-tester-container textarea {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

body .twb-container .api-tester-container input::placeholder,
body .twb-container .api-tester-container textarea::placeholder {
    color: #94a3b8 !important;
}

body .twb-container .api-tester-container .add-param-btn,
body .twb-container .api-tester-container .btn-secondary {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

body .twb-container .api-tester-container .add-param-btn:hover,
body .twb-container .api-tester-container .btn-secondary:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
    border-color: #60a5fa !important;
}

/* ---------- Full Dark Mode Surface & Inline-Style Rescue ---------- */
html[data-theme="dark"] body .twb-container .seo-content,
html[data-theme="dark"] body .twb-container .developer-guide,
html[data-theme="dark"] body .twb-container .seo-section,
html[data-theme="dark"] body .twb-container .info-section,
html[data-theme="dark"] body .twb-container .tool-guide,
html[data-theme="dark"] body .twb-container .content-section,
html[data-theme="dark"] body .twb-container .tool-interface,
html[data-theme="dark"] body .twb-container .tool-interface-pro,
html[data-theme="dark"] body .twb-container .editor-layout,
html[data-theme="dark"] body .twb-container .editor-layout-pro,
html[data-theme="dark"] body .twb-container .editor-section,
html[data-theme="dark"] body .twb-container .panel-body,
html[data-theme="dark"] body .twb-container .code-editor-wrapper,
html[data-theme="dark"] body .twb-container .editor-wrapper-pro,
html[data-theme="dark"] body .twb-container .code-output,
html[data-theme="dark"] body .twb-container .code-output-pro,
html[data-theme="dark"] body .twb-container .code-example,
html[data-theme="dark"] body .twb-container .format-controls,
html[data-theme="dark"] body .twb-container .tool-card,
html[data-theme="dark"] body .twb-container .intro-card,
html[data-theme="dark"] body .twb-container .content-card,
html[data-theme="dark"] body .twb-container .builder-card,
html[data-theme="dark"] body .twb-container .builder-bottom-panel,
html[data-theme="dark"] body .twb-container .compose-patterns,
html[data-theme="dark"] body .twb-container .faq-section,
html[data-theme="dark"] body .twb-container .faq-answer,
html[data-theme="dark"] body .twb-container .pg-card,
html[data-theme="dark"] body .twb-container .pg-history,
html[data-theme="dark"] body .twb-container .pg-info,
html[data-theme="dark"] body .twb-container .pg-feature,
html[data-theme="dark"] body .twb-container .pg-faq-item,
html[data-theme="dark"] body .twb-container .tab-content-section,
html[data-theme="dark"] body .twb-container .hash-details,
html[data-theme="dark"] body .twb-container .cost-control,
html[data-theme="dark"] body .twb-container .security-best-practices,
html[data-theme="dark"] body .twb-container .tech-specs,
html[data-theme="dark"] body .twb-container .tip-card,
html[data-theme="dark"] body .twb-container .rule-card,
html[data-theme="dark"] body .twb-container .resource-item,
html[data-theme="dark"] body .twb-container .feature-card-pro,
html[data-theme="dark"] body .twb-container .quick-action,
html[data-theme="dark"] body .twb-container .table-header,
html[data-theme="dark"] body .twb-container .dependency-node,
html[data-theme="dark"] body .twb-container .lang-item,
html[data-theme="dark"] body .twb-container details {
    background: var(--twb-surface) !important;
    background-image: none !important;
    color: var(--twb-ink) !important;
    border-color: var(--twb-line) !important;
}

html[data-theme="dark"] body .twb-container .interface-header-pro,
html[data-theme="dark"] body .twb-container .interface-tab-pro.active,
html[data-theme="dark"] body .twb-container .panel-header-pro,
html[data-theme="dark"] body .twb-container .editor-status-bar,
html[data-theme="dark"] body .twb-container .output-status-bar,
html[data-theme="dark"] body .twb-container .control-bar-pro,
html[data-theme="dark"] body .twb-container .control-section,
html[data-theme="dark"] body .twb-container .tab-icon,
html[data-theme="dark"] body .twb-container .title-icon,
html[data-theme="dark"] body .twb-container .empty-icon,
html[data-theme="dark"] body .twb-container .line-numbers,
html[data-theme="dark"] body .twb-container .code-example-header,
html[data-theme="dark"] body .twb-container .faq-question,
html[data-theme="dark"] body .twb-container .action-btn,
html[data-theme="dark"] body .twb-container .checkbox-group,
html[data-theme="dark"] body .twb-container .builder-canvas,
html[data-theme="dark"] body .twb-container .builder-main,
html[data-theme="dark"] body .twb-container .table-item,
html[data-theme="dark"] body .twb-container .zoom-level,
html[data-theme="dark"] body .twb-container .step,
html[data-theme="dark"] body .twb-container .service-item,
html[data-theme="dark"] body .twb-container .dependency-canvas,
html[data-theme="dark"] body .twb-container .network-item,
html[data-theme="dark"] body .twb-container .config-type-card:not(.active),
html[data-theme="dark"] body .twb-container .container-item,
html[data-theme="dark"] body .twb-container .resource-calculator,
html[data-theme="dark"] body .twb-container .helm-section,
html[data-theme="dark"] body .twb-container .stage-builder,
html[data-theme="dark"] body .twb-container .cheatsheet-category,
html[data-theme="dark"] body .twb-container .pattern-regex,
html[data-theme="dark"] body .twb-container .lang-btn:not(.active),
html[data-theme="dark"] body .twb-container .pg-controls,
html[data-theme="dark"] body .twb-container .pg-length-value,
html[data-theme="dark"] body .twb-container .pg-btn,
html[data-theme="dark"] body .twb-container .pg-check,
html[data-theme="dark"] body .twb-container .pg-option-box,
html[data-theme="dark"] body .twb-container .pg-strength,
html[data-theme="dark"] body .twb-container .pg-history-item,
html[data-theme="dark"] body .twb-container .complexity-indicator,
html[data-theme="dark"] body .twb-container .complexity-bar,
html[data-theme="dark"] body .twb-container .before,
html[data-theme="dark"] body .twb-container .after,
html[data-theme="dark"] body .twb-container .use-case,
html[data-theme="dark"] body .twb-container .warning-box,
html[data-theme="dark"] body .twb-container .security-warning-box,
html[data-theme="dark"] body .twb-container .security-info,
html[data-theme="dark"] body .twb-container .security-notice,
html[data-theme="dark"] body .twb-container .xf-info-box,
html[data-theme="dark"] body .twb-container .alert,
html[data-theme="dark"] body .twb-container .add-color-btn,
html[data-theme="dark"] body .twb-container .wapiso-banner-cta,
html[data-theme="dark"] body .twb-container #output-hash,
html[data-theme="dark"] body .twb-container #output-serialized,
html[data-theme="dark"] body .twb-container .column-key {
    background: var(--twb-subtle) !important;
    background-image: none !important;
    color: var(--twb-ink) !important;
    border-color: var(--twb-line-2) !important;
}

/* Rescue classless inline-styled divs inside SEO / guide sections in Dark Mode */
html[data-theme="dark"] body .twb-container .seo-content div[style*="background"],
html[data-theme="dark"] body .twb-container .developer-guide div[style*="background"],
html[data-theme="dark"] body .twb-container .seo-section div[style*="background"],
html[data-theme="dark"] body .twb-container .info-section div[style*="background"],
html[data-theme="dark"] body .twb-container .tool-guide div[style*="background"],
html[data-theme="dark"] body .twb-container .content-section div[style*="background"],
html[data-theme="dark"] body .twb-container .tool-container div[style*="background"],
html[data-theme="dark"] body .twb-container .regex-builder-tool .builder-section div[style*="background"] {
    background: var(--twb-subtle) !important;
    background-image: none !important;
    color: var(--twb-ink) !important;
    border-color: var(--twb-line) !important;
}

html[data-theme="dark"] body .twb-container .column-key {
    color: #93c5fd !important;
}

html[data-theme="dark"] body .twb-container a:not(.btn):not(.twb-rail-chip):not(.twb-act-btn):not(.tcb-skill-card):not(.tcb-pill):not(.tcb-cta):not(.linkedin-cta-follow):not(.sidebar-item) {
    color: var(--twb-accent) !important;
}

html[data-theme="dark"] body .twb-container a.tcb-cta-primary,
html[data-theme="dark"] body .twb-container a.tcb-cta-primary span,
html[data-theme="dark"] body .twb-container a.linkedin-cta-follow,
html[data-theme="dark"] body .twb-container a.linkedin-cta-follow span {
    color: #ffffff !important;
}

html[data-theme="dark"] body .twb-container .tcb-skill-owner,
html[data-theme="dark"] body .twb-container .tcb-skill-stars {
    color: var(--twb-muted) !important;
}

html[data-theme="dark"] body .twb-container .cost-info span {
    color: var(--twb-ink-2) !important;
}

html[data-theme="dark"] body .twb-container .tab-label,
html[data-theme="dark"] body .twb-container .container-name,
html[data-theme="dark"] body .twb-container .column-info,
html[data-theme="dark"] body .twb-container .env-tab.active {
    color: var(--twb-ink) !important;
}

html[data-theme="dark"] body .twb-container .tab-description,
html[data-theme="dark"] body .twb-container .checkbox-label,
html[data-theme="dark"] body .twb-container .column-type,
html[data-theme="dark"] body .twb-container .info-item span,
html[data-theme="dark"] body .twb-container .input-info span,
html[data-theme="dark"] body .twb-container .output-info span,
html[data-theme="dark"] body .twb-container .quick-actions span,
html[data-theme="dark"] body .twb-container .quick-domains span,
html[data-theme="dark"] body .twb-container .env-tab:not(.active),
html[data-theme="dark"] body .twb-container #strengthText,
html[data-theme="dark"] body .twb-container .pg-clear {
    color: var(--twb-ink-2) !important;
}

html[data-theme="dark"] body .twb-container .resource-value span,
html[data-theme="dark"] body .twb-container .pg-history-copy {
    color: var(--twb-accent) !important;
}

html[data-theme="dark"] body .twb-container .sp-google-title {
    color: #93c5fd !important;
}

html[data-theme="dark"] body .twb-container .sp-google-url,
html[data-theme="dark"] body .twb-container .sp-google-url span,
html[data-theme="dark"] body .twb-container .sp-google-url .breadcrumb-sep {
    color: #86efac !important;
}

html[data-theme="dark"] body .twb-container .match-highlight {
    background: #854d0e !important;
    color: #fef9c3 !important;
}

html[data-theme="dark"] body .twb-container .test-case-result.pass {
    background: #14532d !important;
    color: #dcfce7 !important;
}

html[data-theme="dark"] body .twb-container .input-unit,
html[data-theme="dark"] body .twb-container .help-text,
html[data-theme="dark"] body .twb-container #char-count,
html[data-theme="dark"] body .twb-container #line-count,
html[data-theme="dark"] body .twb-container #update-time,
html[data-theme="dark"] body .twb-container #match-count,
html[data-theme="dark"] body .twb-container .test-case-name,
html[data-theme="dark"] body .twb-container .interface-tab:not(.active),
html[data-theme="dark"] body .twb-container .status-bar span,
html[data-theme="dark"] body .twb-container .editor-footer span,
html[data-theme="dark"] body .twb-container .char-count,
html[data-theme="dark"] body .twb-container .input-stats span,
html[data-theme="dark"] body .twb-container .hash-stats span,
html[data-theme="dark"] body .twb-container .quick-lookup span,
html[data-theme="dark"] body .twb-container .your-ip span,
html[data-theme="dark"] body .twb-container .rgb-slider label,
html[data-theme="dark"] body .twb-container .slider-group span,
html[data-theme="dark"] body .twb-container .color-sliders span,
html[data-theme="dark"] body .twb-container .regex-input-section label,
html[data-theme="dark"] body .twb-container .highlight-item span,
html[data-theme="dark"] body .twb-container .step-item span,
html[data-theme="dark"] body .twb-container .status-codes h4,
html[data-theme="dark"] body .twb-container .status-card h4 {
    color: var(--twb-ink-2) !important;
}

html[data-theme="dark"] body .twb-container .query-type-btn.active,
html[data-theme="dark"] body .twb-container .query-type-btn.active span {
    color: #ffffff !important;
}

html[data-theme="dark"] body .twb-container .tcb-bridge {
    background: var(--twb-surface) !important;
    border-color: var(--twb-line) !important;
    color: var(--twb-ink) !important;
}

html[data-theme="dark"] body .twb-container .tcb-cli-btn {
    background: var(--twb-subtle) !important;
    color: var(--twb-ink) !important;
    border-color: var(--twb-line-2) !important;
}

html[data-theme="dark"] body .twb-container .tcb-skill-card {
    background: var(--twb-subtle) !important;
    border-color: var(--twb-line-2) !important;
}

html[data-theme="dark"] body .twb-container .tcb-skill-link strong {
    color: var(--twb-ink) !important;
}

/* Dark Mode rescue for headings (h5/h6/summary), hidden post-action panels,
   regex visual builder blocks, hasher checkbox spans, Leaflet popups, & social preview */
html[data-theme="dark"] body .twb-container h5,
html[data-theme="dark"] body .twb-container h6,
html[data-theme="dark"] body .twb-container summary {
    color: var(--twb-ink) !important;
    -webkit-text-fill-color: var(--twb-ink) !important;
}

html[data-theme="dark"] body .twb-container label span,
html[data-theme="dark"] body .twb-container .checkbox-option span,
html[data-theme="dark"] body .twb-container .option-label span {
    color: var(--twb-ink) !important;
}

html[data-theme="dark"] body .twb-container .stats-panel,
html[data-theme="dark"] body .twb-container .stats-section,
html[data-theme="dark"] body .twb-container .compression-stats,
html[data-theme="dark"] body .twb-container .results-panel,
html[data-theme="dark"] body .twb-container .diff-panel,
html[data-theme="dark"] body .twb-container .diff-stats {
    background: var(--twb-surface) !important;
    color: var(--twb-ink) !important;
    border-color: var(--twb-line) !important;
}

html[data-theme="dark"] body .twb-container .stat-card,
html[data-theme="dark"] body .twb-container .stat-box,
html[data-theme="dark"] body .twb-container .size-comparison,
html[data-theme="dark"] body .twb-container .result-box,
html[data-theme="dark"] body .twb-container .result-item,
html[data-theme="dark"] body .twb-container .summary-card,
html[data-theme="dark"] body .twb-container .metric-card,
html[data-theme="dark"] body .twb-container .score-card,
html[data-theme="dark"] body .twb-container .header-item,
html[data-theme="dark"] body .twb-container .record-item,
html[data-theme="dark"] body .twb-container .port-item,
html[data-theme="dark"] body .twb-container .meta-item,
html[data-theme="dark"] body .twb-container .issue-item,
html[data-theme="dark"] body .twb-container .builder-block,
html[data-theme="dark"] body .twb-container .panel-toggle {
    background: var(--twb-subtle) !important;
    color: var(--twb-ink) !important;
    border-color: var(--twb-line-2) !important;
}

html[data-theme="dark"] body .twb-container .builder-block-title,
html[data-theme="dark"] body .twb-container .cheatsheet-pattern,
html[data-theme="dark"] body .twb-container .pattern-title,
html[data-theme="dark"] body .twb-container .regex-builder-tool label {
    color: var(--twb-ink) !important;
}

html[data-theme="dark"] body .twb-container .builder-block-desc,
html[data-theme="dark"] body .twb-container .test-case-content,
html[data-theme="dark"] body .twb-container .cheatsheet-desc,
html[data-theme="dark"] body .twb-container .pattern-desc,
html[data-theme="dark"] body .twb-container .explanation-content,
html[data-theme="dark"] body .twb-container .perf-label,
html[data-theme="dark"] body .twb-container #performance-tips,
html[data-theme="dark"] body .twb-container .sp-google-description,
html[data-theme="dark"] body .twb-container .sp-google-sitelink-desc {
    color: var(--twb-ink-2) !important;
}

/* Dark Mode Leaflet map popup & attribution contrast (ip_location) */
html[data-theme="dark"] body .twb-container .leaflet-popup-content-wrapper,
html[data-theme="dark"] body .twb-container .leaflet-popup-tip {
    background: #111827 !important;
    color: #f8fafc !important;
    border: 1px solid rgba(148, 163, 184, 0.26);
}

html[data-theme="dark"] body .twb-container .leaflet-popup-content,
html[data-theme="dark"] body .twb-container .leaflet-popup-content strong {
    color: #f8fafc !important;
}

html[data-theme="dark"] body .twb-container .leaflet-popup-close-button {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] body .twb-container .leaflet-control-attribution {
    background: rgba(17, 24, 39, 0.92) !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] body .twb-container .leaflet-control-attribution a {
    color: #93c5fd !important;
}

/* ==========================================================================
   11. FULL 74-PAGE AUDIT HARDENING (Light + Dark WCAG 2.2 AA & 0px Overflow)
   Fixes every remaining contrast, gradient, and dark-surface defect verified
   across all 74 unique tool URLs.
   ========================================================================== */

/* Prevent horizontal overflow on cards inside 360px mobile grids */
body .twb-container .technique-cards,
body .twb-container .technique-card,
body .twb-container .claims-grid,
body .twb-container .claim-info,
body .twb-container .versions-grid,
body .twb-container .editor-container,
body .twb-container .editor-section,
body .twb-container .editor-main {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* Unified crisp CTA boxes (eliminates low-contrast pink/coral/blue gradient CTA banners) */
body .twb-container .cta-section,
body .twb-container .cta-section-modern,
body .twb-container .cta-section-ultimate,
body .twb-container .footer-cta {
    background: var(--twb-surface) !important;
    background-image: none !important;
    border: 1px solid var(--twb-accent-border) !important;
    border-radius: var(--twb-r-card) !important;
    color: var(--twb-ink) !important;
}

body .twb-container .cta-section h2,
body .twb-container .cta-section h3,
body .twb-container .cta-section-modern h2,
body .twb-container .cta-section-modern h3,
body .twb-container .cta-section-ultimate h2,
body .twb-container .cta-section-ultimate h3,
body .twb-container .footer-cta h2,
body .twb-container .footer-cta h3 {
    color: var(--twb-ink) !important;
    -webkit-text-fill-color: var(--twb-ink) !important;
}

body .twb-container .cta-section p,
body .twb-container .cta-section-modern p,
body .twb-container .cta-section-ultimate p,
body .twb-container .footer-cta p {
    color: var(--twb-ink-2) !important;
}

body .twb-container .cta-section .btn-secondary,
body .twb-container .cta-section-modern .btn-secondary,
body .twb-container .cta-section-ultimate .btn-secondary,
body .twb-container .footer-cta .btn-secondary {
    background: var(--twb-subtle) !important;
    color: var(--twb-ink) !important;
    border: 1px solid var(--twb-line-2) !important;
}

/* Step numbers, sidebar active items, Kubernetes active cards -> solid brand blue (>= 5.17:1) */
body .twb-container .step-number,
body .twb-container .sidebar-item.active,
html[data-theme="dark"] body .twb-container a.sidebar-item.active,
body .twb-container .config-type-card.active {
    background: var(--twb-btn-bg) !important;
    background-image: none !important;
    border-color: var(--twb-btn-bg) !important;
    color: #ffffff !important;
}

body .twb-container .sidebar-item.active *,
body .twb-container .config-type-card.active,
body .twb-container .config-type-card.active * {
    color: #ffffff !important;
}

/* Hasher action-section & XenForo/Bcrypt contrast (Light + Dark) */
body .twb-container .hash-tool::before {
    display: none !important;
}

body .twb-container .action-section {
    background: var(--twb-subtle) !important;
    background-image: none !important;
    border: 1px solid var(--twb-line) !important;
    color: var(--twb-ink) !important;
}

body .twb-container .xf-badge {
    background: var(--twb-accent-soft) !important;
    background-image: none !important;
    color: var(--twb-accent) !important;
    border: 1px solid var(--twb-accent-border) !important;
}

body .twb-container .xf-badge * {
    color: var(--twb-accent) !important;
}

body .twb-container .cost-info span {
    color: var(--twb-ink-2) !important;
}

body .twb-container .cost-info strong {
    color: var(--twb-ink) !important;
}

/* JSON-to-Interface active language icon */
body .twb-container .language-card.active .lang-icon,
body .twb-container .language-card.active .lang-name {
    color: var(--twb-accent) !important;
}

/* Alert error contrast (case_converter, json_diff) */
body .twb-container .alert.alert-error,
body .twb-container .alert-error {
    background: #fef2f2 !important;
    color: #991b1b !important;
    border: 1px solid #fecaca !important;
}

html[data-theme="dark"] body .twb-container .alert.alert-error,
html[data-theme="dark"] body .twb-container .alert-error {
    background: rgba(185, 28, 28, 0.22) !important;
    color: #fecaca !important;
    border-color: rgba(248, 113, 113, 0.42) !important;
}

/* Case converter: crisp neutral hairline cards, brand blue strictly on active/hover (60/30/10 budget) */
body .twb-container .case-card {
    background: var(--twb-surface) !important;
    background-image: none !important;
    border: 1px solid var(--twb-line-2) !important;
    color: var(--twb-ink) !important;
    box-shadow: none !important;
}

body .twb-container .case-card .case-name {
    color: var(--twb-ink) !important;
}

body .twb-container .case-card .case-name i {
    color: var(--twb-accent) !important;
}

body .twb-container .case-card .case-description {
    color: var(--twb-ink-2) !important;
    opacity: 1 !important;
}

body .twb-container .case-card .case-example {
    background: var(--twb-subtle) !important;
    color: var(--twb-ink) !important;
    border: 1px solid var(--twb-line) !important;
    opacity: 1 !important;
}

body .twb-container .case-card:hover,
body .twb-container .case-card.active {
    background: var(--twb-btn-bg) !important;
    background-image: none !important;
    border-color: var(--twb-btn-bg) !important;
    color: #ffffff !important;
}

body .twb-container .case-card:hover .case-name,
body .twb-container .case-card:hover .case-name i,
body .twb-container .case-card:hover .case-description,
body .twb-container .case-card.active .case-name,
body .twb-container .case-card.active .case-name i,
body .twb-container .case-card.active .case-description {
    color: #ffffff !important;
}

body .twb-container .case-card:hover .case-example,
body .twb-container .case-card.active .case-example {
    background: rgba(15, 23, 42, 0.26) !important;
    border-color: rgba(255, 255, 255, 0.24) !important;
    color: #ffffff !important;
}

/* Primary button icons stay crisp white (fixes docker-compose .card-header i bleed) */
body .twb-container .btn-primary i,
body .twb-container .process-btn i,
body .twb-container .generate-btn i,
body .twb-container .lookup-btn i {
    color: #ffffff !important;
}

/* Regex Builder active language button -> brand blue (not off-brand purple) */
body .twb-container .lang-btn.active {
    background: var(--twb-btn-bg) !important;
    background-image: none !important;
    border-color: var(--twb-btn-bg) !important;
    color: #ffffff !important;
}

/* JSON Minifier post-minify savings banner & size bars (WCAG 2.2 AA >= 7:1 + calm brand palette) */
body .twb-container .savings-indicator {
    background: var(--twb-ok-bg) !important;
    background-image: none !important;
    color: var(--twb-ok) !important;
    border: 1px solid var(--twb-ok-border) !important;
}

body .twb-container .savings-indicator i,
body .twb-container .savings-indicator span {
    color: var(--twb-ok) !important;
}

body .twb-container .size-bar {
    background: var(--twb-subtle) !important;
    border: 1px solid var(--twb-line) !important;
}

body .twb-container .size-bar-fill {
    background: var(--twb-btn-bg) !important;
    background-image: none !important;
}

body .twb-container #size-bar-minified {
    background: var(--twb-ok) !important;
    background-image: none !important;
}

/* Dark Mode post-action export buttons & SQL Validator history timestamps */
html[data-theme="dark"] body .twb-container .export-btn {
    background: var(--twb-subtle) !important;
    color: var(--twb-ink) !important;
    border-color: var(--twb-line-2) !important;
}

html[data-theme="dark"] body .twb-container .history-time {
    color: #cbd5e1 !important;
}

/* Database tools light + dark header, control bar, tabs, query-type labels */
body .twb-container .database-tool .interface-tab.active {
    background: var(--twb-btn-bg) !important;
    background-image: none !important;
    color: #ffffff !important;
    border-color: var(--twb-btn-bg) !important;
}

body .twb-container .database-tool .line-numbers,
body .twb-container .database-tool .line-numbers > div {
    color: #475569 !important;
}

body .twb-container .sql-validator-ultimate .line-numbers,
body .twb-container .sql-validator-ultimate .line-numbers > div,
html[data-theme="dark"] body .twb-container .database-tool .line-numbers,
html[data-theme="dark"] body .twb-container .database-tool .line-numbers > div {
    color: #94a3b8 !important;
}

body .twb-container .query-type-btn:not(.active) small {
    color: var(--twb-ink-2) !important;
}

html[data-theme="dark"] body .twb-container .interface-header,
html[data-theme="dark"] body .twb-container .control-bar {
    background: var(--twb-subtle) !important;
    background-image: none !important;
    color: var(--twb-ink) !important;
    border-color: var(--twb-line) !important;
}

html[data-theme="dark"] body .twb-container .interface-tab:not(.active) {
    background: transparent !important;
    color: var(--twb-ink-2) !important;
}

/* JS Linter & Console Runner dark-editor line numbers & security notice */
body .twb-container .js-linter-tool .line-numbers,
body .twb-container .console-runner-tool .line-numbers {
    color: #94a3b8 !important;
}

body .twb-container .console-runner-tool .security-notice,
body .twb-container .console-runner-tool > div[style*="#dc2626"] {
    background: var(--twb-warn-bg) !important;
    background-image: none !important;
    border: 1px solid var(--twb-warn-border) !important;
    box-shadow: none !important;
    color: var(--twb-ink) !important;
}

body .twb-container .console-runner-tool .security-notice h3,
body .twb-container .console-runner-tool .security-notice p,
body .twb-container .console-runner-tool .security-notice strong,
body .twb-container .console-runner-tool .security-notice div,
body .twb-container .console-runner-tool > div[style*="#dc2626"] h3,
body .twb-container .console-runner-tool > div[style*="#dc2626"] p,
body .twb-container .console-runner-tool > div[style*="#dc2626"] strong,
body .twb-container .console-runner-tool > div[style*="#dc2626"] div,
body .twb-container .console-runner-tool > div[style*="#dc2626"] i {
    color: var(--twb-ink) !important;
    opacity: 1 !important;
}

/* HTML Escape & HTML to Text low-contrast red/pink text on white */
body .twb-container .html-tool .stat-value,
body .twb-container .html-tool .example-box h4,
body .twb-container .converter-tool .stat-value,
body .twb-container .converter-tool .use-case h3,
body .twb-container .converter-tool .mode-explanation h4,
body .twb-container .converter-tool .faq-item h3 {
    color: var(--twb-accent) !important;
}

/* WHOIS Wapiso banner contrast (Light + Dark) */
body .twb-container .whois-tool .wapiso-banner-text {
    color: #ffffff !important;
}

body .twb-container .whois-tool .wapiso-banner-cta {
    background: #ffffff !important;
    color: #0052a3 !important;
}

html[data-theme="dark"] body .twb-container .whois-tool .wapiso-banner-cta {
    background: #0f172a !important;
    color: #93c5fd !important;
    border: 1px solid rgba(147, 197, 253, 0.35) !important;
}

/* Spam Analyzer, HTML Editor, JS Linter, QR, UUID, JWT, HTTP Headers, Hashers Dark Mode Surface Rescue */
html[data-theme="dark"] body .twb-container .mode-content,
html[data-theme="dark"] body .twb-container .option-card,
html[data-theme="dark"] body .twb-container .editor-container,
html[data-theme="dark"] body .twb-container .editor-toolbar,
html[data-theme="dark"] body .twb-container .editor-header,
html[data-theme="dark"] body .twb-container .lint-controls,
html[data-theme="dark"] body .twb-container .control-panel,
html[data-theme="dark"] body .twb-container .analyzer-card,
html[data-theme="dark"] body .twb-container .entity-reference,
html[data-theme="dark"] body .twb-container .entity-item,
html[data-theme="dark"] body .twb-container .batch-dropzone,
html[data-theme="dark"] body .twb-container .batch-results,
html[data-theme="dark"] body .twb-container .batch-result-item,
html[data-theme="dark"] body .twb-container .sample-content,
html[data-theme="dark"] body .twb-container .process-step,
html[data-theme="dark"] body .twb-container .advanced-features,
html[data-theme="dark"] body .twb-container .practice,
html[data-theme="dark"] body .twb-container .developer-section,
html[data-theme="dark"] body .twb-container .hash-info,
html[data-theme="dark"] body .twb-container .app-item,
html[data-theme="dark"] body .twb-container .technique-card,
html[data-theme="dark"] body .twb-container .claim-info {
    background: var(--twb-surface) !important;
    background-image: none !important;
    color: var(--twb-ink) !important;
    border-color: var(--twb-line) !important;
}

html[data-theme="dark"] body .twb-container .editor-toolbar,
html[data-theme="dark"] body .twb-container .editor-header,
html[data-theme="dark"] body .twb-container .entity-code,
html[data-theme="dark"] body .twb-container .example-btn,
html[data-theme="dark"] body .twb-container .type-tab:not(.active),
html[data-theme="dark"] body .twb-container .download-btn,
html[data-theme="dark"] body .twb-container .btn.btn-sm,
html[data-theme="dark"] body .twb-container .batch-result-password {
    background: var(--twb-subtle) !important;
    background-image: none !important;
    color: var(--twb-ink) !important;
    border-color: var(--twb-line-2) !important;
}

html[data-theme="dark"] body .twb-container .option-card.active {
    background: var(--twb-accent-soft) !important;
    border-color: var(--twb-accent) !important;
}

html[data-theme="dark"] body .twb-container .html-editor-tool .editor-toolbar *,
html[data-theme="dark"] body .twb-container .html-editor-tool .toolbar-divider,
html[data-theme="dark"] body .twb-container .html-editor-tool .status-bar,
html[data-theme="dark"] body .twb-container .html-editor-tool .status-bar > div {
    color: var(--twb-ink-2) !important;
}

/* ---------- Reduced Motion Respect (WCAG 2.2 AA) ---------- */
@media (prefers-reduced-motion: reduce) {
    .twb-header,
    .twb-act-btn,
    .twb-fav-btn.is-pop,
    .twb-arrived,
    .twb-pipe,
    .twb-flash,
    .twb-ink,
    .twb-toast,
    .twb-kbd-backdrop,
    .twb-kbd-dialog,
    .twb-sw-dialog {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}
