/* Password Generator — professional dashboard UI */
.tool-widget:has(.pwg-app) {
    padding: 0;
    overflow: hidden;
    background: transparent;
    border: none;
    box-shadow: none;
}

.pwg-app {
    --pwg-accent: #00aeef;
    --pwg-accent-2: #38bdf8;
    --pwg-ok: #34d399;
    --pwg-warn: #fbbf24;
    --pwg-mid: #60a5fa;
    --pwg-err: #f87171;
    --pwg-card: rgba(15, 23, 42, 0.82);
    --pwg-border: rgba(148, 163, 184, 0.16);
    --pwg-muted: #94a3b8;
    width: 100%;
}

.pwg-app [hidden] {
    display: none !important;
}

.pwg-shell {
    border: 1px solid var(--pwg-border);
    border-radius: 20px;
    background:
        radial-gradient(ellipse 70% 45% at 0% 0%, rgba(0, 174, 239, .14), transparent 50%),
        radial-gradient(ellipse 50% 35% at 100% 0%, rgba(52, 211, 153, .08), transparent 45%),
        linear-gradient(180deg, #111827 0%, #0b1220 100%);
    padding: 1.15rem 1.2rem 1.35rem;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

.pwg-trust {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .95rem;
}

.pwg-trust-item {
    padding: .35rem .7rem;
    border-radius: 999px;
    border: 1px solid var(--pwg-border);
    background: rgba(2, 8, 20, .45);
    font-size: .72rem;
    font-weight: 700;
    color: #e2e8f0;
}

.pwg-workspace {
    width: 100%;
    min-width: 0;
}

.pwg-grid {
    display: grid;
    grid-template-columns: minmax(260px, .9fr) minmax(0, 1.2fr);
    gap: .9rem;
    align-items: start;
    margin-bottom: .9rem;
}

.pwg-col {
    display: flex;
    flex-direction: column;
    gap: .85rem;
    min-width: 0;
}

.pwg-card {
    border: 1px solid var(--pwg-border);
    border-radius: 16px;
    background: var(--pwg-card);
    padding: .9rem 1rem 1.05rem;
}

.pwg-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .75rem;
    flex-wrap: wrap;
}

.pwg-card-head h3 {
    margin: 0;
    font-size: .95rem;
    color: #f1f5f9;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}

.pwg-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    background: rgba(0, 174, 239, .2);
    border: 1px solid rgba(0, 174, 239, .4);
    color: var(--pwg-accent-2);
    font-size: .72rem;
    font-weight: 800;
}

.pwg-head-actions {
    display: flex;
    gap: .35rem;
}

.pwg-link-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--pwg-accent-2);
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    padding: .2rem .35rem;
}

.pwg-link-btn:hover {
    color: #fff;
    text-decoration: underline;
}

.pwg-field {
    margin-bottom: .85rem;
}

.pwg-label,
.pwg-label-row label {
    display: block;
    margin-bottom: .35rem;
    font-size: .8rem;
    font-weight: 700;
    color: #cbd5e1;
}

.pwg-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .35rem;
}

.pwg-label-row label {
    margin: 0;
}

.pwg-num {
    width: 4.2rem;
    border-radius: 8px;
    border: 1px solid var(--pwg-border);
    background: rgba(2, 8, 20, .55);
    color: #e2e8f0;
    font-size: .85rem;
    font-weight: 700;
    padding: .35rem .45rem;
    text-align: center;
}

.pwg-range {
    width: 100%;
    accent-color: var(--pwg-accent);
}

.pwg-input {
    width: 100%;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid var(--pwg-border);
    background: rgba(2, 8, 20, .55);
    color: #e2e8f0;
    font-size: .88rem;
    padding: .65rem .75rem;
}

.pwg-input:focus,
.pwg-num:focus {
    outline: none;
    border-color: rgba(0, 174, 239, .55);
    box-shadow: 0 0 0 3px rgba(0, 174, 239, .15);
}

.pwg-checks {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    margin-bottom: .85rem;
}

.pwg-check {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #cbd5e1;
    font-size: .84rem;
    cursor: pointer;
}

.pwg-generate {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    margin-top: .85rem;
}

.pwg-status {
    min-height: 1.2rem;
    margin: .55rem 0 0;
    font-size: .8rem;
    color: var(--pwg-muted);
}

.pwg-status.is-ok { color: var(--pwg-ok); font-weight: 700; }
.pwg-status.is-err { color: var(--pwg-err); font-weight: 700; }

.pwg-output {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.05rem;
    border-radius: 14px;
    border: 1px solid rgba(52, 211, 153, .35);
    background: rgba(52, 211, 153, .1);
    margin-bottom: .85rem;
    min-height: 4.2rem;
}

.pwg-output[data-strength="weak"] {
    border-color: rgba(248, 113, 113, .4);
    background: rgba(248, 113, 113, .1);
    color: #fecaca;
}

.pwg-output[data-strength="fair"] {
    border-color: rgba(251, 191, 36, .4);
    background: rgba(251, 191, 36, .1);
    color: #fde68a;
}

.pwg-output[data-strength="good"] {
    border-color: rgba(96, 165, 250, .4);
    background: rgba(96, 165, 250, .1);
    color: #bfdbfe;
}

.pwg-output[data-strength="strong"],
.pwg-output[data-strength="very-strong"] {
    border-color: rgba(52, 211, 153, .4);
    background: rgba(52, 211, 153, .1);
    color: #a7f3d0;
}

.pwg-output-icon {
    flex-shrink: 0;
    opacity: .9;
}

.pwg-password {
    flex: 1;
    min-width: 0;
    font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
    font-size: clamp(.95rem, 2.2vw, 1.2rem);
    font-weight: 700;
    word-break: break-all;
    line-height: 1.4;
    color: inherit;
}

.pwg-strength-wrap {
    margin-bottom: .75rem;
}

.pwg-strength-labels {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .4rem;
    font-size: .78rem;
    font-weight: 700;
    color: #cbd5e1;
}

.pwg-meter {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: .3rem;
}

.pwg-meter span {
    height: .4rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, .2);
}

.pwg-meter[data-score="1"] span:nth-child(-n+1) { background: var(--pwg-err); }
.pwg-meter[data-score="2"] span:nth-child(-n+2) { background: var(--pwg-warn); }
.pwg-meter[data-score="3"] span:nth-child(-n+3) { background: var(--pwg-mid); }
.pwg-meter[data-score="4"] span:nth-child(-n+4) { background: var(--pwg-ok); }
.pwg-meter[data-score="5"] span { background: var(--pwg-ok); }

.pwg-batch {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    margin-top: .55rem;
}

.pwg-batch-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    padding: .55rem .7rem;
    border-radius: 10px;
    border: 1px solid var(--pwg-border);
    background: rgba(2, 8, 20, .4);
}

.pwg-batch-item code {
    flex: 1;
    min-width: 0;
    font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
    font-size: .78rem;
    color: #e2e8f0;
    word-break: break-all;
}

.pwg-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .85rem;
}

.pwg-checklist,
.pwg-tips {
    margin: 0;
    padding: 0;
    list-style: none;
    color: #cbd5e1;
    font-size: .82rem;
    line-height: 1.5;
}

.pwg-checklist li,
.pwg-tips li {
    position: relative;
    padding-left: 1.4rem;
    margin-bottom: .4rem;
}

.pwg-checklist li::before {
    content: "○";
    position: absolute;
    left: 0;
    color: var(--pwg-muted);
    font-weight: 700;
}

.pwg-checklist li.is-ok::before {
    content: "✓";
    color: var(--pwg-ok);
}

.pwg-tips li::before {
    content: "•";
    position: absolute;
    left: .2rem;
    color: var(--pwg-accent-2);
}

.pwg-history {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.pwg-history-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .5rem .75rem;
    align-items: center;
    padding: .7rem .8rem;
    border-radius: 12px;
    border: 1px solid var(--pwg-border);
    background: rgba(2, 8, 20, .4);
}

.pwg-history-item code {
    font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
    font-size: .78rem;
    color: #e2e8f0;
    word-break: break-all;
}

.pwg-history-meta {
    grid-column: 1 / -1;
    color: var(--pwg-muted);
    font-size: .72rem;
}

.pwg-history-actions {
    display: flex;
    gap: .35rem;
}

.pwg-empty {
    margin: 0;
    color: var(--pwg-muted);
    font-size: .82rem;
}

.pwg-tip {
    margin-bottom: .9rem;
    padding: .9rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(0, 174, 239, .28);
    background: rgba(0, 174, 239, .08);
    color: #cbd5e1;
    font-size: .85rem;
    line-height: 1.5;
}

.pwg-features {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .55rem;
}

.pwg-feature {
    border: 1px solid var(--pwg-border);
    border-radius: 14px;
    background: rgba(2, 8, 20, .35);
    padding: .75rem .8rem;
}

.pwg-feature strong {
    display: block;
    margin-bottom: .25rem;
    color: #e2e8f0;
    font-size: .8rem;
}

.pwg-feature span {
    color: var(--pwg-muted);
    font-size: .72rem;
    line-height: 1.4;
}

@media (max-width: 960px) {
    .pwg-grid,
    .pwg-info-grid {
        grid-template-columns: 1fr;
    }

    .pwg-features {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .pwg-features {
        grid-template-columns: 1fr;
    }
}
