/* Infinity Service R637 public/case route delivery bundle; authenticated Montage rules are excluded. */

/*mobile.css*/
/* Legacy portal mobile contract extracted from styles.css during R214. New mobile UI belongs in tokenized assets. */
/* PRE-QA R189: single client profile tablet/mobile contract, no duplicated responsive layers. */
@media (max-width: 1100px) {
  body.portal-page #profile-section,
  body.portal-page .portal-profile-section {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow-x: hidden !important;
  }

  body.portal-page #portal-profile-dashboard > aside.portal-sidebar,
  body.portal-page #portal-profile-dashboard .portal-sidebar {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body.portal-page #portal-profile-dashboard > main.portal-main,
  body.portal-page #portal-profile-dashboard .portal-main {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: block !important;
    overflow: hidden !important;
    border: 1px solid var(--line) !important;
    border-radius: 10px !important;
    background: var(--surface) !important;
  }

  body.portal-page #portal-profile-dashboard .mobile-top {
    display: block !important;
    padding: 10px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    border-radius: 0 !important;
    background: var(--surface) !important;
  }

  body.portal-page #portal-profile-dashboard .mobile-profile-row {
    display: grid !important;
    grid-template-columns: 48px minmax(0, 1fr) 38px 38px !important;
    gap: 8px !important;
    align-items: center !important;
    min-width: 0 !important;
  }

  body.portal-page #portal-profile-dashboard .mobile-profile-row .avatar-large {
    width: 48px !important;
    height: 48px !important;
    border-radius: 12px !important;
    font-size: 22px !important;
  }

  body.portal-page #portal-profile-dashboard .mobile-profile-row h1 {
    margin: 0 !important;
    max-width: 100% !important;
    color: var(--ink) !important;
    font-size: 17px !important;
    line-height: 1.12 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    overflow: hidden !important;
  }

  body.portal-page #portal-profile-dashboard .mobile-profile-row .profile-pills {
    min-width: 0 !important;
    margin-top: 4px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
  }

  body.portal-page #portal-profile-dashboard .mobile-profile-row .pill {
    max-width: 100% !important;
    min-height: 22px !important;
    padding: 0 7px !important;
    border: 1px solid var(--line) !important;
    background: var(--surface-soft) !important;
    color: var(--muted) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 11px !important;
    line-height: 20px !important;
  }

  body.portal-page #portal-profile-dashboard .portal-notification-bell,
  body.portal-page #portal-profile-dashboard .portal-mobile-logout {
    color: var(--ink) !important;
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
  }

  body.portal-page #portal-profile-dashboard .portal-header {
    display: block !important;
    min-height: 0 !important;
    padding: 10px !important;
    margin: 0 !important;
    border-bottom: 1px solid var(--line) !important;
  }

  body.portal-page #portal-profile-dashboard .portal-header-copy,
  body.portal-page #portal-profile-dashboard #portal-document-preview {
    display: none !important;
  }

  body.portal-page #portal-profile-dashboard .portal-header-loyalty-card {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 72px !important;
    gap: 6px 10px !important;
    min-height: 0 !important;
    padding: 10px !important;
    border-radius: 8px !important;
  }

  body.portal-page #portal-profile-dashboard .portal-header-loyalty-card .portal-qr-mark {
    width: 72px !important;
    height: 72px !important;
    margin: 0 !important;
  }

  body.portal-page #portal-profile-dashboard .portal-tabs {
    display: none !important;
  }

  body.portal-page #portal-profile-dashboard .portal-overview-grid,
  body.portal-page #portal-profile-dashboard .document-grid,
  body.portal-page #portal-profile-dashboard .portal-settings-grid,
  body.portal-page #portal-profile-dashboard .portal-channel-preferences-grid {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin: 0 !important;
  }

  body.portal-page #portal-profile-dashboard .level-grid {
    grid-template-columns: repeat(3, minmax(104px, 1fr)) !important;
    gap: 8px !important;
    overflow-x: auto !important;
    padding-bottom: 2px !important;
    scrollbar-width: thin !important;
  }

  body.portal-page #portal-profile-dashboard .level-item {
    min-width: 104px !important;
    padding: 10px 8px !important;
    border-radius: 8px !important;
  }

  body.portal-page #portal-profile-dashboard .level-item span {
    display: block !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    line-height: 1.25 !important;
  }

  body.portal-page #portal-profile-dashboard :where(.card,.panel-card,.portal-aside-card,.portal-settings-card,.level-card,.stat-card) {
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 10px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
  }

  body.portal-page #portal-profile-dashboard .portal-workspace-head,
  body.portal-page #portal-profile-dashboard .portal-document-status-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  body.portal-page #portal-profile-dashboard .portal-workspace-tabs {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  body.portal-page #portal-profile-dashboard .portal-workspace-tabs button {
    min-width: 0 !important;
    min-height: 34px !important;
    padding: 0 8px !important;
    font-size: 12px !important;
  }

  body.portal-page #portal-profile-dashboard .portal-profile-case-preview {
    margin-top: 10px !important;
    padding: 12px !important;
    border-radius: 8px !important;
    background: var(--surface) !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }

  body.portal-page #portal-profile-dashboard .profile-case-preview-head {
    grid-template-columns: 40px minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: start !important;
  }

  body.portal-page #portal-profile-dashboard .profile-case-preview-device {
    width: 40px !important;
    height: 40px !important;
    border-radius: 10px !important;
    font-size: 16px !important;
  }

  body.portal-page #portal-profile-dashboard .profile-case-preview-head h3 {
    margin: 1px 0 !important;
    font-size: 16px !important;
    line-height: 1.18 !important;
    overflow-wrap: anywhere !important;
  }

  body.portal-page #portal-profile-dashboard .profile-case-preview-head p {
    display: -webkit-box !important;
    margin: 0 !important;
    overflow: hidden !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
  }

  body.portal-page #portal-profile-dashboard .profile-case-preview-head .portal-case-status-pill {
    grid-column: 2 !important;
    justify-self: start !important;
    max-width: 100% !important;
  }

  body.portal-page #portal-profile-dashboard .profile-case-preview-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-top: 10px !important;
  }

  body.portal-page #portal-profile-dashboard .profile-case-preview-meta span {
    padding: 8px !important;
    border-radius: 8px !important;
  }

  body.portal-page #portal-profile-dashboard .profile-case-preview-progress {
    grid-template-columns: repeat(7, minmax(22px, 1fr)) !important;
    gap: 4px !important;
    margin: 12px 0 !important;
    padding-top: 8px !important;
  }

  body.portal-page #portal-profile-dashboard .profile-case-preview-progress::before,
  body.portal-page #portal-profile-dashboard .profile-case-preview-progress > i,
  body.portal-page #portal-profile-dashboard .profile-case-preview-progress > progress.portal-progress-profile {
    top: 19px !important;
    height: 3px !important;
  }

  body.portal-page #portal-profile-dashboard .profile-case-preview-progress span {
    width: 24px !important;
    height: 24px !important;
    font-size: 10px !important;
  }

  body.portal-page #portal-profile-dashboard .profile-case-preview-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  body.portal-page #portal-profile-dashboard .profile-case-preview-grid article {
    padding: 10px !important;
    border-radius: 8px !important;
  }

  body.portal-page #portal-profile-dashboard .profile-case-preview-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-top: 10px !important;
  }

  body.portal-page #portal-profile-dashboard .profile-case-preview-actions .btn {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 38px !important;
    padding: 0 8px !important;
    font-size: 12px !important;
    line-height: 1.15 !important;
  }

  body.portal-page #portal-profile-dashboard .portal-case-mini-row {
    grid-template-columns: 38px minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 9px !important;
    align-items: start !important;
  }

  body.portal-page #portal-profile-dashboard .portal-device-thumb {
    grid-column: 1 !important;
    grid-row: 1 / span 5 !important;
    width: 38px !important;
    height: 38px !important;
  }

  body.portal-page #portal-profile-dashboard .portal-case-mini-main,
  body.portal-page #portal-profile-dashboard .portal-status-pill,
  body.portal-page #portal-profile-dashboard .portal-case-mini-code,
  body.portal-page #portal-profile-dashboard .portal-case-mini-money,
  body.portal-page #portal-profile-dashboard .portal-case-mini-action {
    grid-column: 2 !important;
    min-width: 0 !important;
  }

  body.portal-page #portal-profile-dashboard .portal-case-mini-main :where(b,span,small) {
    overflow-wrap: anywhere !important;
  }

  body.portal-page #portal-profile-dashboard .portal-case-mini-code,
  body.portal-page #portal-profile-dashboard .portal-case-mini-money {
    grid-row: 3 !important;
  }

  body.portal-page #portal-profile-dashboard .portal-case-mini-code {
    justify-self: start !important;
  }

  body.portal-page #portal-profile-dashboard .portal-case-mini-money {
    justify-self: end !important;
  }

  body.portal-page #portal-profile-dashboard .portal-case-mini-action {
    grid-row: 4 !important;
    width: calc(50% - 4px) !important;
    min-height: 34px !important;
    justify-self: start !important;
    padding: 0 8px !important;
  }

  body.portal-page #portal-profile-dashboard .portal-case-chat-action {
    justify-self: end !important;
  }

  body.portal-page .app-mobile-nav {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 95 !important;
    min-height: calc(64px + env(safe-area-inset-bottom)) !important;
    height: auto !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 4px !important;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)) !important;
    overflow: hidden !important;
    border-top: 1px solid var(--line) !important;
    background: var(--surface) !important;
  }

  body.portal-page .app-mobile-nav :where(button,a) {
    min-width: 0 !important;
    width: 100% !important;
    min-height: 50px !important;
    padding: 0 2px !important;
    display: grid !important;
    grid-template-rows: 22px auto !important;
    place-items: center !important;
    gap: 2px !important;
    border-radius: 8px !important;
    white-space: normal !important;
  }
}

@media (max-width: 520px) {
  body.portal-page #portal-profile-dashboard .portal-header-loyalty-card {
    grid-template-columns: 1fr !important;
  }

  body.portal-page #portal-profile-dashboard .portal-header-loyalty-card .portal-qr-mark {
    width: 86px !important;
    height: 86px !important;
    justify-self: start !important;
  }

  body.portal-page #portal-profile-dashboard .level-grid {
    grid-template-columns: 1fr !important;
    overflow: visible !important;
    padding-bottom: 0 !important;
  }

  body.portal-page #portal-profile-dashboard .level-item {
    display: grid !important;
    grid-template-columns: 52px minmax(0, 1fr) !important;
    align-items: center !important;
    min-width: 0 !important;
    text-align: left !important;
    gap: 8px !important;
  }

  body.portal-page #portal-profile-dashboard .profile-case-preview-meta,
  body.portal-page #portal-profile-dashboard .profile-case-preview-actions {
    grid-template-columns: 1fr !important;
  }

  body.portal-page #portal-profile-dashboard .portal-case-mini-action {
    width: 100% !important;
    justify-self: stretch !important;
  }

  body.portal-page #portal-profile-dashboard .portal-case-chat-action {
    grid-row: 5 !important;
    justify-self: stretch !important;
  }
}

/* PRE-QA R190: client profile mobile chrome is state-driven, not visible on the login screen. */
body.portal-page #profile-section .app-mobile-nav[hidden] {
  display: none !important;
}

/* R300: one mobile owner for the client-profile bottom navigation. */
@media (max-width: 760px) {
  body.portal-page .app-mobile-nav {
    align-items: stretch !important;
    overflow-y: hidden !important;
    overscroll-behavior-x: contain !important;
    scrollbar-width: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  body.portal-page .app-mobile-nav::-webkit-scrollbar {
    display: none !important;
  }

  body.portal-page .app-mobile-nav button,
  body.portal-page .app-mobile-nav a {
    min-width: 0 !important;
    width: 100% !important;
    min-height: 50px !important;
    display: grid !important;
    grid-template-rows: 22px auto !important;
    justify-items: center !important;
    align-content: center !important;
    gap: 2px !important;
    padding: 0 2px !important;
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: var(--muted) !important;
    font-size: 12px !important;
    font-weight: 750 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    white-space: normal !important;
  }

  body.portal-page .app-mobile-nav button.is-active:not(.mobile-nav-action),
  body.portal-page .app-mobile-nav button.active:not(.mobile-nav-action) {
    border-color: color-mix(in srgb, var(--primary) 22%, var(--line)) !important;
    background: color-mix(in srgb, var(--primary) 8%, var(--surface)) !important;
    color: var(--primary) !important;
  }

  body.portal-page .app-mobile-nav button.mobile-nav-action {
    border-color: var(--line) !important;
    border-radius: 12px !important;
    background: var(--surface) !important;
    color: var(--primary) !important;
    font-weight: 800 !important;
  }

  body.portal-page .app-mobile-nav button.mobile-nav-action.is-primary {
    border-color: var(--primary) !important;
    background: var(--primary) !important;
    color: #fff !important;
  }

  body.portal-page .app-mobile-nav svg {
    width: 20px !important;
    height: 20px !important;
  }
}

@media (max-width: 720px) {
  body.portal-page.portal-profile-authenticated .cookie-banner {
    bottom: calc(78px + env(safe-area-inset-bottom)) !important;
    max-height: min(42vh, 320px);
    overflow: auto;
  }
}


/*core.css*/
/* Shared design-system contract. New UI must consume these tokens. */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --radius-control: 10px;
  --radius-panel: 14px;
  --radius-card: 14px;
  --radius-dialog: 18px;
  --control-height-compact: 36px;
  --control-height-default: 40px;
  --control-height-touch: 44px;
  --focus-outline: 3px solid var(--focus-ring);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

:where(button, input, select, textarea)[aria-busy="true"],
:where(button, input, select, textarea):disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
}

.request-upload-status[hidden] {
  display: none;
}

.request-upload-track[role="progressbar"] {
  position: relative;
}

.admin-page .admin-case-upload-status {
  margin: var(--space-4) 0 0;
  background: var(--surface-soft, #fff);
}

.admin-page .admin-file-upload-status,
.portal-page .portal-chat-upload-status {
  margin: var(--space-3) 0 0;
  width: 100%;
  background: var(--surface-soft, #fff);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto;
    transition-duration: .01ms;
    animation-duration: .01ms;
    animation-iteration-count: 1;
  }
}


/*portal.css*/
/* PRE-QA R193: client-facing GDPR request workspace. */
body.portal-page .portal-privacy-workspace {
  display: grid;
  gap: 16px;
}

/* R315 visual foundation: current code-driven public hero and wider service shell. */
body.site-page {
  --site-shell: min(1380px, calc(100% - 48px));
}

body.site-page :where(.top-strip .container,.site-header .container,.site-hero,.quick-row,#track-section,.site-main-grid,.category-strip,.process,.portal-action-split,.portal-trust-app-grid,#reservation-section,#full-prices-section,#faq-section,#contacts-section,.site-footer > .container) {
  width: var(--site-shell);
  max-width: 1380px;
}

body.site-page .site-hero:not(.is-image-only) {
  min-height: 520px;
  margin: 20px auto 24px;
  border: 1px solid color-mix(in srgb, var(--pink) 15%, var(--line));
  border-radius: 30px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 96%, var(--pink)), var(--surface-soft));
  box-shadow: 0 1px 2px rgba(20, 28, 48, .04);
}

body.site-page .portal-banner-slide.is-code-hero {
  background-image:
    radial-gradient(circle at 78% 18%, color-mix(in srgb, var(--pink) 15%, transparent), transparent 36%),
    linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--surface-soft) 86%, var(--pink)));
}

body.site-page .portal-banner-slide.is-code-hero > .container {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(420px, 1.08fr);
  gap: 44px;
  align-items: center;
  padding: 42px 54px;
}

body.site-page .portal-banner-slide.is-code-hero .hero-content {
  width: auto;
  max-width: 650px;
  padding: 0;
}

body.site-page .hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--pink) 24%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--pink) 7%, var(--surface));
  color: var(--pink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .055em;
  text-transform: uppercase;
}

body.site-page .hero-kicker svg {
  width: 17px;
  height: 17px;
}

body.site-page .portal-banner-slide.is-code-hero h1 {
  max-width: 12ch;
  font-size: clamp(46px, 4.6vw, 72px);
  letter-spacing: -.045em;
  text-transform: none;
}

body.site-page .hero-product-visual {
  position: relative;
  min-width: 0;
  margin: 0;
}

body.site-page .hero-product-visual > img {
  display: block;
  width: 100%;
  max-height: 390px;
  object-fit: contain;
  border: 1px solid color-mix(in srgb, var(--pink) 12%, var(--line));
  border-radius: 24px;
  background: var(--surface-soft);
}

body.site-page .hero-product-visual figcaption {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body.site-page .hero-product-visual figcaption span {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--pink) 18%, var(--line));
  border-radius: 13px;
  background: var(--surface);
  color: var(--muted);
  box-shadow: none;
  font-size: 11px;
  font-weight: 750;
  backdrop-filter: none;
}

body.site-page .hero-product-visual figcaption b {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 19px;
}

@media (max-width: 980px) {
  body.site-page { --site-shell: min(100% - 24px, 760px); }
  body.site-page .portal-banner-slide.is-code-hero > .container {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 34px;
  }
  body.site-page .site-hero:not(.is-image-only) { min-height: 760px; }
  body.site-page .portal-banner-slide.is-code-hero h1 { max-width: 15ch; }
  body.site-page .hero-product-visual > img { max-height: 300px; }
}

@media (max-width: 560px) {
  body.site-page { --site-shell: calc(100% - 16px); }
  body.site-page .site-hero:not(.is-image-only) { min-height: 690px; border-radius: 20px; }
  body.site-page .portal-banner-slide.is-code-hero > .container { padding: 26px 20px; }
  body.site-page .portal-banner-slide.is-code-hero h1 { font-size: clamp(38px, 12vw, 54px); }
  body.site-page .hero-content p { font-size: 16px; }
  body.site-page .hero-product-visual figcaption { position: static; grid-template-columns: 1fr; margin-top: 10px; }
  body.site-page .hero-product-visual figcaption span { display: grid; grid-template-columns: 42px 1fr; align-items: center; }
  body.site-page .hero-product-visual figcaption b { margin: 0; }
}

/* R314: the location stays useful even when a third-party map tile is blocked. */
body.site-page #contacts-section .portal-map-panel .portal-map-embed {
  position: relative;
  isolation: isolate;
  min-height: 360px;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg) 76%, var(--surface));
}

body.site-page #contacts-section .portal-map-panel .portal-map-embed > iframe {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
  background: color-mix(in srgb, var(--bg) 76%, var(--surface));
}

body.site-page #contacts-section .portal-map-marker-card {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 3;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  width: min(360px, calc(100% - 32px));
  min-height: 68px;
  gap: 2px 10px;
  align-items: center;
  padding: 11px 14px;
  border: 1px solid color-mix(in srgb, var(--pink) 28%, var(--line));
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(20, 24, 40, .08);
  backdrop-filter: none;
}

body.site-page #contacts-section .portal-map-marker-card > span {
  grid-row: 1 / span 2;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
}

body.site-page #contacts-section .portal-map-marker-card :where(b,small) {
  min-width: 0;
  overflow-wrap: break-word;
}

body.site-page #contacts-section .portal-map-marker-card small {
  color: var(--muted);
}

/* R314: client case rows keep readable columns instead of wrapping words letter by letter. */
body.portal-page #portal-profile-dashboard .recent-card {
  container-type: inline-size;
}

@media (max-width: 520px) {
  body.site-page #contacts-section .portal-map-panel .portal-map-embed { min-height: 300px; }
  body.site-page #contacts-section .portal-map-marker-card { left: 10px; bottom: 10px; width: calc(100% - 20px); }
}

body.portal-page.portal-profile-authenticated > .cookie-banner {
  left: 50%;
  right: auto;
  width: min(980px, calc(100vw - 32px));
  transform: translateX(-50%);
  border-radius: 16px;
}

body.portal-page.portal-profile-authenticated > .cookie-banner .cookie-banner__body p {
  max-width: 68ch;
}

@media (max-width: 760px) {
  body.portal-page.portal-profile-authenticated > .cookie-banner {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    width: auto;
    transform: none;
  }
}

body.portal-page .portal-native-progress,
body.portal-page .profile-case-native-progress,
body.portal-page .portal-progress-meter {
  display: block;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  appearance: none;
}

body.portal-page :where(.portal-native-progress,.profile-case-native-progress,.portal-progress-meter)::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
body.portal-page :where(.portal-native-progress,.profile-case-native-progress,.portal-progress-meter)::-webkit-progress-value { background: var(--pink); border-radius: 999px; }
body.portal-page :where(.portal-native-progress,.profile-case-native-progress,.portal-progress-meter)::-moz-progress-bar { background: var(--pink); border-radius: 999px; }

body.portal-page .portal-case-progress-line > .portal-progress-case {
  height: 100%;
  border-radius: inherit;
}

body.portal-page .portal-profile-contract-failure {
  width: min(920px, calc(100% - 32px));
  margin: 24px auto 40px;
  padding: 20px;
  border: 2px solid var(--danger, #d92f55);
  border-radius: 16px;
  background: #fff4f7;
  color: #6f1024;
  box-shadow: 0 14px 40px rgba(80, 8, 30, .14);
}

body.portal-page .portal-profile-contract-failure strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
}

body.portal-page .portal-profile-contract-failure p {
  margin: 0 0 14px;
  line-height: 1.55;
}

/* R300: one portal owner for the profile shell across every breakpoint. */
body.portal-page #portal-profile-dashboard.portal-shell:not([hidden]) {
  display: grid;
  width: min(1580px, calc(100% - 48px));
  min-height: 0;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 24px;
  margin: 24px auto 56px;
  align-items: start;
}

@media (max-width: 1180px) {
  body.portal-page #portal-profile-dashboard.portal-shell:not([hidden]) {
    width: calc(100% - 28px);
    grid-template-columns: 240px minmax(0, 1fr);
  }
}

@media (max-width: 1100px) {
  body.portal-page #portal-profile-dashboard.portal-shell:not([hidden]) {
    width: min(100% - 16px, 900px);
    max-width: 900px;
    min-width: 0;
    display: block;
    grid-template-columns: 1fr;
    gap: 0;
    margin: 6px auto calc(76px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 520px) {
  body.portal-page #portal-profile-dashboard.portal-shell:not([hidden]) {
    width: calc(100% - 8px);
    margin-top: 4px;
  }
}

/* R302: one proportional owner for profile content, overview statistics and profile-card typography. */
body.portal-page #portal-profile-dashboard .portal-content {
  display: grid;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
  margin: 0;
  padding: 24px 28px 32px;
  background: var(--surface);
}

body.portal-page #portal-profile-dashboard .portal-content-main,
body.portal-page #portal-profile-dashboard .portal-dashboard-aside {
  display: grid;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 16px;
  margin: 0;
}

body.portal-page #portal-profile-dashboard .portal-content-main {
  container-name: portal-main;
  container-type: inline-size;
}

body.portal-page #portal-profile-dashboard .stat-grid {
  display: grid;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 12px;
  margin: 0;
}

body.portal-page #portal-profile-dashboard .stat-card {
  display: grid;
  min-width: 0;
  min-height: 142px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr auto;
  gap: 8px 10px;
  align-items: center;
  padding: 16px;
  border-color: color-mix(in srgb, var(--line) 88%, var(--pink));
  border-radius: 14px;
  background: var(--surface);
}

body.portal-page #portal-profile-dashboard .stat-card > .icon-bubble {
  grid-row: 1 / span 2;
  width: 42px;
  height: 42px;
  margin: 0;
}

body.portal-page #portal-profile-dashboard .stat-card > span:not(.icon-bubble) {
  grid-column: 2 / -1;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

body.portal-page #portal-profile-dashboard .stat-card > b {
  grid-column: 3;
  grid-row: 2;
  align-self: center;
  color: var(--ink);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}

/* R343: the profile main column can be narrow while the viewport is still
   desktop-wide. Container queries keep its cards and case rows contained. */
@container portal-main (max-width: 700px) {
  body.portal-page #portal-profile-dashboard .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.portal-page #portal-profile-dashboard #portal-profile-case-preview .profile-case-preview-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.portal-page #portal-profile-dashboard .portal-content-main .portal-case-mini-row {
    grid-template-columns: 42px minmax(0, 1fr) minmax(88px, auto);
    grid-template-areas:
      "thumb main status"
      "thumb main code"
      ". money detail"
      ". . chat";
  }
}

@container portal-main (max-width: 430px) {
  body.portal-page #portal-profile-dashboard .stat-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.portal-page #portal-profile-dashboard .portal-content-main .portal-case-mini-row {
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-areas:
      "thumb main"
      ". status"
      ". code"
      ". money"
      ". detail"
      ". chat";
  }
}

body.portal-page #portal-profile-dashboard .stat-card > a {
  grid-column: 1 / -1;
  grid-row: 3;
  min-width: 0;
  overflow-wrap: normal;
  word-break: normal;
}

body.portal-page:not([data-portal-panel="overview"]) #portal-profile-dashboard .portal-content {
  grid-template-columns: minmax(0, 1fr);
}

body.portal-page:not([data-portal-panel="overview"]) #portal-profile-dashboard .portal-dashboard-aside {
  display: none;
}

@media (max-width: 1180px) {
  body.portal-page #portal-profile-dashboard .portal-content {
    grid-template-columns: minmax(0, 1fr);
  }

  body.portal-page #portal-profile-dashboard .portal-dashboard-aside {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  }

  body.portal-page #portal-profile-dashboard .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  body.portal-page #portal-profile-dashboard .portal-content {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  body.portal-page #portal-profile-dashboard .portal-content-main,
  body.portal-page #portal-profile-dashboard .portal-dashboard-aside {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

}

@media (max-width: 520px) {
  body.portal-page #portal-profile-dashboard .stat-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* R303: one portal owner for the client document list and preview workspace. */
body.portal-page #portal-profile-dashboard .portal-documents-split,
body.portal-page #portal-profile-dashboard .portal-documents-split.is-active {
  display: grid;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 340px);
  gap: 14px;
  align-items: start;
}

body.portal-page #portal-profile-dashboard .portal-doc-row {
  display: grid;
  min-width: 0;
  max-width: 100%;
  min-height: 72px;
  grid-template-columns: 48px minmax(0, 1fr) minmax(104px, auto) 38px;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
}

body.portal-page #portal-profile-dashboard .portal-doc-row.is-active {
  border-color: color-mix(in srgb, var(--pink) 48%, var(--line));
  outline: 2px solid color-mix(in srgb, var(--pink) 24%, transparent);
  outline-offset: 1px;
  box-shadow: none;
}

body.portal-page #portal-profile-dashboard .portal-doc-row > span {
  display: inline-grid;
  width: 46px;
  height: 38px;
  place-items: center;
  padding: 0 6px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--pink);
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.portal-page #portal-profile-dashboard .portal-doc-row > div {
  display: grid;
  min-width: 0;
  gap: 4px;
  overflow: visible;
}

body.portal-page #portal-profile-dashboard .portal-doc-row > div :where(b,small) {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

/* R311: technical evidence belongs to every locked document surface. */
body.portal-page .profile-preview-doc > a {
  display: grid;
  min-width: 0;
  gap: 3px;
}

body.portal-page #portal-profile-dashboard :where(.portal-doc-row,.portal-protocol-row,.portal-document-preview) .portal-hash-evidence,
body:is(.site-page,.portal-page) .portal-case-doc-row .portal-hash-evidence,
body.portal-page .profile-preview-doc .portal-hash-evidence {
  justify-self: start;
  margin-left: 0;
}

body.portal-page #portal-profile-dashboard .portal-doc-row .portal-hash-evidence-pop,
body.portal-page #portal-profile-dashboard .portal-protocol-row .portal-hash-evidence-pop {
  z-index: 80;
}

body.portal-page #portal-profile-dashboard .portal-doc-row > div small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

body.portal-page #portal-profile-dashboard .portal-doc-row > .portal-doc-status {
  max-width: 128px;
  justify-self: start;
  overflow-wrap: anywhere;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}

body.portal-page #portal-profile-dashboard .portal-doc-row > .portal-doc-download {
  display: inline-grid;
  width: 38px;
  min-width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
  text-decoration: none;
}

@media (max-width: 980px) {
  body.portal-page #portal-profile-dashboard .portal-documents-split,
  body.portal-page #portal-profile-dashboard .portal-documents-split.is-active {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  body.portal-page #portal-profile-dashboard .portal-doc-row {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px 10px;
    align-items: start;
    padding: 10px;
  }

  body.portal-page #portal-profile-dashboard .portal-doc-row > span {
    width: 38px;
    height: 38px;
    padding: 0 4px;
    font-size: 10px;
  }

  body.portal-page #portal-profile-dashboard .portal-doc-row > div,
  body.portal-page #portal-profile-dashboard .portal-doc-row > :where(em,a) {
    grid-column: 2;
    min-width: 0;
    justify-self: start;
  }

  body.portal-page #portal-profile-dashboard .portal-doc-row > .portal-doc-download {
    width: 34px;
    min-width: 34px;
    height: 34px;
    justify-self: end;
  }
}

/* R304: one portal owner for recent notifications and the notification journal. */
body.portal-page #portal-profile-dashboard .portal-notification-list,
body.portal-page #portal-profile-dashboard .portal-notification-workspace.is-active {
  display: grid;
  min-width: 0;
  gap: 12px;
}

body.portal-page #portal-profile-dashboard .portal-notification-workspace.is-active {
  margin-top: 0;
}

body.portal-page #portal-profile-dashboard .portal-notification-item {
  display: grid;
  min-width: 0;
  min-height: 72px;
  grid-template-columns: 44px minmax(0, 1fr) minmax(82px, auto);
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

body.portal-page #portal-profile-dashboard .portal-notification-item > i {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  color: var(--primary);
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.portal-page #portal-profile-dashboard .portal-notification-item > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

body.portal-page #portal-profile-dashboard .portal-notification-item :where(b, span) {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
  word-break: normal;
}

body.portal-page #portal-profile-dashboard .portal-notification-item span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

body.portal-page #portal-profile-dashboard .portal-notification-open,
body.portal-page #portal-profile-dashboard .portal-case-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

body.portal-page #portal-profile-dashboard .portal-notification-open:hover,
body.portal-page #portal-profile-dashboard .portal-case-link:hover {
  border-color: color-mix(in srgb, var(--primary) 42%, var(--line));
  color: var(--primary);
}

body.portal-page #portal-profile-dashboard .portal-notification-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

body.portal-page #portal-profile-dashboard .portal-notification-table table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
}

body.portal-page #portal-profile-dashboard .portal-notification-table th {
  padding: 10px 12px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
  text-align: left;
  text-transform: uppercase;
}

body.portal-page #portal-profile-dashboard .portal-notification-table td {
  min-width: 0;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
}

body.portal-page #portal-profile-dashboard .portal-notification-table tr:last-child td {
  border-bottom: 0;
}

body.portal-page #portal-profile-dashboard .portal-notification-table :is(th, td):nth-child(1) {
  width: 104px;
}

body.portal-page #portal-profile-dashboard .portal-notification-table :is(th, td):nth-child(3) {
  width: 138px;
}

body.portal-page #portal-profile-dashboard .portal-notification-table :is(th, td):nth-child(4) {
  width: 154px;
}

body.portal-page #portal-profile-dashboard .portal-notification-table :is(th, td):nth-child(5) {
  width: 132px;
}

body.portal-page #portal-profile-dashboard .portal-service-event-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--primary) 26%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

@media (max-width: 980px) {
  body.portal-page #portal-profile-dashboard .portal-notification-table {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  body.portal-page #portal-profile-dashboard .portal-notification-table :is(table, tbody, tr, td) {
    display: block;
    width: 100%;
    min-width: 0;
  }

  body.portal-page #portal-profile-dashboard .portal-notification-table thead {
    display: none;
  }

  body.portal-page #portal-profile-dashboard .portal-notification-table tr {
    margin: 0 0 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }

  body.portal-page #portal-profile-dashboard .portal-notification-table tr:last-child {
    margin-bottom: 0;
  }

  body.portal-page #portal-profile-dashboard .portal-notification-table td {
    display: grid;
    width: 100%;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
  }

  body.portal-page #portal-profile-dashboard .portal-notification-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
  }

  body.portal-page #portal-profile-dashboard .portal-notification-table td[colspan] {
    display: block;
  }

  body.portal-page #portal-profile-dashboard .portal-notification-table td[colspan]::before {
    display: none;
  }

  body.portal-page #portal-profile-dashboard .portal-notification-table .portal-status-pill {
    max-width: 100%;
    min-width: 0;
    justify-self: start;
    text-align: center;
    white-space: normal;
  }
}

@media (max-width: 760px) {
  body.portal-page #portal-profile-dashboard .portal-notification-item {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px 10px;
    align-items: start;
    padding: 11px;
  }

  body.portal-page #portal-profile-dashboard .portal-notification-item > i {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  body.portal-page #portal-profile-dashboard .portal-notification-item > :where(.portal-status-pill, .portal-notification-open) {
    grid-column: 2;
    justify-self: start;
  }

  body.portal-page #portal-profile-dashboard .portal-notification-table td {
    grid-template-columns: 82px minmax(0, 1fr);
  }
}

body.portal-page .portal-privacy-workspace .section-head {
  align-items: flex-start;
  gap: 12px;
}

body.portal-page .portal-privacy-workspace .section-head p,
body.portal-page .portal-privacy-workspace .form-note,
body.portal-page .portal-privacy-request-meta,
body.portal-page .portal-privacy-request-row small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

body.portal-page .portal-privacy-workspace .section-head p,
body.portal-page .portal-privacy-workspace .form-note {
  margin: 4px 0 0;
}

body.portal-page .portal-privacy-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr);
  gap: 24px;
  align-items: start;
}

body.portal-page .portal-privacy-request-form {
  display: grid;
  gap: 12px;
}

body.portal-page .portal-privacy-request-form .form-group {
  display: grid;
  gap: 6px;
  margin: 0;
}

body.portal-page .portal-privacy-request-form label,
body.portal-page .portal-privacy-history h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

body.portal-page .portal-privacy-request-form .form-optional {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

body.portal-page .portal-privacy-request-form .field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

body.portal-page .portal-privacy-history {
  display: grid;
  gap: 10px;
  min-width: 0;
  min-height: 100%;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

body.portal-page .portal-privacy-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.portal-page .portal-privacy-request-row {
  display: grid;
  gap: 9px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

body.portal-page .portal-privacy-request-row:first-child {
  padding-top: 0;
}

body.portal-page .portal-privacy-request-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

body.portal-page .portal-privacy-request-head,
body.portal-page .portal-privacy-request-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

body.portal-page .portal-privacy-request-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

body.portal-page .portal-privacy-request-row p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

body.portal-page .portal-privacy-request-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px 14px;
}

body.portal-page .portal-privacy-request-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

body.portal-page :where(.portal-privacy-context-link, .portal-privacy-context-document) {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

body.portal-page .portal-privacy-context-link {
  cursor: pointer;
}

body.portal-page .portal-privacy-context-link:hover {
  border-color: var(--pink);
  color: var(--pink);
}

body.portal-page .portal-privacy-response {
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

@media (max-width: 760px) {
  body.portal-page .portal-privacy-grid {
    grid-template-columns: 1fr;
  }

  body.portal-page .portal-privacy-history {
    padding: 16px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

/* Portal-owned components. Keep public/profile additions out of styles.css. */
.portal-page :where(.btn, .submit-btn, .search-btn) {
  min-height: var(--control-height-touch);
}

.portal-page :where(.request-form, .portal-profile-edit-form, .portal-privacy-request-form) :where(input, select, textarea) {
  min-height: var(--control-height-default);
}

.portal-page .portal-privacy-request-form :where(textarea) {
  min-height: 150px;
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
}

.portal-page .portal-privacy-request-form :where(select) {
  font-size: 15px;
}

.portal-page .portal-privacy-request-form > .btn {
  width: 100%;
  min-height: 48px;
  font-size: 15px;
}

.portal-page .portal-case-chat-compose :where(textarea) {
  resize: vertical;
}

.portal-page .portal-document-preview,
.portal-page .portal-privacy-workspace,
.portal-page .portal-case-chat-dialog {
  border-radius: var(--radius-card);
}

.portal-page .portal-document-preview {
  min-width: 0;
  overflow-x: auto;
  overflow-wrap: anywhere;
}

.portal-page .portal-privacy-request-form :where(button[type="submit"])[aria-busy="true"]::after {
  content: ' Записва се…';
}

/* R315 mobile code-hero recovery: keep the absolute slide inside its owner. */
@media (max-width: 560px) {
  body.site-page .site-hero:not(.is-image-only) {
    min-height: 610px;
  }

  body.site-page .portal-banner-slide.is-code-hero {
    align-items: flex-start;
    overflow: hidden;
  }

  body.site-page .portal-banner-slide.is-code-hero > .container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-content: start;
    padding: 18px 16px 20px;
  }

  body.site-page .portal-banner-slide.is-code-hero .hero-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body.site-page .portal-banner-slide.is-code-hero .hero-kicker {
    margin-bottom: 10px;
    padding: 6px 9px;
    font-size: 10px;
  }

  body.site-page .portal-banner-slide.is-code-hero h1 {
    max-width: none;
    color: var(--ink);
    font-size: clamp(30px, 9vw, 36px);
    line-height: 1.02;
    letter-spacing: -.025em;
  }

  body.site-page .portal-banner-slide.is-code-hero .hero-content p {
    margin: 12px 0 16px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
  }

  body.site-page .portal-banner-slide.is-code-hero .hero-bullets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 16px;
    color: var(--ink);
    font-size: 10px;
  }

  body.site-page .portal-banner-slide.is-code-hero .hero-bullets li {
    min-width: 0;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
  }

  body.site-page .portal-banner-slide.is-code-hero .hero-bullets svg {
    width: 15px;
    height: 15px;
  }

  body.site-page .portal-banner-slide.is-code-hero .hero-buttons {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.site-page .portal-banner-slide.is-code-hero .hero-buttons .btn {
    width: 100%;
    min-width: 0;
    padding-inline: 8px;
  }

  body.site-page .portal-banner-slide.is-code-hero .hero-product-visual {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  body.site-page .portal-banner-slide.is-code-hero .hero-product-visual > img {
    width: 100%;
    max-height: 155px;
    border-radius: 14px;
  }

  body.site-page .portal-banner-slide.is-code-hero .hero-product-visual figcaption {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
  }

  body.site-page .portal-banner-slide.is-code-hero .hero-product-visual figcaption span {
    display: block;
    min-width: 0;
    padding: 7px 5px;
    font-size: 9px;
    line-height: 1.2;
    text-align: center;
  }

  body.site-page .portal-banner-slide.is-code-hero .hero-product-visual figcaption b {
    margin: 0 0 2px;
    font-size: 16px;
  }
}

/* R357 mobile banner contrast: CMS/default hero slides use a light readability
   scrim, so their content must use the product ink palette instead of the
   desktop white-on-image treatment. Image-only campaigns remain untouched. */
@media (max-width: 760px) {
  body.site-page .portal-banner-slide:not(.is-image-only):not(.is-code-hero) {
    background-image:
      linear-gradient(180deg, rgba(255,255,255,.985) 0%, rgba(255,255,255,.94) 58%, rgba(255,255,255,.76) 80%, rgba(255,255,255,.2) 100%),
      var(--hero-mobile);
  }

  body.site-page .portal-banner-slide:not(.is-image-only):not(.is-code-hero) .hero-content {
    color: var(--ink);
    text-shadow: none;
  }

  body.site-page .portal-banner-slide:not(.is-image-only):not(.is-code-hero) .hero-content h1 {
    max-width: 15ch;
    color: var(--ink);
    font-size: clamp(30px, 8.8vw, 35px);
    line-height: 1.04;
    letter-spacing: -.025em;
    text-wrap: balance;
  }

  body.site-page .portal-banner-slide:not(.is-image-only):not(.is-code-hero) .hero-content p {
    max-width: 34ch;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
  }

  body.site-page .portal-banner-slide:not(.is-image-only):not(.is-code-hero) .hero-bullets {
    color: var(--ink);
  }

  body.site-page .portal-banner-slide:not(.is-image-only):not(.is-code-hero) .btn-outline {
    border-color: color-mix(in srgb, var(--pink) 24%, var(--line));
    background: rgba(255,255,255,.9);
    color: var(--ink);
  }
}
/* R707 white-label SaaS containment: tenant content and live counters may be
   longer than the design examples, but must never leave their owning card. */
body.portal-page :where(.card,.panel-card,.portal-shell,.portal-workspace,.portal-case-mini-row,.document-card,.modal,.modal-body) {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

body.portal-page :where(.btn,button,.badge,.portal-notification-badge,.portal-status-pill) {
  max-width: 100%;
  box-sizing: border-box;
}

body.portal-page :where(.portal-case-mini-row,.document-card,.portal-notification-row,.portal-profile-summary) > * {
  min-width: 0;
}

body.portal-page :where(.portal-case-mini-row,.document-card,.portal-notification-row) :where(h3,h4,b,strong,p,span,small) {
  overflow-wrap: anywhere;
}

body.portal-page .portal-notification-button {
  min-width: 0;
  overflow: hidden;
}

body.portal-page .portal-notification-button > :not(.portal-notification-badge) {
  min-width: 0;
}


/*components.css*/
/*
 * Shared UI components and theme completion layer.
 * New component work belongs here so the legacy shared stylesheet can be
 * reduced incrementally instead of receiving another end-of-file override.
 */

/* Case item / labour modal ------------------------------------------------ */
body.admin-page #m-item .case-item-modal {
  width: min(900px, calc(100vw - 32px));
}

body.admin-page #m-item .case-item-modal-head > div {
  min-width: 0;
}

body.admin-page #m-item .case-item-modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

body.admin-page #m-item .modal-body {
  gap: 12px !important;
  background: color-mix(in srgb, var(--surface-soft) 68%, var(--surface)) !important;
}

body.admin-page #m-item .case-item-form-section {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  background: var(--surface);
}

body.admin-page #m-item .case-item-form-section[hidden] {
  display: none;
}

body.admin-page #m-item .case-item-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ui-border);
}

body.admin-page #m-item .case-item-section-head > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

body.admin-page #m-item .case-item-section-head > div > span {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  color: var(--primary);
  font-size: 11px;
  font-weight: 760;
}

body.admin-page #m-item .case-item-section-head h4 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

body.admin-page #m-item .case-item-section-head small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 520;
  line-height: 1.3;
  text-align: right;
}

body.admin-page #m-item .case-item-search-control {
  position: relative;
}

body.admin-page #m-item .case-item-search-control > span {
  position: absolute;
  z-index: 1;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 23px;
  line-height: 1;
  pointer-events: none;
}

body.admin-page #m-item #ai-catalog-search {
  padding-left: 42px !important;
}

body.admin-page #m-item #ai-catalog-search[aria-busy="true"] {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--ui-border)) !important;
}

body.admin-page #m-item .case-item-catalog-results {
  max-height: 246px;
  display: grid;
  gap: 7px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  background: var(--surface-soft);
  scrollbar-gutter: stable;
}

body.admin-page #m-item .case-item-catalog-results[hidden] {
  display: none;
}

body.admin-page #m-item .case-item-catalog-result {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

body.admin-page #m-item .case-item-catalog-result:hover,
body.admin-page #m-item .case-item-catalog-result:focus-visible,
body.admin-page #m-item .case-item-catalog-result.is-selected {
  border-color: color-mix(in srgb, var(--primary) 60%, var(--ui-border));
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
  outline: none;
}

body.admin-page #m-item .case-item-result-main,
body.admin-page #m-item .case-item-result-stock {
  min-width: 0;
  display: grid;
  gap: 3px;
}

body.admin-page #m-item .case-item-result-main strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.admin-page #m-item .case-item-result-main small,
body.admin-page #m-item .case-item-result-main em,
body.admin-page #m-item .case-item-result-stock small {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
  line-height: 1.25;
}

body.admin-page #m-item .case-item-result-main em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.admin-page #m-item .case-item-result-stock {
  justify-items: end;
  white-space: nowrap;
}

body.admin-page #m-item .case-item-result-stock b {
  color: var(--success);
  font-size: 12px;
}

body.admin-page #m-item .case-item-catalog-loading,
body.admin-page #m-item .case-item-catalog-empty {
  min-height: 70px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 5px;
  padding: 14px;
  color: var(--muted);
  text-align: center;
}

body.admin-page #m-item .case-item-catalog-loading {
  grid-template-columns: 18px auto;
}

body.admin-page #m-item .case-item-catalog-loading > span {
  width: 17px;
  height: 17px;
  border: 2px solid var(--ui-border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: case-item-spin .7s linear infinite;
}

body.admin-page #m-item .case-item-catalog-empty strong {
  color: var(--ink);
  font-size: 13px;
}

body.admin-page #m-item .case-item-catalog-empty span,
body.admin-page #m-item .case-item-catalog-more {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

body.admin-page #m-item .case-item-catalog-empty.is-error {
  color: var(--danger);
}

body.admin-page #m-item .case-item-catalog-more {
  padding: 7px 10px;
  text-align: center;
}

body.admin-page #m-item .case-item-catalog-selection {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--success) 38%, var(--ui-border));
  border-radius: 11px;
  background: color-mix(in srgb, var(--success) 7%, var(--surface));
}

body.admin-page #m-item .case-item-catalog-selection[hidden] {
  display: none;
}

body.admin-page #m-item .case-item-selection-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--success) 16%, var(--surface));
  color: var(--success);
  font-weight: 800;
}

body.admin-page #m-item .case-item-catalog-selection > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body.admin-page #m-item .case-item-catalog-selection small,
body.admin-page #m-item .case-item-catalog-selection em {
  color: var(--muted);
  font-size: 10.5px;
  font-style: normal;
}

body.admin-page #m-item .case-item-catalog-selection strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.admin-page #m-item .case-item-catalog-selection > b {
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
}

body.admin-page #m-item #ai-catalog-hint {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

body.admin-page #m-item #ai-catalog-hint[data-tone="warn"] {
  border-color: color-mix(in srgb, var(--warning) 38%, var(--ui-border));
  background: color-mix(in srgb, var(--warning) 7%, var(--surface));
}

body.admin-page #m-item #ai-catalog-hint[data-tone="err"] {
  border-color: color-mix(in srgb, var(--danger) 38%, var(--ui-border));
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
  color: color-mix(in srgb, var(--danger) 72%, var(--ink));
}

@keyframes case-item-spin { to { transform: rotate(360deg); } }

/* Dark-theme completion --------------------------------------------------- */
body:is(.site-page,.portal-page)[data-portal-theme="dark"] {
  --bg: #0b1220;
  --surface: #111a28;
  --surface-soft: #0f1828;
  --ink: #f8fbff;
  --text: #eef4ff;
  --muted: #b8c4d6;
  --muted-2: #8fa1b8;
  --line: #304056;
  --line-strong: #40516a;
  --card: var(--surface);
  --control-bg: #0b1322;
  --control-bg-muted: #111a28;
  --control-text: #f8fbff;
  --control-muted: #aebbd0;
  color-scheme: dark;
}

:root[data-theme="dark"] body.admin-page,
body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) {
  color-scheme: dark;
}

:root[data-theme="dark"] body.admin-page #sb,
body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) #sb {
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 38%, #171724), #211923 74%, #17171f) !important;
  border-right-color: var(--line) !important;
}

:root[data-theme="dark"] body.admin-page .admin-toolbar .global-search .search-box,
:root[data-theme="dark"] body.admin-page .admin-toolbar .global-search input,
body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) .admin-toolbar .global-search .search-box,
body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) .admin-toolbar .global-search input {
  border-color: var(--line) !important;
  background: var(--control-bg) !important;
  color: var(--control-text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] body.admin-page :where(.data-table thead,.data-table th,table thead,table th),
body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) :where(.data-table thead,.data-table th,table thead,table th) {
  background: #0d1726 !important;
  color: var(--muted) !important;
  border-color: var(--line) !important;
}

:root[data-theme="dark"] body.admin-page :where(.panel-card-header,.admin-side-head,.admin-chart-head,.ch),
body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) :where(.panel-card-header,.admin-side-head,.admin-chart-head,.ch) {
  background: color-mix(in srgb, var(--surface-soft) 84%, #080f1b) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}

:root[data-theme="dark"] body.admin-page :where(.topbar-icon,.icon-control,.avatar),
body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) :where(.topbar-icon,.icon-control,.avatar) {
  border-color: var(--line) !important;
  background: var(--control-bg) !important;
  color: var(--primary) !important;
}

/* Public site: eliminate white cards with light text in dark mode. */
body.site-page[data-portal-theme="dark"] :where(
  .card,.section,.tracker-card,.toggle-card,.category-strip,.process,
  .portal-review-panel,.portal-download-panel,.portal-review-grid article,
  .process-item,.service-mini,.price-row,.portal-action-split
) {
  border-color: var(--line) !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

body.site-page[data-portal-theme="dark"] :where(
  .portal-review-panel h2,.portal-download-panel h2,.process h2,
  .portal-review-grid b,.process-item strong,.service-mini strong,.toggle-title
) {
  color: var(--ink) !important;
}

body.site-page[data-portal-theme="dark"] :where(
  .portal-review-panel p,.portal-download-panel p,.portal-review-grid p,
  .process-item span,.service-mini span span,.toggle-sub
) {
  color: var(--muted) !important;
}

body.site-page[data-portal-theme="dark"] .site-header,
body.site-page[data-portal-theme="dark"] .site-nav {
  border-color: var(--line) !important;
  background: color-mix(in srgb, var(--surface) 96%, transparent) !important;
}

body.site-page[data-portal-theme="dark"] .site-nav a:not(.is-active) {
  color: var(--muted) !important;
}

/* Public-site dark contract.  Contact/map, FAQ and install surfaces used
   literal light backgrounds in the legacy templates and therefore escaped
   the generic card rules above. */
body.site-page[data-portal-theme="dark"] :where(
  .loc-card,.portal-contact-one-card,.portal-contact-panel,.portal-map-panel,
  .portal-map-top-card,.portal-map-marker-card,.portal-contact-item,
  .portal-hours-line,.portal-faq-item,.portal-app-phone
) {
  border-color: var(--line) !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

body.site-page[data-portal-theme="dark"] :where(
  .loc-card,.portal-contact-panel,.portal-map-panel,.portal-map-top-card,
  .portal-map-marker-card,.portal-contact-item,.portal-faq-item,.portal-app-phone
) :where(h2,h3,h4,strong,b,summary) {
  color: var(--ink) !important;
}

body.site-page[data-portal-theme="dark"] :where(
  .loc-card,.portal-contact-panel,.portal-map-panel,.portal-map-top-card,
  .portal-map-marker-card,.portal-contact-item,.portal-faq-item
) :where(p,small,span,address) {
  color: var(--muted) !important;
}

body.site-page[data-portal-theme="dark"] .portal-app-phone {
  border-color: color-mix(in srgb, var(--primary) 72%, var(--line)) !important;
  background: var(--surface-soft) !important;
}

body.site-page[data-portal-theme="dark"] :where(.btn-outline,.btn-secondary) {
  border-color: var(--control-border) !important;
  background: var(--control-bg) !important;
  color: var(--control-text) !important;
  box-shadow: none !important;
}

body.site-page[data-portal-theme="dark"] .btn-outline:hover,
body.site-page[data-portal-theme="dark"] .btn-secondary:hover {
  border-color: color-mix(in srgb, var(--primary) 62%, var(--control-border)) !important;
  background: color-mix(in srgb, var(--primary) 12%, var(--control-bg)) !important;
  color: var(--ink) !important;
}

/* Client profile: the tab bar, workspace cards and case preview use one dark surface. */
body.portal-page[data-portal-theme="dark"] :where(
  .portal-tabs,.portal-profile-tabs,.portal-profile-content,.portal-profile-main,
  .portal-overview-grid .card,.document-grid .card,.panel-card,.recent-card,
  .portal-profile-case-preview,.profile-case-preview-grid article,
  .portal-case-board,.portal-case-hero,.portal-case-progress,.portal-case-kpis,
  .portal-case-next-grid article,.portal-case-insight-grid article,.portal-case-panel,
  .portal-case-cta-row,.portal-privacy-workspace,.portal-aside-card
) {
  border-color: var(--line) !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

body.portal-page[data-portal-theme="dark"] :where(
  .portal-tabs a,.portal-tabs button,.portal-profile-tabs a,.portal-profile-tabs button
):not(.active):not(.is-active) {
  color: var(--muted) !important;
  background: transparent !important;
}

body.portal-page[data-portal-theme="dark"] :where(
  .section-head h3,.panel-card h3,.portal-profile-case-preview h3,
  .profile-case-preview-grid h4,.portal-case-board h2,.portal-case-board h3,
  .portal-case-board b,.portal-case-board strong
) {
  color: var(--ink) !important;
}

body.portal-page[data-portal-theme="dark"] :where(
  .section-head p,.panel-card p,.portal-profile-case-preview p,
  .profile-case-preview-grid p,.profile-case-preview-grid small,
  .portal-case-board p,.portal-case-board small,.portal-case-board span
) {
  color: var(--muted) !important;
}

body.portal-page[data-portal-theme="dark"] :where(
  .profile-case-preview-grid article,.portal-case-kpis > div,
  .portal-case-next-grid article,.portal-case-insight-grid article
) {
  background: var(--surface-soft) !important;
}

/* Client-profile dark contract.  This deliberately includes the containers,
   nested history rows, wizard controls and progress rails which were reported
   as isolated light islands by the authenticated computed-style scan. */
body.portal-page[data-portal-theme="dark"] :where(
  .portal-case-next-grid,.portal-case-insight-grid,.portal-case-history-row,
  .profile-case-preview-meta > span,.portal-wizard-step,
  .portal-wizard-rail-list > span,.portal-wizard-panel,.portal-wizard-card
) {
  border-color: var(--line) !important;
  background: var(--surface-soft) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

body.portal-page[data-portal-theme="dark"] :where(
  .portal-case-next-grid,.portal-case-insight-grid,.portal-case-history-row,
  .profile-case-preview-meta > span,.portal-wizard-step,
  .portal-wizard-rail-list > span,.portal-wizard-panel,.portal-wizard-card
) :where(h2,h3,h4,strong,b) {
  color: var(--ink) !important;
}

body.portal-page[data-portal-theme="dark"] :where(
  .portal-case-next-grid,.portal-case-insight-grid,.portal-case-history-row,
  .profile-case-preview-meta > span,.portal-wizard-step,
  .portal-wizard-rail-list > span,.portal-wizard-panel,.portal-wizard-card
) :where(p,small,span) {
  color: var(--muted) !important;
}

body.portal-page[data-portal-theme="dark"] :where(
  .btn-outline,.btn-secondary,.portal-outline-btn,.portal-wizard-nav .back,
  .portal-case-mini-action
) {
  border-color: var(--control-border) !important;
  background: var(--control-bg) !important;
  color: var(--control-text) !important;
  box-shadow: none !important;
}

body.portal-page[data-portal-theme="dark"] :where(
  .btn-outline,.btn-secondary,.portal-outline-btn,.portal-wizard-nav .back,
  .portal-case-mini-action
):hover {
  border-color: color-mix(in srgb, var(--primary) 62%, var(--control-border)) !important;
  background: color-mix(in srgb, var(--primary) 12%, var(--control-bg)) !important;
  color: var(--ink) !important;
}

body.portal-page[data-portal-theme="dark"] :where(
  .portal-case-progress-line,.portal-case-meter,.portal-progress-meter,
  .portal-wizard-progress,.profile-case-preview-progress
) {
  border-color: var(--line) !important;
  background: var(--line) !important;
}

body.portal-page[data-portal-theme="dark"] progress {
  color: var(--primary) !important;
  background: var(--line) !important;
}

body.portal-page[data-portal-theme="dark"] progress::-webkit-progress-bar {
  background: var(--line) !important;
}

body.portal-page[data-portal-theme="dark"] progress::-webkit-progress-value,
body.portal-page[data-portal-theme="dark"] progress::-moz-progress-bar {
  background: var(--primary) !important;
}

body.portal-page[data-portal-theme="dark"] :where(.portal-status-pill,.portal-doc-status) {
  border-color: color-mix(in srgb, var(--primary) 42%, var(--line)) !important;
  background: color-mix(in srgb, var(--primary) 15%, var(--surface-soft)) !important;
  color: color-mix(in srgb, var(--primary) 62%, var(--ink)) !important;
}

/* Runtime feedback and post-submit states are created or revealed after the
   initial dark-theme render.  Literal white legacy colors made their text
   unreadable even though the surrounding workspace already used dark tokens. */
body:is(.site-page,.portal-page)[data-portal-theme="dark"] :where(
  #portal-toast,.portal-toast,#toast,.toast,
  .success-msg,.success-code,.success-notification-warning
) {
  border-color: var(--line) !important;
  background: var(--surface-soft) !important;
  color: var(--ink) !important;
  box-shadow: 0 18px 42px rgba(0,0,0,.34) !important;
}

/* R324 realtime communication and explicit public selections -------------
   Compact dots were visually indistinguishable from radio decoration.  The
   request problem controls now expose a full checkbox-sized state. */
body.site-page #request-section .prob-tag,
body.portal-page #request-section .prob-tag {
  min-height: 38px !important;
  gap: 9px !important;
  border-width: 1px !important;
}

body.site-page #request-section .prob-tag::before,
body.portal-page #request-section .prob-tag::before {
  width: 18px !important;
  height: 18px !important;
  border: 2px solid color-mix(in srgb, var(--ink) 48%, var(--control-bg)) !important;
  border-radius: 5px !important;
  background: var(--control-bg) !important;
  color: #fff !important;
  font-size: 12px !important;
  line-height: 1 !important;
}

body.site-page #request-section .prob-tag.active,
body.portal-page #request-section .prob-tag.active {
  border-color: var(--primary) !important;
  background: color-mix(in srgb, var(--primary) 14%, var(--surface)) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 24%, transparent) !important;
}

body.site-page #request-section .prob-tag.active::before,
body.portal-page #request-section .prob-tag.active::before {
  content: "✓" !important;
  border-color: var(--primary) !important;
  background: var(--primary) !important;
}

.wizard-estimate-value {
  display: block;
  margin-top: 6px;
  color: var(--primary) !important;
  font-size: 15px;
  line-height: 1.25;
}

.portal-chat-live-status,
.case-chat-head-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-chat-live-status {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.portal-chat-live-status > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.portal-chat-live-status > span > i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 14%, transparent);
}

.case-chat-head-actions {
  justify-content: flex-end;
}

body:is(.site-page,.portal-page)[data-portal-theme="dark"] :where(
  #portal-toast,.portal-toast,#toast,.toast
).info {
  border-color: color-mix(in srgb, var(--blue) 52%, var(--line)) !important;
  background: color-mix(in srgb, var(--blue) 12%, var(--surface-soft)) !important;
  color: color-mix(in srgb, var(--blue) 38%, var(--ink)) !important;
}

body:is(.site-page,.portal-page)[data-portal-theme="dark"] :where(
  #portal-toast,.portal-toast,#toast,.toast
):is(.ok,.success) {
  border-color: color-mix(in srgb, var(--green) 52%, var(--line)) !important;
  background: color-mix(in srgb, var(--green) 12%, var(--surface-soft)) !important;
  color: color-mix(in srgb, var(--green) 42%, var(--ink)) !important;
}

body:is(.site-page,.portal-page)[data-portal-theme="dark"] :where(
  #portal-toast,.portal-toast,#toast,.toast
):is(.err,.error) {
  border-color: color-mix(in srgb, var(--red) 56%, var(--line)) !important;
  background: color-mix(in srgb, var(--red) 12%, var(--surface-soft)) !important;
  color: color-mix(in srgb, var(--red) 44%, var(--ink)) !important;
}

body:is(.site-page,.portal-page)[data-portal-theme="dark"] :where(
  #portal-toast,.portal-toast,#toast,.toast
).warn {
  border-color: color-mix(in srgb, var(--orange) 58%, var(--line)) !important;
  background: color-mix(in srgb, var(--orange) 12%, var(--surface-soft)) !important;
  color: color-mix(in srgb, var(--orange) 48%, var(--ink)) !important;
}

body:is(.site-page,.portal-page)[data-portal-theme="dark"] .success-msg :where(
  .success-title,.success-text,.success-note,.success-code
) {
  color: inherit !important;
}

body:is(.site-page,.portal-page)[data-portal-theme="dark"] .success-code {
  border-color: var(--control-border) !important;
  background: var(--control-bg) !important;
  color: var(--control-text) !important;
}

/* Typography hierarchy ---------------------------------------------------
   Body copy stays calm and readable; emphasis is reserved for headings,
   primary metrics and explicit actions. */
body.admin-page :where(p,li,td,small,input,select,textarea,.sub,.mini,.hint,.muted) {
  font-weight: 400 !important;
}

body.admin-page :where(
  button,.btn,.action-btn,.table-action,.tab,.filter-tabs button,
  .nav-item,.settings-menu button,.form-label,.field > span,label,th,.badge
) {
  font-weight: 600 !important;
}

body.admin-page :where(
  h1,h2,h3,h4,h5,h6,strong,b,.admin-title,.topbar-title,.num,.ccod,.logo-s
) {
  font-weight: 700 !important;
}

body.site-page :where(p,li,small,input,select,textarea,.toggle-sub) {
  font-weight: 400 !important;
}

body.site-page :where(
  button,.btn,.submit-btn,.site-nav a,.form-label,label,.toggle-title,.badge
) {
  font-weight: 600 !important;
}

body.site-page :where(h1,h2,h3,h4,h5,h6,strong,b,.brand-title,.logo-s) {
  font-weight: 700 !important;
}

body.portal-page :where(p,li,td,small,input,select,textarea,.muted) {
  font-weight: 400 !important;
}

body.portal-page :where(
  button,.btn,.submit-btn,.portal-outline-btn,.portal-tabs a,
  .portal-profile-tabs button,.form-label,label,.badge,.portal-status-pill,
  .portal-doc-status,.portal-case-mini-action,.info-row
) {
  font-weight: 600 !important;
}

body.portal-page .portal-tabs a,
body.portal-page .portal-profile-tabs button {
  font-weight: 600 !important;
}

body.portal-page :where(h1,h2,h3,h4,h5,h6,strong,b,.brand-title,.logo-s) {
  font-weight: 700 !important;
}

/* R322 admin visual contract ---------------------------------------------
   This block deliberately owns the shell, filters and choice controls at
   one point.  Older page-specific rules still exist in styles.css while the
   stylesheet is being split, so the final component layer must prevent a
   light legacy surface from leaking into the dark theme. */
body.admin-page > .admin-shell,
body.admin-page > .admin-shell > #main.admin-main,
body.admin-page > .admin-shell > #main.admin-main > #content.admin-content,
body.admin-page #content.admin-content > .view.active {
  background: var(--bg) !important;
  color: var(--text) !important;
}

/* Registry views start at the workspace edge.  A legacy generic view rule
   previously allowed a tall empty track before the recycling toolbar. */
body.admin-page > .admin-shell > #main.admin-main > #content.admin-content > #v-recycling_register.view.active {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  align-content: start !important;
  align-items: start !important;
  gap: 16px;
  min-height: 0 !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

body.admin-page #v-recycling_register > :where(.action-row,.filters-bar,.card) {
  width: 100%;
  min-width: 0;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

body.admin-page > .admin-shell > #main.admin-main {
  min-height: 100vh;
}

body.admin-page > .admin-shell > #main.admin-main > #content.admin-content {
  min-height: calc(100vh - 78px);
}

/* Navigation is body copy, not a page title.  Keep only the active entry and
   section headings semibold so the sidebar remains calm and scannable. */
body.admin-page #sb .admin-nav :where(a,button) {
  font-weight: 520 !important;
}

body.admin-page #sb .admin-nav :where(a,button).is-active {
  font-weight: 620 !important;
  box-shadow: none !important;
}

body.admin-page #sb .nav-group-title {
  font-weight: 650 !important;
}

body.admin-page #sb .admin-brand strong,
body.admin-page #sb .admin-user-card strong {
  font-weight: 650 !important;
}

/* Every administrative filter row uses the same token-driven surface. */
body.admin-page :where(.filters-bar,.catalog-filter-bar) {
  border-color: var(--line) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

body.admin-page :where(.filters-bar,.catalog-filter-bar) :where(
  input:not([type="checkbox"]):not([type="radio"]),select,.control,
  .search-box,.case-search-box
) {
  border-color: var(--control-border) !important;
  background: var(--control-bg) !important;
  color: var(--control-text) !important;
}

body.admin-page .filter-tabs button:not(.is-active) {
  border-color: var(--control-border) !important;
  background: var(--control-bg) !important;
  color: var(--control-text) !important;
  font-weight: 560 !important;
}

body.admin-page .filter-tabs button.is-active {
  border-color: color-mix(in srgb, var(--primary) 52%, var(--control-border)) !important;
  background: color-mix(in srgb, var(--primary) 13%, var(--surface)) !important;
  color: var(--primary) !important;
  font-weight: 620 !important;
}

/* Case detail contains several legacy cards that used literal white. */
body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) #v-case :where(
  .case-detail-head,.case-brief-grid article,.case-doc-quickbar,
  .case-doc-quickbar > *, .admin-tech-workspace,.case-workspace,
  .tech-panel,.tech-file-card,.case-summary-card,.case-metric,
  .case-panel,.document-card
) {
  border-color: var(--line) !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) #v-case :where(
  .case-detail-head,.case-brief-grid article,.case-doc-quickbar,
  .admin-tech-workspace,.case-workspace,.tech-panel,.tech-file-card,
  .case-summary-card,.case-metric,.case-panel,.document-card
) :where(h2,h3,h4,strong,b) {
  color: var(--ink) !important;
}

body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) #v-case :where(
  .case-detail-head,.case-brief-grid article,.case-doc-quickbar,
  .admin-tech-workspace,.case-workspace,.tech-panel,.tech-file-card,
  .case-summary-card,.case-metric,.case-panel,.document-card
) :where(p,small,span,.muted) {
  color: var(--muted) !important;
}

/* Choice controls must be recognizable before interaction.  The previous
   1.5px theme border could resolve almost white-on-white in a light modal. */
body.admin-page :where(input[type="checkbox"],input[type="radio"]),
body.site-page :where(input[type="checkbox"],input[type="radio"]),
body.portal-page :where(input[type="checkbox"],input[type="radio"]) {
  opacity: 1 !important;
  border-width: 2px !important;
  border-style: solid !important;
  border-color: color-mix(in srgb, var(--ink) 48%, var(--control-bg)) !important;
  background: var(--control-bg) !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent) !important;
}

body:is(.admin-page,.site-page,.portal-page) :where(input[type="checkbox"],input[type="radio"]):hover {
  border-color: color-mix(in srgb, var(--primary) 68%, var(--ink)) !important;
}

body.admin-page :where(input[type="checkbox"],input[type="radio"]):checked,
body.site-page :where(input[type="checkbox"],input[type="radio"]):checked,
body.portal-page :where(input[type="checkbox"],input[type="radio"]):checked {
  border-color: var(--control-active) !important;
  background: var(--control-active) !important;
  color: var(--control-active-text) !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--control-active) 34%, transparent) !important;
}

body:is(.admin-page,.site-page,.portal-page) :where(input[type="checkbox"],input[type="radio"]):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 32%, transparent) !important;
  outline-offset: 2px !important;
}

body.admin-page #m-case .prob-tag::before {
  border: 2px solid color-mix(in srgb, var(--ink) 42%, var(--control-bg)) !important;
  background: var(--control-bg) !important;
}

body.admin-page #m-case .prob-tag.active::before {
  border-color: var(--control-active) !important;
  background: var(--control-active) !important;
}

body.admin-page #m-case :where(.check-control,.gdpr-consent-check) {
  color: var(--control-text) !important;
  font-weight: 500 !important;
}

body.admin-page .gdpr-consent-card {
  border-color: var(--line) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
}

body.admin-page .gdpr-consent-text {
  border-color: var(--line) !important;
  background: var(--surface-soft) !important;
  color: var(--muted) !important;
}

body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) :where(input[type="checkbox"],input[type="radio"]):not(:checked),
body.site-page[data-portal-theme="dark"] :where(input[type="checkbox"],input[type="radio"]):not(:checked),
body.portal-page[data-portal-theme="dark"] :where(input[type="checkbox"],input[type="radio"]):not(:checked) {
  border-color: color-mix(in srgb, var(--ink) 58%, var(--control-bg)) !important;
  background: var(--control-bg) !important;
}

@media (max-width: 720px) {
  body.admin-page #m-item .case-item-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  body.admin-page #m-item .case-item-section-head small {
    text-align: left;
  }

  body.admin-page #m-item .case-item-catalog-selection {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  body.admin-page #m-item .case-item-catalog-selection > b {
    grid-column: 2;
  }

  body.admin-page #m-item .modal-foot {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
  }

  body.admin-page #m-item .modal-foot .btn-primary {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.admin-page #m-item .case-item-catalog-loading > span { animation-duration: 1.8s; }
}

/* R323 chart and icon foundation -----------------------------------------
   The legacy stylesheet hid the complete chart grid at a later cascade
   position.  This component layer is the authoritative dashboard contract. */
body.admin-page #v-dashboard .admin-chart-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
  margin: 14px 0 !important;
}

body.admin-page #v-dashboard .admin-chart-card {
  position: relative;
  min-width: 0;
  min-height: 258px !important;
  max-height: none !important;
  overflow: hidden;
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  background: var(--surface) !important;
  color: var(--text) !important;
}

body.admin-page #v-dashboard .admin-chart-card canvas {
  width: 100% !important;
  height: 190px !important;
  max-height: 190px !important;
  padding: 10px 14px 14px;
}

body.admin-page #v-dashboard .admin-chart-card .chart-empty {
  min-height: 190px;
  display: grid;
  place-items: center;
  padding: 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

body.admin-page #v-reports #r-audit .report-table-wrap {
  max-height: 430px;
  overflow: auto;
  scrollbar-gutter: stable;
}

body.admin-page #v-reports #r-audit .data-table thead {
  position: sticky;
  z-index: 1;
  top: 0;
}

body.admin-page #sb .admin-nav .icon {
  width: 30px !important;
  height: 30px !important;
  padding: 6px !important;
  border: 1px solid color-mix(in srgb, #fff 15%, transparent) !important;
  border-radius: 9px !important;
  background: color-mix(in srgb, #fff 8%, transparent) !important;
  color: currentColor !important;
}

body.admin-page #sb .admin-nav .icon svg,
body.admin-page :where(.icon-button,.icon-control,.btn,.table-action) .icon svg,
body.site-page .icon svg,
body.portal-page .icon svg {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  vector-effect: non-scaling-stroke;
}

/* Shared control cleanup: one surface, one border and a keyboard-only focus ring. */
body.admin-page :where(.btn.btn-primary,.action-btn,.submit-btn),
body.site-page :where(.btn-primary,.submit-btn,.search-btn),
body.portal-page :where(.btn-primary,.submit-btn,.portal-case-mini-action,.portal-outline-btn.is-primary) {
  background: var(--primary) !important;
  background-image: none !important;
  border-color: var(--primary) !important;
  box-shadow: none !important;
  filter: none !important;
}

body.admin-page :where(.btn.btn-primary,.action-btn,.submit-btn):hover,
body.site-page :where(.btn-primary,.submit-btn,.search-btn):hover,
body.portal-page :where(.btn-primary,.submit-btn,.portal-case-mini-action,.portal-outline-btn.is-primary):hover {
  background: color-mix(in srgb, var(--primary) 88%, #000) !important;
  background-image: none !important;
}

body.admin-page :where(button,.btn,.action-btn,.table-action,.icon-button,.submit-btn,.mini-btn):is(:hover,:active,:focus:not(:focus-visible)),
body.site-page :where(button,.btn,.action-btn,.table-action,.icon-button,.submit-btn,.mini-btn):is(:hover,:active,:focus:not(:focus-visible)),
body.portal-page :where(button,.btn,.action-btn,.table-action,.icon-button,.submit-btn,.mini-btn,.side-action):is(:hover,:active,:focus:not(:focus-visible)) {
  outline: none !important;
}

body.admin-page :where(button,.btn,.action-btn,.table-action,.icon-button,.submit-btn,.mini-btn):focus-visible,
body.site-page :where(button,.btn,.action-btn,.table-action,.icon-button,.submit-btn,.mini-btn):focus-visible,
body.portal-page :where(button,.btn,.action-btn,.table-action,.icon-button,.submit-btn,.mini-btn,.side-action):focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent) !important;
  outline-offset: 2px !important;
}

body.admin-page .admin-toolbar :where(.search-box,.icon-button,.icon-control) {
  border: 1px solid var(--control-border, var(--line)) !important;
  background: var(--control-bg, var(--surface)) !important;
  box-shadow: none !important;
}

body.admin-page .admin-toolbar :where(.search-box,.icon-button,.icon-control) > .icon {
  display: inline-grid !important;
  place-items: center !important;
  width: 20px !important;
  min-width: 20px !important;
  height: 20px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.admin-page .admin-toolbar :where(.search-box,.icon-button,.icon-control) > .icon > svg {
  width: 20px !important;
  height: 20px !important;
}

/* Critical-case rows have four semantic children. The legacy three-column
   grid pushed the action into an implicit, extremely narrow column. */
body.admin-page :where(#d-crits,#cases-side-sla) .crit {
  grid-template-columns: 12px minmax(0,1fr) auto !important;
  grid-template-areas:
    "dot info deadline"
    ". action action";
  align-items: start !important;
  gap: 8px 10px !important;
}

body.admin-page :where(#d-crits,#cases-side-sla) .crit .cdot {
  grid-area: dot;
  align-self: center;
}

body.admin-page :where(#d-crits,#cases-side-sla) .crit .cinfo {
  grid-area: info;
  min-width: 0;
}

body.admin-page :where(#d-crits,#cases-side-sla) .crit :where(.ccod,.ccli,.cdev) {
  overflow-wrap: anywhere;
}

body.admin-page :where(#d-crits,#cases-side-sla) .crit .cdl {
  grid-area: deadline;
  white-space: nowrap;
}

body.admin-page :where(#d-crits,#cases-side-sla) .crit .table-action {
  grid-area: action;
  justify-self: end;
  width: auto !important;
  min-width: 68px !important;
  white-space: nowrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  writing-mode: horizontal-tb !important;
}

body.site-page .public-case-detail-anchor .portal-case-device-art > .portal-case-inline-icon,
body.site-page .public-case-detail-anchor .portal-case-device-box > .portal-case-inline-icon,
body.portal-page .portal-case-device-art > .portal-case-inline-icon,
body.portal-page .portal-case-device-box > .portal-case-inline-icon {
  display: grid !important;
  width: 28px !important;
  height: 28px !important;
  place-items: center !important;
  border: 0 !important;
  background: transparent !important;
  color: currentColor !important;
}

body :where(.portal-case-kpis) i[data-kpi] {
  display: grid !important;
  place-items: center !important;
  color: var(--primary) !important;
}

body :where(.portal-case-kpis) i[data-kpi] > .portal-case-inline-icon {
  display: grid !important;
  width: 17px !important;
  height: 17px !important;
  place-items: center !important;
  border: 0 !important;
  background: transparent !important;
  color: currentColor !important;
}

body :where(.portal-case-kpis) i[data-kpi] > .portal-case-inline-icon > svg {
  width: 17px !important;
  height: 17px !important;
}

body.admin-page #sb .admin-nav :where(a,button).is-active .icon {
  border-color: color-mix(in srgb, #fff 34%, transparent) !important;
  background: color-mix(in srgb, #fff 17%, transparent) !important;
}

body:is(.site-page,.portal-page) #request-section .svc-icon {
  width: 38px !important;
  height: 38px !important;
  display: grid !important;
  place-items: center !important;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line)) !important;
  border-radius: 11px !important;
  background: color-mix(in srgb, var(--primary) 9%, var(--surface)) !important;
  color: var(--primary) !important;
}

body:is(.site-page,.portal-page) #request-section .svc-icon .icon {
  width: 20px !important;
  height: 20px !important;
}

/* R323 complete dark-surface contract ------------------------------------
   Covers expanded request accordions and generated profile workspaces, not
   only their collapsed parent cards. */
body.site-page[data-portal-theme="dark"] :where(
  .toggle-head,.toggle-body,.request-form,.tracker-card,.svc-card,
  .legal-stack,.request-doc-box,.estimate-box,.price-hint,.portal-info-pop,
  .recycle-steps,.rc-step,.recycle-mode,.recycle-subpanel,.remote-downloads
),
body.portal-page[data-portal-theme="dark"] :where(
  #request-section,#reservation-section,#prices-section,#full-prices-section,#contacts-section,
  .toggle-card,.toggle-head,.toggle-body,.request-form,.tracker-card,.svc-card,
  .legal-stack,.request-doc-box,.estimate-box,.price-hint,.portal-info-pop,
  .recycle-steps,.rc-step,.recycle-mode,.recycle-subpanel,.remote-downloads,
  .portal-profile-revealed,.portal-profile-revealed > *
) {
  border-color: var(--line) !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

body:is(.site-page,.portal-page)[data-portal-theme="dark"] :where(
  .toggle-head,.toggle-body,.request-form,.tracker-card,.svc-card,
  .legal-stack,.request-doc-box,.estimate-box,.price-hint,.portal-info-pop,
  .recycle-steps,.rc-step,.recycle-mode,.recycle-subpanel,.remote-downloads,
  .portal-profile-revealed
) :where(h1,h2,h3,h4,strong,b,.svc-title,.tracker-title,.recycle-mode-title) {
  color: var(--ink) !important;
}

body:is(.site-page,.portal-page)[data-portal-theme="dark"] :where(
  .toggle-head,.toggle-body,.request-form,.tracker-card,.svc-card,
  .legal-stack,.request-doc-box,.estimate-box,.price-hint,.portal-info-pop,
  .recycle-steps,.rc-step,.recycle-mode,.recycle-subpanel,.remote-downloads,
  .portal-profile-revealed
) :where(p,small,label,span,.svc-desc,.tracker-sub,.toggle-sub,.recycle-mode-desc) {
  color: var(--muted) !important;
}

body:is(.site-page,.portal-page)[data-portal-theme="dark"] :where(
  .request-form,.portal-profile-revealed,.portal-privacy-workspace,.portal-profile-content
) :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea,.form-input,.file-input) {
  border-color: var(--control-border) !important;
  background: var(--control-bg) !important;
  color: var(--control-text) !important;
  box-shadow: none !important;
}

body:is(.site-page,.portal-page)[data-portal-theme="dark"] :where(
  .request-form,.portal-profile-revealed,.portal-privacy-workspace,.portal-profile-content
) :where(input::placeholder,textarea::placeholder) {
  color: var(--control-muted) !important;
  opacity: .92;
}

body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) :where(
  .view.active,.admin-left,.admin-right,.admin-dashboard-grid,
  .admin-chart-card,.admin-recent-card,.panel-card,.report-panel,.report-grid,.table-wrap,
  .case-stats,.filters-bar,.catalog-filter-bar,.settings-layout,
  .modal,.modal-body,.modal-foot,.data-table,table,tbody,tr,td
) {
  border-color: var(--line) !important;
  background-color: var(--surface) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) :where(
  .modal-body,.admin-content,.view.active,.admin-left,.admin-right,.admin-dashboard-grid
) {
  background: var(--bg) !important;
}

body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) :where(
  .panel-card-header,.admin-chart-head,.admin-side-head,.modal-head,.modal-foot,
  .data-table thead,.data-table th,table thead,table th
) {
  border-color: var(--line) !important;
  background: var(--surface-soft) !important;
  color: var(--ink) !important;
}

@media (max-width: 1080px) {
  body.admin-page #v-dashboard .admin-chart-grid {
    grid-template-columns: 1fr !important;
  }
}

/* R328 client-auth and dark-surface ownership ---------------------------
   These rules deliberately live in the component layer. They replace the
   legacy white-card login treatment and keep generated admin surfaces from
   falling back to browser/light defaults after an asynchronous render. */
body.portal-page #portal-profile-auth {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(34px, 6vw, 76px) 0 72px;
}

body.portal-page #portal-profile-auth .portal-auth-shell {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(420px, 1.08fr);
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 24px 62px rgba(18, 29, 48, .12);
}

body.portal-page #portal-profile-auth .portal-auth-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(32px, 5vw, 62px);
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--primary) 9%, var(--surface));
  color: var(--ink);
}

body.portal-page #portal-profile-auth .portal-auth-brand-mark,
body.portal-page #portal-profile-auth .portal-login-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 22px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  color: var(--primary);
}

body.portal-page #portal-profile-auth :where(.portal-auth-brand-mark,.portal-login-icon) .icon,
body.portal-page #portal-profile-auth :where(.portal-auth-brand-mark,.portal-login-icon) svg {
  width: 22px;
  height: 22px;
}

body.portal-page #portal-profile-auth .portal-profile-page-title {
  width: auto;
  margin: 0;
  padding: 8px 0 0;
}

body.portal-page #portal-profile-auth .portal-profile-page-title h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 4.4vw, 52px);
  line-height: 1.04;
  letter-spacing: -.035em;
}

body.portal-page #portal-profile-auth .portal-profile-page-title p {
  max-width: 520px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

body.portal-page #portal-profile-auth .portal-auth-benefits {
  display: grid;
  gap: 12px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

body.portal-page #portal-profile-auth .portal-auth-benefits li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 17%, var(--line));
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

body.portal-page #portal-profile-auth .portal-auth-benefits .icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  color: var(--primary);
}

body.portal-page #portal-profile-auth .portal-auth-benefits .icon svg {
  width: 19px;
  height: 19px;
}

body.portal-page #portal-profile-auth .portal-auth-benefits span,
body.portal-page #portal-profile-auth .portal-auth-benefits strong,
body.portal-page #portal-profile-auth .portal-auth-benefits small {
  display: block;
  min-width: 0;
}

body.portal-page #portal-profile-auth .portal-auth-benefits strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

body.portal-page #portal-profile-auth .portal-auth-benefits small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

body.portal-page #portal-profile-auth .portal-login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(32px, 5vw, 62px) !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

body.portal-page #portal-profile-auth .portal-login-card-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 15px;
  margin-bottom: 12px;
}

body.portal-page #portal-profile-auth .portal-login-card-head .portal-login-icon {
  margin: 0;
}

body.portal-page #portal-profile-auth .portal-card-kicker {
  color: var(--primary);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .09em;
}

body.portal-page #portal-profile-auth .portal-login-card h2 {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.12;
  letter-spacing: -.025em;
}

body.portal-page #portal-profile-auth .portal-login-hint {
  margin: 6px 0 24px;
  color: var(--muted);
  line-height: 1.55;
}

body.portal-page #portal-profile-auth :where(.portal-login-form,.portal-forgot-form,.portal-reset-form) {
  display: grid;
  gap: 14px;
  margin: 0;
}

body.portal-page #portal-profile-auth :where(.portal-login-form,.portal-forgot-form,.portal-reset-form) .form-group {
  margin: 0;
}

body.portal-page #portal-profile-auth :where(.form-input,input:not([type="hidden"])) {
  min-height: 48px;
  border-color: var(--control-border, var(--line));
  background: var(--control-bg, var(--card));
  color: var(--control-text, var(--ink));
  box-shadow: none;
}

body.portal-page #portal-profile-auth .portal-login-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 2px;
}

body.portal-page #portal-profile-auth .portal-login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

body.portal-page #portal-profile-auth .portal-login-divider::before,
body.portal-page #portal-profile-auth .portal-login-divider::after {
  content: "";
  height: 1px;
  flex: 1 1 auto;
  background: var(--line);
}

body.portal-page #portal-profile-auth .portal-login-assistance {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(0, 1.3fr);
  align-items: end;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

body.portal-page #portal-profile-auth .portal-login-assistance > div {
  align-self: center;
}

body.portal-page #portal-profile-auth .portal-login-assistance strong,
body.portal-page #portal-profile-auth .portal-login-assistance small {
  display: block;
}

body.portal-page #portal-profile-auth .portal-login-assistance strong {
  color: var(--ink);
  font-size: 13px;
}

body.portal-page #portal-profile-auth .portal-login-assistance small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

body.portal-page #portal-profile-auth .portal-forgot-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  padding: 0;
  border: 0;
  background: transparent;
}

body.portal-page #portal-profile-auth .portal-forgot-form .btn {
  width: auto;
  min-height: 48px;
  white-space: nowrap;
}

body.portal-page #portal-profile-auth .portal-login-privacy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 11px;
}

body.portal-page #portal-profile-auth .portal-login-privacy .icon,
body.portal-page #portal-profile-auth .portal-login-privacy svg {
  width: 15px;
  height: 15px;
  color: var(--primary);
}

body.portal-page[data-portal-theme="dark"] #portal-profile-auth .portal-auth-shell,
body.portal-page[data-portal-theme="dark"] #portal-profile-auth :where(.portal-auth-intro,.portal-login-card,.portal-login-assistance) {
  border-color: var(--line) !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

body.portal-page[data-portal-theme="dark"] #portal-profile-auth .portal-auth-intro {
  background: color-mix(in srgb, var(--primary) 13%, var(--surface)) !important;
}

body.portal-page[data-portal-theme="dark"] #portal-profile-auth .portal-login-assistance {
  background: var(--surface-soft) !important;
}

body.portal-page[data-portal-theme="dark"] #portal-profile-auth :where(h1,h2,strong,.form-label) {
  color: var(--ink) !important;
}

body.portal-page[data-portal-theme="dark"] #portal-profile-auth :where(p,small,.portal-login-divider) {
  color: var(--muted) !important;
}

/* The default service logo already owns its dark rounded surface. A forced
   white image background created the extra tile circled in QA screenshots. */
body.admin-page .admin-brand .logo-img,
body.admin-page #sb .admin-brand .logo-img {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) :where(
  .admin-toolbar .search-box > .icon,
  .admin-toolbar .icon-control > .icon,
  .admin-toolbar .icon-button > .icon,
  .case-search-box > .icon,
  .admin-avatar
) {
  background-image: none !important;
  box-shadow: none !important;
  filter: none !important;
}

body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) .admin-avatar {
  border: 1px solid color-mix(in srgb, var(--primary) 42%, var(--line)) !important;
  background: color-mix(in srgb, var(--primary) 18%, var(--surface-soft)) !important;
  color: color-mix(in srgb, var(--primary) 84%, #fff) !important;
}

body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) :where(
  .data-table thead,.data-table th,table thead,table th,
  .panel-card-header,.admin-side-head,.admin-chart-head,.ch
) {
  border-color: var(--line) !important;
  background-color: var(--surface-soft) !important;
  background-image: none !important;
  color: var(--muted) !important;
  box-shadow: none !important;
}

body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) :where(
  .panel-card-header,.admin-side-head,.admin-chart-head,.ch
) :where(h2,h3,strong) {
  color: var(--ink) !important;
}

body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) :where(
  .empty-mini,.admin-empty-state,.case-detail-empty-compact,.case-detail-empty-row,
  .report-empty,.case-chat-empty,.admin-load-error
) {
  border-color: var(--line) !important;
  background: var(--surface-soft) !important;
  color: var(--muted) !important;
  box-shadow: none !important;
}

@media (max-width: 900px) {
  body.portal-page #portal-profile-auth .portal-auth-shell {
    grid-template-columns: 1fr;
  }

  body.portal-page #portal-profile-auth .portal-auth-intro {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 620px) {
  body.portal-page #portal-profile-auth {
    width: min(100% - 24px, 560px);
    padding: 22px 0 54px;
  }

  body.portal-page #portal-profile-auth .portal-auth-shell {
    border-radius: 18px;
  }

  body.portal-page #portal-profile-auth :where(.portal-auth-intro,.portal-login-card) {
    padding: 24px !important;
  }

  body.portal-page #portal-profile-auth .portal-auth-benefits {
    margin-top: 24px;
  }

  body.portal-page #portal-profile-auth .portal-login-card-head,
  body.portal-page #portal-profile-auth .portal-login-assistance,
  body.portal-page #portal-profile-auth .portal-forgot-form {
    grid-template-columns: 1fr;
  }

  body.portal-page #portal-profile-auth .portal-forgot-form .btn {
    width: 100%;
  }
}

/* R329 full visual-surface and choice-control contract -------------------
   The live audit checks the rendered controls, not only token definitions.
   Keep one background/border owner for every generated admin surface and
   expose public problem choices as real keyboard buttons. */
body:is(.site-page,.portal-page) #request-section button.prob-tag {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  font: inherit;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  box-shadow: none !important;
  text-shadow: none !important;
}

body:is(.site-page,.portal-page) #request-section button.prob-tag:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 58%, transparent) !important;
  outline-offset: 2px !important;
}

body:is(.site-page,.portal-page) #request-section button.prob-tag[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--primary) 72%, var(--line)) !important;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface)) !important;
  color: var(--primary) !important;
}

body:is(.site-page,.portal-page) .portal-info-icon-btn {
  display: inline-grid !important;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  place-items: center !important;
  border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--line)) !important;
  border-radius: 10px !important;
  background: color-mix(in srgb, var(--primary) 8%, var(--surface)) !important;
  color: var(--primary) !important;
  box-shadow: none !important;
}

body:is(.site-page,.portal-page) .portal-info-icon-btn :where(.icon,.portal-case-inline-icon,svg) {
  width: 18px !important;
  height: 18px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

body.admin-page #sb .admin-nav :where(a,button) {
  font-weight: 500 !important;
}

body.admin-page #sb .admin-nav :where(a,button).is-active {
  font-weight: 600 !important;
}

body.admin-page :where(.search-box,.case-search-box) > .icon {
  display: inline-grid !important;
  width: 20px !important;
  min-width: 20px !important;
  height: 20px !important;
  padding: 0 !important;
  place-items: center !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  filter: none !important;
}

body.admin-page :where(.search-box,.case-search-box) > .icon > svg {
  width: 20px !important;
  height: 20px !important;
}

:root[data-theme="dark"] body.admin-page,
body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) {
  --bg: #0b1220;
  --surface: #111a28;
  --surface-soft: #0d1726;
  --text: #eef4ff;
  --ink: #f8fbff;
  --muted: #b8c4d6;
  --muted-2: #8fa1b8;
  --line: #304056;
  --line-strong: #40516a;
  --card: var(--surface);
  --admin-panel: var(--surface);
  --admin-panel-2: var(--surface-soft);
  --admin-field: #0b1322;
  --admin-field-text: #f8fbff;
  --admin-field-muted: #aebbd0;
  --control-bg: #0b1322;
  --control-bg-muted: var(--surface);
  --control-text: #f8fbff;
  --control-muted: #aebbd0;
  --control-border: var(--line);
  color-scheme: dark;
  background: var(--bg) !important;
  color: var(--text) !important;
}

:root[data-theme="dark"] body.admin-page :where(#main,#content,.admin-main,.admin-content,.view.active),
body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) :where(#main,#content,.admin-main,.admin-content,.view.active) {
  background: var(--bg) !important;
  color: var(--text) !important;
}

:root[data-theme="dark"] body.admin-page :where(
  .card,.panel-card,.admin-chart-card,.admin-recent-card,.admin-side-panel,
  .finance-panel,.report-panel,.table-wrap,.data-table,table,tbody,tr,td,
  .filters-bar,.catalog-filter-bar,.case-stats,.stat-card,.fin-kpi,
  .case-detail-head,.case-brief-grid article,.case-doc-quickbar,
  .case-detail-layout,.case-detail-layout .card,.case-summary-panel,
  .tech-workspace,.tech-work-card,.complaints-register-card,
  .complaint-register-shell,.recycling-register-shell,.settings-layout,
  .settings-menu,.settings-section,.visual-module,.modal
),
body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) :where(
  .card,.panel-card,.admin-chart-card,.admin-recent-card,.admin-side-panel,
  .finance-panel,.report-panel,.table-wrap,.data-table,table,tbody,tr,td,
  .filters-bar,.catalog-filter-bar,.case-stats,.stat-card,.fin-kpi,
  .case-detail-head,.case-brief-grid article,.case-doc-quickbar,
  .case-detail-layout,.case-detail-layout .card,.case-summary-panel,
  .tech-workspace,.tech-work-card,.complaints-register-card,
  .complaint-register-shell,.recycling-register-shell,.settings-layout,
  .settings-menu,.settings-section,.visual-module,.modal
) {
  border-color: var(--line) !important;
  background: var(--surface) !important;
  background-image: none !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] body.admin-page :where(
  .data-table thead,.data-table thead tr,.data-table th,table thead,table thead tr,table th,
  .panel-card-header,.admin-chart-head,.admin-side-head,.ch,.ph,
  .modal-head,.modal-foot,.settings-head,.complaint-register-head,
  .recycling-register-head,.case-tabs,.theme-subtabs
),
body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) :where(
  .data-table thead,.data-table thead tr,.data-table th,table thead,table thead tr,table th,
  .panel-card-header,.admin-chart-head,.admin-side-head,.ch,.ph,
  .modal-head,.modal-foot,.settings-head,.complaint-register-head,
  .recycling-register-head,.case-tabs,.theme-subtabs
) {
  border-color: var(--line) !important;
  background: #0d1726 !important;
  background-image: none !important;
  color: var(--muted) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] body.admin-page :where(
  .empty-mini,.admin-empty-state,.case-detail-empty-compact,.case-detail-empty-row,
  .report-empty,.case-chat-empty,.admin-load-error,.catalog-stats,
  .complaint-evidence-note,.recycling-empty,.ld
),
body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) :where(
  .empty-mini,.admin-empty-state,.case-detail-empty-compact,.case-detail-empty-row,
  .report-empty,.case-chat-empty,.admin-load-error,.catalog-stats,
  .complaint-evidence-note,.recycling-empty,.ld
) {
  border-color: var(--line) !important;
  background: var(--surface-soft) !important;
  background-image: none !important;
  color: var(--muted) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] body.admin-page :where(.avatar,.admin-avatar),
body.admin-page:is([data-theme="dark"],[data-admin-theme="dark"]) :where(.avatar,.admin-avatar) {
  border: 1px solid color-mix(in srgb, var(--primary) 42%, var(--line)) !important;
  background: color-mix(in srgb, var(--primary) 18%, var(--surface)) !important;
  background-image: none !important;
  color: color-mix(in srgb, var(--primary) 84%, #fff) !important;
  box-shadow: none !important;
}
/* R346 activation, identity-linking feedback and uncropped mobile campaign media. */
.portal-activation-link,
.public-client-link-note {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
  color: var(--text);
  text-decoration: none;
}

.portal-activation-link { justify-content: flex-start; margin-top: 14px; padding: 13px 14px; }
.portal-activation-link > span:nth-child(2) { flex: 1; min-width: 0; }
.portal-activation-link :where(strong,small) { display: block; }
.portal-activation-link small { margin-top: 3px; color: var(--muted); font-size: .8rem; }
.portal-activation-link:is(:hover,:focus-visible) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, var(--surface)); }
.portal-activation-link-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--primary); background: color-mix(in srgb, var(--primary) 11%, var(--surface)); }

.public-client-link-note { margin: 0 0 16px; padding: 12px 14px; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.public-client-link-note svg { flex: 0 0 auto; color: var(--primary); }
.public-client-link-note strong { color: var(--text); }
.success-client-match { margin: 12px auto 0; max-width: 680px; color: var(--muted); }

@media (max-width: 760px) {
  body.site-page .site-hero.is-image-only {
    min-height: 0 !important;
    height: auto !important;
    aspect-ratio: 4 / 5 !important;
    max-height: none !important;
    background: var(--surface-soft) !important;
  }

  body.site-page .site-hero.is-image-only :where(.portal-banner-slides,.portal-banner-slide) {
    min-height: 0 !important;
    height: 100% !important;
  }

  body.site-page .site-hero.is-image-only .portal-banner-slide.is-image-only {
    /* Keep the uploaded mobile asset. A background shorthand here used to
       reset background-image to none, leaving only the carousel dots visible. */
    background-color: var(--surface-soft) !important;
    background-image: var(--hero-mobile) !important;
    background-position: center top !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
  }
}

/* R347 Premium SaaS visual clarity ---------------------------------------
   The public application uses a single, opaque navigation surface and a
   deliberately restrained elevation scale. This keeps active work legible
   while scrolling and makes the product feel like one workspace rather than
   a stack of independently floating cards. */
body.site-page {
  --public-premium-elevation: 0 1px 2px rgb(16 24 40 / .045), 0 1px 1px rgb(16 24 40 / .025);
}

body.site-page .site-header {
  background: var(--surface) !important;
  box-shadow: 0 1px 2px rgb(16 24 40 / .055);
}

@media (min-width: 761px) {
  body.site-page .site-header-inner {
    min-height: 80px;
  }

  body.site-page .site-nav {
    gap: 24px;
    font-size: 14px;
  }

  body.site-page .site-nav a {
    padding: 27px 0;
    letter-spacing: -.01em;
  }

  body.site-page .site-nav a.is-active::after {
    bottom: 16px;
    height: 2px;
  }
}

body.site-page :where(
  .quick-card,.price-card,.offer-card,.category-strip,.process,.tracker-card,
  .toggle-card,.portal-review-panel,.portal-download-panel,.portal-action-split,
  .portal-contact-one-card,.portal-contact-panel,.portal-map-panel,.portal-app-phone
) {
  box-shadow: var(--public-premium-elevation) !important;
}

body.site-page :where(.quick-card,.service-mini,.portal-action-split,.portal-activation-link) {
  transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}

@media (hover: hover) {
  body.site-page :where(.quick-card,.service-mini,.portal-action-split,.portal-activation-link):hover {
    border-color: color-mix(in srgb, var(--primary) 42%, var(--line)) !important;
    transform: translateY(-1px);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.site-page :where(.quick-card,.service-mini,.portal-action-split,.portal-activation-link) {
    transition: none;
  }
}

/* R349 Verified client identity intake -----------------------------------
   Existing client master data is visibly read-only inside service and
   reservation forms. Profile editing remains a separate, explicit action. */
.portal-identity-guard {
  align-items: flex-start;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary) 8%, var(--surface)),
    color-mix(in srgb, var(--primary) 3%, var(--surface)));
}

.portal-identity-guard a {
  color: var(--primary);
  font-weight: 760;
  text-underline-offset: 3px;
}

.portal-identity-verified-copy { display: none; }

body.portal-profile-authenticated .portal-identity-public-copy { display: none; }
body.portal-profile-authenticated .portal-identity-verified-copy { display: inline; }

body.portal-profile-authenticated .request-form input[data-verified-identity="1"] {
  border-color: color-mix(in srgb, var(--primary) 34%, var(--border));
  background: color-mix(in srgb, var(--primary) 5%, var(--surface-soft));
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--primary) 72%, transparent);
  color: var(--text);
  cursor: default;
}

body.portal-profile-authenticated .request-form input[data-verified-identity="1"]:focus {
  border-color: color-mix(in srgb, var(--primary) 52%, var(--border));
  box-shadow: inset 3px 0 0 var(--primary), 0 0 0 3px color-mix(in srgb, var(--primary) 10%, transparent);
}

/* R351 Premium SaaS density and Theme Studio clarity ----------------------
   Keep the product calm and information-led: compact hero typography,
   restrained elevation, explicit settings grouping and visible save state. */
body.site-page,
body.portal-page,
body.admin-page {
  --premium-panel-shadow: 0 1px 2px rgb(16 24 40 / .045), 0 14px 34px -30px rgb(16 24 40 / .32);
  --premium-panel-shadow-hover: 0 2px 4px rgb(16 24 40 / .06), 0 18px 40px -30px rgb(16 24 40 / .38);
}

body.site-page .portal-banner-slide.is-code-hero > .container {
  grid-template-columns: minmax(0, .96fr) minmax(390px, 1.04fr);
  gap: clamp(28px, 3vw, 44px);
  padding: 38px clamp(38px, 4vw, 54px);
}

body.site-page .portal-banner-slide.is-code-hero .hero-content {
  max-width: 590px;
}

body.site-page .portal-banner-slide.is-code-hero h1 {
  max-width: 14ch;
  font-size: clamp(42px, 3.8vw, 60px) !important;
  line-height: 1.015 !important;
  letter-spacing: -.038em !important;
  text-wrap: balance;
}

body.site-page .portal-banner-slide.is-code-hero .hero-content p {
  max-width: 54ch;
  margin: 18px 0 22px;
  font-size: 17px;
  line-height: 1.55;
}

body.site-page .hero-product-visual > img {
  border-radius: 20px;
  box-shadow: var(--premium-panel-shadow);
}

body.site-page .quick-card,
body.portal-page :where(.portal-card,.stat-card,.portal-case-mini-row,.portal-device-card,.portal-warranty-row,.portal-protocol-row) {
  box-shadow: var(--premium-panel-shadow) !important;
}

@media (hover: hover) {
  body.site-page .quick-card:hover {
    box-shadow: var(--premium-panel-shadow-hover) !important;
  }
}

body.admin-page #topbar,
body.admin-page .admin-topbar {
  border-bottom-color: color-mix(in srgb, var(--primary) 8%, var(--line)) !important;
  box-shadow: 0 1px 2px rgb(16 24 40 / .04) !important;
}

body.admin-page :where(.admin-kpi,.metric-card,.stat-card,.panel-card,.settings-section) {
  box-shadow: var(--premium-panel-shadow) !important;
}

body.admin-page .theme-studio-modernized .settings-body {
  gap: 16px !important;
}

body.admin-page .theme-studio-modernized .theme-subtabs {
  top: 76px;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 7px;
  overflow-x: auto;
  border-color: color-mix(in srgb, var(--primary) 12%, var(--line));
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface) 96%, var(--primary));
  box-shadow: 0 8px 24px -24px rgb(16 24 40 / .42);
  scrollbar-width: thin;
}

body.admin-page .theme-studio-modernized .theme-subtabs button {
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 9px;
  background: transparent;
}

body.admin-page .theme-studio-modernized .theme-subtabs button.is-active {
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(16 24 40 / .07) !important;
}

body.admin-page .theme-studio-modernized [data-theme-group-count] {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 12%, transparent);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

body.admin-page .theme-studio-modernized .theme-subtabs button.is-active [data-theme-group-count] {
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  color: var(--primary);
}

body.admin-page .theme-studio-modernized .visual-module {
  overflow: hidden;
  padding: 16px !important;
  border-color: color-mix(in srgb, var(--primary) 10%, var(--line)) !important;
  border-radius: 14px !important;
  box-shadow: var(--premium-panel-shadow) !important;
}

body.admin-page .theme-studio-modernized .visual-module-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -16px -16px 16px;
  padding: 11px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 10%, var(--line));
  background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 5%, var(--surface)), var(--surface));
}

body.admin-page .theme-studio-modernized .visual-num {
  width: 25px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  margin-right: 7px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  color: var(--primary);
  font-size: 11px;
  font-weight: 850;
}

body.admin-page .portal-banner-manager-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

body.admin-page .portal-banner-save-state {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--success, #15803d);
  font-size: 11px;
  font-weight: 750;
}

body.admin-page .portal-banner-save-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

body.admin-page .portal-banner-save-state[data-tone="warn"] {
  color: var(--warning, #b45309);
}

@media (max-width: 980px) {
  body.site-page .portal-banner-slide.is-code-hero > .container {
    grid-template-columns: 1fr;
    padding: 30px;
  }

  body.site-page .portal-banner-slide.is-code-hero h1 {
    max-width: 16ch;
    font-size: clamp(38px, 6vw, 52px) !important;
  }
}

@media (max-width: 560px) {
  body.site-page .site-hero:not(.is-image-only) {
    min-height: 590px;
  }

  body.site-page .portal-banner-slide.is-code-hero > .container {
    gap: 12px;
    padding: 16px 14px 18px;
  }

  body.site-page .portal-banner-slide.is-code-hero h1 {
    max-width: none;
    font-size: clamp(28px, 8.2vw, 33px) !important;
    line-height: 1.04 !important;
  }

  body.site-page .portal-banner-slide.is-code-hero .hero-content p {
    margin: 10px 0 13px;
    font-size: 13px;
  }

  body.site-page .portal-banner-slide.is-code-hero .hero-bullets {
    margin-bottom: 13px;
  }

  body.site-page .portal-banner-slide.is-code-hero .hero-product-visual > img {
    max-height: 145px;
  }

  body.admin-page .portal-banner-manager-head,
  body.admin-page .portal-banner-manager-head-actions {
    align-items: stretch;
    flex-direction: column;
  }

  body.admin-page .portal-banner-manager-head-actions .btn {
    width: 100%;
  }
}

/* R365 public SaaS hero: the fallback headline may be materially longer than
   the demo copy. Give desktop content a truthful vertical budget and a calmer
   type scale instead of centering an overflowing block inside a 520px slide. */
@media (min-width: 981px) {
  body.site-page .site-hero:not(.is-image-only) {
    min-height: clamp(600px, 44vw, 640px);
  }

  body.site-page .portal-banner-slide.is-code-hero > .container {
    grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
    gap: clamp(28px, 2.8vw, 40px);
  }

  body.site-page .portal-banner-slide.is-code-hero .hero-content {
    max-width: 640px;
  }

  body.site-page .portal-banner-slide.is-code-hero h1 {
    max-width: 16ch;
    font-size: clamp(40px, 3.45vw, 54px) !important;
    line-height: 1.02 !important;
    text-wrap: balance;
  }

  body.site-page .portal-banner-slide.is-code-hero .hero-content p {
    margin: 16px 0 20px;
    font-size: 16px;
    line-height: 1.5;
  }

  body.site-page .portal-banner-slide.is-code-hero .hero-product-visual > img {
    max-height: 360px;
  }
}


/*reactive-ui-r450.css*/
html::before {
  content: '';
  position: fixed;
  z-index: 10000;
  inset: 0 auto auto 0;
  width: 0;
  height: 2px;
  background: var(--pr, var(--primary, #334155));
  opacity: 0;
  pointer-events: none;
  transition: width .18s ease, opacity .18s ease;
}
html[data-reactive-pending]::before,
html[data-admin-navigating]::before { width: 72%; opacity: 1; }
.reactive-ui-status {
  position: fixed;
  z-index: 10001;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  max-width: min(320px, calc(100vw - 28px));
  padding: 8px 12px;
  border: 1px solid var(--line, var(--border, #dbe3ee));
  border-radius: 999px;
  background: var(--surface, #fff);
  color: var(--ink, var(--text, #0f172a));
  box-shadow: 0 12px 32px rgb(15 23 42 / 14%);
  font: 700 12px/1.35 inherit;
}
.reactive-ui-status[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { html::before { transition: none; } }


/*saas-premium-r369.css*/
/* R369 final ownership layer for premium SaaS depth, rhythm and interaction polish. */
body.admin-page,
body.site-page,
body.portal-page {
  --r369-hairline: color-mix(in srgb, var(--line) 76%, transparent);
  --r369-soft: color-mix(in srgb, var(--surface) 92%, var(--primary) 8%);
  --r369-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 18px 52px -38px rgba(15, 23, 42, .32);
  --r369-shadow-hover: 0 2px 4px rgba(15, 23, 42, .05), 0 24px 58px -38px rgba(15, 23, 42, .4);
}

/* Admin shell */
body.admin-page .admin-sidebar {
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 26px 72px -38px rgba(15, 23, 42, .78);
}
body.admin-page .admin-brand {
  border-bottom-color: rgba(255, 255, 255, .12);
}
body.admin-page .admin-brand img,
body.admin-page .admin-brand .brand-mark {
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .16));
}
body.admin-page .admin-nav a:hover {
  border-color: rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .075);
}
body.admin-page .admin-user-card {
  border-color: rgba(255, 255, 255, .12);
  background: linear-gradient(135deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .035));
}
body.admin-page .admin-main {
  border: 1px solid var(--r369-hairline);
  box-shadow: 0 26px 80px -52px rgba(15, 23, 42, .5);
}
body.admin-page .admin-content {
  width: min(1680px, 100%);
  margin-inline: auto;
}
body.admin-page .view.active {
  animation: r369-view-in .2s ease-out both;
}
body.admin-page :where(.card, .panel-card, .admin-side-panel, .settings-section, .finance-panel, .fast-card) {
  border-color: var(--r369-hairline);
  border-radius: 16px;
  box-shadow: var(--r369-shadow);
}
body.admin-page :where(.card, .panel-card, .admin-side-panel, .finance-panel) {
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
body.admin-page :where(.card, .panel-card, .admin-side-panel, .finance-panel):hover {
  border-color: color-mix(in srgb, var(--primary) 16%, var(--line));
  box-shadow: var(--r369-shadow-hover);
}
body.admin-page .filters-bar {
  border: 1px solid var(--r369-hairline);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: 0 10px 32px -28px rgba(15, 23, 42, .35);
  backdrop-filter: blur(12px) saturate(130%);
}
body.admin-page :where(.btn, .action-btn, .table-action, .icon-button) {
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
body.admin-page :where(.btn, .action-btn, .table-action):hover:not(:disabled) {
  transform: translateY(-1px);
}
body.admin-page :where(.btn, .action-btn, .table-action, .icon-button):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent);
  outline-offset: 2px;
}
body.admin-page .table-wrap,
body.admin-page .admin-u-scroll-x {
  scrollbar-color: color-mix(in srgb, var(--primary) 26%, var(--line)) transparent;
}
body.admin-page .data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: inset 0 -1px 0 var(--r369-hairline);
}
body.admin-page .data-table tbody tr:last-child td { border-bottom: 0; }
body.admin-page .modal-layer.open { padding: 16px; }
body.admin-page .modal {
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  border-radius: 18px;
}
body.admin-page .modal-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: color-mix(in srgb, var(--primary) 28%, var(--line)) transparent;
}
body.admin-page .modal-close {
  border: 1px solid var(--r369-hairline);
  background: var(--surface);
  box-shadow: 0 8px 20px -16px rgba(15, 23, 42, .5);
}
body.admin-page[data-theme="dark"] {
  --r369-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 22px 56px -36px rgba(0, 0, 0, .7);
  --r369-shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 26px 62px -36px rgba(0, 0, 0, .78);
}

/* Public and authenticated portal */
body.site-page,
body.portal-page {
  background-image:
    radial-gradient(circle at 8% 4%, color-mix(in srgb, var(--primary) 7%, transparent), transparent 26rem),
    radial-gradient(circle at 92% 16%, color-mix(in srgb, var(--secondary) 6%, transparent), transparent 30rem);
  background-attachment: fixed;
}
body.site-page .site-header {
  border-bottom-color: var(--r369-hairline);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 10px 34px -30px rgba(15, 23, 42, .42);
  backdrop-filter: blur(16px) saturate(145%);
}
body.site-page .brand-logo-img { filter: drop-shadow(0 7px 15px rgba(15, 23, 42, .12)); }
body.site-page .site-nav a { transition: color .15s ease, opacity .15s ease; }
body.site-page .site-nav a:hover { color: var(--primary); }
body.site-page .site-hero {
  border-bottom-color: var(--r369-hairline);
  box-shadow: inset 0 -28px 50px -48px rgba(15, 23, 42, .35);
}
body.site-page .portal-banner-dots {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 999px;
  background: rgba(15, 23, 42, .16);
  box-shadow: 0 10px 28px -20px rgba(15, 23, 42, .7);
  backdrop-filter: blur(10px);
}
body.site-page :where(.quick-card, .service-mini, .toggle-card, .loc-card, .hero-card, .offer-card) {
  border-color: var(--r369-hairline);
  box-shadow: var(--r369-shadow);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
body.site-page :where(.quick-card, .service-mini):hover {
  border-color: color-mix(in srgb, var(--primary) 24%, var(--line));
  box-shadow: var(--r369-shadow-hover);
  transform: translateY(-2px);
}
body.site-page :where(.btn, .quick-card, .service-mini, .toggle-head, .site-mobile-bar a):focus-visible,
body.portal-page :where(.btn, button, a, input, select, textarea):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent);
  outline-offset: 2px;
}
body.portal-page .portal-shell {
  gap: 20px;
}
body.portal-page .portal-sidebar {
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 28px 80px -42px color-mix(in srgb, var(--secondary) 72%, rgba(15, 23, 42, .8));
}
body.portal-page .portal-main {
  border: 1px solid var(--r369-hairline);
  box-shadow: 0 26px 80px -50px rgba(15, 23, 42, .5);
}
body.portal-page .portal-header {
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 96%, var(--primary) 4%), var(--surface));
}
body.portal-page .portal-header h1 { letter-spacing: -.035em; text-wrap: balance; }
body.portal-page .portal-tabs {
  background: color-mix(in srgb, var(--surface) 91%, transparent);
  backdrop-filter: blur(12px) saturate(135%);
}
body.portal-page :where(.stat-card, .loyalty-card, .level-card, .portal-aside-card, .panel-card, .portal-settings-card, .portal-login-card) {
  border-color: var(--r369-hairline);
  box-shadow: var(--r369-shadow);
}
body.portal-page :where(.portal-case-mini-row, .portal-warranty-row, .portal-protocol-row, .info-row) {
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}
body.portal-page :where(.portal-case-mini-row, .portal-warranty-row, .portal-protocol-row, .info-row):hover {
  border-color: color-mix(in srgb, var(--primary) 20%, var(--line));
  background: color-mix(in srgb, var(--surface) 95%, var(--primary) 5%);
}

@keyframes r369-view-in {
  from { opacity: .72; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 760px) {
  body.admin-page .admin-content { padding-inline: 12px; }
  body.admin-page .modal-layer.open { padding: 8px; align-items: flex-end; }
  body.admin-page .modal { width: 100%; max-height: calc(100dvh - 16px); border-radius: 18px 18px 12px 12px; }
  body.site-page,
  body.portal-page { background-attachment: scroll; }
  body.site-page .site-header { backdrop-filter: blur(11px) saturate(130%); }
  body.site-page .portal-banner-dots { bottom: 14px; }
  body.site-page :where(.quick-card, .service-mini):hover { transform: none; }
  body.portal-page .portal-main { border-radius: 18px; box-shadow: 0 18px 46px -38px rgba(15, 23, 42, .48); }
  body.portal-page .app-mobile-nav,
  body.site-page .site-mobile-bar {
    border-top: 1px solid var(--r369-hairline);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    box-shadow: 0 -12px 32px -26px rgba(15, 23, 42, .5);
    backdrop-filter: blur(15px) saturate(145%);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.admin-page .view.active { animation: none; }
  body.admin-page :where(.card, .panel-card, .admin-side-panel, .finance-panel, .btn, .action-btn, .table-action),
  body.site-page :where(.quick-card, .service-mini, .toggle-card, .loc-card, .hero-card, .offer-card) { transition: none; }
}


/*saas-premium-r389.css*/
/* R389 — final premium SaaS ownership layer. Kept additive and token-driven. */
body.admin-page,
body.site-page,
body.portal-page {
  --r389-line: color-mix(in srgb, var(--line) 72%, transparent);
  --r389-soft: color-mix(in srgb, var(--surface) 94%, var(--primary) 6%);
  --r389-elevated: 0 1px 2px rgba(15, 23, 42, .04), 0 20px 54px -39px rgba(15, 23, 42, .36);
  --r389-elevated-hover: 0 2px 5px rgba(15, 23, 42, .05), 0 28px 64px -40px rgba(15, 23, 42, .44);
}

/* Admin: calm hierarchy, denser information and explicit modal ownership. */
body.admin-page .admin-topbar {
  border-bottom-color: var(--r389-line);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: 0 12px 34px -32px rgba(15, 23, 42, .48);
  backdrop-filter: blur(15px) saturate(140%);
}
body.admin-page :where(.card, .panel-card, .montage-panel, .montage-dispatcher, .montage-field-card, .montage-insights) {
  border-color: var(--r389-line);
  box-shadow: var(--r389-elevated);
}
body.admin-page :where(.form-input, input, select, textarea):focus {
  border-color: color-mix(in srgb, var(--primary) 54%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}
body.admin-page .data-table tbody tr {
  transition: background-color .14s ease;
}
body.admin-page .data-table tbody tr:hover {
  background: color-mix(in srgb, var(--surface) 95%, var(--primary) 5%);
}
body.admin-page .modal-layer.open {
  background: color-mix(in srgb, rgba(15, 23, 42, .6) 84%, transparent);
  backdrop-filter: blur(8px) saturate(110%);
}
body.admin-page .modal {
  border: 1px solid color-mix(in srgb, var(--line) 75%, var(--primary) 25%);
  box-shadow: 0 34px 100px -36px rgba(2, 6, 23, .72);
}
body.admin-page .modal-head,
body.admin-page .modal-foot {
  background: color-mix(in srgb, var(--surface) 94%, var(--primary) 6%);
}
body.admin-page .modal-head {
  border-bottom: 1px solid var(--r389-line);
}
body.admin-page .modal-foot {
  border-top: 1px solid var(--r389-line);
}
body.admin-page .modal-close:hover {
  border-color: color-mix(in srgb, var(--danger) 32%, var(--line));
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
  color: var(--danger);
}

/* Montage: documents, visits and material settlement read as one workspace. */
body.admin-page .montage-view {
  --montage-workspace-accent: color-mix(in srgb, var(--primary) 14%, transparent);
}
body.admin-page .montage-hero {
  border-color: color-mix(in srgb, var(--primary) 22%, var(--line));
  background:
    radial-gradient(circle at 92% 4%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 22rem),
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 91%, var(--primary) 9%), var(--surface) 58%);
}
body.admin-page .montage-kpis article {
  position: relative;
  overflow: hidden;
}
body.admin-page .montage-kpis article::after {
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), transparent 74%);
  content: "";
  opacity: .38;
}
body.admin-page .montage-agenda-card {
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 97%, var(--primary) 3%);
}
body.admin-page .montage-agenda-card.is-visit {
  background: linear-gradient(110deg, color-mix(in srgb, var(--info) 7%, var(--surface)), var(--surface));
}
body.admin-page .montage-agenda-card.is-visit time::before {
  display: inline-flex;
  margin: 0 6px 4px 0;
  padding: 3px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--info) 11%, var(--surface));
  color: var(--info);
  content: "ПОСЕЩЕНИЕ";
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
}
body.admin-page .montage-panel .table-action[href*="montage-document.php"],
body.admin-page .montage-aftercare-row a[href*="montage-document.php"] {
  border-color: color-mix(in srgb, var(--primary) 26%, var(--line));
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
  color: var(--primary);
  text-decoration: none;
}
body.admin-page .montage-panel .table-action[href*="montage-document.php"]::before,
body.admin-page .montage-aftercare-row a[href*="montage-document.php"]::before {
  content: "DOC";
  margin-right: 5px;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .08em;
}
body.admin-page .montage-field-row {
  background: color-mix(in srgb, var(--surface) 98%, var(--primary) 2%);
}
body.admin-page .montage-field-metric b:last-child {
  color: var(--primary);
}

/* Public banner: image and code banners keep a visible, deterministic mobile canvas. */
body.site-page .portal-hero-rotator,
body.site-page .portal-banner-slides,
body.site-page .portal-banner-slide {
  isolation: isolate;
}
body.site-page .portal-banner-slide {
  background-color: color-mix(in srgb, var(--surface-soft) 92%, var(--primary) 8%);
}
body.site-page .portal-banner-slide.active {
  opacity: 1 !important;
  visibility: visible !important;
}
body.site-page .portal-banner-dots button {
  min-width: 10px;
  min-height: 10px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .46);
}

/* Client portal: premium document shelf and trustworthy completed state. */
body.portal-page .portal-montage-card {
  border-color: var(--r389-line);
  box-shadow: var(--r389-elevated);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
body.portal-page .portal-montage-card:hover {
  border-color: color-mix(in srgb, var(--primary) 24%, var(--line));
  box-shadow: var(--r389-elevated-hover);
  transform: translateY(-1px);
}
body.portal-page .portal-montage-documents {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--r389-line);
}
body.portal-page .portal-montage-document-link {
  min-height: 34px;
  border-color: color-mix(in srgb, var(--primary) 25%, var(--line));
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
  text-decoration: none;
}
body.portal-page .portal-montage-document-link::before {
  content: "DOC";
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .09em;
}
body.portal-page .portal-montage-decision[data-state="completed"] > span,
body.portal-page .portal-montage-decision[data-state="accepted"] > span {
  color: var(--ok);
}

body.admin-page[data-theme="dark"],
body.admin-page[data-admin-theme="dark"] {
  --r389-elevated: 0 1px 2px rgba(0, 0, 0, .3), 0 24px 60px -38px rgba(0, 0, 0, .78);
  --r389-elevated-hover: 0 2px 5px rgba(0, 0, 0, .34), 0 30px 70px -38px rgba(0, 0, 0, .84);
}

@media (max-width: 760px) {
  body.admin-page .modal-layer.open {
    padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
  }
  body.admin-page .modal-head,
  body.admin-page .modal-body,
  body.admin-page .modal-foot {
    padding-inline: 15px;
  }
  body.admin-page .montage-agenda-card,
  body.admin-page .montage-aftercare-row {
    max-width: 100%;
  }
  body.site-page .site-hero,
  body.site-page .portal-hero-rotator {
    min-height: clamp(310px, 62vh, 520px);
  }
  body.site-page .portal-banner-slide {
    min-height: 100%;
    background-position: center center;
    background-size: cover;
  }
  body.site-page .portal-banner-slide.is-image-only {
    background-image: var(--hero-mobile, var(--hero-desktop));
  }
  body.portal-page .portal-montage-documents {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.portal-page .portal-montage-document-link {
    width: 100%;
    justify-content: center;
  }

  /* R390 mobile portal density: six first-class destinations without a
     horizontal scroller, while keeping the primary request action prominent. */
  body.portal-page #profile-section .app-mobile-nav {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 2px !important;
    min-height: calc(66px + env(safe-area-inset-bottom)) !important;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)) !important;
    border-top-color: color-mix(in srgb, var(--primary) 12%, var(--line)) !important;
    background: color-mix(in srgb, var(--surface) 91%, transparent) !important;
    box-shadow: 0 -18px 42px -34px rgba(15, 23, 42, .56) !important;
    backdrop-filter: blur(18px) saturate(150%) !important;
  }
  body.portal-page #profile-section .app-mobile-nav :where(button,a) {
    min-height: 52px !important;
    gap: 3px !important;
    padding: 3px 1px !important;
    border-radius: 11px !important;
    font-size: 10px !important;
    font-weight: 760 !important;
    line-height: 1.05 !important;
  }
  body.portal-page #profile-section .app-mobile-nav svg {
    width: 19px !important;
    height: 19px !important;
  }
  body.portal-page #profile-section .app-mobile-nav :where(button,a).is-active:not(.mobile-nav-action) {
    border-color: color-mix(in srgb, var(--primary) 20%, var(--line)) !important;
    background: color-mix(in srgb, var(--primary) 9%, var(--surface)) !important;
  }

  /* Keep the first viewport useful: identity, loyalty and four KPIs fit into a
     deliberate dashboard rhythm instead of a long single-column document. */
  body.portal-page #portal-profile-dashboard.portal-shell:not([hidden]) {
    width: calc(100% - 8px) !important;
    margin-top: 4px !important;
  }
  body.portal-page #portal-profile-dashboard .portal-main {
    border-radius: 16px !important;
    overflow: clip !important;
  }
  body.portal-page #portal-profile-dashboard .mobile-top {
    position: sticky !important;
    top: 0 !important;
    z-index: 32 !important;
    padding: 9px 10px !important;
    border-bottom-color: var(--r389-line) !important;
    background: color-mix(in srgb, var(--surface) 92%, transparent) !important;
    box-shadow: 0 12px 30px -28px rgba(15, 23, 42, .62) !important;
    backdrop-filter: blur(16px) saturate(145%) !important;
  }
  body.portal-page #portal-profile-dashboard .mobile-profile-row {
    grid-template-columns: 44px minmax(0, 1fr) 40px 40px !important;
    gap: 8px !important;
  }
  body.portal-page #portal-profile-dashboard .mobile-profile-row .avatar-large {
    width: 44px !important;
    height: 44px !important;
  }
  body.portal-page #portal-profile-dashboard .mobile-profile-row h1 {
    font-size: 18px !important;
    letter-spacing: -.025em !important;
  }
  body.portal-page #portal-profile-dashboard .portal-header {
    padding: 8px !important;
  }
  body.portal-page #portal-profile-dashboard .portal-header-loyalty-card {
    grid-template-columns: minmax(0, 1fr) 74px !important;
    grid-template-areas:
      "kicker qr"
      "level qr"
      "discount qr"
      "meta qr" !important;
    gap: 4px 10px !important;
    min-height: 112px !important;
    padding: 12px !important;
    border-radius: 13px !important;
    background:
      radial-gradient(circle at 92% 10%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 9rem),
      var(--surface) !important;
    box-shadow: var(--r389-elevated) !important;
  }
  body.portal-page #portal-profile-dashboard .portal-header-loyalty-card strong {
    font-size: 20px !important;
  }
  body.portal-page #portal-profile-dashboard .portal-header-loyalty-card .portal-qr-mark {
    width: 68px !important;
    height: 68px !important;
    align-self: center !important;
    justify-self: end !important;
  }
  body.portal-page #portal-profile-dashboard .portal-content {
    gap: 8px !important;
    padding: 8px !important;
  }
  body.portal-page #portal-profile-dashboard .portal-content-main,
  body.portal-page #portal-profile-dashboard .portal-dashboard-aside {
    gap: 8px !important;
  }
  body.portal-page #portal-profile-dashboard .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  body.portal-page #portal-profile-dashboard .stat-card {
    min-height: 110px !important;
    grid-template-columns: 34px minmax(0, 1fr) !important;
    grid-template-rows: auto 1fr auto !important;
    gap: 5px 8px !important;
    align-content: stretch !important;
    padding: 11px !important;
    border-radius: 13px !important;
    box-shadow: var(--r389-elevated) !important;
  }
  body.portal-page #portal-profile-dashboard .stat-card > .icon-bubble {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    width: 32px !important;
    height: 32px !important;
  }
  body.portal-page #portal-profile-dashboard .stat-card > span:not(.icon-bubble) {
    grid-column: 2 !important;
    grid-row: 1 !important;
    font-size: 11px !important;
    line-height: 1.15 !important;
  }
  body.portal-page #portal-profile-dashboard .stat-card > b {
    grid-column: 2 !important;
    grid-row: 2 !important;
    justify-self: start !important;
    font-size: 24px !important;
  }
  body.portal-page #portal-profile-dashboard .stat-card > a {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    font-size: 10.5px !important;
  }
  body.portal-page #portal-profile-dashboard .level-card {
    padding: 13px !important;
    box-shadow: var(--r389-elevated) !important;
  }
  body.portal-page #portal-profile-dashboard .level-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }
  body.portal-page #portal-profile-dashboard .level-item {
    min-width: 0 !important;
    padding: 8px 5px !important;
    text-align: center !important;
  }
  body.portal-page #portal-profile-dashboard .level-item span {
    font-size: 9.5px !important;
    line-height: 1.15 !important;
  }
  body.portal-page #portal-profile-dashboard .portal-aside-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }
  body.portal-page #portal-profile-dashboard .portal-aside-actions button {
    min-height: 48px !important;
    padding: 8px !important;
    font-size: 11px !important;
  }
  body.portal-page #portal-profile-dashboard .portal-case-mini-row {
    grid-template-columns: 38px minmax(0, 1fr) minmax(76px, .62fr) !important;
    grid-template-areas:
      "thumb main main"
      "thumb status status"
      ". code money"
      ". detail chat" !important;
    gap: 7px 8px !important;
    padding: 10px !important;
  }
  body.portal-page #portal-profile-dashboard .portal-case-mini-row > .portal-device-thumb {
    grid-area: thumb !important;
  }
  body.portal-page #portal-profile-dashboard .portal-case-mini-row > .portal-case-mini-main {
    grid-area: main !important;
  }
  body.portal-page #portal-profile-dashboard .portal-case-mini-row > .portal-status-pill {
    grid-area: status !important;
    justify-self: start !important;
  }
  body.portal-page #portal-profile-dashboard .portal-case-mini-row > .portal-case-mini-code {
    grid-area: code !important;
    justify-self: start !important;
  }
  body.portal-page #portal-profile-dashboard .portal-case-mini-row > .portal-case-mini-money {
    grid-area: money !important;
    justify-self: end !important;
  }
  body.portal-page #portal-profile-dashboard .portal-case-mini-row > .portal-case-mini-action:not(.portal-case-chat-action) {
    grid-area: detail !important;
  }
  body.portal-page #portal-profile-dashboard .portal-case-mini-row > .portal-case-chat-action {
    grid-area: chat !important;
  }
  body.portal-page #portal-profile-dashboard .portal-case-mini-row > .portal-case-mini-action {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 36px !important;
  }
}

@media (max-width: 430px) {
  body.admin-page .montage-kpis,
  body.portal-page .portal-montage-documents {
    grid-template-columns: 1fr;
  }
  body.admin-page .modal {
    max-width: 100%;
  }
  body.portal-page #profile-section .app-mobile-nav :where(button,a) {
    font-size: 9.5px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.admin-page .data-table tbody tr,
  body.portal-page .portal-montage-card {
    transition: none;
  }
  body.portal-page .portal-montage-card:hover {
    transform: none;
  }
}


/*saas-premium-r399.css*/
/* R399 final SaaS premium visual pass. Loaded after every feature stylesheet. */
:root{
  --r399-radius-sm:12px;--r399-radius:16px;--r399-radius-lg:22px;
  --r399-line:color-mix(in srgb,var(--border,#dfe5ef) 82%,transparent);
  --r399-shadow:0 1px 2px rgba(15,23,42,.04),0 18px 48px -34px rgba(15,23,42,.34);
  --r399-shadow-up:0 2px 5px rgba(15,23,42,.05),0 24px 62px -34px rgba(15,23,42,.42);
  --r399-focus:0 0 0 4px color-mix(in srgb,var(--primary,#c72c6d) 14%,transparent);
}

.case-warranty-resolution{margin:14px 0 16px;padding:16px;border:1px solid color-mix(in srgb,var(--primary,#c72c6d) 26%,var(--border,#dfe5ef));border-radius:16px;background:linear-gradient(145deg,color-mix(in srgb,var(--primary,#c72c6d) 7%,var(--surface,#fff)),var(--surface,#fff));box-shadow:0 10px 28px rgba(15,23,42,.06)}
.case-warranty-resolution[hidden]{display:none!important}
.case-warranty-resolution-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
.case-warranty-resolution-head strong{display:block;color:var(--text,#111827);font-size:14px;letter-spacing:.01em}
.case-warranty-resolution-head small{display:block;margin-top:5px;color:var(--muted,#64748b);line-height:1.5}
.case-warranty-resolution .case-option-grid{margin:0 0 14px}
.case-warranty-resolution .check-control{background:color-mix(in srgb,var(--surface,#fff) 92%,transparent);border-color:color-mix(in srgb,var(--primary,#c72c6d) 20%,var(--border,#dfe5ef))}
.case-warranty-resolution .form-row{margin-bottom:10px}
.portal-warranty-paid{display:block!important;margin-top:3px;color:var(--warning,#b45309)!important;font-weight:700}

@media(max-width:720px){
  .case-warranty-resolution{padding:13px;border-radius:14px}
  .case-warranty-resolution .case-option-grid,.case-warranty-resolution .form-row{grid-template-columns:1fr}
  .portal-warranty-row{align-items:flex-start}
  .portal-warranty-row>strong{max-width:42%;text-align:right;white-space:normal}
}

/* Shared control language */
:where(body.admin-page,body.portal-page,body.site-page) :where(.btn,.form-input,button,a){-webkit-tap-highlight-color:transparent}
:where(body.admin-page,body.portal-page) :where(.btn,.form-input,.table-action){transition:border-color .16s ease,background-color .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease}
:where(body.admin-page,body.portal-page) .form-input{min-height:44px;border-radius:var(--r399-radius-sm);border-color:var(--r399-line);background:color-mix(in srgb,var(--surface,#fff) 97%,var(--primary,#c72c6d) 3%);box-shadow:0 1px 1px rgba(15,23,42,.02)}
:where(body.admin-page,body.portal-page) textarea.form-input{min-height:92px;line-height:1.55;resize:vertical}
:where(body.admin-page,body.portal-page) .form-input:focus{border-color:color-mix(in srgb,var(--primary,#c72c6d) 55%,var(--border,#dfe5ef));box-shadow:var(--r399-focus);outline:0}
:where(body.admin-page,body.portal-page) .btn{min-height:42px;border-radius:12px;font-weight:760;letter-spacing:-.006em}
:where(body.admin-page,body.portal-page) .btn-primary{box-shadow:0 9px 24px -16px color-mix(in srgb,var(--primary,#c72c6d) 70%,transparent)}
:where(body.admin-page,body.portal-page) .btn-primary:hover{transform:translateY(-1px);box-shadow:0 13px 30px -17px color-mix(in srgb,var(--primary,#c72c6d) 78%,transparent)}

/* Admin shell and information density */
body.admin-page{background:linear-gradient(145deg,color-mix(in srgb,var(--bg,#f4f7fb) 95%,var(--primary,#c72c6d) 5%),var(--bg,#f4f7fb) 55%,color-mix(in srgb,var(--bg,#f4f7fb) 96%,#0ea5e9 4%));color:var(--text,#172033)}
body.admin-page .main{max-width:none}
body.admin-page .page-head{margin-bottom:18px}
body.admin-page .page-head h1{font-size:clamp(25px,2vw,34px);letter-spacing:-.035em;line-height:1.08}
body.admin-page .page-head p{max-width:760px;line-height:1.55}
body.admin-page :where(.card,.montage-command-center,.montage-insights,.montage-dispatcher,.montage-location,.montage-finance){border:1px solid var(--r399-line);border-radius:var(--r399-radius);background:color-mix(in srgb,var(--surface,#fff) 98%,var(--primary,#c72c6d) 2%);box-shadow:var(--r399-shadow)}
body.admin-page :where(.card,.montage-location-row,.montage-finance-row){contain:paint}
body.admin-page .montage-module{display:grid;gap:18px;max-width:1720px;margin-inline:auto}
body.admin-page .montage-module>.page-head{margin-bottom:0;padding:4px 2px}
body.admin-page .montage-module>.page-head>div:first-child{max-width:850px}
body.admin-page .montage-kpis{gap:14px;margin:0}
body.admin-page .montage-kpis article{min-height:116px;padding:19px 20px;overflow:hidden;position:relative}
body.admin-page .montage-kpis article:after{content:"";position:absolute;width:74px;height:74px;right:-24px;top:-26px;border-radius:50%;background:color-mix(in srgb,var(--primary,#c72c6d) 8%,transparent)}
body.admin-page .montage-kpis strong{font-size:30px;letter-spacing:-.045em}
body.admin-page :where(.montage-command-center,.montage-insights,.montage-dispatcher,.montage-location,.montage-finance)>header{min-height:86px;padding:20px 22px;background:linear-gradient(115deg,color-mix(in srgb,var(--surface,#fff) 98%,var(--primary,#c72c6d) 2%),color-mix(in srgb,var(--surface,#fff) 97%,#0ea5e9 3%))}
body.admin-page :where(.montage-command-center,.montage-insights,.montage-dispatcher,.montage-location,.montage-finance)>header h3{font-size:19px;letter-spacing:-.022em}
body.admin-page :where(.montage-command-center,.montage-insights,.montage-dispatcher,.montage-location,.montage-finance)>header p{line-height:1.48}
body.admin-page .montage-toolbar{position:sticky;top:10px;z-index:12;padding:14px;gap:12px;background:color-mix(in srgb,var(--surface,#fff) 90%,transparent);backdrop-filter:blur(18px) saturate(140%)}
body.admin-page .montage-agenda{padding:16px 18px 20px}
body.admin-page .montage-agenda-card{border-radius:14px;border-color:var(--r399-line);background:var(--surface,#fff);box-shadow:0 10px 28px -26px rgba(15,23,42,.35)}
body.admin-page .montage-field-grid{gap:14px}
body.admin-page .montage-field-card{min-width:0}
body.admin-page .montage-location-row:hover,body.admin-page .montage-finance-row:hover{background:color-mix(in srgb,var(--surface,#fff) 94%,var(--primary,#c72c6d) 6%)}
body.admin-page .montage-location-row.is-stale{opacity:.78}
body.admin-page .montage-location-eta strong{letter-spacing:-.025em}
body.admin-page .montage-finance-money strong{font-variant-numeric:tabular-nums}
body.admin-page .montage-grid{gap:16px}
body.admin-page .table-wrap{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--primary,#c72c6d) 22%,transparent) transparent}
body.admin-page .data-table{border-collapse:separate;border-spacing:0}
body.admin-page .data-table thead th{position:sticky;top:0;z-index:2;padding-block:12px;background:color-mix(in srgb,var(--surface,#fff) 95%,var(--bg,#f4f7fb) 5%);border-bottom:1px solid var(--r399-line);font-size:10px;letter-spacing:.065em;text-transform:uppercase}
body.admin-page .data-table tbody td{padding-block:14px;border-bottom-color:var(--r399-line);vertical-align:top}
body.admin-page .data-table tbody tr:hover td{background:color-mix(in srgb,var(--primary,#c72c6d) 3%,transparent)}
body.admin-page .table-action{min-height:32px;border-radius:9px;font-weight:720;text-decoration:none}

/* Dialogs: focused SaaS workspace; backdrop never owns a close action. */
body.admin-page .modal-layer.open{padding:clamp(10px,3vw,34px);background:rgba(15,23,42,.48);backdrop-filter:blur(8px) saturate(110%)}
body.admin-page .modal{width:min(620px,100%);max-height:min(90vh,920px);border:1px solid color-mix(in srgb,var(--border,#dfe5ef) 74%,#fff 26%);border-radius:20px;background:var(--surface,#fff);box-shadow:0 32px 95px -36px rgba(2,6,23,.68);overflow:hidden}
body.admin-page .modal.wide{width:min(980px,100%)}
body.admin-page .modal-head{padding:19px 22px;border-bottom:1px solid var(--r399-line);background:linear-gradient(125deg,color-mix(in srgb,var(--surface,#fff) 96%,var(--primary,#c72c6d) 4%),var(--surface,#fff))}
body.admin-page .modal-head h3{font-size:20px;letter-spacing:-.025em}
body.admin-page .modal-close{display:grid;place-items:center;width:38px;height:38px;border:1px solid var(--r399-line);border-radius:11px;background:var(--surface,#fff);font-size:22px}
body.admin-page .modal-close:hover{border-color:color-mix(in srgb,var(--primary,#c72c6d) 35%,var(--border,#dfe5ef));background:color-mix(in srgb,var(--primary,#c72c6d) 7%,var(--surface,#fff))}
body.admin-page .modal-body{padding:22px;overflow:auto;overscroll-behavior:contain}
body.admin-page .modal-foot{padding:15px 22px;border-top:1px solid var(--r399-line);background:color-mix(in srgb,var(--surface,#fff) 96%,var(--bg,#f4f7fb) 4%)}

/* Client profile: app-like desktop composition */
body.portal-page{background:linear-gradient(145deg,color-mix(in srgb,var(--bg,#f5f7fb) 95%,var(--primary,#c72c6d) 5%),var(--bg,#f5f7fb) 58%,color-mix(in srgb,var(--bg,#f5f7fb) 96%,#0ea5e9 4%))}
body.portal-page #portal-profile-dashboard.portal-shell{max-width:1540px;margin-inline:auto;border:1px solid var(--r399-line);border-radius:24px;background:color-mix(in srgb,var(--surface,#fff) 82%,transparent);box-shadow:0 34px 95px -58px rgba(15,23,42,.48);overflow:clip}
body.portal-page #portal-profile-dashboard .portal-sidebar{border-right:1px solid var(--r399-line);background:linear-gradient(180deg,color-mix(in srgb,var(--surface,#fff) 97%,var(--primary,#c72c6d) 3%),color-mix(in srgb,var(--surface,#fff) 98%,#0ea5e9 2%))}
body.portal-page #portal-profile-dashboard .portal-main{min-width:0;background:transparent}
body.portal-page #portal-profile-dashboard .portal-header{gap:16px;padding:22px 24px 12px}
body.portal-page #portal-profile-dashboard .portal-header-copy h1{font-size:clamp(25px,2.3vw,36px);letter-spacing:-.04em}
body.portal-page #portal-profile-dashboard .portal-tabs{position:sticky;top:0;z-index:28;gap:5px;margin:0 20px;padding:7px;border:1px solid var(--r399-line);border-radius:15px;background:color-mix(in srgb,var(--surface,#fff) 88%,transparent);box-shadow:0 14px 32px -28px rgba(15,23,42,.46);backdrop-filter:blur(18px) saturate(140%);overflow-x:auto;scrollbar-width:none}
body.portal-page #portal-profile-dashboard .portal-tabs::-webkit-scrollbar{display:none}
body.portal-page #portal-profile-dashboard .portal-tabs a{min-height:38px;padding:9px 13px;border:1px solid transparent;border-radius:10px;white-space:nowrap;font-size:12px;font-weight:740;text-decoration:none}
body.portal-page #portal-profile-dashboard .portal-tabs a:is(.active,.is-active){border-color:color-mix(in srgb,var(--primary,#c72c6d) 18%,var(--border,#dfe5ef));background:color-mix(in srgb,var(--primary,#c72c6d) 9%,var(--surface,#fff));box-shadow:0 8px 18px -16px color-mix(in srgb,var(--primary,#c72c6d) 45%,transparent)}
body.portal-page #portal-profile-dashboard .portal-content{gap:18px;padding:18px 20px 24px}
body.portal-page #portal-profile-dashboard :where(.card,.portal-aside-card,.portal-montage-card,.portal-montage-form,.portal-montage-aftercare){border-color:var(--r399-line);border-radius:var(--r399-radius);box-shadow:var(--r399-shadow);background:color-mix(in srgb,var(--surface,#fff) 98%,var(--primary,#c72c6d) 2%)}
body.portal-page #portal-profile-dashboard :where(.card,.portal-aside-card,.portal-montage-card):hover{box-shadow:var(--r399-shadow-up)}
body.portal-page #portal-profile-dashboard .stat-grid{gap:13px}
body.portal-page #portal-profile-dashboard .stat-card{min-height:142px;padding:18px;overflow:hidden}
body.portal-page #portal-profile-dashboard .stat-card .kpi-number{font-size:31px;letter-spacing:-.05em}
body.portal-page #portal-profile-dashboard .portal-montage-workspace{padding:22px}
body.portal-page #portal-profile-dashboard .portal-montage-head{align-items:flex-start;padding-bottom:16px;border-bottom:1px solid var(--r399-line)}
body.portal-page #portal-profile-dashboard .portal-montage-grid{gap:16px;margin-top:16px}
body.portal-page #portal-profile-dashboard .portal-montage-form{padding:18px}
body.portal-page #portal-profile-dashboard .portal-montage-card{padding:17px}
body.portal-page #portal-profile-dashboard .portal-montage-meta{gap:10px}
body.portal-page #portal-profile-dashboard .portal-montage-meta>span{padding:10px 11px;border:1px solid var(--r399-line);border-radius:11px;background:color-mix(in srgb,var(--surface,#fff) 96%,var(--bg,#f5f7fb) 4%)}
body.portal-page #portal-profile-dashboard .portal-montage-location{box-shadow:0 14px 34px -30px rgba(14,165,233,.6)}
body.portal-page #portal-profile-dashboard .portal-montage-aftercare{margin-top:18px;padding:19px}
body.portal-page #portal-profile-dashboard .portal-montage-documents .btn{min-height:36px}

/* Public premium canvas and deterministic banner visibility */
body.site-page .site-header{border-bottom:1px solid color-mix(in srgb,var(--border,#dfe5ef) 76%,transparent);background:color-mix(in srgb,var(--surface,#fff) 88%,transparent);box-shadow:0 16px 40px -38px rgba(15,23,42,.48);backdrop-filter:blur(18px) saturate(140%)}
body.site-page .portal-hero-rotator{display:block;overflow:hidden;border-bottom:1px solid color-mix(in srgb,var(--border,#dfe5ef) 65%,transparent);background:color-mix(in srgb,var(--surface-soft,#f3f6fb) 92%,var(--primary,#c72c6d) 8%)}
body.site-page .portal-banner-slides{display:block;min-height:inherit}
body.site-page .portal-banner-slide{display:grid;min-height:inherit;background-image:var(--hero-desktop);background-repeat:no-repeat;background-position:center;background-size:cover}
body.site-page .portal-banner-slide.active{display:grid!important;opacity:1!important;visibility:visible!important;pointer-events:auto}
body.site-page .portal-banner-slide:not(.active){pointer-events:none}
body.site-page .portal-banner-dots{z-index:8}
body.site-page :where(.quick-action,.price-card,.service-card,.review-card){border-color:var(--r399-line);border-radius:var(--r399-radius);box-shadow:var(--r399-shadow)}

body.admin-page[data-theme="dark"],body.admin-page[data-admin-theme="dark"]{--r399-line:color-mix(in srgb,var(--border,#293349) 86%,transparent);--r399-shadow:0 1px 2px rgba(0,0,0,.3),0 20px 54px -34px rgba(0,0,0,.84);--r399-shadow-up:0 2px 4px rgba(0,0,0,.34),0 28px 68px -34px rgba(0,0,0,.9)}
body.admin-page[data-theme="dark"] .modal-layer.open,body.admin-page[data-admin-theme="dark"] .modal-layer.open{background:rgba(2,6,23,.72)}

@media(max-width:1100px){
  body.admin-page .montage-module{gap:15px}
  body.admin-page .montage-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  body.portal-page #portal-profile-dashboard .portal-content{grid-template-columns:minmax(0,1fr)}
  body.portal-page #portal-profile-dashboard .portal-dashboard-aside{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
}

@media(max-width:760px){
  :root{--r399-radius:14px;--r399-radius-lg:18px}
  body.admin-page .content{padding:12px!important}
  body.admin-page .page-head{gap:12px}
  body.admin-page .page-head h1{font-size:25px}
  body.admin-page .montage-module{gap:12px}
  body.admin-page .montage-kpis{gap:9px}
  body.admin-page .montage-kpis article{min-height:105px;padding:15px}
  body.admin-page .montage-kpis strong{font-size:25px}
  body.admin-page :where(.montage-command-center,.montage-insights,.montage-dispatcher,.montage-location,.montage-finance)>header{min-height:auto;padding:17px}
  body.admin-page .montage-toolbar{position:static;padding:11px}
  body.admin-page .modal-layer.open{align-items:flex-end;padding:max(7px,env(safe-area-inset-top)) 7px max(7px,env(safe-area-inset-bottom))}
  body.admin-page .modal,body.admin-page .modal.wide{width:100%;max-height:94dvh;border-radius:19px 19px 14px 14px}
  body.admin-page .modal-head,body.admin-page .modal-body,body.admin-page .modal-foot{padding-inline:16px}
  body.admin-page .modal-foot{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  body.admin-page .modal-foot .btn{width:100%;min-width:0}
  body.portal-page{padding-bottom:calc(76px + env(safe-area-inset-bottom))}
  body.portal-page #portal-profile-dashboard.portal-shell:not([hidden]){width:100%!important;margin:0!important;border:0;border-radius:0;box-shadow:none}
  body.portal-page #portal-profile-dashboard .portal-main{border-radius:0!important}
  body.portal-page #portal-profile-dashboard .portal-header{padding:10px!important}
  body.portal-page #portal-profile-dashboard .portal-tabs{position:static;margin:0 8px;padding:5px}
  body.portal-page #portal-profile-dashboard .portal-content{padding:10px 8px 16px;gap:11px}
  body.portal-page #portal-profile-dashboard .stat-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  body.portal-page #portal-profile-dashboard .stat-card{min-height:112px;padding:13px}
  body.portal-page #portal-profile-dashboard .portal-dashboard-aside{grid-template-columns:1fr}
  body.portal-page #portal-profile-dashboard .portal-montage-workspace{padding:14px}
  body.portal-page #portal-profile-dashboard .portal-montage-grid{grid-template-columns:1fr}
  body.portal-page #portal-profile-dashboard .portal-montage-meta{grid-template-columns:repeat(2,minmax(0,1fr))}
  body.portal-page #profile-section .app-mobile-nav:not([hidden]){display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:2px!important;overflow:visible!important;padding:6px 3px calc(6px + env(safe-area-inset-bottom))!important;min-height:calc(68px + env(safe-area-inset-bottom))!important;border-top:1px solid color-mix(in srgb,var(--primary,#c72c6d) 15%,var(--border,#dfe5ef))!important;background:color-mix(in srgb,var(--surface,#fff) 91%,transparent)!important;box-shadow:0 -20px 48px -36px rgba(15,23,42,.64)!important;backdrop-filter:blur(20px) saturate(155%)!important}
  body.portal-page #profile-section .app-mobile-nav[hidden]{display:none!important}
  body.portal-page #profile-section .app-mobile-nav :where(button,a){min-width:0!important;width:auto!important;min-height:54px!important;padding:4px 1px!important;gap:3px!important;border-radius:11px!important;font-size:9px!important;font-weight:780!important;line-height:1.05!important;overflow:hidden!important}
  body.portal-page #profile-section .app-mobile-nav :where(button,a) svg{width:19px!important;height:19px!important;flex:none}
  body.portal-page #profile-section .app-mobile-nav :where(button,a).is-active:not(.mobile-nav-action){border-color:color-mix(in srgb,var(--primary,#c72c6d) 20%,var(--border,#dfe5ef))!important;background:color-mix(in srgb,var(--primary,#c72c6d) 10%,var(--surface,#fff))!important;color:var(--primary,#c72c6d)!important}
  body.site-page .site-hero,body.site-page .portal-hero-rotator{min-height:clamp(310px,58vh,500px)}
  body.site-page .portal-banner-slide{min-height:100%;background-image:var(--hero-mobile,var(--hero-desktop));background-position:center;background-size:cover}
}

@media(max-width:430px){
  body.admin-page .montage-kpis{grid-template-columns:1fr 1fr}
  body.portal-page #portal-profile-dashboard .portal-montage-meta{grid-template-columns:1fr}
  body.portal-page #profile-section .app-mobile-nav :where(button,a){font-size:8.5px!important}
}

@media(prefers-reduced-motion:reduce){:where(body.admin-page,body.portal-page,body.site-page) *, :where(body.admin-page,body.portal-page,body.site-page) *:before,:where(body.admin-page,body.portal-page,body.site-page) *:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}

body.admin-page .case-brief-grid .case-warranty-summary{border-color:color-mix(in srgb,var(--primary,#c72c6d) 24%,var(--border,#dfe5ef));background:linear-gradient(145deg,color-mix(in srgb,var(--primary,#c72c6d) 8%,var(--surface,#fff)),var(--surface,#fff));box-shadow:0 14px 34px -28px color-mix(in srgb,var(--primary,#c72c6d) 48%,transparent)}
body.admin-page .case-brief-grid .case-warranty-summary b{color:var(--text,#162033);letter-spacing:-.02em}
body.admin-page .warranty-case-box{border:1px solid color-mix(in srgb,var(--primary,#c72c6d) 18%,var(--border,#dfe5ef));border-radius:16px;padding:16px;background:color-mix(in srgb,var(--primary,#c72c6d) 4%,var(--surface,#fff))}

/* R648 — profile shell containment across wide monitors, compact laptops and tablets. */
body.portal-page #portal-profile-dashboard.portal-shell:not([hidden]){
  container-name: portal-profile-shell;
  container-type:inline-size;
  width:min(100%,1540px);
  max-width:100%;
  min-width:0;
}
body.portal-page #portal-profile-dashboard :where(.portal-sidebar,.portal-main,.portal-header,.portal-content,.portal-section,.card,.panel-card,.portal-montage-workspace,.portal-montage-grid,.portal-montage-card,.portal-montage-form){max-width:100%;min-width:0}
body.portal-page #portal-profile-dashboard :where(img,video,canvas){max-width:100%;height:auto}
body.portal-page #portal-profile-dashboard :where(.portal-header,.portal-montage-head,.portal-montage-actions,.portal-action-row,.button-row){flex-wrap:wrap}

@media(min-width:1101px) and (max-width:1439px){
  body.portal-page #portal-profile-dashboard.portal-shell:not([hidden]){grid-template-columns:clamp(216px,18vw,248px) minmax(0,1fr);border-radius:clamp(16px,1.5vw,22px)}
  body.portal-page #portal-profile-dashboard .portal-sidebar{padding-inline:clamp(12px,1.2vw,18px)}
  body.portal-page #portal-profile-dashboard .portal-header{padding:clamp(15px,1.4vw,22px)}
  body.portal-page #portal-profile-dashboard .portal-content{padding:clamp(13px,1.35vw,19px);gap:clamp(12px,1.2vw,17px)}
}

@container portal-profile-shell (max-width:1180px){
  body.portal-page #portal-profile-dashboard :where(.stat-grid,.portal-overview-grid,.portal-montage-meta){grid-template-columns:repeat(2,minmax(0,1fr))}
  body.portal-page #portal-profile-dashboard .portal-dashboard-aside{grid-template-columns:repeat(2,minmax(0,1fr))}
  body.portal-page #portal-profile-dashboard :where(.portal-header-actions,.portal-montage-actions,.button-row){gap:8px}
}

@media(max-width:1100px){
  body.portal-page #portal-profile-dashboard.portal-shell:not([hidden]){grid-template-columns:minmax(0,1fr);border-radius:14px}
}

@media(max-width:560px){
  body.portal-page #portal-profile-dashboard :where(.stat-grid,.portal-overview-grid,.portal-montage-meta,.portal-dashboard-aside){grid-template-columns:minmax(0,1fr)!important}
  body.portal-page #portal-profile-dashboard :where(.portal-header-actions,.portal-montage-actions,.portal-action-row,.button-row) > :where(.btn,button,a){max-width:100%;min-width:0}
}


/*saas-premium-r410.css*/
/* R410 production polish: reliable contrast, lower paint cost and denser workspaces. */
:root{
  --r410-line:color-mix(in srgb,var(--border,#dfe5ef) 88%,transparent);
  --r410-shadow:0 1px 2px rgba(15,23,42,.035),0 16px 40px -34px rgba(15,23,42,.3);
}

/* The selected item must remain readable regardless of earlier theme layers. */
body.admin-page #sb .admin-nav :where(a,button).is-active{
  border-color:color-mix(in srgb,var(--primary,#c72d72) 86%,#000)!important;
  background:var(--primary,#c72d72)!important;
  color:#fff!important;
  box-shadow:inset 3px 0 0 rgba(255,255,255,.9),0 8px 20px -16px color-mix(in srgb,var(--primary,#c72d72) 78%,transparent)!important;
}
body.admin-page #sb .admin-nav :where(a,button).is-active :where(.icon,.nav-badge,svg){color:#fff!important}
body.admin-page #sb .admin-nav :where(a,button).is-active .icon{
  border-color:rgba(255,255,255,.28)!important;
  background:rgba(255,255,255,.14)!important;
}

/* Opaque working surfaces avoid repeated full-screen blur composition. */
body.admin-page .montage-toolbar,
body.portal-page #portal-profile-dashboard .portal-tabs{
  background:var(--surface,#fff)!important;
  backdrop-filter:none!important;
}
body.admin-page .modal-layer.open{backdrop-filter:none!important}
body.admin-page :where(.montage-command-center,.montage-insights,.montage-dispatcher,.montage-location,.montage-finance,.montage-field-card){box-shadow:var(--r410-shadow)}
body.admin-page .montage-command-center>header{grid-template-columns:minmax(0,1fr)!important}

/* Client consent is owned and displayed by the client record. */
body.admin-page .client-consent-status{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  margin:0 0 12px;padding:11px 12px;border:1px solid var(--r410-line);border-radius:11px;
  background:var(--surface-soft,#f5f7fb);font-size:12px;
}
body.admin-page .client-consent-status strong{font-size:13px;color:var(--text,#172033)}
body.admin-page .client-consent-status span{color:var(--muted,#64748b)}
body.admin-page .client-consent-status.is-recorded{border-color:color-mix(in srgb,var(--ok,#129a64) 32%,var(--r410-line));background:color-mix(in srgb,var(--ok,#129a64) 7%,var(--surface,#fff))}
body.admin-page .gdpr-consent-card.has-recorded-consent .gdpr-consent-check,
body.admin-page .gdpr-consent-card.has-recorded-consent .gdpr-consent-text,
body.admin-page .gdpr-consent-card.has-recorded-consent .case-helper-note{display:none!important}

body.portal-page .portal-montage-pin-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:8px}
body.portal-page .portal-montage-pin-row span{font-size:12px;color:var(--muted,#64748b)}
body.portal-page .portal-montage-pin-row span[data-state="ready"]{color:var(--ok,#129a64);font-weight:700}
body.portal-page .portal-montage-pin-row span[data-state="busy"]{color:var(--primary,#c72d72)}
body.portal-page .portal-montage-pin-row span[data-state="error"]{color:var(--danger,#dc2626)}

/* The technician work area is the primary case surface. */
body.admin-page #case-content .admin-tech-workspace{
  margin-top:14px;border-color:var(--r410-line);box-shadow:var(--r410-shadow);
}
body.admin-page #case-content .tech-work-head{position:sticky;top:8px;z-index:8;background:var(--surface,#fff)}
body.admin-page #case-content .case-doc-quickbar{
  margin:0;border-width:0 0 1px;border-radius:0;background:color-mix(in srgb,var(--surface,#fff) 97%,var(--primary,#c72d72) 3%);box-shadow:none;
}
body.admin-page #case-content .case-doc-copy p{max-width:290px}
body.admin-page #case-content .case-detail-layout{margin-top:16px}
body.admin-page #case-content .case-brief-grid{grid-template-columns:repeat(5,minmax(0,1fr))}
body.admin-page #case-content .case-summary-panel{align-self:start}
body.admin-page #case-content .case-workflow-panel{min-width:0}
body.admin-page #case-content .case-warranty-summary{display:none!important}
body.admin-page #case-content .tech-work-actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}
body.admin-page #case-content .tech-work-actions .btn{min-height:36px;white-space:nowrap}

/* Production copy does not need decorative uppercase tracker labels. */
body.admin-page .montage-field-card>header span,
body.admin-page .montage-aftercare-head span,
body.admin-page .montage-insight-head span,
body.admin-page .montage-panel>header span{
  letter-spacing:.025em;text-transform:none;
}

@media(max-width:1180px){
  body.admin-page #case-content .case-brief-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  body.admin-page #case-content .tech-work-head{position:static}
}
@media(max-width:760px){
  body.admin-page #case-content .case-brief-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  body.admin-page #case-content .case-doc-quickbar{padding:12px}
  body.admin-page #case-content .case-doc-copy p{display:none}
  body.portal-page #profile-section .app-mobile-nav:not([hidden]){background:var(--surface,#fff)!important;backdrop-filter:none!important}
  body.portal-page #portal-profile-dashboard .portal-header{background:var(--surface,#fff)}
}
@media(max-width:430px){body.admin-page #case-content .case-brief-grid{grid-template-columns:1fr 1fr}}

@media(prefers-reduced-motion:reduce){
  :where(body.admin-page,body.portal-page,body.site-page) *{scroll-behavior:auto!important;transition:none!important;animation:none!important}
}


/*saas-premium-r411.css*/
/* R411 — compact arrival status and stable operational surfaces. */
.montage-geofence-pill,.portal-montage-arrival{display:inline-flex!important;align-items:center;width:max-content;max-width:100%;margin-top:7px;padding:4px 9px;border:1px solid var(--border,#dfe5ee);border-radius:999px;background:var(--surface,#fff);color:var(--muted,#667085);font-size:11px!important;font-style:normal;font-weight:760;line-height:1.2}
.montage-geofence-pill::before,.portal-montage-arrival::before{content:"";width:7px;height:7px;margin-right:6px;border-radius:50%;background:#94a3b8}
.montage-geofence-pill[data-tone="inside"],.portal-montage-arrival[data-tone="inside"]{border-color:#a7e2cb;background:#ecfdf6;color:#087451}
.montage-geofence-pill[data-tone="inside"]::before,.portal-montage-arrival[data-tone="inside"]::before{background:#10b981}
.montage-geofence-pill[data-tone="outside"],.portal-montage-arrival[data-tone="outside"]{border-color:#bfdbfe;background:#eff6ff;color:#1d4ed8}
.montage-geofence-pill[data-tone="outside"]::before,.portal-montage-arrival[data-tone="outside"]::before{background:#3b82f6}
.montage-geofence-pill[data-tone="uncertain"],.portal-montage-arrival[data-tone="uncertain"]{border-color:#fde68a;background:#fffbeb;color:#9a5a08}
.montage-geofence-pill[data-tone="uncertain"]::before,.portal-montage-arrival[data-tone="uncertain"]::before{background:#f59e0b}
body.admin-page .case-saved-view-toolbar{contain:layout style}
@media(max-width:720px){.montage-geofence-pill,.portal-montage-arrival{white-space:normal}.portal-montage-location{align-items:start}}


/*saas-premium-r423.css*/
/* R423 — responsive client identity, location workflow and progress geometry. */

body.portal-page #portal-profile-dashboard .portal-header-loyalty-card {
  isolation: isolate;
  background:
    radial-gradient(circle at 92% 8%, rgba(255,255,255,.19), transparent 9rem),
    linear-gradient(135deg, var(--primary, var(--pink)) 0%, color-mix(in srgb, var(--secondary, var(--plum)) 82%, var(--primary, var(--pink))) 100%) !important;
  color: #fff !important;
}

body.portal-page #portal-profile-dashboard .portal-header-loyalty-card :where(h3,strong,p) {
  position: relative;
  z-index: 1;
  color: #fff !important;
  opacity: 1 !important;
  visibility: visible !important;
}

body.portal-page #portal-profile-dashboard .portal-header-loyalty-card #portal-loyalty-meta {
  color: rgba(255,255,255,.84) !important;
  overflow-wrap: anywhere;
}

body.portal-page .portal-address-control {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 8px;
  align-items: stretch;
}

body.portal-page .portal-address-control > .btn {
  min-height: 44px;
  white-space: nowrap;
}

body.portal-page .portal-location-status {
  display: block;
  min-height: 18px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

body.portal-page .portal-location-status[data-state="busy"],
body.portal-page #portal-montage-pin-status[data-state="busy"] { color: var(--primary, var(--pink)); }
body.portal-page .portal-location-status[data-state="ready"],
body.portal-page #portal-montage-pin-status[data-state="ready"] { color: var(--green, #07834d); }
body.portal-page .portal-location-status[data-state="warning"],
body.portal-page #portal-montage-pin-status[data-state="warning"] { color: var(--orange, #a85b00); }
body.portal-page .portal-location-status[data-state="error"],
body.portal-page #portal-montage-pin-status[data-state="error"] { color: var(--red, #c71f37); }

body.portal-page .progress-track {
  width: 100%;
  height: 10px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 78%, var(--surface));
  line-height: 0;
}

body.portal-page .progress-track > progress.progress-fill {
  position: static !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  border: 0;
  border-radius: inherit;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
}

body.portal-page .progress-track > progress.progress-fill::-webkit-progress-bar {
  border-radius: inherit;
  background: transparent;
}
body.portal-page .progress-track > progress.progress-fill::-webkit-progress-value,
body.portal-page .progress-track > progress.progress-fill::-moz-progress-bar {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary, var(--pink)), color-mix(in srgb, var(--primary, var(--pink)) 65%, var(--blue)));
}

@media (max-width: 760px) {
  body.portal-page #portal-profile-dashboard .portal-header-loyalty-card {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 142px !important;
    padding: 16px !important;
    grid-template-columns: minmax(0,1fr) 88px !important;
    grid-template-areas:
      "kicker qr"
      "level qr"
      "discount qr"
      "meta qr" !important;
    grid-auto-columns: 0 !important;
    gap: 5px 12px !important;
    align-content: center !important;
    border-radius: 16px !important;
  }

  body.portal-page #portal-profile-dashboard .portal-header-loyalty-card strong {
    font-size: clamp(20px,6vw,25px) !important;
    line-height: 1.08 !important;
  }

  body.portal-page #portal-profile-dashboard .portal-header-loyalty-card .portal-qr-mark {
    grid-area: qr !important;
    width: 84px !important;
    height: 84px !important;
    margin: 0 !important;
    align-self: center !important;
    justify-self: end !important;
  }

  body.portal-page .portal-case-progress {
    grid-template-columns: repeat(7, minmax(94px, 1fr));
    gap: 8px;
    padding: 16px 12px 14px;
    scroll-padding-inline: 12px;
  }

  body.portal-page .portal-case-progress-line {
    left: 57px;
    right: 57px;
    top: 33px;
    height: 4px;
  }

  body.portal-page .portal-case-step {
    grid-template-rows: 36px auto;
    align-content: start;
    min-width: 94px;
    gap: 8px;
    line-height: 1.25;
  }

  body.portal-page .portal-case-step span {
    align-self: start;
    margin: 0;
  }

  body.portal-page .portal-case-step small,
  body.portal-page .portal-case-step strong {
    position: static !important;
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  body.portal-page #portal-profile-dashboard .mobile-top,
  body.portal-page .app-mobile-nav {
    backdrop-filter: none !important;
  }
}

@media (max-width: 520px) {
  body.portal-page .portal-address-control { grid-template-columns: 1fr; }
  body.portal-page .portal-address-control > .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  body.portal-page *, body.portal-page *::before, body.portal-page *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}


/*progress-system-r427.css*/
/* R427 — one geometry contract for progress bars and step rails. */

body.site-page .portal-case-progress,
body.portal-page .portal-case-progress {
  --case-step-gap: 10px;
  position: relative;
  isolation: isolate;
}

body.site-page .portal-case-progress-line,
body.portal-page .portal-case-progress-line {
  position: relative;
  z-index: 0;
  grid-column: 1 / -1;
  grid-row: 1;
  align-self: start;
  left: auto;
  right: auto;
  top: 15px;
  width: auto;
  height: 4px;
  margin-inline: calc(7.142857% - 4.286px);
  pointer-events: none;
}

body.site-page .portal-case-step,
body.portal-page .portal-case-step {
  z-index: 1;
  grid-row: 1;
  grid-template-rows: 34px auto auto;
  align-content: start;
}

body.site-page .portal-case-step :where(b,strong,small),
body.portal-page .portal-case-step :where(b,strong,small) {
  position: static;
  max-width: 100%;
  overflow-wrap: anywhere;
}

body.portal-page .profile-case-preview-progress > progress.portal-progress-profile,
body.portal-page .profile-case-preview-progress::before {
  left: calc(7.142857% - 3.429px);
  right: calc(7.142857% - 3.429px);
  width: auto;
}

body.site-page .portal-wizard-step,
body.portal-page .portal-wizard-step {
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  min-height: 58px;
  line-height: 1.35;
}

body.site-page .portal-wizard-step > :not(i),
body.portal-page .portal-wizard-step > :not(i) {
  min-width: 0;
  overflow-wrap: anywhere;
}

body.site-page .steps,
body.portal-page .steps {
  align-items: start;
}

body.site-page .step,
body.portal-page .step {
  grid-template-rows: 46px auto;
  align-content: start;
  min-width: 74px;
  line-height: 1.3;
  text-align: center;
}

body.site-page .step > :not(.step-dot),
body.portal-page .step > :not(.step-dot) {
  min-width: 0;
  overflow-wrap: anywhere;
}

body.site-page progress,
body.portal-page progress,
body.admin-page progress {
  vertical-align: middle;
}

@media (max-width: 760px) {
  body.site-page .portal-case-progress,
  body.portal-page .portal-case-progress {
    --case-step-gap: 8px;
    grid-template-columns: repeat(7, 94px);
    gap: var(--case-step-gap);
    padding: 16px 12px 14px;
  }

  body.site-page .portal-case-progress-line,
  body.portal-page .portal-case-progress-line {
    top: 15px;
    margin-inline: calc(7.142857% - 3.429px);
  }

  body.site-page .portal-case-step,
  body.portal-page .portal-case-step {
    min-width: 94px;
  }

  body.site-page .portal-wizard-steps,
  body.portal-page .portal-wizard-steps {
    grid-template-columns: 1fr;
  }

  body.site-page .portal-wizard-step,
  body.portal-page .portal-wizard-step {
    grid-template-columns: 28px minmax(0, 1fr);
    min-height: 48px;
    padding: 8px 10px;
    font-size: 12px;
  }

  body.site-page .portal-wizard-step i,
  body.portal-page .portal-wizard-step i {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 520px) {
  body.portal-page .profile-case-preview-progress > progress.portal-progress-profile,
  body.portal-page .profile-case-preview-progress::before {
    left: calc(7.142857% - 1.714px);
    right: calc(7.142857% - 1.714px);
  }
}



/*progress-system-r433.css*/
/* Infinity Service R433 — deterministic service progress and public hours polish. */

/*
 * The progress meter occupies the full first grid row. Explicitly pin every
 * step to its real column so CSS grid never creates implicit columns to the
 * right of the meter.
 */
body.site-page .portal-case-progress > .portal-case-step:nth-child(2),
body.portal-page .portal-case-progress > .portal-case-step:nth-child(2) { grid-column: 1; }
body.site-page .portal-case-progress > .portal-case-step:nth-child(3),
body.portal-page .portal-case-progress > .portal-case-step:nth-child(3) { grid-column: 2; }
body.site-page .portal-case-progress > .portal-case-step:nth-child(4),
body.portal-page .portal-case-progress > .portal-case-step:nth-child(4) { grid-column: 3; }
body.site-page .portal-case-progress > .portal-case-step:nth-child(5),
body.portal-page .portal-case-progress > .portal-case-step:nth-child(5) { grid-column: 4; }
body.site-page .portal-case-progress > .portal-case-step:nth-child(6),
body.portal-page .portal-case-progress > .portal-case-step:nth-child(6) { grid-column: 5; }
body.site-page .portal-case-progress > .portal-case-step:nth-child(7),
body.portal-page .portal-case-progress > .portal-case-step:nth-child(7) { grid-column: 6; }
body.site-page .portal-case-progress > .portal-case-step:nth-child(8),
body.portal-page .portal-case-progress > .portal-case-step:nth-child(8) { grid-column: 7; }

body.site-page .portal-case-progress > .portal-case-step,
body.portal-page .portal-case-progress > .portal-case-step {
  grid-row: 1;
  min-width: 0;
}

/* Day names are labels, not badges. The shared brand icon rule must not paint them. */
body.site-page #contacts-section .portal-hours-line > b {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--ink) !important;
  padding: 0 !important;
}



/*saas-theme-r434.css*/
/* Infinity Service R434 — neutral premium surfaces and dark-theme integrity. */

/* The active navigation item must remain legible in every tenant palette. */
body.admin-page #sb .admin-nav :where(a, button).is-active,
body.admin-page #sb .admin-nav a[aria-current="page"] {
  color: #fff !important;
  text-shadow: none !important;
}

:root:is([data-theme="dark"], [data-admin-theme="dark"])
  body.admin-page #sb .admin-nav :where(a, button).is-active,
body.admin-page:is([data-theme="dark"], [data-admin-theme="dark"])
  #sb .admin-nav :where(a, button).is-active {
  border-color: rgba(255, 255, 255, .14) !important;
  background: rgba(255, 255, 255, .1) !important;
  color: #fff !important;
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, .88), 0 8px 22px rgba(2, 6, 23, .2) !important;
}

/* A gray/dark tenant palette must not retain pink light effects. */
:root:is([data-theme="dark"], [data-admin-theme="dark"])
  body.admin-page :where(.btn-primary, .action-btn, .montage-command-hero, .montage-dispatch-card, .montage-insight-card),
body.admin-page:is([data-theme="dark"], [data-admin-theme="dark"])
  :where(.btn-primary, .action-btn, .montage-command-hero, .montage-dispatch-card, .montage-insight-card) {
  box-shadow: none !important;
  filter: none !important;
}

:root:is([data-theme="dark"], [data-admin-theme="dark"])
  body.admin-page :where(input, textarea, select, button, a):focus-visible,
body.admin-page:is([data-theme="dark"], [data-admin-theme="dark"])
  :where(input, textarea, select, button, a):focus-visible {
  outline-color: rgba(226, 232, 240, .72) !important;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, .18) !important;
}

/* Portal cards use the semantic theme surfaces, never hard-coded white. */
:root[data-theme="dark"] body.portal-page :where(
  .portal-case-mini-row,
  .svc-card,
  .portal-service-card,
  .portal-device-card,
  .portal-warranty-row,
  .portal-protocol-row,
  .profile-case-preview-grid > article,
  .portal-profile-panel,
  .portal-panel,
  .portal-card
) {
  border-color: var(--line) !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] body.portal-page :where(
  .portal-case-mini-row,
  .svc-card,
  .portal-service-card,
  .portal-device-card,
  .portal-warranty-row,
  .portal-protocol-row,
  .profile-case-preview-grid > article
) :where(h2, h3, h4, strong, b) {
  color: var(--ink) !important;
}

:root[data-theme="dark"] body.portal-page :where(
  .portal-case-mini-row,
  .svc-card,
  .portal-service-card,
  .portal-device-card,
  .portal-warranty-row,
  .portal-protocol-row,
  .profile-case-preview-grid > article
) :where(p, small, span) {
  color: var(--muted) !important;
}

@media (prefers-reduced-motion: reduce) {
  body.admin-page *,
  body.portal-page *,
  body.site-page * {
    scroll-behavior: auto !important;
  }
}


/*saas-premium-r708.css*/
/* R708 — public case progress rail without visible browser scroll chrome. */

body.site-page .public-case-detail-anchor .portal-case-progress,
body.portal-page .portal-case-progress {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
  scrollbar-width: none;
  scrollbar-gutter: auto;
}

body.site-page .public-case-detail-anchor .portal-case-progress::-webkit-scrollbar,
body.portal-page .portal-case-progress::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body.site-page .public-case-detail-anchor .portal-case-progress-line,
body.portal-page .portal-case-progress-line {
  max-width: 100%;
  overflow: hidden;
}

body.site-page .public-case-detail-anchor .portal-case-progress-line > progress.portal-progress-case,
body.portal-page .portal-case-progress-line > progress.portal-progress-case {
  display: block;
  min-width: 0;
  max-width: 100%;
  height: 100%;
}

@media (max-width: 760px) {
  body.site-page .public-case-detail-anchor .portal-case-progress,
  body.portal-page .portal-case-progress {
    grid-template-columns: repeat(7, 94px);
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline proximity;
    scroll-padding-inline: 12px;
    -webkit-overflow-scrolling: touch;
  }

  body.site-page .public-case-detail-anchor .portal-case-step,
  body.portal-page .portal-case-step {
    min-width: 0;
    scroll-snap-align: center;
  }
}

