.ferk-rx-widget,
.ferk-rx-widget * {
    box-sizing: border-box;
}

.ferk-rx-widget {
    width: 100%;
    margin: 14px 0;
    font-family: inherit;
}

.ferk-rx-card {
    width: 100%;
    min-height: 70px;
    padding: 14px 18px;
    border: 1px solid #d7e1f1;
    border-radius: 14px;
    background: #fff;
    color: #071226;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-align: left;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .03);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.ferk-rx-card:hover {
    border-color: #bfd2ec;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .05);
    transform: translateY(-1px);
}

.ferk-rx-card-icon {
    width: 24px;
    min-width: 24px;
    height: 24px;
    color: #071226;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ferk-rx-card-icon svg {
    width: 24px;
    height: 24px;
}

.ferk-rx-card-main {
    flex: 1;
    min-width: 0;
}

.ferk-rx-card-title {
    display: block;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: 0;
}

.ferk-rx-card-status {
    display: none;
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.35;
}

.ferk-rx-card-action {
    color: #174a96;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.ferk-rx-widget.is-filled .ferk-rx-card {
    border-color: #cfe0fb;
    background: #f8fbff;
}

.ferk-rx-widget.is-filled .ferk-rx-card-status {
    display: block;
}

.ferk-rx-help {
    display: inline-block;
    margin: 10px 8px 0 0;
    float: right;
    color: #174a96;
    font-weight: 600;
    text-decoration: underline;
    font-size: 13px;
}

.ferk-rx-overlay {
    position: fixed;
    inset: 0;
    z-index: 999998;
    background: rgba(0, 0, 0, .42);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.ferk-rx-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 999999;
    width: min(440px, 100vw);
    height: 100vh;
    background: #fff;
    transform: translateX(102%);
    transition: transform .25s ease;
    box-shadow: -14px 0 32px rgba(15, 23, 42, .12);
    display: flex;
    flex-direction: column;
    color: #1f2937;
    font-family: inherit;
}

body.ferk-rx-open {
    overflow: hidden;
}

body.ferk-rx-open .ferk-rx-overlay {
    opacity: 1;
    pointer-events: auto;
}

body.ferk-rx-open .ferk-rx-drawer {
    transform: translateX(0);
}

.ferk-rx-drawer-header {
    height: 52px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.ferk-rx-drawer-close,
.ferk-rx-drawer-back {
    appearance: none;
    border: 0;
    background: transparent;
    color: #1f2937;
    cursor: pointer;
    padding: 6px;
    margin: 0;
    font-size: 28px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ferk-rx-drawer-back {
    font-size: 34px;
    font-weight: 300;
}

.ferk-rx-drawer-back.is-hidden {
    visibility: hidden;
}

.ferk-rx-drawer-body {
    padding: 4px 24px 18px;
    flex: 1;
    overflow-y: auto;
}

.ferk-rx-step-title {
    margin: 0 0 18px;
    font-size: 20px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.01em;
    color: #202124;
}

.ferk-rx-step-subtitle {
    margin: -8px 0 14px;
    font-size: 14px;
    line-height: 1.45;
    color: #7b8190;
}

.ferk-rx-type-list {
    display: grid;
    gap: 18px;
}

.ferk-rx-type-option {
    display: grid;
    grid-template-columns: 24px 1fr;
    align-items: start;
    gap: 12px;
    cursor: pointer;
}

.ferk-rx-type-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ferk-rx-radio-ui {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1.6px solid #111827;
    margin-top: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color .18s ease;
}

.ferk-rx-radio-ui::after {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #4aa3df;
    opacity: 0;
    transform: scale(.6);
    transition: opacity .18s ease, transform .18s ease;
}

.ferk-rx-type-option input:checked + .ferk-rx-radio-ui {
    border-color: #4aa3df;
}

.ferk-rx-type-option input:checked + .ferk-rx-radio-ui::after {
    opacity: 1;
    transform: scale(1);
}

.ferk-rx-type-title {
    display: block;
    color: #202124;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
}

.ferk-rx-type-description {
    display: block;
    margin-top: 3px;
    color: #7b8190;
    font-size: 14px;
    line-height: 1.35;
}

.ferk-rx-form-group {
    margin: 0 0 10px;
}

.ferk-rx-field {
    width: 100%;
    height: 48px;
    border: 1px solid #e6ebf2;
    border-radius: 8px;
    background: #fff;
    color: #2b2f36;
    font-size: 15px;
    line-height: 1.2;
    padding: 0 14px;
    outline: none;
    font-family: inherit;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.ferk-rx-field:focus {
    border-color: #24529c;
    box-shadow: 0 0 0 3px rgba(36, 82, 156, .10);
}

.ferk-rx-field::placeholder {
    color: #9b9b9b;
}

.ferk-rx-select-wrap {
    position: relative;
}

.ferk-rx-select-wrap::after {
    content: '⌄';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-54%);
    color: #aab2bf;
    font-size: 20px;
    pointer-events: none;
}

select.ferk-rx-field {
    appearance: none;
    padding-right: 38px;
}

.ferk-rx-small-help {
    display: block;
    margin-top: 10px;
    color: #7b8190;
    font-size: 13px;
    line-height: 1.4;
}

.ferk-rx-error {
    display: none;
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff1f2;
    color: #b42318;
    font-weight: 600;
    font-size: 13px;
}

.ferk-rx-error.is-visible {
    display: block;
}

.ferk-rx-drawer-footer {
    padding: 16px 24px 20px;
    flex-shrink: 0;
    background: #fff;
}

.ferk-rx-footer-note {
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #7b8190;
    font-size: 12px;
}

.ferk-rx-primary {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 8px;
    background: #23529f;
    color: #fff;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
    font-weight: 700;
    font-family: inherit;
    box-shadow: 0 2px 0 rgba(12, 42, 95, .10);
    transition: background .18s ease, transform .18s ease;
}

.ferk-rx-primary:hover {
    background: #1f4890;
    transform: translateY(-1px);
}

.ferk-rx-assist {
    display: block;
    margin: 16px auto 0;
    border: 0;
    background: transparent;
    color: #333;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 640px) {
    .ferk-rx-widget {
        margin: 12px 0;
    }

    .ferk-rx-card {
        min-height: 64px;
        padding: 12px 14px;
        border-radius: 12px;
        gap: 10px;
    }

    .ferk-rx-card-title {
        font-size: 15px;
    }

    .ferk-rx-card-action {
        font-size: 12px;
    }

    .ferk-rx-help {
        font-size: 12px;
    }

    .ferk-rx-drawer {
        width: 100vw;
    }

    .ferk-rx-drawer-body,
    .ferk-rx-drawer-footer {
        padding-left: 18px;
        padding-right: 18px;
    }

    .ferk-rx-step-title {
        font-size: 18px;
    }

    .ferk-rx-type-title {
        font-size: 15px;
    }

    .ferk-rx-type-description,
    .ferk-rx-step-subtitle {
        font-size: 13px;
    }
}
