.rsg-page .rsg-subtitle {
    max-width: 760px;
    margin-inline: auto;
}

.rsg-page .tool-card {
    height: auto;
}

.rsg-card {
    border-radius: 18px;
}

.rsg-card .tool-card-header {
    padding: 1rem 1.3rem 0.35rem;
    display: grid;
    grid-template-columns: 48px 1fr;
    column-gap: 0.85rem;
    row-gap: 0.25rem;
    align-items: start;
}

.rsg-card .tool-card-body {
    padding: 0.85rem 1.3rem 1.3rem;
}

.rsg-card #rsgForm > .rsg-box:first-child {
    margin-top: -0.65rem;
}

.rsg-card .tool-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 0;
    grid-column: 1;
    grid-row: 1 / span 2;
}

.rsg-card .tool-card-title {
    margin-top: -3px;
    margin-bottom: 0;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.25;
    grid-column: 2;
    grid-row: 1;
}

.rsg-card .tool-card-text {
    margin-bottom: 0;
    font-size: 0.98rem;
    line-height: 1.55;
    grid-column: 2;
    grid-row: 2;
}

.rsg-page .form-label {
    margin-bottom: 0.38rem;
    font-weight: 600;
}

.rsg-page .form-control,
.rsg-page .form-select {
    min-height: 42px;
    border-radius: 5px;
}

.rsg-box {
    border: 1px solid #dbe3ec;
    border-radius: 5px;
    padding: 0.9rem;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.rsg-box-title {
    font-size: 0.98rem;
    font-weight: 700;
    margin: 0;
}

.rsg-item {
    border: 1px solid #e5ebf2;
    border-radius: 5px;
    padding: 0.8rem;
    background: #fff;
    margin-bottom: 0.65rem;
}

.rsg-item-head {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.65rem;
}

.rsg-skill-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 0.65rem;
    align-items: center;
}

.rsg-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.rsg-actions .btn {
    width: auto !important;
    min-width: 102px;
    min-height: 42px;
    border-radius: 0.25rem;
    padding: 0.375rem 0.75rem;
    line-height: 1.5;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.rsg-actions #rsg_reset {
    background-color: #f8f9fa;
    border: 1px solid #8b98a7;
    color: #526070;
}

.rsg-actions #rsg_reset:hover,
.rsg-actions #rsg_reset:focus {
    background-color: #eef2f6;
    border-color: #748396;
    color: #3f4c5c;
}

.rsg-output {
    border: 1px solid #dbe3ec;
    border-radius: 5px;
    background:
        linear-gradient(180deg, rgba(241, 245, 249, 0.8) 0%, rgba(255, 255, 255, 1) 100%);
    padding: 1rem;
    min-height: 560px;
    overflow-x: auto;
}

.rsg-preview-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.rsg-preview-actions .btn {
    width: auto !important;
    min-width: 102px;
    min-height: 42px;
    border-radius: 0.25rem;
    padding: 0.375rem 0.75rem;
    line-height: 1.5;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.rsg-doc {
    width: 100%;
    background: #fff;
    color: #0f172a;
}

.rsg-doc-head {
    border-bottom: 2px solid #dbe3ec;
    padding-bottom: 0.9rem;
    margin-bottom: 1rem;
}

.rsg-doc-title {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.rsg-doc-role {
    margin: 0.3rem 0 0;
    font-size: 1rem;
    color: #334155;
    font-weight: 600;
}

.rsg-doc-contact {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.95rem;
    color: #475569;
}

.rsg-section {
    margin-top: 1rem;
}

.rsg-section h3 {
    margin: 0 0 0.7rem;
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #0f3a63;
    text-transform: uppercase;
}

.rsg-summary {
    white-space: pre-wrap;
    line-height: 1.65;
}

.rsg-skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.rsg-skill-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid #cfe1f3;
    background: #f7fbff;
    font-size: 0.9rem;
}

.rsg-entry {
    margin-bottom: 0.95rem;
}

.rsg-entry-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.8rem;
}

.rsg-entry h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.rsg-entry-meta {
    margin: 0.12rem 0 0;
    color: #475569;
    font-size: 0.92rem;
}

.rsg-entry-date {
    white-space: nowrap;
    font-size: 0.9rem;
    color: #334155;
    font-weight: 600;
}

.rsg-entry-desc {
    margin: 0.45rem 0 0;
    white-space: pre-wrap;
    line-height: 1.6;
}

@media (max-width: 991.98px) {
    .rsg-output {
        min-height: 420px;
    }
}

@media (max-width: 575.98px) {
    .rsg-card .tool-card-header,
    .rsg-card .tool-card-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .rsg-card .tool-card-title {
        font-size: 1.45rem;
    }

    .rsg-skill-row,
    .rsg-preview-actions {
        grid-template-columns: 1fr;
    }

    .rsg-actions {
        justify-content: stretch;
        flex-direction: column;
    }

    .rsg-actions .btn {
        width: 100%;
    }

    .rsg-entry-head {
        flex-direction: column;
    }

    .rsg-entry-date {
        white-space: normal;
    }
}
