.tool-widget:has(.pc-app) {
    padding: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.pc-app {
    --line: rgba(148, 163, 184, .18);
    --pc-teal: #14b8a6;
    --pc-teal-bright: #5eead4;
    --pc-amber: #d97706;
    container-type: inline-size;
    width: 100%;
    min-width: 0;
    padding: clamp(14px, 2.5vw, 22px);
    border: 1px solid var(--line);
    border-radius: 22px;
    background:
        radial-gradient(circle at 0 0, rgba(20, 184, 166, .14), transparent 34%),
        linear-gradient(145deg, #111827, #07111f);
    box-shadow: 0 22px 55px rgba(0, 0, 0, .25);
    color: #e5edf8;
    font-family: Inter, system-ui, sans-serif;
}

.pc-app * {
    box-sizing: border-box;
}

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

.pc-app button,
.pc-app input,
.pc-app select,
.pc-app textarea {
    font: inherit;
}

.pc-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.pc-head > div:first-child {
    min-width: 0;
}

.pc-head > div:first-child > span {
    color: var(--pc-teal-bright);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.pc-head p {
    margin: 6px 0 0;
    color: #94a3b8;
    font-size: .84rem;
    line-height: 1.5;
}

.pc-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

.pc-head button,
.pc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(30, 41, 59, .7);
    color: #e2e8f0;
    font-size: .78rem;
    font-weight: 750;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

.pc-head button:hover,
.pc-btn:hover {
    border-color: rgba(45, 212, 191, .45);
    color: #fff;
    background: rgba(20, 184, 166, .12);
}

.pc-example {
    border-color: rgba(45, 212, 191, .35);
    color: var(--pc-teal-bright);
}

.pc-reset {
    border-color: rgba(248, 113, 113, .3);
    color: #fca5a5;
}

.pc-reset:hover {
    border-color: rgba(248, 113, 113, .5);
    background: rgba(248, 113, 113, .1);
    color: #fecaca;
}

.pc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, .95fr);
    gap: 15px;
}

.pc-card {
    min-width: 0;
    padding: clamp(14px, 2vw, 18px);
    border: 1px solid var(--line);
    border-radius: 17px;
    background: rgba(15, 23, 42, .74);
}

.pc-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.pc-card-head i {
    display: grid;
    place-items: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0d9488, #d97706);
    font-size: .68rem;
    font-style: normal;
    font-weight: 900;
}

.pc-card-head h3 {
    margin: 0;
    font-size: .96rem;
}

.pc-card-head p {
    margin: 3px 0 0;
    color: #94a3b8;
    font-size: .72rem;
    line-height: 1.4;
}

.pc-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.pc-fields label.wide {
    grid-column: 1 / -1;
}

.pc-fields label > span {
    display: block;
    margin-bottom: 6px;
    color: #94a3b8;
    font-size: .72rem;
    font-weight: 650;
}

.pc-fields input,
.pc-fields select,
.pc-fields textarea {
    width: 100%;
    height: 46px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: 0;
    background: #0b1322;
    color: #e2e8f0;
    font-size: .88rem;
}

.pc-fields textarea {
    height: auto;
    min-height: 110px;
    padding: 10px 12px;
    resize: vertical;
    line-height: 1.5;
}

.pc-fields input:focus,
.pc-fields select:focus,
.pc-fields textarea:focus {
    border-color: #2dd4bf;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, .12);
}

.pc-error {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(248, 113, 113, .3);
    border-radius: 9px;
    background: rgba(248, 113, 113, .08);
    color: #fecaca;
    font-size: .8rem;
    line-height: 1.4;
}

.pc-calculate {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 50px;
    margin-top: 16px;
    padding: 12px 18px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #0d9488, #d97706);
    color: #fff;
    font-size: .95rem;
    font-weight: 800;
    letter-spacing: .01em;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(13, 148, 136, .25);
    transition: filter .15s ease, transform .15s ease, box-shadow .15s ease;
}

.pc-calculate span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    font-size: 1.05rem;
    line-height: 1;
}

.pc-calculate:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(13, 148, 136, .32);
}

.pc-calculate:active {
    transform: translateY(0);
}

.pc-result {
    display: flex;
    flex-direction: column;
}

.pc-empty {
    display: grid;
    justify-items: center;
    align-content: center;
    flex: 1;
    min-height: 280px;
    padding: 12px;
    text-align: center;
}

.pc-empty i {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin-bottom: 10px;
    border: 1px solid rgba(45, 212, 191, .23);
    border-radius: 17px;
    background: rgba(20, 184, 166, .07);
    color: var(--pc-teal-bright);
    font-style: normal;
}

.pc-empty strong {
    color: #e2e8f0;
    font-size: .95rem;
}

.pc-empty p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: .78rem;
    line-height: 1.45;
}

.pc-hero {
    padding: 18px;
    border: 1px solid rgba(45, 212, 191, .2);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(20, 184, 166, .11), rgba(245, 158, 11, .05));
    text-align: center;
}

.pc-hero span,
.pc-hero small {
    display: block;
    color: #94a3b8;
    font-size: .72rem;
    line-height: 1.4;
}

.pc-hero strong {
    display: block;
    margin: 6px 0;
    color: #99f6e4;
    font-size: clamp(1.45rem, 4cqw, 2.2rem);
    overflow-wrap: anywhere;
    line-height: 1.2;
}

.pc-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.pc-metrics div {
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(2, 8, 23, .28);
}

.pc-metrics span,
.pc-metrics b {
    display: block;
}

.pc-metrics span {
    color: #64748b;
    font-size: .68rem;
}

.pc-metrics b {
    margin-top: 4px;
    font-size: .84rem;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.pc-explain {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(2, 8, 23, .25);
    color: #94a3b8;
    font-size: .78rem;
    line-height: 1.55;
}

.pc-copy {
    width: 100%;
    min-height: 42px;
    margin-top: 12px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(30, 41, 59, .55);
    color: #cbd5e1;
    font-size: .8rem;
    font-weight: 750;
    cursor: pointer;
}

.pc-copy:hover {
    border-color: rgba(45, 212, 191, .4);
    color: #99f6e4;
}

.pc-note {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(245, 158, 11, .22);
    border-radius: 10px;
    background: rgba(245, 158, 11, .06);
    color: #fcd34d;
    font-size: .78rem;
    line-height: 1.5;
}

.pc-app button:focus-visible,
.pc-app input:focus-visible,
.pc-app select:focus-visible,
.pc-app textarea:focus-visible {
    outline: 2px solid #5eead4;
    outline-offset: 2px;
}

@container (max-width: 760px) {
    .pc-layout {
        grid-template-columns: 1fr;
    }

    .pc-empty {
        min-height: 180px;
    }
}

@container (max-width: 520px) {
    .pc-app {
        padding: 14px;
        border-radius: 16px;
    }

    .pc-head {
        flex-direction: column;
        gap: 12px;
    }

    .pc-head-actions {
        width: 100%;
    }

    .pc-head-actions .pc-example,
    .pc-head-actions .pc-reset {
        flex: 1;
    }

    .pc-card {
        padding: 14px;
    }

    .pc-fields,
    .pc-metrics {
        grid-template-columns: 1fr;
    }

    .pc-fields label.wide {
        grid-column: auto;
    }

    .pc-calculate {
        min-height: 48px;
        font-size: .92rem;
    }
}
