/* Opted-in CRM pages only; public site, Admin and Playground remain untouched. */
:root { --app-gutter: clamp(20px, 2vw, 48px); }
/* One horizontal contract for current and future authenticated pages. */
:where(.ds-container, .crm-shell, .inventory-shell, .team-shell, .settings-shell, .profile-shell, .mercury-app [data-mercury-shell] ~ main) { width: 100%; max-width: none; min-width: 0; margin: 0; padding: var(--space-8) var(--app-gutter) var(--space-16); }
:where(.ds-page-header, .page-heading) { margin-bottom: 28px; gap: var(--space-6); }
.ds-page-header { display: flex; align-items: flex-end; justify-content: space-between; }
:where(.ds-page-header, .page-heading) h1 { margin: 0; font-size: var(--text-page); line-height: 1.2; letter-spacing: -.035em; font-weight: 800; }
:where(.section-label, .section-eyebrow, .card-eyebrow, .login-heading .eyebrow) { margin: 0 0 var(--space-2); color: var(--color-primary); font-size: var(--text-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
:where(.page-heading p:not(.section-label), .heading-description) { color: var(--color-text-secondary); font-size: var(--text-md); line-height: 1.5; }
:where(.ds-toolbar, .heading-actions) { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-3); }
.ds-toolbar { margin-bottom: var(--space-5); }
.ds-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: var(--space-4); }
.mercury-app [data-mercury-shell] { width: 100%; padding: 0; background: var(--color-surface); }
.mercury-app .application-header { width: 100%; max-width: none; margin: 0; padding: var(--space-3) var(--app-gutter); border: 0; border-bottom: var(--border-default); border-radius: 0; box-shadow: var(--shadow-card); }
.mercury-app :is(.brand-mark, .shell-brand-mark) { background: var(--color-brand); border-radius: var(--radius-control); }
.mercury-app .user-avatar { border-radius: 50%; }
.mercury-app .desktop-navigation a { font-size: var(--text-md); font-weight: 600; }
.mercury-app .user-menu { border-radius: var(--radius-card); box-shadow: var(--shadow-raised); }
.mercury-app .desktop-navigation a[aria-current="page"] { color: var(--color-brand); }
.lead-tools { max-width: none; margin-bottom: var(--space-6); }
.kanban-board { width: 100%; min-width: 0; margin-inline: 0; padding-inline: 0; grid-template-columns: repeat(5, minmax(260px, 1fr)); overflow-x: auto; }
.kanban-column { min-width: 0; background: #eef0ed; border-radius: var(--radius-card); }
.kanban-column .column-name { min-width: 0; overflow-wrap: anywhere; }
.kanban-column .column-name::before, .kanban-column .column-count { flex-shrink: 0; }
.lead-card .card-heading, .lead-card .card-footer { flex-wrap: wrap; }
.lead-card .owner-line { min-width: 0; overflow-wrap: anywhere; }
.lead-card:hover { transform: none; box-shadow: var(--shadow-raised); }
.lead-card .customer-name { font-size: var(--text-md); }
.lead-card .qualification-badge { font-size: var(--text-xs); padding-inline: var(--space-2); }
.lead-card .last-activity { color: var(--color-text-secondary); }
.lead-summary { background: var(--color-background); }
.vehicle-details { padding: var(--space-5); }
.vehicle-price { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.inventory-filters { gap: 0; width: fit-content; max-width: 100%; padding: 3px; border: var(--border-default); border-radius: var(--radius-control); background: var(--color-surface); }
.inventory-filters button { min-height: var(--control-compact); border: 0; background: transparent; font-size: var(--text-sm); white-space: nowrap; }
.inventory-filters button.active { background: var(--color-brand); }
.team-surface { overflow-x: auto; }
.team-surface .ds-table { min-width: 1000px; }
.team-row .user-name { min-width: 180px; font-weight: 700; }
.team-row .email { overflow-wrap: anywhere; }
.team-surface .ds-table th { white-space: nowrap; }
.team-surface .ds-table td { font-size: var(--text-sm); }
.institutional-panel { background: var(--color-brand); }
.wordmark-on-dark .brand-mark { background: white; color: var(--color-brand); }
.authentication-panel { background: var(--color-surface); }
.login-heading h2 { font-size: var(--text-page); line-height: 1.2; }
.submit-button { width: 100%; }
@media (max-width: 1080px) { .heading-actions { justify-content: flex-end; } }
@media (max-width: 820px) { .page-heading:has(.heading-actions) { flex-direction: column; align-items: flex-start; } .heading-actions { justify-content: flex-start; } }
@media (max-width: 640px) {
  :root { --app-gutter: 14px; }
  :where(.ds-container, .crm-shell, .inventory-shell, .team-shell, .settings-shell, .profile-shell, .mercury-app [data-mercury-shell] ~ main) { padding-block: var(--space-6) var(--space-12); }
  .mercury-app .application-header { padding: var(--space-2) var(--app-gutter); }
  :where(.ds-page-header, .page-heading) h1 { font-size: 1.75rem; }
  .ds-page-header { flex-direction: column; align-items: flex-start; }
  .heading-actions { align-items: stretch; width: 100%; }
}

/* Full-width sections; internal form proportions remain page-owned. */
:where(.settings-card, .profile-card, .team-surface) { width: 100%; min-width: 0; max-width: none; }
.vehicle-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
