.gpmd-apc-outer,
.gpmd-apc-outer * {
    box-sizing: border-box;
}

.gpmd-apc-outer {
    width: 100%;
    margin: 0 auto;
    padding: 14px 14px 30px;
    color: #222;
    font-family: "Segoe UI", Inter, Roboto, Arial, sans-serif;
}

.gpmd-apc-calculator {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    overflow: hidden;
    background: #fff;
    border: 1px solid #d8dce2;
    border-radius: 18px;
    box-shadow: 0 6px 18px rgba(22, 34, 50, .09);
}

.gpmd-apc-front-head {
    padding: 28px 26px 12px;
    color: #113b67;
    text-align: center;
    background: #fff;
}

.gpmd-apc-front-head span {
    display: none;
}

.gpmd-apc-front-head h3 {
    margin: 0;
    color: #113b67;
    font-size: clamp(22px, 2.6vw, 25px);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -.02em;
}

.gpmd-apc-front-head p {
    max-width: 420px;
    margin: 5px auto 0;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.5;
}

.gpmd-apc-front-grid[hidden],
.gpmd-apc-front-actions[hidden],
.gpmd-apc-front-field[hidden],
.gpmd-apc-included-copy[hidden],
.gpmd-apc-result [hidden] {
    display: none !important;
}

.gpmd-apc-front-field {
    min-width: 0;
    text-align: center;
}

.gpmd-apc-journal-field {
    padding: 6px 28px 13px;
    background: #fff;
}

.gpmd-apc-front-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 0 28px 2px;
    background: #fff;
}

.gpmd-apc-front-grid > .gpmd-apc-front-field {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 7px 0 8px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.gpmd-apc-front-field > label {
    display: block;
    margin: 0 0 5px;
    color: #30343b;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.35;
    text-align: center;
}

.gpmd-apc-journal-field label {
    color: #113b67;
}

.gpmd-apc-journal-field label span {
    color: #c4322c;
}

.gpmd-apc-front-field select,
.gpmd-apc-front-field input[type="number"] {
    width: 100%;
    min-height: 42px;
    margin: 0;
    padding: 7px 10px;
    color: #30343b;
    font: inherit;
    font-size: 15px;
    line-height: 1.25;
    text-align: center;
    background: #fff;
    border: 1px solid #c9ced6;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(25, 35, 50, .05);
    transition: border-color .16s ease, box-shadow .16s ease;
}

.gpmd-apc-front-field select {
    display: block;
    max-width: 280px;
    margin-right: auto;
    margin-left: auto;
    text-align-last: center;
}

.gpmd-apc-journal-field select {
    max-width: 460px;
    min-height: 42px;
    padding-right: 36px;
    color: #27364b;
    font-size: 14px;
}

.gpmd-apc-front-field select:hover:not(:disabled),
.gpmd-apc-front-field input[type="number"]:hover:not(:disabled) {
    border-color: #8b96a6;
}

.gpmd-apc-front-field select:focus,
.gpmd-apc-front-field input[type="number"]:focus {
    outline: none;
    border-color: #138add;
    box-shadow: 0 0 0 3px rgba(19, 138, 221, .13);
}

.gpmd-apc-front-field select:disabled,
.gpmd-apc-front-field input:disabled {
    color: #677283;
    background: #f4f5f7;
    border-color: #d8dce2;
    cursor: not-allowed;
    opacity: 1;
}

.gpmd-apc-stepper {
    display: grid;
    grid-template-columns: 42px minmax(130px, 250px) 42px;
    gap: 10px;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 370px;
    margin: 0 auto;
}

.gpmd-apc-stepper input[type="number"] {
    min-width: 0;
    text-align: center;
    appearance: textfield;
    -moz-appearance: textfield;
}

.gpmd-apc-stepper input::-webkit-outer-spin-button,
.gpmd-apc-stepper input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.gpmd-apc-stepper button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
    background: #171717;
    border: 1px solid #171717;
    border-radius: 9px;
    box-shadow: 0 3px 7px rgba(0, 0, 0, .16);
    cursor: pointer;
    transition: background-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.gpmd-apc-stepper button:hover:not(:disabled) {
    background: #0b67ae;
    border-color: #0b67ae;
    box-shadow: 0 5px 11px rgba(11, 103, 174, .22);
    transform: translateY(-1px);
}

.gpmd-apc-stepper button:focus-visible,
.gpmd-apc-front-actions button:focus-visible,
.gpmd-apc-reset:focus-visible {
    outline: 3px solid rgba(19, 138, 221, .24);
    outline-offset: 2px;
}

.gpmd-apc-stepper button:disabled {
    color: #9aa1aa;
    background: #e6e8eb;
    border-color: #e6e8eb;
    box-shadow: none;
    cursor: not-allowed;
}

.gpmd-apc-hint {
    max-width: 460px;
    min-height: 0;
    margin: 5px auto 0;
    color: #666d77;
    font-size: 11.5px;
    line-height: 1.4;
    text-align: center;
}

.gpmd-apc-included-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 0 auto 7px;
    padding: 5px 9px;
    color: #146c3b;
    font-size: 11.5px;
    font-weight: 750;
    line-height: 1.35;
    background: #edf9f1;
    border: 1px solid #bfe5cb;
    border-radius: 999px;
}

.gpmd-apc-included-copy span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: #fff;
    font-size: 10px;
    background: #1d8a4c;
    border-radius: 50%;
}

.gpmd-apc-front-actions {
    display: flex;
    justify-content: center;
    padding: 7px 24px 6px;
    background: #fff;
}

.gpmd-apc-front-actions button,
.gpmd-apc-reset {
    min-width: 110px;
    min-height: 40px;
    margin: 0;
    padding: 7px 18px;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    background: #138add;
    border: 1px solid #138add;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(19, 138, 221, .2);
    cursor: pointer;
    transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.gpmd-apc-front-actions button:hover:not(:disabled),
.gpmd-apc-reset:hover {
    color: #fff;
    background: #0b67ae;
    border-color: #0b67ae;
    box-shadow: 0 5px 12px rgba(11, 103, 174, .24);
}

.gpmd-apc-front-actions button:disabled {
    color: #8a929f;
    background: #e4e7eb;
    border-color: #e4e7eb;
    box-shadow: none;
    cursor: not-allowed;
}

.gpmd-apc-result {
    padding: 6px 28px 26px;
    background: #fff;
    border: 0;
}

.gpmd-apc-result.is-empty {
    padding-top: 14px;
    padding-bottom: 24px;
}

.gpmd-apc-result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 430px;
    margin: 0 auto;
    color: #596273;
    text-align: center;
}

.gpmd-apc-placeholder-icon {
    display: none;
}

.gpmd-apc-result-placeholder strong {
    color: #30343b;
    font-size: 13px;
    line-height: 1.4;
}

.gpmd-apc-result-placeholder small {
    max-width: 390px;
    margin-top: 4px;
    color: #737c89;
    font-size: 11.5px;
    line-height: 1.5;
}

.gpmd-apc-breakdown {
    max-width: 420px;
    margin: 0 auto 10px;
    padding: 3px 12px;
    background: #f8fafc;
    border: 1px solid #e1e5ea;
    border-radius: 8px;
}

.gpmd-apc-breakdown-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 7px 0;
    color: #555e6c;
    font-size: 12px;
    border-bottom: 1px dashed #d6dbe2;
}

.gpmd-apc-breakdown-row:last-child {
    border-bottom: 0;
}

.gpmd-apc-breakdown-row strong {
    color: #222b37;
    white-space: nowrap;
}

.gpmd-apc-breakdown-row.is-included strong {
    color: #107c41;
}

.gpmd-apc-total {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    max-width: 460px;
    margin: 0 auto;
    padding: 5px 0;
    color: #111;
    font-size: 20px;
    font-weight: 800;
    text-align: center;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.gpmd-apc-total span::after {
    content: ":";
}

.gpmd-apc-total strong {
    color: #111;
    font-size: 22px;
    white-space: nowrap;
}

.gpmd-apc-reset-wrap {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.gpmd-apc-empty {
    max-width: 560px;
    margin: 32px auto;
    padding: 16px 18px;
    color: #6b4b00;
    text-align: center;
    background: #fff8e5;
    border: 1px solid #f0d48a;
    border-radius: 12px;
}

@media (prefers-reduced-motion: no-preference) {
    .gpmd-apc-outer.is-ready .gpmd-apc-front-grid,
    .gpmd-apc-outer.is-ready .gpmd-apc-front-actions {
        animation: gpmd-apc-reveal .2s ease-out both;
    }

    @keyframes gpmd-apc-reveal {
        from {
            opacity: 0;
            transform: translateY(-4px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

@media (max-width: 640px) {
    .gpmd-apc-outer {
        padding: 10px 8px 18px;
    }

    .gpmd-apc-calculator {
        border-radius: 16px;
        box-shadow: 0 7px 20px rgba(22, 34, 50, .09);
    }

    .gpmd-apc-front-head {
        padding: 24px 16px 10px;
    }

    .gpmd-apc-front-head p {
        font-size: 11.5px;
    }

    .gpmd-apc-journal-field {
        padding: 6px 16px 12px;
    }

    .gpmd-apc-front-grid {
        padding: 0 16px 2px;
    }

    .gpmd-apc-front-grid > .gpmd-apc-front-field {
        padding: 6px 0 8px;
    }

    .gpmd-apc-stepper {
        grid-template-columns: 40px minmax(100px, 1fr) 40px;
        gap: 7px;
        max-width: 340px;
    }

    .gpmd-apc-stepper button {
        width: 40px;
        height: 40px;
        font-size: 19px;
        border-radius: 8px;
    }

    .gpmd-apc-front-field select,
    .gpmd-apc-front-field input[type="number"] {
        min-height: 42px;
        font-size: 14px;
    }

    .gpmd-apc-front-actions {
        padding: 7px 16px 6px;
    }

    .gpmd-apc-result,
    .gpmd-apc-result.is-empty {
        padding: 9px 16px 22px;
    }

    .gpmd-apc-total,
    .gpmd-apc-total strong {
        font-size: 19px;
    }
}

@media (max-width: 360px) {
    .gpmd-apc-front-head h3 {
        font-size: 21px;
    }

    .gpmd-apc-front-field > label {
        font-size: 14px;
    }

    .gpmd-apc-stepper {
        grid-template-columns: 36px minmax(82px, 1fr) 36px;
        gap: 6px;
    }

    .gpmd-apc-stepper button {
        width: 36px;
        height: 36px;
    }

    .gpmd-apc-breakdown-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }
}
