/* Shared menu-page rhythm. Search keeps its focused input layout.
   Outer page padding belongs to page_frame.css; section gaps belong to the parent. */
html body:not(.standalone-page) > .main > :is(.mc-dashboard-v2,.mc-myday,.mc-calendar-enterprise,.mc-companies-page,.mc-contacts-page,.network-page,.mc-activities-page,.mc-opportunities-page,.mc-pipeline-workspace,.tasks-container,.di-page,.manager-page,.settings-container,.mc-admin-users,.audit-page,.mc-search-page) {margin-top:0!important;padding-top:0!important;padding-left:0!important;padding-right:0!important;}
html body:not(.standalone-page) > .main :is(.mc-dash-header,.myday-header,.cal-hero,.mc-companies-header,.mc-contacts-header,.network-topbar,.mc-activities-header,.mc-opportunities-header,.mc-pipeline-header,.tasks-container>.page-header,.di-page-header,.manager-header,.settings-container>.page-header,.mc-admin-header,.audit-header,.mc-search-header) {box-sizing:border-box!important;position:relative!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:20px!important;min-height:126px!important;height:auto!important;padding:18px 20px!important;margin:0!important;width:100%!important;max-width:none!important;}
html body:not(.standalone-page) > .main :is(.mc-dash-header,.myday-header,.cal-hero,.mc-companies-header,.mc-contacts-header,.network-topbar,.mc-activities-header,.mc-opportunities-header,.mc-pipeline-header,.tasks-container>.page-header,.di-page-header,.manager-header,.settings-container>.page-header,.mc-admin-header,.audit-header,.mc-search-header)::before {content:none!important;}
html body:not(.standalone-page) > .main :is(.mc-dash-header,.myday-header,.cal-hero,.mc-companies-header,.mc-contacts-header,.network-topbar,.mc-activities-header,.mc-opportunities-header,.mc-pipeline-header,.tasks-container>.page-header,.di-page-header,.manager-header,.settings-container>.page-header,.mc-admin-header,.audit-header,.mc-search-header)>:first-child {min-width:0;flex:1 1 auto;}
html body:not(.standalone-page) > .main :is(.mc-dash-header,.myday-header,.cal-hero,.mc-companies-header,.mc-contacts-header,.network-topbar,.mc-activities-header,.mc-opportunities-header,.mc-pipeline-header,.tasks-container>.page-header,.di-page-header,.manager-header,.settings-container>.page-header,.mc-admin-header,.audit-header,.mc-search-header) h1 {margin:0!important;padding:0!important;font-size:var(--mc-81-title)!important;line-height:1.2!important;letter-spacing:-.025em;}
html body:not(.standalone-page) > .main :is(.mc-dash-header,.myday-header,.cal-hero,.mc-companies-header,.mc-contacts-header,.network-topbar,.mc-activities-header,.mc-opportunities-header,.mc-pipeline-header,.tasks-container>.page-header,.di-page-header,.manager-header,.settings-container>.page-header,.mc-admin-header,.audit-header,.mc-search-header) h1::before {content:var(--menu-label);display:block;color:#1465e8;font-size:var(--mc-81-kicker);font-weight:800;letter-spacing:.075em;line-height:14px;margin-bottom:6px;}
html body:not(.standalone-page) > .main :is(.mc-dash-header,.myday-header,.cal-hero,.mc-companies-header,.mc-contacts-header,.network-topbar,.mc-activities-header,.mc-opportunities-header,.mc-pipeline-header,.tasks-container>.page-header,.di-page-header,.manager-header,.settings-container>.page-header,.mc-admin-header,.audit-header,.mc-search-header)>:first-child>p:not(:first-child) {margin:5px 0 0!important;padding:0!important;font-size:var(--mc-81-subtitle)!important;line-height:1.5!important;}
html body:not(.standalone-page) > .main :is(.mc-dash-header,.myday-header,.cal-hero,.mc-companies-header,.mc-contacts-header,.network-topbar,.mc-activities-header,.mc-opportunities-header,.mc-pipeline-header,.tasks-container>.page-header,.di-page-header,.manager-header,.settings-container>.page-header,.mc-admin-header,.audit-header,.mc-search-header)>:first-child>:is(span:first-child,p:first-child) {display:none!important;}
html body:not(.standalone-page) > .main .mc-dashboard-v2 {--menu-label:"DASHBOARD";}
html body:not(.standalone-page) > .main .mc-myday {--menu-label:"MY DAY";}
html body:not(.standalone-page) > .main .mc-calendar-enterprise {--menu-label:"CALENDAR";}
html body:not(.standalone-page) > .main .mc-companies-page {--menu-label:"CUSTOMER ACCOUNTS";}
html body:not(.standalone-page) > .main .mc-contacts-page {--menu-label:"CUSTOMER RELATIONSHIPS";}
html body:not(.standalone-page) > .main .network-page {--menu-label:"RELATIONSHIPS";}
html body:not(.standalone-page) > .main .mc-activities-page {--menu-label:"CUSTOMER ACTIVITY";}
html body:not(.standalone-page) > .main .mc-opportunities-page {--menu-label:"SALES OPPORTUNITIES";}
html body:not(.standalone-page) > .main .mc-pipeline-workspace {--menu-label:"SALES PIPELINE";}
html body:not(.standalone-page) > .main .tasks-container {--menu-label:"DAILY FOLLOW-UPS";}
html body:not(.standalone-page) > .main .di-page {--menu-label:"DEAL INTELLIGENCE";}
html body:not(.standalone-page) > .main .manager-page {--menu-label:"MANAGER";}
html body:not(.standalone-page) > .main .settings-container {--menu-label:"SETTINGS";}
html body:not(.standalone-page) > .main .mc-admin-users {--menu-label:"ACCESS MANAGEMENT";}
html body:not(.standalone-page) > .main :is(.mc-dash-header,.myday-header,.cal-hero,.mc-companies-header,.mc-contacts-header,.network-topbar,.mc-activities-header,.mc-opportunities-header,.mc-pipeline-header,.tasks-container>.page-header,.di-page-header,.manager-header,.settings-container>.page-header,.mc-admin-header,.audit-header,.mc-search-header) :is(button,a[class],select,input[type=search]) {box-sizing:border-box!important;min-height:var(--mc-81-control-height)!important;height:var(--mc-81-control-height)!important;font-size:var(--mc-81-control-font)!important;line-height:1.3!important;}
html body:not(.standalone-page) > .main :is(.mc-dashboard-v2,.mc-myday,.mc-calendar-enterprise,.mc-companies-page,.mc-contacts-page,.network-page,.mc-activities-page,.mc-opportunities-page,.mc-pipeline-workspace,.tasks-container,.di-page,.manager-page,.settings-container,.mc-admin-users,.audit-page,.mc-search-page) :is(.edit-button,.delete-button,.add-button,.save-button,.secondary-button,.workflow-button,.mc-opportunity-prepared-action,.di-primary-button,.di-secondary-button,.di-review-button,.manager-primary) {box-sizing:border-box!important;height:var(--mc-81-control-height)!important;min-height:var(--mc-81-control-height)!important;font-size:var(--mc-81-control-font)!important;padding-top:0!important;padding-bottom:0!important;line-height:1.3!important;}
html body .main .opportunities-table td:last-child .actions :is(.edit-button,.delete-button,.workflow-button) {font-size:var(--mc-81-control-font)!important;height:var(--mc-81-control-height)!important;min-height:var(--mc-81-control-height)!important;}
@media(max-width:900px){html body:not(.standalone-page) > .main :is(.mc-dash-header,.myday-header,.cal-hero,.mc-companies-header,.mc-contacts-header,.network-topbar,.mc-activities-header,.mc-opportunities-header,.mc-pipeline-header,.tasks-container>.page-header,.di-page-header,.manager-header,.settings-container>.page-header,.mc-admin-header,.audit-header,.mc-search-header) {flex-wrap:wrap!important;gap:12px!important;}html body:not(.standalone-page) > .main :is(.mc-dash-header,.myday-header,.cal-hero,.mc-companies-header,.mc-contacts-header,.network-topbar,.mc-activities-header,.mc-opportunities-header,.mc-pipeline-header,.tasks-container>.page-header,.di-page-header,.manager-header,.settings-container>.page-header,.mc-admin-header,.audit-header,.mc-search-header)>:first-child {flex-basis:100%;}}
@media(max-width:900px){html body:not(.standalone-page) > .main .mc-dashboard-v2 .mc-dash-header,html body:not(.standalone-page) > .main .mc-pipeline-workspace .mc-pipeline-header{flex-wrap:nowrap!important;}}
@media(max-width:760px){html body:not(.standalone-page) > .main .mc-calendar-enterprise.mc-calendar-enterprise .cal-hero{flex-wrap:nowrap!important;}}

/* Consistent header corners and explicit Pipeline card controls. */
html body:not(.standalone-page) > .main :is(.mc-dash-header,.myday-header,.cal-hero,.mc-companies-header,.mc-contacts-header,.network-topbar,.mc-activities-header,.mc-opportunities-header,.mc-pipeline-header,.tasks-container>.page-header,.di-page-header,.manager-header,.settings-container>.page-header,.mc-admin-header,.audit-header,.mc-search-header) {
 border-radius:var(--mc-81-radius,10px)!important;
 background-clip:padding-box!important;
}
html body .main .mc-pipeline-workspace .opportunity-card :is(.mc-pipeline-move-button,.mc-pipeline-more-button,.edit-button) {
 box-sizing:border-box!important;
 display:inline-flex!important;align-items:center!important;justify-content:center!important;
 height:var(--mc-81-control-height,36px)!important;
 min-height:var(--mc-81-control-height,36px)!important;
 width:var(--mc-81-row-action-width)!important;min-width:var(--mc-81-row-action-width)!important;max-width:var(--mc-81-row-action-width)!important;flex:0 0 var(--mc-81-row-action-width)!important;
 padding:0 var(--mc-81-control-padding-x)!important;margin-left:0!important;
 font-family:inherit!important;font-size:var(--mc-81-control-font,11px)!important;
 font-weight:var(--mc-81-control-weight)!important;line-height:1.3!important;letter-spacing:normal!important;
 border-radius:var(--mc-81-control-radius)!important;white-space:nowrap!important;
}

/* One spacing owner at the header/content boundary. Search stays untouched. */
html body:not(.standalone-page) > .main :is(.mc-dash-header,.myday-header,.cal-hero,.mc-companies-header,.mc-contacts-header,.network-topbar,.mc-activities-header,.mc-opportunities-header,.mc-pipeline-header,.tasks-container>.page-header,.di-page-header,.manager-header,.settings-container>.page-header,.mc-admin-header,.audit-header,.mc-search-header) + :not([hidden]) {margin-top:0!important;}
html body:not(.standalone-page) > .main :is(.mc-dashboard-v2,.mc-calendar-enterprise) {row-gap:16px!important;}

html body:not(.standalone-page) > .main .settings-container .settings-category-nav {
 padding:10px!important;gap:6px!important;
}
html body:not(.standalone-page) > .main .settings-container .settings-category-nav button {
 box-sizing:border-box!important;display:flex!important;align-items:center!important;
 width:100%!important;max-width:none!important;min-width:0!important;
 height:auto!important;min-height:36px!important;margin:0 0 2px!important;
 padding:7px 12px!important;border:1px solid transparent!important;border-radius:8px!important;
 background:transparent!important;box-shadow:none!important;color:#344b69!important;
 font-family:inherit!important;font-size:var(--mc-81-control-font,11px)!important;
 font-weight:600!important;line-height:1.4!important;text-align:left!important;white-space:normal!important;
}
html body:not(.standalone-page) > .main .settings-container .settings-category-nav button:last-child {margin-bottom:0!important;}
html body:not(.standalone-page) > .main .settings-container>.page-header {gap:8px!important;}
html body:not(.standalone-page) > .main .settings-container .settings-category-nav button:hover {background:#f1f6fd!important;}
html body:not(.standalone-page) > .main .settings-container .settings-category-nav button.is-selected {background:#e9f2ff!important;color:#145cc7!important;border-color:#ccdef7!important;}
html body:not(.standalone-page) > .main .settings-container .settings-card>h2 {
 display:flex!important;align-items:center!important;gap:10px!important;margin:0 0 8px!important;
}
html body:not(.standalone-page) > .main .settings-container .settings-card>h2 .settings-heading-icon {flex:0 0 auto!important;margin:0!important;position:static!important;}
html body:not(.standalone-page) > .main .settings-container .settings-access .settings-description {margin:0 0 12px!important;}
html body:not(.standalone-page) > .main .settings-container .settings-save-bar {padding:10px 14px!important;min-height:0!important;margin:0!important;}

/* Main sections: the parent owns spacing; child margins do not accumulate. */
html body:not(.standalone-page) > .main > :is(.mc-dashboard-v2,.mc-myday,.mc-calendar-enterprise,.mc-companies-page,.mc-contacts-page,.network-page,.mc-activities-page,.mc-opportunities-page,.mc-pipeline-workspace,.tasks-container,.di-page,.manager-page,.settings-container,.mc-admin-users,.audit-page,.mc-search-page) {--mc-section-gap:16px;row-gap:var(--mc-section-gap)!important;}
html body:not(.standalone-page) > .main > :is(.mc-myday,.mc-companies-page,.mc-contacts-page,.network-page,.mc-activities-page,.mc-opportunities-page,.tasks-container,.di-page,.manager-page,.settings-container,.mc-admin-users,.audit-page,.mc-search-page) {display:flex!important;flex-direction:column!important;}
html body:not(.standalone-page) > .main > :is(.mc-dashboard-v2,.mc-myday,.mc-calendar-enterprise,.mc-companies-page,.mc-contacts-page,.network-page,.mc-activities-page,.mc-opportunities-page,.mc-pipeline-workspace,.tasks-container,.di-page,.manager-page,.settings-container,.mc-admin-users,.audit-page,.mc-search-page)>:not(dialog):not(script):not(style):not(link) {margin-top:0!important;margin-bottom:0!important;}

html body .main .settings-container .settings-category-content {
 display:flex!important;flex-direction:column!important;gap:16px!important;
}
html body .main .settings-container .settings-category-content>.settings-card {margin-top:0!important;margin-bottom:0!important;}
html body .main .settings-container .settings-category-content>form {
 display:flex!important;flex-direction:column!important;gap:16px!important;
}
html body .main .settings-container .settings-category-content>form>.settings-card {margin-top:0!important;margin-bottom:0!important;}
/* Do not leave an empty flex item for a category's inactive shared form. */
html body .main .settings-categories-ready .settings-category-content>form:not(:has(>.settings-card:not([hidden]))) {display:none!important;}

/* Pipeline follows the shared type scale. Content can grow without clipping. */
html body .main .mc-pipeline-workspace .mc-pipeline-kpi-top {
 display:flex;flex-wrap:wrap;align-items:center;gap:6px;min-width:0;
}
html body .main .mc-pipeline-workspace .mc-pipeline-kpi-top h3 {
 font-size:11.4px!important;font-weight:720!important;line-height:1.5!important;
 white-space:normal!important;overflow:visible!important;overflow-wrap:anywhere;
}
html body .main .mc-pipeline-workspace :is(.mc-pipeline-kpi-top small,.mc-pipeline-currency-count,.mc-pipeline-probability,.count) {
 font-size:9.7px!important;font-weight:700!important;line-height:1.1!important;
}
html body .main .mc-pipeline-workspace .mc-pipeline-kpi-values {
 flex-wrap:wrap!important;min-width:0;height:auto;max-height:none;overflow:visible;
}
html body .main .mc-pipeline-workspace .mc-pipeline-kpi-values>strong {
 font-size:clamp(23px,1.65vw,28px)!important;line-height:1.1!important;
 max-width:100%;white-space:normal;overflow:visible;overflow-wrap:anywhere;
}
html body .main .mc-pipeline-workspace :is(.mc-pipeline-kpi-values>b,.mc-pipeline-kpi-values>span,.mc-pipeline-kpi-values>small,.company,.mc-pipeline-card-meta,.mc-pipeline-card-meta strong,.mc-pipeline-card-meta .close-date,.mc-pipeline-stage-totals span,.mc-pipeline-stage-totals small,.mc-pipeline-stage-more,.mc-pipeline-signal,.mc-pipeline-next-action>span,.mc-pipeline-next-action>strong,.mc-pipeline-next-action>small,.mc-pipeline-stage-footer,.mc-pipeline-filter-empty,.empty) {
 font-size:var(--mc-81-copy,10.5px)!important;line-height:1.45!important;
}
html body .main .mc-pipeline-workspace :is(.column-header h2,.opportunity-card h3) {
 font-size:var(--mc-81-panel-title,14.6px)!important;font-weight:730!important;line-height:1.3!important;
}
html body .main .mc-pipeline-workspace .opportunity-card h3 {
 white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere;min-width:0;
}
html body .main .mc-pipeline-workspace .opportunity-card {padding:13px!important;}
html body .main .mc-pipeline-workspace :is(.mc-pipeline-card-meta,.mc-pipeline-next-action) {flex-wrap:wrap!important;gap:6px!important;}
html body .main .mc-pipeline-workspace .mc-pipeline-kpis {
 height:auto;min-height:min-content;
}
html body .main .mc-pipeline-workspace .mc-pipeline-kpis .kpi-card.mc-pipeline-kpi-card {
 position:relative;height:auto;min-height:100px!important;
 padding:14px 14px 14px 58px!important;
}
html body .main .mc-pipeline-workspace .mc-pipeline-kpis .kpi-card.mc-pipeline-kpi-card::before {
 position:absolute;top:14px!important;left:14px!important;width:32px!important;height:32px!important;
}

/* Primary headers use the same right edge even on two-column workspaces. */
html body:not(.standalone-page) > .main .mc-calendar-enterprise > .cal-hero {grid-column:1 / -1!important;}
html body:not(.standalone-page) > .main .mc-calendar-enterprise > .cal-side {grid-column:2;grid-row:2 / span 4!important;}
html body:not(.standalone-page) > .main .audit-page {--menu-label:"AUDIT LOG";}
html body:not(.standalone-page) > .main .mc-search-page {--menu-label:"SEARCH CRM";}
html body:not(.standalone-page) > .main .mc-search-page > .mc-search-header {text-align:left!important;align-self:stretch;}
html body:not(.standalone-page) > .main .mc-companies-header-actions .mc-company-count {min-height:36px!important;height:36px!important;}
html body:not(.standalone-page) > .main .mc-companies-header-actions {flex:0 0 auto;width:auto!important;min-width:0!important;max-width:100%;gap:9px!important;}
/* Hover feedback changes colour rather than moving header actions. */
html body:not(.standalone-page) > .main :is(.mc-dash-header,.myday-header,.cal-hero,.mc-companies-header,.mc-contacts-header,.network-topbar,.mc-activities-header,.mc-opportunities-header,.mc-pipeline-header,.page-header,.di-page-header,.manager-header,.mc-admin-header,.audit-header,.mc-search-header) :is(button,a):hover {transform:none!important;}
@media(max-width:1420px){
 html body:not(.standalone-page) > .main .mc-calendar-enterprise {grid-template-columns:minmax(0,1fr)!important;}
 html body:not(.standalone-page) > .main .mc-calendar-enterprise > .cal-side {grid-column:1;grid-row:auto!important;}
}
@media(min-width:1101px) and (max-width:1420px){
 html body:not(.standalone-page) > .main .mc-calendar-enterprise > .cal-side {grid-template-columns:repeat(3,minmax(0,1fr));}
}
@media(min-width:821px) and (max-width:1100px){
 html body:not(.standalone-page) > .main .mc-calendar-enterprise > .cal-side {grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(min-width:761px) and (max-width:1100px){
 html body:not(.standalone-page) > .main .mc-calendar-enterprise .cal-board {overflow-x:auto!important;}
 html body:not(.standalone-page) > .main .mc-calendar-enterprise :is(.cal-month-head,.cal-month-grid) {min-width:700px;}
}
@media(min-width:761px) and (max-width:1200px){
 html body:not(.standalone-page) > .main .mc-calendar-enterprise :is(.cal-time-head,.cal-time-body)[style*="--days:7"] {min-width:840px!important;}
}
@media(min-width:901px) and (max-width:1100px){
 html body:not(.standalone-page) > .main .mc-companies-header {flex-wrap:wrap!important;gap:12px!important;}
 html body:not(.standalone-page) > .main .mc-companies-header > :first-child {flex-basis:100%;}
 html body:not(.standalone-page) > .main .mc-companies-header-actions {margin-left:auto;}
}
