.rise-mcp-page,
.rise-mcp-widget {
    --rise-mcp-heading: #394b5d;
    --rise-mcp-text: #5a6a7a;
    --rise-mcp-muted: #8b97a4;
    --rise-mcp-border: #e5e9ec;
    --rise-mcp-border-soft: #eef1f5;
    --rise-mcp-surface: #ffffff;
    --rise-mcp-surface-soft: #fbfcfe;
    --rise-mcp-accent: #2f5ed7;
    --rise-mcp-accent-soft: #eef4ff;
    --rise-mcp-radius: 12px;
}

.rise-mcp-page {
    color: var(--rise-mcp-text);
}

.rise-mcp-textarea {
    min-height: 220px;
    height: auto !important;
}

.rise-mcp-textarea-sm {
    min-height: 110px;
    height: auto !important;
}

.rise-mcp-policy-list {
    max-height: 360px;
    overflow-y: auto;
}

#sidebar-menu ul li.rise-mcp-active-submenu > a {
    background: #eef4ff;
    color: #2f5ed7;
    font-weight: 600;
    border-radius: 6px;
}

.rise-mcp-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.rise-mcp-page-head-main {
    min-width: 0;
}

.rise-mcp-page-head h1 {
    margin: 0 0 4px;
    font-size: 26px;
    line-height: 1.2;
    color: var(--rise-mcp-heading);
}

.rise-mcp-page-head p {
    margin: 0;
    max-width: 760px;
    color: var(--rise-mcp-muted);
    line-height: 1.5;
}

.rise-mcp-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #6b8afd;
    margin-bottom: 4px;
}

.rise-mcp-head-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.rise-mcp-head-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 8px;
}

.rise-mcp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.rise-mcp-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e3e8ef;
    background: #f7f9fc;
    color: #647486;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    line-height: 1.4;
}

.rise-mcp-muted {
    color: var(--rise-mcp-muted);
    font-size: 12.5px;
    line-height: 1.5;
}

p.rise-mcp-muted {
    margin-bottom: 14px;
}

.rise-mcp-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.rise-mcp-stat-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.rise-mcp-stat-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.rise-mcp-stat-grid-compact {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin-bottom: 0;
}

.rise-mcp-stat {
    background: var(--rise-mcp-surface);
    border: 1px solid var(--rise-mcp-border);
    border-radius: var(--rise-mcp-radius);
    padding: 16px;
    display: flex;
    gap: 13px;
    align-items: center;
    height: 100%;
}

.rise-mcp-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    flex: 0 0 42px;
}

.rise-mcp-stat-icon svg {
    width: 20px;
    height: 20px;
}

.rise-mcp-icon-green { background: #e8f8f4; color: #0b8a72; }
.rise-mcp-icon-blue { background: #eef4ff; color: #2f5ed7; }
.rise-mcp-icon-violet { background: #f2edff; color: #6d4aff; }
.rise-mcp-icon-amber { background: #fff4e5; color: #b26a00; }
.rise-mcp-icon-red { background: #fdecec; color: #c0392b; }

.rise-mcp-stat-label {
    color: var(--rise-mcp-muted);
    font-size: 12px;
}

.rise-mcp-stat-value {
    color: var(--rise-mcp-heading);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
}

.rise-mcp-stat-value-sm {
    font-size: 17px;
    word-break: break-word;
}

.rise-mcp-stat-hint {
    color: #9aa5b1;
    font-size: 12px;
}

.rise-mcp-stat-hint a {
    color: #4076f2;
    text-decoration: none;
}

.rise-mcp-stat-hint a:hover {
    text-decoration: underline;
}

.rise-mcp-card {
    border: 1px solid var(--rise-mcp-border);
    border-radius: var(--rise-mcp-radius);
    background: var(--rise-mcp-surface);
    overflow: hidden;
}

.rise-mcp-card > .card-header {
    background: var(--rise-mcp-surface);
    border-bottom: 1px solid var(--rise-mcp-border-soft);
    padding: 14px 18px;
}

.rise-mcp-card > .card-header h5 {
    margin: 0;
    font-size: 15px;
    color: var(--rise-mcp-heading);
    display: flex;
    align-items: center;
    gap: 7px;
}

.rise-mcp-card > .card-body {
    padding: 18px;
}

.rise-mcp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rise-mcp-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 8px;
}

.rise-mcp-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
    gap: 12px;
}

.rise-mcp-quick {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    padding: 13px;
    border: 1px solid var(--rise-mcp-border-soft);
    border-radius: 10px;
    background: var(--rise-mcp-surface-soft);
    color: #4a5964;
    text-decoration: none;
    transition: border-color .15s, background .15s, transform .15s;
}

.rise-mcp-quick:hover {
    text-decoration: none;
    background: var(--rise-mcp-surface);
    border-color: #cfdcf6;
    transform: translateY(-1px);
    color: var(--rise-mcp-heading);
}

.rise-mcp-quick-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--rise-mcp-accent-soft);
    color: var(--rise-mcp-accent);
    display: grid;
    place-items: center;
    flex: 0 0 34px;
}

.rise-mcp-quick-icon svg {
    width: 17px;
    height: 17px;
}

.rise-mcp-quick strong {
    display: block;
    font-size: 13.5px;
    margin-bottom: 2px;
}

.rise-mcp-quick small {
    display: block;
    color: var(--rise-mcp-muted);
    font-size: 12px;
    line-height: 1.45;
}

.rise-mcp-mini-stat {
    border: 1px solid var(--rise-mcp-border-soft);
    background: var(--rise-mcp-surface-soft);
    border-radius: 9px;
    padding: 10px 12px;
}

.rise-mcp-mini-stat span {
    display: block;
    color: var(--rise-mcp-muted);
    font-size: 12px;
}

.rise-mcp-mini-stat strong {
    color: var(--rise-mcp-heading);
    font-size: 18px;
    word-break: break-word;
}

.rise-mcp-table th {
    color: var(--rise-mcp-muted);
    font-size: 11px;
    letter-spacing: .05em;
    text-transform: uppercase;
    border-top: 0;
    font-weight: 600;
    white-space: nowrap;
}

.rise-mcp-table td {
    vertical-align: middle;
    color: var(--rise-mcp-text);
}

.rise-mcp-table td code {
    color: #35507a;
}

.rise-mcp-kv {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--rise-mcp-border-soft);
    font-size: 13px;
}

.rise-mcp-kv:last-child {
    border-bottom: 0;
}

.rise-mcp-kv span {
    color: var(--rise-mcp-muted);
}

.rise-mcp-kv strong {
    color: #4a5964;
    text-align: right;
    word-break: break-word;
}

.rise-mcp-empty {
    text-align: center;
    color: #9aa5b1;
    padding: 26px 10px;
    font-size: 13px;
}

.rise-mcp-empty svg {
    width: 30px;
    height: 30px;
    margin-bottom: 6px;
    color: #b7c1cb;
}

.rise-mcp-settings-card {
    display: block;
    background: var(--rise-mcp-surface);
    border: 1px solid var(--rise-mcp-border);
    border-radius: var(--rise-mcp-radius);
    padding: 18px;
    color: #4a5964;
    text-decoration: none;
    height: 100%;
    position: relative;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

.rise-mcp-settings-card:hover {
    text-decoration: none;
    color: var(--rise-mcp-heading);
    border-color: #cfdcf6;
    box-shadow: 0 8px 22px rgba(47, 94, 215, .08);
    transform: translateY(-1px);
}

.rise-mcp-settings-card h5 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: var(--rise-mcp-heading);
    margin-bottom: 7px;
}

.rise-mcp-settings-card p {
    margin: 0;
    color: var(--rise-mcp-muted);
    font-size: 12.5px;
    line-height: 1.5;
}

.rise-mcp-settings-card .rise-mcp-settings-arrow {
    position: absolute;
    top: 16px;
    right: 16px;
    color: #b7c1cb;
}

.rise-mcp-code {
    background: #f7f9fc;
    border: 1px solid var(--rise-mcp-border-soft);
    border-radius: 9px;
    padding: 12px 14px;
    color: #35507a;
    font-size: 12.5px;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 0;
}

.rise-mcp-endpoints li {
    padding: 4px 0;
    color: var(--rise-mcp-text);
    font-size: 13px;
}

.rise-mcp-tool-row {
    transition: opacity .15s;
}

.rise-mcp-tool-row.opacity-50 {
    opacity: .5;
}

.rise-mcp-policy-module-row:last-child {
    border-bottom: 0 !important;
}

.rise-mcp-chat-log {
    flex: 1 1 auto;
    min-height: 360px;
    height: 460px;
    overflow-y: auto;
    padding: 16px;
    background: var(--rise-mcp-surface-soft);
    border: 1px solid var(--rise-mcp-border-soft);
    border-radius: 10px;
}

.rise-mcp-chat-empty {
    height: 100%;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #9aa5b1;
    font-size: 13px;
    text-align: center;
}

.rise-mcp-chat-empty svg {
    width: 32px;
    height: 32px;
    color: #b7c1cb;
}

.rise-mcp-message {
    max-width: 82%;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--rise-mcp-border-soft);
    border-radius: 12px;
    background: var(--rise-mcp-surface);
    color: #4a5964;
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.rise-mcp-message:last-child {
    margin-bottom: 0;
}

.rise-mcp-message-user {
    margin-left: auto;
    background: var(--rise-mcp-accent-soft);
    border-color: #dbe6fb;
}

.rise-mcp-message-role {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--rise-mcp-muted);
    margin-bottom: 3px;
}

.rise-mcp-message-text {
    white-space: pre-wrap;
}

.rise-mcp-chat-input {
    min-height: 58px;
    resize: vertical;
}

.rise-mcp-thread-list {
    max-height: 420px;
    overflow-y: auto;
}

.rise-mcp-thread {
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 7px;
    font-size: 13px;
}

.rise-mcp-thread-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rise-mcp-thread.active,
.rise-mcp-thread.active:hover {
    background: var(--rise-mcp-accent-soft);
    color: var(--rise-mcp-accent);
    border-color: #dbe6fb;
    font-weight: 600;
}

.rise-mcp-widget .offcanvas-body {
    display: flex;
    flex-direction: column;
}

.rise-mcp-widget-log {
    height: 360px;
    min-height: 240px;
    overflow-y: auto;
    padding: 12px;
    background: var(--rise-mcp-surface-soft);
    border: 1px solid var(--rise-mcp-border-soft);
    border-radius: 10px;
}

.rise-mcp-widget-button {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(47, 94, 215, .28);
    z-index: 1030;
}

.rise-mcp-widget-button svg {
    width: 22px;
    height: 22px;
}

@media (max-width: 991px) {
    .rise-mcp-head-actions {
        justify-content: flex-start;
    }

    .rise-mcp-chat-log {
        height: 420px;
    }
}

@media (max-width: 767px) {
    .rise-mcp-page-head {
        flex-direction: column;
    }

    .rise-mcp-page-head h1 {
        font-size: 22px;
    }

    .rise-mcp-stat-grid,
    .rise-mcp-stat-grid-3,
    .rise-mcp-stat-grid-4 {
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    }

    .rise-mcp-message {
        max-width: 100%;
    }

    .rise-mcp-chat-log {
        height: 360px;
    }

    .rise-mcp-widget-log {
        height: 300px;
    }
}
