.pwd-gen-section {
    --tool-accent: #6366F1;
    --tool-accent-rgb: 99, 102, 241;
}

/* ── Mode tabs (5 tabs, scrollable on mobile) ── */
.pwd-mode-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px;
    border-radius: 10px;
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap;
}

.pwd-mode-tabs::-webkit-scrollbar {
    display: none;
}

.pwd-mode-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--tool-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s, color 0.18s;
}

.pwd-mode-tab--active {
    background: var(--tool-accent);
    color: #fff;
}

.pwd-mode-tab:not(.pwd-mode-tab--active):hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--tool-text-primary);
}

/* ── Length slider row ── */
.pwd-length-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.pwd-slider {
    flex: 1;
    accent-color: var(--tool-accent);
    cursor: pointer;
    height: 4px;
}

.pwd-len-num {
    width: 72px;
    text-align: center;
    flex-shrink: 0;
}

/* ── Charset toggle row ── */
.pwd-charset-row {
    flex-wrap: wrap;
}

/* ── Custom symbols input ── */
.pwd-custom-sym {
    min-width: 220px;
}

/* ── button.tool-toggle (data-on pattern used in this tool) ── */
button.tool-toggle {
    position: relative;
    width: 42px;
    height: 24px;
    min-width: 42px;
    border: none;
    border-radius: 12px;
    background: var(--tool-border);
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    /* clip thumb so it never bleeds outside */
    transition: background 0.2s;
}

button.tool-toggle[data-on="true"] {
    background: var(--tool-accent);
}

/* Override tool-base.css which sets position:absolute; top:2px; left:2px on all .tool-toggle-thumb */
button.tool-toggle .tool-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    /* OFF state: 3px from left edge */
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: left 0.2s;
    transform: none;
    /* cancel any transform from base CSS */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

button.tool-toggle[data-on="true"] .tool-toggle-thumb {
    left: 21px;
    /* ON state: 42 - 3 - 18 = 21px from left edge */
    transform: none;
}

/* ── Hint text ── */
.pwd-hint {
    font-weight: 400;
    color: var(--tool-text-muted);
    font-size: 0.8125rem;
}

/* ── Qty input ── */
.pwd-qty-input {
    width: 90px;
}

/* ── Output list ── */
.pwd-output-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0.875rem 1rem;
}

.pwd-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--tool-surface);
    border: 1px solid var(--tool-border);
    border-radius: var(--tool-radius-sm);
    padding: 0.6rem 1rem;
    transition: border-color 0.15s;
}

.pwd-item:hover {
    border-color: rgba(var(--tool-accent-rgb), 0.4);
}

.pwd-item-text {
    font-family: var(--tool-font-mono);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--tool-text-primary);
    word-break: break-all;
    flex: 1;
}

.pwd-item-copy {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tool-text-muted);
    font-size: 1rem;
    padding: 0.2rem;
    border-radius: 4px;
    transition: color 0.15s;
}

.pwd-item-copy:hover {
    color: var(--tool-accent);
}

/* ── Strength bar ── */
.pwd-strength-wrap {
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    background: var(--tool-surface);
    border: 1px solid var(--tool-border);
    border-radius: var(--tool-radius-md);
}

.pwd-strength-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--tool-text-muted);
    margin-bottom: 0.5rem;
}

.pwd-strength-bar-bg {
    height: 6px;
    background: var(--tool-border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.pwd-strength-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease, background 0.4s ease;
    width: 0;
}

/* ── Crack time / entropy row ── */
.pwd-checker-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--tool-text-muted);
}

/* ── PIN pills ── */
.pwd-pin-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pwd-pin-pill {
    padding: 6px 16px;
    border: 1px solid var(--tool-border);
    border-radius: var(--tool-radius-sm);
    background: none;
    color: var(--tool-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.pwd-pin-pill--active {
    background: var(--tool-accent);
    border-color: var(--tool-accent);
    color: #fff;
}

.pwd-pin-pill:not(.pwd-pin-pill--active):hover {
    border-color: var(--tool-accent);
    color: var(--tool-accent);
}

/* ── Strength Checker ── */
.pwd-check-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.pwd-check-input {
    width: 100%;
    padding-right: 2.75rem;
    font-family: var(--tool-font-mono);
}

.pwd-check-eye {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tool-text-muted);
    font-size: 1.1rem;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

.pwd-check-eye:hover {
    color: var(--tool-text-primary);
}

.pwd-checker-tips {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.pwd-checker-tips li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.875rem;
    color: #f97316;
}

.pwd-checker-tips li.pwd-tip-ok {
    color: #22c55e;
}

/* ── Passphrase / Memorable example ── */
.pwd-passphrase-example {
    font-size: 0.9375rem;
    color: var(--tool-text-muted);
    margin: 8px 0 0;
    font-style: italic;
}

/* ── Session History ── */
.pwd-history-wrap {
    margin-top: 1.25rem;
}

.pwd-history-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pwd-history-toggle {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 0.5rem;
    background: none;
    border: 1px solid var(--tool-border);
    border-radius: var(--tool-radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--tool-text-muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.pwd-history-toggle:hover {
    border-color: var(--tool-accent);
    color: var(--tool-accent);
}

.pwd-history-toggle span {
    flex: 1;
    text-align: left;
}

.pwd-history-clear {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--tool-border);
    border-radius: var(--tool-radius-sm);
    background: none;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--tool-text-muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    white-space: nowrap;
}

.pwd-history-clear:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.06);
}

.pwd-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding-bottom: 0.25rem;
    max-height: 280px;
    overflow-y: auto;
}

.pwd-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--tool-surface);
    border: 1px solid var(--tool-border);
    border-radius: var(--tool-radius-sm);
    padding: 0.6rem 1rem;
    opacity: 0.85;
    transition: opacity 0.15s;
}

.pwd-history-item:hover {
    opacity: 1;
}

.pwd-history-item .pwd-item-text {
    font-size: 0.875rem;
}

/* ── Inner card spacing ── */

/* Mode tabs float inside card with breathing room */
.pwd-gen-section .pwd-mode-tabs {
    margin: 1.5rem 1.5rem 1.25rem;
    max-width: calc(100% - 3rem);
}

/* Length slider rows get horizontal + top padding */
.pwd-gen-section .pwd-length-row {
    padding: 1.25rem 1.5rem 0;
}

/* Passphrase, PIN, Memorable – widen tool-options-bar sides to match 1.5rem card standard */
.pwd-gen-section #pwd-passphrase-section .tool-options-bar,
.pwd-gen-section #pwd-pin-section .tool-options-bar,
.pwd-gen-section #pwd-memorable-section .tool-options-bar {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Passphrase / memorable italic examples */
.pwd-gen-section .pwd-passphrase-example {
    padding: 0.5rem 1.5rem 1rem;
    margin-top: 4px;
}

/* Strength checker section inner padding */
.pwd-gen-section #pwd-checker-section {
    padding: 1.25rem 1.5rem;
}

/* Output pane gets horizontal margin + top/bottom gap so it floats inside card */
.pwd-gen-section #pwd-output-wrap {
    margin: 1.25rem 1.5rem;
}

/* Main strength bar (outside checker) */
.pwd-gen-section #pwd-strength-wrap {
    margin: 1rem 1.5rem 0;
}

/* History panel */
.pwd-gen-section .pwd-history-wrap {
    margin: 1.25rem 1.5rem 1.5rem;
    /* bottom 1.5rem so card edge has breathing room */
}

/* Status toast — add bottom gap so it clears the card */
.pwd-gen-section #pwd-status {
    margin: 0.5rem 1.5rem 1.5rem;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .pwd-mode-tab {
        padding: 6px 11px;
        font-size: 0.8125rem;
    }

    .pwd-length-row {
        flex-wrap: wrap;
    }

    .pwd-len-num {
        width: 60px;
    }

    .pwd-custom-sym {
        min-width: 0;
        width: 100%;
    }
}