.mac-page {
    --mac-accent: var(--theme-color, #4c63d2);
    --mac-accent-2: #7c3aed;
}

.mac-hero {
    background: linear-gradient(120deg, var(--mac-accent) 0%, var(--mac-accent-2) 55%, #312e81 100%);
    border-radius: 1rem;
    overflow: hidden;
}

.mac-hero-sub {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.95rem;
    max-width: 42rem;
}

.mac-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.5rem 1rem;
}

.mac-panel {
    border-radius: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.mac-panel-header {
    background: linear-gradient(180deg, #fafbff 0%, #f4f6fb 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 1rem 1rem 0 0;
}

.mac-search .input-group-text {
    background: #fff;
}

.mac-org-list {
    max-height: min(60vh, 520px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mac-org-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    background: #fff;
}

.mac-org-card:hover {
    border-color: rgba(76, 99, 210, 0.35);
    box-shadow: 0 4px 14px rgba(76, 99, 210, 0.12);
}

.mac-org-card.active {
    border-color: var(--mac-accent);
    box-shadow: 0 0 0 2px rgba(76, 99, 210, 0.2);
}

.mac-org-card .mac-org-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #2c2c40;
}

.mac-org-card .mac-org-meta {
    font-size: 0.8rem;
    color: #697a8d;
}

.mac-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.82rem;
}

.mac-switch .form-check-label {
    color: #566a7f;
}

.mac-accordion .accordion-item {
    border-radius: 0.75rem !important;
    overflow: hidden;
}

.mac-acc-btn {
    font-weight: 600;
    font-size: 0.9rem;
    background: #fafbff;
}

.mac-acc-btn:not(.collapsed) {
    background: #eef1ff;
    color: var(--mac-accent);
}

.mac-ref-body {
    max-height: 220px;
    overflow-y: auto;
    background: #fcfcfd;
}

.mac-chip {
    font-size: 0.75rem;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    margin: 0.2rem;
    border: 1px solid rgba(76, 99, 210, 0.25);
    background: #fff;
    color: #4c5775;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.mac-chip code {
    font-size: 0.72rem;
    color: var(--mac-accent);
}

@media (max-width: 1199.98px) {
    .mac-org-list {
        max-height: 40vh;
    }
}
