.percent-calculator,
.percent-calculator *,
.percent-calculator *::before,
.percent-calculator *::after {
    box-sizing: border-box;
}

.percent-calculator {
    --percent-accent: var(--color-accent, #ff485b);
    --percent-accent-dark: var(--color-accent-dark, #e73b50);
    --percent-accent-soft: rgba(255, 72, 91, .07);
    --percent-border: #dfe3e7;
    --percent-border-soft: #eceded;
    --percent-text: #2f3b46;
    --percent-muted: #667482;
    --percent-page-soft: #f8f9fb;
    --percent-danger: var(--color-accent-dark, #e73b50);
    --percent-warning: #8d5a14;

    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
}

.percent-calculator--result-page {
    max-width: 820px;
}

.percent-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.percent-grid > * {
    min-width: 0;
}

.percent-card {
    position: relative;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 24px;
    border: 1px solid var(--percent-border);
    border-radius: 14px;
    background-color: #fff;
    box-shadow: 0 18px 42px -36px rgba(28, 37, 46, .48);
}

.percent-card-title {
    margin: 0 0 18px;
    color: var(--percent-text);
    font-size: 1.15em;
    font-weight: 900;
    line-height: 1.35;
}

.percent-card p {
    margin: 14px 0 0;
    color: var(--percent-muted);
    font-size: 15px;
    line-height: 1.65;
}

.percent-card p:first-child {
    margin-top: 0;
}

.percent-card b,
.percent-card strong {
    color: var(--percent-text);
    font-weight: 900;
}

.percent-card a {
    color: var(--percent-accent);
    font-weight: 900;
    text-decoration: none;
}

.percent-card a:hover {
    color: var(--percent-accent-dark);
    text-decoration: underline;
}

.percent-field {
    margin-bottom: 16px;
}

.percent-card .row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.percent-card .row > * {
    min-width: 0;
}

.percent-card .mb-3 {
    margin-bottom: 16px !important;
}

.percent-card .form-label,
.percent-field .form-label {
    display: block;
    margin: 0 0 7px;
    color: var(--percent-muted);
    font-size: .86em;
    font-weight: 900;
    line-height: 1.35;
    text-transform: uppercase;
}

.percent-card input,
.percent-card select,
.percent-card textarea,
.percent-card .form-control,
.percent-field input,
.percent-field select,
.percent-field textarea,
.percent-link-box__input {
    display: block;
    width: 100%;
    min-width: 0;
    height: 46px;
    border: 1px solid var(--percent-border);
    border-radius: 8px;
    padding: 0 14px;
    background-color: #fff;
    color: #273340;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 46px;
    box-shadow: none;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.percent-card textarea,
.percent-field textarea {
    min-height: 96px;
    padding-top: 12px;
    padding-bottom: 12px;
    line-height: 1.5;
    resize: vertical;
}

.percent-card input:hover,
.percent-card select:hover,
.percent-card textarea:hover,
.percent-card .form-control:hover,
.percent-field input:hover,
.percent-field select:hover,
.percent-field textarea:hover,
.percent-link-box__input:hover {
    border-color: #cfd6dd;
}

.percent-card input:focus,
.percent-card select:focus,
.percent-card textarea:focus,
.percent-card .form-control:focus,
.percent-field input:focus,
.percent-field select:focus,
.percent-field textarea:focus,
.percent-link-box__input:focus {
    outline: none;
    border-color: rgba(255, 72, 91, .5);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 72, 91, .12);
}

.percent-card input::placeholder,
.percent-card textarea::placeholder,
.percent-card .form-control::placeholder,
.percent-field input::placeholder,
.percent-field textarea::placeholder,
.percent-link-box__input::placeholder {
    color: #a2a8ae;
    font-weight: 500;
}

.percent-card input[type="number"],
.percent-field input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

.percent-card input[type="number"]::-webkit-outer-spin-button,
.percent-card input[type="number"]::-webkit-inner-spin-button,
.percent-field input[type="number"]::-webkit-outer-spin-button,
.percent-field input[type="number"]::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.percent-card .btn,
.percent-card button[type="submit"],
.percent-card button[type="button"]:not(.percent-link-box__button),
.percent-link-box__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--percent-accent);
    border-radius: 8px;
    background-color: var(--percent-accent);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: none;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease, transform .15s ease;
}

.percent-card .btn:hover,
.percent-card button[type="submit"]:hover,
.percent-card button[type="button"]:not(.percent-link-box__button):hover,
.percent-link-box__button:hover {
    border-color: var(--percent-accent-dark);
    background-color: var(--percent-accent-dark);
    color: #fff;
    text-decoration: none;
}

.percent-card .btn:active,
.percent-card button[type="submit"]:active,
.percent-card button[type="button"]:not(.percent-link-box__button):active,
.percent-link-box__button:active {
    transform: translateY(1px);
}

.percent-card .btn:focus,
.percent-card button[type="submit"]:focus,
.percent-card button[type="button"]:not(.percent-link-box__button):focus,
.percent-link-box__button:focus {
    outline: none;
}

.percent-card .btn:focus-visible,
.percent-card button[type="submit"]:focus-visible,
.percent-card button[type="button"]:not(.percent-link-box__button):focus-visible,
.percent-link-box__button:focus-visible {
    box-shadow: 0 0 0 3px rgba(255, 72, 91, .14);
}

.percent-card .btn-secondary,
.percent-card .btn-light,
.percent-card .btn-outline-secondary {
    border-color: var(--percent-border);
    background-color: #f4f5f7;
    color: var(--percent-muted);
}

.percent-card .btn-secondary:hover,
.percent-card .btn-light:hover,
.percent-card .btn-outline-secondary:hover {
    border-color: rgba(255, 72, 91, .42);
    background-color: rgba(255, 72, 91, .08);
    color: var(--percent-accent);
}

.percent-result {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 64px;
    margin-top: 16px;
    padding: 16px 18px;
    border: 1px solid rgba(255, 72, 91, .18);
    border-radius: 12px;
    background-color: rgba(255, 72, 91, .07);
    color: var(--percent-text);
    font-size: 18px;
    font-weight: 900;
    line-height: 1.45;
    word-break: break-word;
}

.percent-result:first-child {
    margin-top: 0;
}

.percent-result::before {
    content: "=";
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-top: 1px;
    border-radius: 50%;
    background-color: #fff;
    color: var(--percent-accent);
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 10px 22px -18px rgba(28, 37, 46, .45);
}

.percent-result strong,
.percent-result b {
    color: var(--percent-accent-dark);
    font-weight: 900;
}

.percent-result .text-danger,
.percent-result.is-error,
.percent-result.error {
    color: var(--percent-danger);
}

.percent-result:has(.text-danger),
.percent-result.is-error,
.percent-result.error {
    border-color: rgba(255, 72, 91, .24);
    background-color: rgba(255, 72, 91, .08);
    color: var(--percent-danger);
}

.percent-result:has(.text-danger)::before,
.percent-result.is-error::before,
.percent-result.error::before {
    content: "!";
    color: var(--percent-danger);
}

.percent-link-box {
    margin-top: 20px;
    padding: 18px;
    border: 1px solid var(--percent-border);
    border-radius: 12px;
    background-color: var(--percent-page-soft);
}

.percent-link-title,
.percent-link-box__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    color: var(--percent-text);
    font-size: 15px;
    font-weight: 900;
    line-height: 1.35;
}

.percent-link-box__title i {
    flex: 0 0 auto;
    color: var(--percent-accent);
    font-size: 20px;
    line-height: 1;
}

.percent-link-box__info {
    margin-bottom: 14px;
}

.percent-link-box__text {
    max-width: 640px;
    margin: 0;
    color: var(--percent-muted);
    font-size: 13px;
    line-height: 1.55;
}

.percent-link-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: stretch;
}

.percent-link-row .percent-link-box__input {
    margin-bottom: 0;
}

.percent-link-row .percent-link-box__button {
    width: auto;
    margin: 0;
    white-space: nowrap;
}

.percent-link-box__button {
    width: 100%;
    margin: 0 0 12px;
}

.percent-link-box__button:disabled {
    opacity: .62;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.percent-link-box__button i {
    flex: 0 0 auto;
    font-size: 18px;
    line-height: 1;
}

.percent-link-box__input {
    height: 44px;
    margin-bottom: 9px;
    font-size: 13px;
    line-height: 44px;
}

.percent-link-status {
    min-height: 20px;
    margin-top: 9px;
    color: var(--percent-muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.percent-link-status:empty {
    display: none;
}

.percent-link-status.is-success {
    color: var(--percent-accent-dark);
}

.percent-link-status.is-error {
    color: var(--percent-danger);
}

@media (max-width: 991px) {
    .percent-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .percent-calculator {
        max-width: 100%;
    }

    .percent-card {
        padding: 20px;
        border-radius: 12px;
    }

    .percent-card .row {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .percent-card-title {
        margin-bottom: 16px;
        font-size: 1.08em;
    }

    .percent-result {
        font-size: 17px;
    }
}

@media (max-width: 575px) {
    .percent-card {
        padding: 16px;
    }

    .percent-card-title {
        font-size: 1.06em;
    }

    .percent-card p {
        font-size: 14px;
        line-height: 1.6;
    }

    .percent-card .form-label,
    .percent-field .form-label {
        font-size: .84em;
    }

    .percent-card input,
    .percent-card select,
    .percent-card textarea,
    .percent-card .form-control,
    .percent-field input,
    .percent-field select,
    .percent-field textarea {
        height: 44px;
        border-radius: 7px;
        padding: 0 12px;
        font-size: 14px;
        line-height: 44px;
    }

    .percent-card .btn,
    .percent-card button[type="submit"],
    .percent-card button[type="button"]:not(.percent-link-box__button),
    .percent-link-box__button {
        width: 100%;
        min-height: 44px;
        border-radius: 7px;
        font-size: 14px;
    }

    .percent-result {
        min-height: 58px;
        padding: 14px;
        border-radius: 12px;
        font-size: 15px;
    }

    .percent-result::before {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .percent-link-box {
        padding: 15px;
        border-radius: 12px;
    }

    .percent-link-title,
    .percent-link-box__title {
        font-size: 14px;
    }

    .percent-link-box__text {
        font-size: 12px;
    }

    .percent-link-row {
        grid-template-columns: 1fr;
    }

    .percent-link-box__input {
        height: 42px;
        border-radius: 7px;
        font-size: 12px;
        line-height: 42px;
    }

    .percent-link-row .percent-link-box__button {
        width: 100%;
    }
}

@media (max-width: 380px) {
    .percent-card {
        padding: 14px;
    }

    .percent-result {
        flex-direction: column;
        gap: 8px;
    }
}