/* ============================================================================
   Password Generator (rebuilt 2026-10-12)
   Everything is scoped to .pwg (the tool container) or a pwg- class.
   Light mode default, dark mode via [data-theme="dark"] on <html>. Accent #339966.
   ========================================================================== */
.pwg {
    --pwg-primary: #339966;
    --pwg-primary-dark: #25764e;
    --pwg-primary-soft: rgba(51, 153, 102, 0.12);
    --pwg-primary-mid: rgba(51, 153, 102, 0.28);
    --pwg-btn: #2b7f56;
    --pwg-btn-hover: #226a47;
    --pwg-success: #2f8f5f;
    --pwg-success-soft: rgba(51, 153, 102, 0.12);
    --pwg-danger: #d64545;
    --pwg-danger-soft: rgba(230, 78, 78, 0.10);
    --pwg-warning: #b7791f;
    --pwg-warning-soft: rgba(245, 158, 11, 0.12);
    --pwg-elevated: #ffffff;
    --pwg-bg-2: #f1f5f9;
    --pwg-text: #1e293b;
    --pwg-text-2: #475569;
    --pwg-muted: #64748b;
    --pwg-border: #e2e8f0;
    --pwg-border-strong: #cbd5e1;
    --pwg-code-bg: #f8fafc;
    --pwg-switch-off: #cbd5e1;
    --pwg-switch-off-border: #94a3b8;
    --pwg-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    --pwg-shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.18);
    --pwg-r-sm: 8px;
    --pwg-r-md: 12px;
    --pwg-r-lg: 16px;
    --tool-accent: #339966;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
    color: var(--pwg-text);
    box-sizing: border-box;
}
[data-theme="dark"] .pwg {
    --pwg-primary: #4cc38a;
    --pwg-primary-dark: #7fd8ad;
    --pwg-primary-soft: rgba(76, 195, 138, 0.15);
    --pwg-primary-mid: rgba(76, 195, 138, 0.32);
    --pwg-success: #4ade80;
    --pwg-success-soft: rgba(74, 222, 128, 0.14);
    --pwg-danger: #f87171;
    --pwg-danger-soft: rgba(248, 113, 113, 0.14);
    --pwg-warning: #fbbf24;
    --pwg-warning-soft: rgba(251, 191, 36, 0.14);
    --pwg-elevated: #1e293b;
    --pwg-bg-2: #273449;
    --pwg-text: #f1f5f9;
    --pwg-text-2: #cbd5e1;
    --pwg-muted: #94a3b8;
    --pwg-border: #334155;
    --pwg-border-strong: #475569;
    --pwg-code-bg: #0f172a;
    --pwg-switch-off: #475569;
    --pwg-switch-off-border: #64748b;
    --pwg-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    --pwg-shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.5);
}
.pwg *, .pwg *::before, .pwg *::after { box-sizing: border-box; }
.pwg [hidden] { display: none !important; }
.pwg button { width: auto; }   /* custom_styles.css makes every button 100% wide under 768px */
.pwg a { color: var(--pwg-primary); }
.pwg a:hover { color: var(--pwg-primary-dark); }
.pwg i[data-lucide], .pwg svg.lucide { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- breadcrumb + header ---------- */
.pwg .pwg-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; font-size: 0.82rem; color: var(--pwg-muted); margin: 0 0 1.1rem; }
.pwg .pwg-crumbs a { color: var(--pwg-muted); text-decoration: none; }
.pwg .pwg-crumbs a:hover { color: var(--pwg-primary); text-decoration: underline; }
.pwg .pwg-crumbs svg { width: 13px; height: 13px; }
.pwg .pwg-header { text-align: center; margin-bottom: 1.75rem; }
.pwg .pwg-title-row { display: flex; align-items: center; justify-content: center; gap: 0.85rem; margin-bottom: 0.85rem; }
.pwg .pwg-title-icon { width: 56px; height: 56px; border-radius: var(--pwg-r-md); background: var(--pwg-primary); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
[data-theme="dark"] .pwg .pwg-title-icon { background: #2b7f56; }
.pwg .pwg-title-icon svg, .pwg .pwg-title-icon i { width: 28px; height: 28px; display: block; }
.pwg .pwg-title { margin: 0; color: var(--pwg-primary); font-size: clamp(1.75rem, 4vw, 2.4rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.pwg .pwg-desc { max-width: 900px; margin: 0 auto; color: var(--pwg-text-2); font-size: 1.05rem; line-height: 1.7; }

/* ---------- messages ---------- */
.pwg .pwg-error { display: flex; gap: 0.75rem; align-items: flex-start; background: var(--pwg-danger-soft); border: 1px solid var(--pwg-danger); color: var(--pwg-text); border-radius: var(--pwg-r-md); padding: 0.85rem 1rem; margin: 0 0 1rem; }
.pwg .pwg-error > svg { color: var(--pwg-danger); margin-top: 2px; }
.pwg .pwg-error p { margin: 0; line-height: 1.55; }
.pwg .pwg-error-body { flex: 1; min-width: 0; }
.pwg .pwg-x { background: none; border: 0; color: var(--pwg-muted); cursor: pointer; padding: 2px; border-radius: 6px; display: inline-flex; }
.pwg .pwg-x:hover { color: var(--pwg-text); background: var(--pwg-bg-2); }
.pwg .pwg-note { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.85rem; padding: 0.6rem 0.75rem 0.6rem 0.9rem; border: 1px solid rgba(51, 153, 102, 0.35); border-radius: var(--pwg-r-md); background: var(--pwg-success-soft); color: var(--pwg-text); font-size: 0.92rem; }
.pwg .pwg-note.is-hint { border-color: rgba(245, 158, 11, 0.4); background: var(--pwg-warning-soft); }
.pwg .pwg-note-icon { display: inline-flex; color: var(--pwg-success); flex-shrink: 0; }
.pwg .pwg-note.is-hint .pwg-note-icon { color: var(--pwg-warning); }
.pwg .pwg-note > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* ---------- cards ---------- */
.pwg .pwg-card { background: var(--pwg-elevated); border: 1px solid var(--pwg-border); border-radius: var(--pwg-r-lg); padding: 1.25rem; box-shadow: var(--pwg-shadow); min-width: 0; }
.pwg .pwg-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.75rem; min-width: 0; flex-wrap: wrap; }
.pwg .pwg-panel-head h2 { display: flex; align-items: center; gap: 0.45rem; margin: 0; font-size: 1rem; font-weight: 700; color: var(--pwg-text); white-space: nowrap; }
.pwg .pwg-panel-head h2 svg { color: var(--pwg-primary); }
.pwg .pwg-chip { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; font-weight: 700; min-width: 0; color: var(--pwg-primary); background: var(--pwg-primary-soft); border-radius: 6px; padding: 0.18rem 0.55rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pwg .pwg-chip.pwg-chip-warn { color: var(--pwg-warning); background: var(--pwg-warning-soft); }
.pwg .pwg-chip svg { width: 13px; height: 13px; }

/* ---------- upload ---------- */
.pwg .pwg-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.45rem; min-height: 240px; padding: 2.25rem 1.25rem; text-align: center; cursor: pointer; border: 2px dashed var(--pwg-border-strong); border-radius: var(--pwg-r-lg); background: var(--pwg-elevated); transition: border-color 0.2s ease, background-color 0.2s ease; }
.pwg .pwg-drop:hover, .pwg .pwg-drop.pwg-over, .pwg .pwg-drop:focus-within { border-color: var(--pwg-primary); background: var(--pwg-primary-soft); }
.pwg .pwg-drop-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--pwg-primary-soft); color: var(--pwg-primary); display: flex; align-items: center; justify-content: center; margin-bottom: 0.35rem; }
.pwg .pwg-drop-icon svg { width: 30px; height: 30px; }
.pwg .pwg-drop strong { font-size: 1.25rem; color: var(--pwg-text); }
.pwg .pwg-drop-link { color: var(--pwg-primary); text-decoration: underline; text-underline-offset: 3px; }
.pwg .pwg-drop-sub { color: var(--pwg-muted); font-size: 0.92rem; }
.pwg .pwg-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 0.6rem; }
.pwg .pwg-badge { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.65rem; border-radius: 999px; background: var(--pwg-bg-2); color: var(--pwg-text-2); font-size: 0.8rem; font-weight: 600; }
.pwg .pwg-badge svg { width: 14px; height: 14px; color: var(--pwg-success); }
.pwg .pwg-under { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 0.85rem; }

/* ConvertICO ring loader */
.pwg .pwg-loader { display: block; width: 32px; height: 32px; overflow: visible; flex-shrink: 0; --cico-outer: #f2534e; --cico-outer-soft: #f8d3d1; --cico-mid: #31ae77; --cico-mid-soft: #d0e7dd; --cico-inner: #2b9edb; }
[data-theme="dark"] .pwg .pwg-loader { --cico-outer-soft: rgba(242, 83, 78, 0.22); --cico-mid-soft: rgba(49, 174, 119, 0.22); }
.pwg .pwg-loader circle { fill: none; stroke-width: 72; transform-box: fill-box; transform-origin: center; }
.pwg .pwg-loader .bp { stroke: var(--cico-outer-soft); }
.pwg .pwg-loader .gp { stroke: var(--cico-mid-soft); }
.pwg .pwg-loader .b { stroke: var(--cico-outer); stroke-linecap: round; stroke-dasharray: 35.3 100; animation: pwgSpinL 1.3s linear infinite; }
.pwg .pwg-loader .g { stroke: var(--cico-mid); stroke-linecap: round; stroke-dasharray: 75.8 100; animation: pwgSpinR 2.1s linear infinite; }
.pwg .pwg-loader .r { stroke: var(--cico-inner); animation: pwgBreathe 1.3s ease-in-out infinite; }
@keyframes pwgSpinL { from { transform: rotate(117deg); } to { transform: rotate(-243deg); } }
@keyframes pwgSpinR { from { transform: rotate(36deg); } to { transform: rotate(396deg); } }
@keyframes pwgBreathe { 50% { transform: scale(0.9); } }
@media (prefers-reduced-motion: reduce) { .pwg .pwg-loader .b { animation-duration: 4s; } .pwg .pwg-loader .g { animation-duration: 6s; } .pwg .pwg-loader .r { animation: none; } }
.pwg .pwg-reading { display: flex; align-items: center; justify-content: center; gap: 0.6rem; padding: 0.75rem; color: var(--pwg-muted); font-size: 0.92rem; }

/* ---------- buttons ---------- */
.pwg .pwg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 44px; padding: 0.6rem 1.15rem; border-radius: var(--pwg-r-md); font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer; text-decoration: none; border: 1px solid transparent; transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease; margin: 0; }
.pwg .pwg-btn:focus-visible { outline: 2px solid var(--pwg-primary); outline-offset: 2px; }
.pwg .pwg-btn-primary { background: var(--pwg-btn); color: #fff; }
.pwg .pwg-btn-primary:hover { background: var(--pwg-btn-hover); color: #fff; }
.pwg .pwg-btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.pwg .pwg-btn-ghost { background: var(--pwg-elevated); color: var(--pwg-text); border-color: var(--pwg-border-strong); }
.pwg .pwg-btn-ghost:hover { border-color: var(--pwg-primary); color: var(--pwg-primary); }
.pwg .pwg-btn-ghost:disabled { opacity: 0.5; cursor: not-allowed; }
.pwg .pwg-btn-sm { white-space: nowrap; flex-shrink: 0; min-height: 34px; padding: 0.35rem 0.75rem; font-size: 0.85rem; border-radius: var(--pwg-r-sm); }
.pwg .pwg-btn-sm svg { width: 15px; height: 15px; }
.pwg .pwg-link-btn { background: none; border: 0; padding: 0.25rem; font: inherit; font-size: 0.85rem; color: var(--pwg-muted); cursor: pointer; display: inline-flex; align-items: center; gap: 0.3rem; margin: 0; }
.pwg .pwg-link-btn:hover { color: var(--pwg-primary); }
.pwg .pwg-link-btn.pwg-danger:hover { color: var(--pwg-danger); }
.pwg .pwg-link-btn svg { width: 15px; height: 15px; }
.pwg .pwg-icon-btn { width: 34px; height: 34px; padding: 0; margin: 0; border-radius: var(--pwg-r-sm); border: 1px solid var(--pwg-border); background: var(--pwg-elevated); color: var(--pwg-text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.pwg .pwg-icon-btn:hover { border-color: var(--pwg-primary); color: var(--pwg-primary); }
.pwg .pwg-icon-btn.pwg-danger:hover { border-color: var(--pwg-danger); color: var(--pwg-danger); }
.pwg .pwg-icon-btn svg { width: 16px; height: 16px; }
.pwg .pwg-icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pwg .pwg-actions { display: flex; justify-content: flex-end; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; align-items: center; }
.pwg .pwg-kbd { font-size: 0.75rem; color: var(--pwg-muted); margin-right: auto; }
.pwg kbd { font: inherit; font-size: 0.72rem; border: 1px solid var(--pwg-border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 0.3rem; background: var(--pwg-elevated); color: var(--pwg-text-2); }

/* ---------- layout ---------- */
.pwg .pwg-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.pwg .pwg-grid > * { min-width: 0; }
.pwg .pwg-col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.pwg .pwg-block { background: var(--pwg-elevated); border: 1px solid var(--pwg-border); border-radius: var(--pwg-r-md); padding: 0.9rem 1rem; margin-bottom: 0.875rem; }
.pwg .pwg-caption { display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pwg-muted); margin: 0 0 0.45rem; }
.pwg .pwg-hint { font-size: 0.8rem; color: var(--pwg-muted); margin: 0.45rem 0 0; line-height: 1.45; }

/* segmented choices */
.pwg .pwg-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.35rem; }
.pwg .pwg-seg-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pwg .pwg-seg-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pwg .pwg-seg-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pwg .pwg-qcard { display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; padding: 0.5rem 0.6rem; min-height: 50px; min-width: 0; margin: 0; border: 1px solid var(--pwg-border-strong); border-radius: var(--pwg-r-sm); background: var(--pwg-elevated); cursor: pointer; font: inherit; text-align: left; color: var(--pwg-text); }
.pwg .pwg-qcard b { font-size: 0.86rem; }
.pwg .pwg-qcard span { font-size: 0.72rem; color: var(--pwg-muted); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pwg .pwg-qcard:hover { border-color: var(--pwg-primary); }
.pwg .pwg-qcard.pwg-on { border-color: var(--pwg-primary); background: var(--pwg-primary-soft); box-shadow: inset 0 0 0 1px var(--pwg-primary); }
.pwg .pwg-qcard.pwg-on b { color: var(--pwg-primary); }
.pwg .pwg-qcard > svg { width: 18px; height: 18px; color: var(--pwg-primary); margin-bottom: 0.15rem; }
.pwg .pwg-q { min-height: 34px; padding: 0.3rem 0.5rem; margin: 0; border: 1px solid var(--pwg-border-strong); border-radius: var(--pwg-r-sm); background: var(--pwg-elevated); color: var(--pwg-text); font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; line-height: 1.2; }
.pwg .pwg-q:hover { border-color: var(--pwg-primary); }
.pwg .pwg-q.pwg-on { background: var(--pwg-primary-soft); border-color: var(--pwg-primary); color: var(--pwg-primary); }

/* progressive disclosure rows */
.pwg .pwg-adv { background: var(--pwg-elevated); border: 1px solid var(--pwg-border); border-radius: var(--pwg-r-md); overflow: hidden; margin-bottom: 0.875rem; }
.pwg .pwg-adv-row + .pwg-adv-row { border-top: 1px solid var(--pwg-border); }
.pwg .pwg-adv-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 52px; padding: 0.6rem 0.9rem; margin: 0; background: none; border: 0; border-radius: 0; cursor: pointer; text-align: left; font: inherit; color: var(--pwg-text); }
.pwg .pwg-adv-head:hover { background: var(--pwg-bg-2); }
.pwg .pwg-adv-head:focus-visible { outline: 2px solid var(--pwg-primary); outline-offset: -2px; }
.pwg .pwg-adv-left, .pwg .pwg-adv-right { display: inline-flex; align-items: center; gap: 0.6rem; min-width: 0; }
.pwg .pwg-adv-right { flex-shrink: 0; gap: 0.5rem; }
.pwg .pwg-adv-left > svg { width: 16px; height: 16px; color: var(--pwg-primary); }
.pwg .pwg-adv-text { display: flex; flex-direction: column; min-width: 0; }
.pwg .pwg-adv-title { font-size: 0.86rem; font-weight: 600; color: var(--pwg-text); white-space: nowrap; }
.pwg .pwg-adv-hint { font-size: 0.75rem; color: var(--pwg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pwg .pwg-adv-value { font-size: 0.76rem; font-weight: 700; color: var(--pwg-primary); background: var(--pwg-primary-soft); border-radius: 6px; padding: 0.15rem 0.5rem; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pwg .pwg-adv-chev { width: 16px; height: 16px; color: var(--pwg-muted); transition: transform 0.2s ease; }
.pwg .pwg-adv-row.pwg-open .pwg-adv-chev { transform: rotate(180deg); }
.pwg .pwg-adv-row.pwg-open .pwg-adv-head, .pwg .pwg-adv-row.pwg-open .pwg-adv-body { background: var(--pwg-bg-2); }
.pwg .pwg-adv-body { padding: 0.25rem 0.9rem 0.9rem; display: flex; flex-direction: column; gap: 0.6rem; }
.pwg .pwg-subrow { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding-top: 0.2rem; }
.pwg .pwg-subrow-text { display: flex; flex-direction: column; min-width: 0; }
.pwg .pwg-subrow-text b { font-size: 0.84rem; color: var(--pwg-text); font-weight: 600; }
.pwg .pwg-subrow-text span { font-size: 0.74rem; color: var(--pwg-muted); line-height: 1.4; }
.pwg .pwg-switchwrap { display: inline-flex; align-items: center; gap: 0.45rem; flex-shrink: 0; }
.pwg .pwg-state { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; color: var(--pwg-muted); min-width: 26px; text-align: right; }
.pwg .pwg-state.pwg-on { color: var(--pwg-primary); }

/* form fields */
.pwg .pwg-field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.pwg .pwg-field > span { font-size: 0.78rem; font-weight: 700; color: var(--pwg-text-2); }
.pwg .pwg-input, .pwg .pwg-select { width: 100%; min-width: 0; height: 38px; margin: 0; padding: 0 0.6rem; border: 1px solid var(--pwg-border-strong); border-radius: var(--pwg-r-sm); background: var(--pwg-elevated); color: var(--pwg-text); font: inherit; font-size: 0.9rem; }
.pwg .pwg-select { padding-right: 1.6rem; }
.pwg .pwg-input:focus, .pwg .pwg-select:focus { outline: none; border-color: var(--pwg-primary); box-shadow: 0 0 0 3px var(--pwg-primary-soft); }
.pwg .pwg-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.6rem; }
.pwg .pwg-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.pwg .pwg-stepper { display: flex; align-items: stretch; border: 1px solid var(--pwg-border-strong); border-radius: var(--pwg-r-sm); overflow: hidden; background: var(--pwg-elevated); min-width: 0; }
.pwg .pwg-stepper:focus-within { border-color: var(--pwg-primary); box-shadow: 0 0 0 3px var(--pwg-primary-soft); }
.pwg .pwg-stepper button { flex: 0 0 34px; border: 0; margin: 0; background: var(--pwg-bg-2); color: var(--pwg-text-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; border-radius: 0; }
.pwg .pwg-stepper button:hover { color: var(--pwg-primary); }
.pwg .pwg-stepper button svg { width: 15px; height: 15px; }
.pwg .pwg-stepper input { flex: 1; min-width: 0; width: 100%; border: 0; margin: 0; background: transparent; color: var(--pwg-text); text-align: center; font: inherit; font-size: 0.95rem; font-weight: 600; padding: 0.45rem 0.2rem; -moz-appearance: textfield; appearance: textfield; font-variant-numeric: tabular-nums; }
.pwg .pwg-stepper input::-webkit-outer-spin-button, .pwg .pwg-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pwg .pwg-stepper input:focus { outline: none; }
.pwg .pwg-unit { display: inline-flex; align-items: center; padding: 0 0.5rem; font-size: 0.78rem; color: var(--pwg-muted); font-weight: 700; background: var(--pwg-bg-2); }
.pwg .pwg-range { width: 100%; accent-color: var(--pwg-primary); margin: 0.2rem 0; }
.pwg .pwg-range-head { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--pwg-muted); }
.pwg .pwg-range-head b { color: var(--pwg-primary); }

/* switch - must out-specify the site-wide checkbox style in custom_styles.css */
.tool-container input[type="checkbox"].pwg-switch {
    -webkit-appearance: none !important; -moz-appearance: none !important; appearance: none !important;
    box-sizing: border-box !important; position: relative !important; display: inline-block !important;
    width: 44px !important; min-width: 44px !important; max-width: 44px !important;
    height: 24px !important; min-height: 24px !important; padding: 0 !important; margin: 0 !important;
    border: 1px solid var(--pwg-switch-off-border) !important; border-radius: 999px !important;
    background: var(--pwg-switch-off) !important; background-color: var(--pwg-switch-off) !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08) !important; cursor: pointer !important; flex-shrink: 0 !important;
    outline: none !important; vertical-align: middle !important; transition: background-color 0.2s ease, border-color 0.2s ease !important;
}
.tool-container input[type="checkbox"].pwg-switch:hover { border-color: var(--pwg-primary) !important; }
.tool-container input[type="checkbox"].pwg-switch:checked { background: var(--pwg-primary) !important; background-color: var(--pwg-primary) !important; border-color: var(--pwg-primary) !important; box-shadow: none !important; }
.tool-container input[type="checkbox"].pwg-switch::after,
.tool-container input[type="checkbox"].pwg-switch:checked::after {
    content: '' !important; position: absolute !important; display: block !important; top: 2px !important; left: 2px !important; right: auto !important; bottom: auto !important;
    width: 18px !important; height: 18px !important; margin: 0 !important; padding: 0 !important; font-size: 0 !important; line-height: 0 !important;
    border-radius: 50% !important; border: 1px solid rgba(0, 0, 0, 0.12) !important; background: #fff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important; transform: none !important; transition: transform 0.2s ease !important;
}
.tool-container input[type="checkbox"].pwg-switch:checked::after { transform: translateX(20px) !important; }
.tool-container input[type="checkbox"].pwg-switch:focus-visible { outline: 2px solid var(--pwg-primary) !important; outline-offset: 2px !important; }

/* summary + guards */
.pwg .pwg-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; background: var(--pwg-primary-soft); border-radius: var(--pwg-r-md); padding: 0.75rem 0.9rem; }
.pwg .pwg-sum-item { display: flex; flex-direction: column; min-width: 0; }
.pwg .pwg-sum-item span { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--pwg-muted); font-weight: 700; white-space: nowrap; }
.pwg .pwg-sum-item b { font-size: 1.02rem; color: var(--pwg-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.pwg .pwg-guard { display: flex; gap: 0.6rem; align-items: flex-start; margin-top: 0.75rem; padding: 0.65rem 0.8rem; border-radius: var(--pwg-r-md); font-size: 0.84rem; line-height: 1.5; background: var(--pwg-primary-soft); color: var(--pwg-text); border: 1px solid transparent; }
.pwg .pwg-guard svg { width: 17px; height: 17px; color: var(--pwg-primary); margin-top: 1px; }
.pwg .pwg-guard.pwg-warn { background: var(--pwg-warning-soft); border-color: rgba(245, 158, 11, 0.35); }
.pwg .pwg-guard.pwg-warn svg { color: var(--pwg-warning); }
.pwg .pwg-guard p { margin: 0; }
.pwg .pwg-guard .pwg-link-btn { padding: 0; font-size: inherit; color: var(--pwg-primary); text-decoration: underline; }

/* code / text panes */
.pwg .pwg-tabs { display: flex; gap: 0.3rem; background: var(--pwg-bg-2); padding: 0.3rem; border-radius: var(--pwg-r-md); margin-bottom: 0.75rem; overflow-x: auto; }
.pwg .pwg-tab { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; min-height: 38px; padding: 0.35rem 0.8rem; margin: 0; border: 0; border-radius: 9px; background: transparent; color: var(--pwg-text-2); font: inherit; font-size: 0.86rem; font-weight: 600; cursor: pointer; white-space: nowrap; flex: 1 0 auto; }
.pwg .pwg-tab svg { width: 15px; height: 15px; }
.pwg .pwg-tab.pwg-on { background: var(--pwg-elevated); color: var(--pwg-primary); box-shadow: var(--pwg-shadow); }
.pwg .pwg-tab:focus-visible { outline: 2px solid var(--pwg-primary); outline-offset: 1px; }
.pwg .pwg-code { display: block; width: 100%; min-height: 300px; max-height: 520px; margin: 0; padding: 0.85rem 0.95rem; border: 1px solid var(--pwg-border); border-radius: var(--pwg-r-md); background: var(--pwg-code-bg); color: var(--pwg-text); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 0.84rem; line-height: 1.55; resize: vertical; white-space: pre; overflow: auto; tab-size: 4; }
.pwg .pwg-code:focus { outline: none; border-color: var(--pwg-primary); box-shadow: 0 0 0 3px var(--pwg-primary-soft); }
.pwg .pwg-code[readonly] { cursor: text; }
.pwg .pwg-stats { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.7rem; }
.pwg .pwg-stat { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; padding: 0.22rem 0.6rem; border-radius: 999px; background: var(--pwg-bg-2); color: var(--pwg-text-2); white-space: nowrap; }
.pwg .pwg-stat b { color: var(--pwg-text); }
.pwg .pwg-stat svg { width: 13px; height: 13px; }
.pwg .pwg-stat.pwg-good { background: var(--pwg-success-soft); color: var(--pwg-success); }
.pwg .pwg-stat.pwg-good b { color: var(--pwg-success); }
.pwg .pwg-stat.pwg-bad { background: var(--pwg-warning-soft); color: var(--pwg-warning); }
.pwg .pwg-stat.pwg-bad b { color: var(--pwg-warning); }

/* file list */
.pwg .pwg-list { display: flex; flex-direction: column; gap: 0.4rem; max-height: 360px; overflow-y: auto; min-width: 0; }
.pwg .pwg-item { display: flex; align-items: center; gap: 0.5rem; min-width: 0; border: 1px solid var(--pwg-border); border-radius: var(--pwg-r-md); background: var(--pwg-elevated); padding: 0.45rem 0.45rem 0.45rem 0.6rem; }
.pwg .pwg-item.pwg-on { border-color: var(--pwg-primary); background: var(--pwg-primary-soft); }
.pwg .pwg-item-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.6rem; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.pwg .pwg-item-main:focus-visible { outline: 2px solid var(--pwg-primary); outline-offset: 2px; border-radius: 8px; }
.pwg .pwg-fmt { flex: 0 0 auto; min-width: 46px; height: 30px; padding: 0 0.4rem; border-radius: 7px; background: var(--pwg-primary-soft); color: var(--pwg-primary); font-size: 0.72rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; letter-spacing: 0.03em; }
.pwg .pwg-item-text { display: flex; flex-direction: column; min-width: 0; gap: 0.1rem; }
.pwg .pwg-item-name { font-size: 0.86rem; font-weight: 700; color: var(--pwg-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pwg .pwg-item-meta { font-size: 0.74rem; color: var(--pwg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pwg .pwg-item-meta.pwg-warn-text { color: var(--pwg-warning); }

/* info sections */
.tool-container .pwg-info { margin-top: 2rem; display: flex; flex-direction: column; gap: 1rem; }
.pwg .pwg-info-card { background: var(--pwg-elevated); border: 1px solid var(--pwg-border); border-radius: var(--pwg-r-lg); padding: 1.4rem 1.5rem; }
.pwg .pwg-info-card h2 { display: flex; align-items: center; gap: 0.55rem; margin: 0 0 0.85rem; font-size: 1.3rem; color: var(--pwg-text); }
.pwg .pwg-info-card h2 svg { width: 22px; height: 22px; color: var(--pwg-primary); }
.pwg .pwg-info-card h3 { margin: 0 0 0.35rem; font-size: 1rem; color: var(--pwg-text); }
.pwg .pwg-info-card p, .pwg .pwg-info-card li { color: var(--pwg-text-2); line-height: 1.7; font-size: 0.97rem; }
.pwg .pwg-info-card p { margin: 0 0 0.75rem; }
.pwg .pwg-info-card p:last-child { margin-bottom: 0; }
.pwg .pwg-ul { margin: 0 0 0.75rem; padding-left: 1.2rem; }
.pwg .pwg-ul li { margin-bottom: 0.35rem; }
.pwg .pwg-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; }
.pwg .pwg-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pwg .pwg-two > div { background: var(--pwg-bg-2); border-radius: var(--pwg-r-md); padding: 0.9rem 1rem; min-width: 0; }
.pwg .pwg-two p { font-size: 0.92rem; margin: 0 0 0.5rem; }
.pwg .pwg-tag { display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.15rem 0.5rem; border-radius: 6px; background: var(--pwg-primary-soft); color: var(--pwg-primary); margin-bottom: 0.4rem; }
.pwg .pwg-table-wrap { overflow-x: auto; border: 1px solid var(--pwg-border); border-radius: var(--pwg-r-md); margin-bottom: 0.75rem; }
.pwg .pwg-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 480px; }
.pwg .pwg-table th, .pwg .pwg-table td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--pwg-border); color: var(--pwg-text-2); vertical-align: top; }
.pwg .pwg-table th { background: var(--pwg-bg-2); color: var(--pwg-text); font-weight: 700; font-size: 0.82rem; }
.pwg .pwg-table tr:last-child td { border-bottom: 0; }
.pwg .pwg-table td:first-child { font-weight: 600; color: var(--pwg-text); white-space: nowrap; }
.pwg code.pwg-inline { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.86em; background: var(--pwg-bg-2); padding: 0.05rem 0.35rem; border-radius: 5px; color: var(--pwg-text); }

/* toast */
.pwg .pwg-toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 9500; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1rem; border-radius: 999px; background: #1e293b; color: #fff; font-size: 0.9rem; font-weight: 600; box-shadow: var(--pwg-shadow-lg); max-width: calc(100vw - 2rem); }
[data-theme="dark"] .pwg .pwg-toast { background: #f1f5f9; color: #0f172a; }
.pwg .pwg-toast svg { width: 16px; height: 16px; color: #4ade80; }
[data-theme="dark"] .pwg .pwg-toast svg { color: #2f8f5f; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
    .pwg .pwg-grid { grid-template-columns: minmax(0, 1fr); }
    .pwg .pwg-three { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
    .pwg { padding: 1.25rem 0.75rem 2.5rem; }
    .pwg .pwg-title-icon { width: 46px; height: 46px; }
    .pwg .pwg-title-icon svg { width: 24px; height: 24px; }
    .pwg .pwg-card { padding: 0.9rem; }
    .pwg .pwg-block { padding: 0.8rem; }
    .pwg .pwg-pair { grid-template-columns: minmax(0, 1fr); }
    .pwg .pwg-seg-4, .pwg .pwg-seg-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pwg .pwg-two { grid-template-columns: minmax(0, 1fr); }
    .pwg .pwg-adv-hint { white-space: normal; }
    .pwg .pwg-info-card { padding: 1.1rem; }
    .pwg .pwg-kbd { display: none; }
    .pwg .pwg-actions .pwg-btn { flex: 1 1 auto; }
    .pwg .pwg-summary { padding: 0.65rem 0.7rem; }
    .pwg .pwg-sum-item b { font-size: 0.92rem; }
    .pwg .pwg-code { min-height: 240px; font-size: 0.8rem; }
}

/* ============================================================================
   Password Generator - tool parts
   ========================================================================== */
.pwg .pwg-main { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.pwg .pwg-main > * { min-width: 0; }
.pwg .pwg-noscript { text-align: center; color: var(--pwg-danger); }
.pwg .pwg-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.3rem; background: var(--pwg-bg-2); padding: 0.3rem; border-radius: var(--pwg-r-md); margin-bottom: 1rem; }
.pwg .pwg-mode { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 42px; padding: 0.4rem 0.5rem; margin: 0; border: 0; border-radius: 9px; background: transparent; color: var(--pwg-text-2); font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.pwg .pwg-mode svg { width: 16px; height: 16px; }
.pwg .pwg-mode.pwg-on { background: var(--pwg-elevated); color: var(--pwg-primary); box-shadow: var(--pwg-shadow); }
.pwg .pwg-outbox { display: flex; align-items: center; gap: 0.6rem; padding: 1rem 0.75rem 1rem 1.1rem; border: 1px solid var(--pwg-border-strong); border-radius: var(--pwg-r-md); background: var(--pwg-code-bg); min-height: 92px; }
.pwg .pwg-out { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: clamp(1.15rem, 3vw, 1.55rem); font-weight: 600; color: var(--pwg-text); line-height: 1.45; word-break: break-all; cursor: copy; letter-spacing: 0.02em; }
.pwg .pwg-out.pwg-out-long { font-size: clamp(0.9rem, 2.2vw, 1.05rem); }
.pwg .pwg-out .pwg-c-d { color: #1f78a8; }
.pwg .pwg-out .pwg-c-s { color: #c2410c; }
[data-theme="dark"] .pwg .pwg-out .pwg-c-d { color: #7cccf0; }
[data-theme="dark"] .pwg .pwg-out .pwg-c-s { color: #fdba74; }
.pwg .pwg-out-err { font-family: inherit; font-size: 0.95rem; color: var(--pwg-danger); font-weight: 600; }
.pwg .pwg-out.pwg-flash { animation: pwgFlash 0.35s ease; }
@keyframes pwgFlash { from { opacity: 0.35; } to { opacity: 1; } }
.pwg .pwg-big { width: 46px; height: 46px; border-radius: 12px; }
.pwg .pwg-big svg { width: 20px; height: 20px; }
.pwg .pwg-meter { height: 8px; border-radius: 999px; background: var(--pwg-bg-2); overflow: hidden; margin: 0.9rem 0 0.55rem; }
.pwg .pwg-meter-fill { height: 100%; width: 0; border-radius: 999px; transition: width 0.3s ease, background-color 0.3s ease; background: var(--pwg-danger); }
.pwg .pwg-lv0 .pwg-meter-fill { background: #dc2626; }
.pwg .pwg-lv1 .pwg-meter-fill { background: #ea580c; }
.pwg .pwg-lv2 .pwg-meter-fill { background: #ca8a04; }
.pwg .pwg-lv3 .pwg-meter-fill { background: #339966; }
.pwg .pwg-lv4 .pwg-meter-fill { background: #25764e; }
[data-theme="dark"] .pwg .pwg-lv4 .pwg-meter-fill { background: #4cc38a; }
.pwg .pwg-strength { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.pwg .pwg-level { font-weight: 800; color: var(--pwg-text); margin-right: 0.2rem; }
.pwg .pwg-chip-plain { color: var(--pwg-text-2); background: var(--pwg-bg-2); }
.pwg .pwg-crack { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.5rem; margin-top: 0.85rem; }
.pwg .pwg-crack > div { background: var(--pwg-bg-2); border-radius: var(--pwg-r-md); padding: 0.6rem 0.75rem; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.pwg .pwg-crack span { font-size: 0.72rem; color: var(--pwg-muted); font-weight: 600; }
.pwg .pwg-crack b { font-size: 0.95rem; color: var(--pwg-text); }
.pwg .pwg-lenrow { display: flex; align-items: center; gap: 0.75rem; }
.pwg .pwg-lenrow .pwg-range { flex: 1; min-width: 0; }
.pwg .pwg-stepper-sm { width: 132px; flex: 0 0 auto; }
.pwg .pwg-stepper-wide { max-width: 220px; margin: 0.3rem 0 0.9rem; }
.pwg .pwg-range-head span { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 700; color: var(--pwg-text-2); }
.pwg .pwg-range-head span svg { width: 15px; height: 15px; color: var(--pwg-primary); }
.pwg .pwg-range-head b { font-size: 1rem; }
.pwg .pwg-quick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.35rem; margin: 0.6rem 0 1rem; }
.pwg .pwg-toggles { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.45rem; margin-bottom: 0.85rem; }
.pwg .pwg-toggle { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem; border: 1px solid var(--pwg-border); border-radius: var(--pwg-r-md); cursor: pointer; margin: 0; min-width: 0; font-size: 0.86rem; color: var(--pwg-text-2); }
.pwg .pwg-toggle b { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--pwg-text); margin-right: 0.25rem; }
.pwg .pwg-toggle:hover { border-color: var(--pwg-primary); }
.pwg .pwg-mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.pwg .pwg-adv { padding: 0.2rem 0.9rem 0.7rem; margin-top: 0.85rem; }
.pwg .pwg-adv .pwg-subrow { padding-top: 0.55rem; }
.pwg .pwg-pair { margin-bottom: 0.2rem; }
.pwg .pwg-bulk { border-top: 1px solid var(--pwg-border); margin-top: 1rem; padding-top: 0.9rem; display: flex; flex-direction: column; gap: 0.55rem; }
.pwg .pwg-bulk .pwg-caption { margin: 0; }
.pwg .pwg-bulk .pwg-code { min-height: 160px; max-height: 260px; }
.pwg .pwg-row-end { justify-content: flex-end; }
.pwg .pwg-private { display: block; font-size: 0.8rem; color: var(--pwg-muted); margin: 0.9rem 0 0; line-height: 1.5; }
.pwg .pwg-private svg { width: 15px; height: 15px; color: var(--pwg-success); vertical-align: -3px; margin-right: 0.2rem; }
.pwg .pwg-result .pwg-actions { margin-top: 1rem; }
@media (max-width: 860px) {
    .pwg .pwg-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
    .pwg .pwg-toggles, .pwg .pwg-crack { grid-template-columns: minmax(0, 1fr); }
    .pwg .pwg-mode svg { display: none; }
    .pwg .pwg-lenrow { flex-wrap: wrap; }
}
