/* =========================================================
   MOCLARUS — CENTRAL PAGE FRAME AND UI SCALE

   Load after moclarus.css.
   This file owns outer page dimensions and shared size tokens.
   Pages opt in by adding the mc-page-frame class.
   Never use zoom or transform: scale() for page sizing.
   ========================================================= */

:root {
    --mc-page-frame-width: 1540px;
    --mc-page-frame-gutter: 36px;
    --mc-page-frame-top: 28px;
    --mc-page-frame-bottom: 48px;

    /* Dashboard is the locked size reference. */
    --mc-81-title: clamp(27px, 1.9vw, 32px);
    --mc-81-subtitle: 12.5px;
    --mc-81-kicker: 10px;
    --mc-81-panel-title: 14.6px;
    --mc-81-copy: 10.5px;
    --mc-81-font-family: Inter, "Segoe UI", Arial, sans-serif;
    --mc-81-control-weight: 650;
    --mc-81-control-padding-x: 15px;
    --mc-81-control-radius: 9px;
    --mc-81-row-action-width: 80px;
    --mc-81-control-height: 36px;
    --mc-81-control-font: 11px;
    --mc-81-gap: 13px;
    --mc-81-radius: 10px;
    --mc-81-page-margin: 34px;
    --mc-pipeline-card-side-gap: 0px;
}

body:not(.standalone-page) > .main {
    box-sizing: border-box;
    padding: var(--mc-page-frame-top) var(--mc-page-frame-gutter) var(--mc-page-frame-bottom) !important;
}

body:not(.standalone-page) > .main > .mc-page-frame {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: var(--mc-page-frame-width) !important;
    margin-right: auto !important;
    margin-left: auto !important;
}

/* Pipeline cards stay wide while retaining equal space at both edges. */
.mc-page-frame.mc-pipeline-workspace .mc-pipeline-card-list {
    padding-right: var(--mc-pipeline-card-side-gap) !important;
    padding-left: var(--mc-pipeline-card-side-gap) !important;
    scrollbar-gutter: stable both-edges;
}

/* Standard list pages use the main frame directly, without double padding. */
body:not(.standalone-page) > .main > .mc-page-frame.mc-companies-page,
body:not(.standalone-page) > .main > .mc-page-frame.mc-contacts-page,
body:not(.standalone-page) > .main > .mc-page-frame.mc-search-page.has-query {
    padding: 0 !important;
}

/* The empty Search view keeps its intentional vertical breathing room. */
body:not(.standalone-page) > .main > .mc-page-frame.mc-search-page.is-ready {
    padding-right: 0 !important;
    padding-left: 0 !important;
}

/* Main workspaces no longer add a second outer frame. */
body:not(.standalone-page) > .main > .mc-page-frame.network-page,
body:not(.standalone-page) > .main > .mc-page-frame.mc-activities-page,
body:not(.standalone-page) > .main > .mc-page-frame.mc-opportunities-page {
    padding-bottom: 0 !important;
}

body:not(.standalone-page) > .main > .mc-page-frame.tasks-container,
body:not(.standalone-page) > .main > .mc-page-frame.di-page,
body:not(.standalone-page) > .main > .mc-page-frame.settings-container,
body:not(.standalone-page) > .main > .mc-page-frame.mc-admin-users {
    padding: 0 !important;
}

/* Deal Intelligence keeps its action visible without widening the page frame. */
.mc-page-frame.di-page .di-deal-head,
.mc-page-frame.di-page .di-deal-row {
    grid-template-columns:
        minmax(170px, 1.45fr)
        minmax(90px, .75fr)
        minmax(82px, .65fr)
        minmax(74px, .58fr)
        56px
        minmax(150px, 1.25fr)
        96px;
    gap: 8px;
    min-width: 820px;
}

.mc-page-frame.di-page .di-risk-cell,
.mc-page-frame.di-page .di-gap-list {
    flex-wrap: wrap;
}

.mc-page-frame.di-page .di-gap-list {
    overflow: visible;
}

.mc-page-frame.di-page .di-deal-head > span:last-child,
.mc-page-frame.di-page .di-review-button {
    position: sticky;
    z-index: 2;
    right: 8px;
}

.mc-page-frame.di-page .di-deal-head > span:last-child {
    align-self: stretch;
    background: #fff;
}

.mc-page-frame.di-page .di-review-button {
    width: 96px;
}

/* Directory headers follow the locked Dashboard scale. */
.mc-page-frame.mc-companies-page .mc-companies-header h1,
.mc-page-frame.mc-contacts-page .mc-contacts-header h1 {
    font-size: var(--mc-81-title) !important;
}

.mc-page-frame.mc-companies-page .mc-companies-header p,
.mc-page-frame.mc-contacts-page .mc-contacts-header p {
    font-size: var(--mc-81-subtitle) !important;
    line-height: 1.45 !important;
}

.mc-page-frame.mc-companies-page .mc-companies-kicker,
.mc-page-frame.mc-contacts-page .mc-contacts-kicker {
    font-size: var(--mc-81-kicker) !important;
    letter-spacing: .075em !important;
}

/* Shared title hierarchy for the remaining primary workspaces. */
.mc-page-frame.network-page .network-topbar h1,
.mc-page-frame.mc-activities-page .mc-activities-header h1,
.mc-page-frame.mc-opportunities-page .mc-opportunities-header h1,
.mc-page-frame.mc-pipeline-workspace .mc-pipeline-header h1,
.mc-page-frame.tasks-container > .page-header h1,
.mc-page-frame.di-page .di-page-header h1,
.mc-page-frame.manager-page .manager-header h1 {
    font-size: var(--mc-81-title) !important;
    line-height: 1.12 !important;
}

.mc-page-frame.mc-admin-users .mc-admin-header h1,
.mc-page-frame.audit-page .audit-title {
    font-size: var(--mc-81-title) !important;
    line-height: 1.12 !important;
}

.mc-page-frame.network-page .network-topbar > div > p:last-child,
.mc-page-frame.mc-activities-page .mc-activities-header > div > p,
.mc-page-frame.mc-opportunities-page .mc-opportunities-header h1::after,
.mc-page-frame.mc-pipeline-workspace .mc-pipeline-header p,
.mc-page-frame.tasks-container > .page-header .section-description,
.mc-page-frame.di-page .di-page-header p,
.mc-page-frame.manager-page .manager-header > div > p:last-child {
    font-size: var(--mc-81-subtitle) !important;
    line-height: 1.45 !important;
}

.mc-page-frame.mc-admin-users .mc-admin-header p,
.mc-page-frame.audit-page .audit-subtitle {
    font-size: var(--mc-81-subtitle) !important;
    line-height: 1.45 !important;
}

.mc-page-frame.mc-activities-page .mc-activities-header::before,
.mc-page-frame.mc-opportunities-page .mc-opportunities-header::before,
.mc-page-frame.network-page .network-eyebrow,
.mc-page-frame.mc-pipeline-workspace .mc-pipeline-eyebrow,
.mc-page-frame.di-page .di-kicker,
.mc-page-frame.manager-page .manager-eyebrow {
    font-size: var(--mc-81-kicker) !important;
    letter-spacing: .075em !important;
}

.mc-page-frame.mc-admin-users .mc-admin-header > div:first-child > span {
    font-size: var(--mc-81-kicker) !important;
    letter-spacing: .075em !important;
}

/* Form controls and adjacent actions share one baseline. */
.mc-page-frame.manager-page .manager-filters,
.mc-page-frame.mc-admin-users .mc-admin-create-grid {
    align-items: end !important;
}

.mc-page-frame.manager-page .manager-filters label,
.mc-page-frame.mc-admin-users .mc-admin-create-grid label {
    margin: 0 !important;
}

.mc-page-frame.manager-page .manager-filters > button,
.mc-page-frame.mc-admin-users .mc-admin-create-grid > .mc-admin-primary {
    align-self: end !important;
    margin: 0 !important;
}

/* Keep directory cards inside the shared frame. */
.mc-page-frame.mc-companies-page .mc-companies-card,
.mc-page-frame.mc-contacts-page .mc-contacts-card,
.mc-page-frame.mc-companies-page .mc-companies-table-wrap,
.mc-page-frame.mc-contacts-page .mc-contacts-table-wrap {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 900px) {
    :root {
        --mc-page-frame-gutter: 18px;
        --mc-page-frame-top: 22px;
        --mc-page-frame-bottom: 38px;
    }
}

@media (max-width: 640px) {
    :root {
        --mc-page-frame-gutter: 12px;
        --mc-page-frame-top: 16px;
        --mc-page-frame-bottom: 30px;
        --mc-81-page-margin: 15px;
    }
}
