body.rx-page {
    min-height: 100vh;
    height: auto;
    background: #f7fbfa;
    color: #22313f;
    user-select: auto;
}

body.rx-page header {
    background: #e8f7f1;
    color: #1f5b49;
}

.rx-shell {
    width: min(100%, 840px);
    margin: 0 auto;
    padding: 16px 16px 34px;
}

.back-button {
    min-height: 40px;
    border: 1px solid #d8e8e1;
    border-radius: 999px;
    background: #ffffff;
    color: #1f5b49;
    padding: 8px 15px;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(32, 88, 71, 0.08);
}

.back-button:active,
.primary-action:active,
.secondary-action:active {
    transform: translateY(1px);
}

.intro-card,
.form-card,
.result-card {
    background: #ffffff;
    border: 1px solid #e3efea;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(32, 88, 71, 0.08);
}

.intro-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-top: 14px;
    padding: 18px;
}

.intro-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #def7ec;
    font-size: 1.55rem;
    flex: 0 0 auto;
}

.intro-card h1,
.form-card h2 {
    margin: 0;
    letter-spacing: 0;
}

.intro-card h1 {
    color: #164937;
    font-size: 1.45rem;
}

.intro-card p {
    margin: 8px 0 0;
    color: #5d6d7e;
    line-height: 1.6;
    font-size: 0.95rem;
}

.form-card,
.result-card {
    margin-top: 16px;
    padding: 18px;
}

.form-card h2 {
    color: #1f5b49;
    font-size: 1.08rem;
    margin-bottom: 14px;
}

.field-grid {
    display: grid;
    gap: 12px;
}

.field {
    display: grid;
    gap: 7px;
}

.field span {
    color: #4b635b;
    font-weight: 800;
    font-size: 0.92rem;
}

.field input,
.field select {
    width: 100%;
    min-height: 46px;
    border: 1px solid #d8e8e1;
    border-radius: 10px;
    padding: 10px 12px;
    color: #22313f;
    background: #ffffff;
    font: inherit;
    font-size: 1rem;
}

.button-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
    gap: 8px;
}

.choice-button {
    min-height: 46px;
    border: 1px solid #d8e8e1;
    border-radius: 10px;
    background: #ffffff;
    color: #1f5b49;
    font: inherit;
    font-size: 0.98rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(32, 88, 71, 0.06);
}

.choice-button.is-selected {
    border-color: #1f8f6b;
    background: #e1f6ee;
    color: #164937;
    box-shadow: inset 0 0 0 2px rgba(31, 143, 107, 0.14);
}

.choice-button:active {
    transform: translateY(1px);
}

.field input:focus,
.field select:focus,
.choice-button:focus-visible {
    outline: 3px solid rgba(112, 199, 163, 0.28);
    border-color: #70c7a3;
}

.last-date-field span {
    color: #d35400;
}

.form-message {
    min-height: 22px;
    margin: 12px 0 10px;
    color: #c0392b;
    font-weight: 700;
    line-height: 1.4;
}

.primary-action,
.secondary-action {
    width: 100%;
    min-height: 48px;
    border-radius: 10px;
    font-size: 1.03rem;
    font-weight: 900;
    cursor: pointer;
}

.primary-action {
    border: 0;
    background: #1f8f6b;
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(31, 143, 107, 0.22);
}

.secondary-action {
    margin-top: 16px;
    border: 1px solid #cfe3da;
    background: #ffffff;
    color: #1f5b49;
}

.result-summary {
    display: grid;
    gap: 10px;
}

.result-summary > div {
    border-radius: 12px;
    background: #f0f7ff;
    padding: 12px;
}

.summary-label {
    display: block;
    color: #5d6d7e;
    font-size: 0.82rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.result-summary strong {
    color: #164937;
    font-size: 1.05rem;
    line-height: 1.5;
}

#expire-date {
    color: #c0392b;
}

#valid-window-start,
#valid-window-end {
    color: #0275d8;
}

.warning-box {
    margin-top: 14px;
    border-radius: 10px;
    border-left: 5px solid #ffc107;
    background: #fff3cd;
    color: #856404;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.55;
}

.warning-box.info {
    border-left-color: #17a2b8;
    background: #d1ecf1;
    color: #0c5460;
}

.warning-box.warning {
    border-left-color: #ffc107;
    background: #fff3cd;
    color: #856404;
}

.warning-box.danger {
    border-left-color: #dc3545;
    background: #f8d7da;
    color: #721c24;
}

.next-window-card {
    margin-top: 14px;
    border: 1px solid #d8e8e1;
    border-radius: 12px;
    background: #f8fffb;
    padding: 12px;
}

.next-window-card h3 {
    margin: 0 0 10px;
    color: #1f5b49;
    font-size: 0.98rem;
}

.next-window-list {
    display: grid;
    gap: 8px;
}

.next-window-item {
    display: grid;
    gap: 4px;
    border-radius: 10px;
    background: #ffffff;
    padding: 10px;
}

.next-window-item span {
    color: #5d6d7e;
    font-size: 0.82rem;
    font-weight: 800;
}

.next-window-item strong {
    color: #0275d8;
    font-size: 1rem;
    line-height: 1.45;
}

.next-window-item.is-expired {
    background: #fff5f5;
}

.next-window-item.is-expired strong {
    color: #c0392b;
}

.result-note {
    margin: 14px 0 0;
    color: #6b7b76;
    font-size: 0.86rem;
    line-height: 1.55;
}

@media (min-width: 720px) {
    .rx-shell {
        padding-top: 24px;
    }

    .intro-card,
    .form-card,
    .result-card {
        padding: 22px;
    }

    .field-grid,
    .result-summary {
        grid-template-columns: 1fr 1fr;
    }
}
