/* Product navigation shell. Loaded last to keep the application chrome deterministic. */
.workspace-nav-icon,
.workspace-action-icon {
  display: block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: var(--workspace-icon) center / contain no-repeat;
  mask: var(--workspace-icon) center / contain no-repeat;
}

.workspace-nav-link {
  gap: 10px !important;
}

.workspace-sidebar-collapse {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  min-height: 34px;
  margin-right: 10px;
  place-items: center;
  padding: 0;
  border: 1px solid #363b42 !important;
  border-radius: 5px !important;
  background: #202329 !important;
  color: #bfc5cd !important;
}

.workspace-sidebar-head {
  justify-content: center !important;
}

.workspace-sidebar-brand {
  width: 100%;
  justify-content: center !important;
  padding-inline: 16px !important;
}

.workspace-sidebar-brand .workspace-brand-wordmark {
  width: 174px !important;
  max-width: 100% !important;
}

.workspace-sidebar-footer > .workspace-sidebar-collapse {
  justify-self: center;
  width: 44px;
  height: 40px;
  min-height: 40px;
  margin: 0;
}

.workspace-brand-mark {
  display: none !important;
}

.workspace-footer-action {
  gap: 9px;
  text-decoration: none;
}

.workspace-footer-action .workspace-action-icon {
  color: #9fa6af;
}

.workspace-footer-label {
  margin-right: auto;
}

.workspace-tooltip {
  position: fixed;
  z-index: 500;
  max-width: 220px;
  padding: 7px 9px;
  border: 1px solid #353a42;
  border-radius: 4px;
  background: #202329;
  color: #f3f4f6;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-4px);
  transition: opacity 100ms ease, transform 100ms ease;
}

.workspace-tooltip.is-visible {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

@media (min-width: 1024px) {
  body.hex-workspace-body,
  body.hex-workspace-body > .workspace-sidebar {
    transition: grid-template-columns 180ms ease, width 180ms ease;
  }

  body.hex-workspace-body.workspace-sidebar-collapsed {
    grid-template-columns: 72px minmax(0, 1fr) !important;
  }

  body.hex-workspace-body.workspace-sidebar-collapsed > .workspace-sidebar {
    width: 72px !important;
  }

  body.workspace-sidebar-collapsed .workspace-sidebar-head {
    flex-direction: column;
    justify-content: center;
    min-height: 104px;
    padding: 8px 0;
  }

  body.workspace-sidebar-collapsed .workspace-sidebar-brand {
    flex: 0 0 48px;
    width: 72px;
    min-height: 48px;
    justify-content: center;
    padding: 3px 12px;
  }

  body.workspace-sidebar-collapsed .workspace-brand-wordmark {
    display: none !important;
  }

  body.workspace-sidebar-collapsed .workspace-brand-mark {
    display: block !important;
    width: 42px !important;
    height: 42px !important;
    max-height: 42px !important;
    object-fit: contain;
  }

  body.workspace-sidebar-collapsed .workspace-sidebar-collapse {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
    min-height: 32px;
    margin: 0;
  }

  body.workspace-sidebar-collapsed .workspace-nav {
    display: grid !important;
    align-content: start;
    justify-items: center;
    padding: 10px 8px 16px !important;
  }

  body.workspace-sidebar-collapsed .workspace-nav-section {
    display: contents;
  }

  body.workspace-sidebar-collapsed :is(.workspace-nav-heading, .workspace-nav-text, .workspace-user-copy, .workspace-footer-label, .workspace-theme-value) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
  }

  body.workspace-sidebar-collapsed .workspace-nav-link {
    justify-content: center;
    width: 46px;
    min-height: 42px;
    margin: 2px 0;
    padding: 0 !important;
  }

  body.workspace-sidebar-collapsed .workspace-nav-icon {
    width: 19px;
    height: 19px;
  }

  body.workspace-sidebar-collapsed .workspace-sidebar-footer {
    justify-items: center;
    gap: 4px;
    padding: 8px 6px 12px;
  }

  body.workspace-sidebar-collapsed .workspace-user {
    grid-template-columns: 36px;
    justify-content: center;
    min-height: 42px;
    padding: 3px;
  }

  body.workspace-sidebar-collapsed .workspace-user-avatar {
    width: 36px;
    height: 36px;
  }

  body.workspace-sidebar-collapsed .workspace-footer-action {
    justify-content: center;
    width: 44px;
    min-height: 40px;
    padding: 0;
  }
}

@media (max-width: 1023px) {
  .workspace-sidebar-collapse {
    display: none !important;
  }

  .workspace-brand-wordmark {
    display: block !important;
  }

  .workspace-brand-mark {
    display: none !important;
  }

  .workspace-nav-link {
    gap: 11px !important;
  }
}

/* Desktop windows snapped to half-screen use the complete mobile application frame. */
body.workspace-mobile-layout.hex-workspace-body {
  display: block !important;
  min-width: 0;
  padding-top: 60px !important;
}

body.workspace-mobile-layout.workspace-menu-open {
  overflow: hidden !important;
}

body.workspace-mobile-layout .workspace-mobilebar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 320;
  display: grid !important;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  height: 60px;
  padding: 0 max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left));
  border-bottom: 1px solid #30343a;
  background: #17191d;
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}

body.workspace-mobile-layout .workspace-menu-trigger {
  display: grid;
  width: 44px;
  height: 44px;
  min-height: 44px;
  place-content: center;
  gap: 4px;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
}

body.workspace-mobile-layout .workspace-menu-trigger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: #f4f5f6;
}

body.workspace-mobile-layout .workspace-mobile-brand {
  justify-self: center;
  display: flex;
}

body.workspace-mobile-layout .workspace-mobile-brand img {
  width: 142px;
  height: 44px;
  object-fit: contain;
}

body.workspace-mobile-layout .workspace-mobilebar > strong {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

body.workspace-mobile-layout > .workspace-sidebar {
  position: fixed !important;
  inset: 0 auto 0 0 !important;
  z-index: 350;
  display: flex !important;
  flex-direction: column;
  width: min(86vw, 330px) !important;
  height: 100dvh !important;
  transform: translateX(-102%);
  transition: transform 190ms ease;
}

body.workspace-mobile-layout.workspace-menu-open > .workspace-sidebar {
  transform: translateX(0);
}

body.workspace-mobile-layout .workspace-sidebar-collapse {
  display: none !important;
}

body.workspace-mobile-layout .workspace-menu-close {
  position: absolute;
  top: 17px;
  right: 10px;
  display: grid !important;
  margin: 0 !important;
}

body.workspace-mobile-layout .workspace-sidebar-head {
  position: relative;
  justify-content: center;
  min-height: 78px;
}

body.workspace-mobile-layout .workspace-sidebar-brand {
  flex: 0 0 100%;
  width: 100%;
  min-height: 78px;
  justify-content: center !important;
  padding: 4px 62px !important;
}

body.workspace-mobile-layout .workspace-sidebar-brand .workspace-brand-wordmark {
  width: 176px !important;
  max-width: 100% !important;
  height: 66px !important;
  object-fit: contain;
}

body.workspace-mobile-layout .workspace-brand-wordmark {
  display: block !important;
}

body.workspace-mobile-layout .workspace-brand-mark {
  display: none !important;
}

body.workspace-mobile-layout .workspace-nav {
  display: block !important;
  margin: 0 !important;
  padding: 11px 10px 18px !important;
  overflow-y: auto !important;
}

body.workspace-mobile-layout .workspace-nav-section {
  display: block;
}

body.workspace-mobile-layout .workspace-nav-heading,
body.workspace-mobile-layout .workspace-nav-text,
body.workspace-mobile-layout .workspace-user-copy,
body.workspace-mobile-layout .workspace-footer-label,
body.workspace-mobile-layout .workspace-theme-value {
  position: static !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  clip: auto !important;
  clip-path: none !important;
  white-space: normal !important;
}

body.workspace-mobile-layout .workspace-nav-link {
  justify-content: flex-start;
  width: 100%;
  min-height: 44px;
  padding-inline: 12px !important;
}

body.workspace-mobile-layout .workspace-sidebar-footer {
  justify-items: stretch;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

body.workspace-mobile-layout .workspace-user {
  grid-template-columns: 34px minmax(0, 1fr);
  justify-content: stretch;
  padding: 6px 8px 10px;
}

body.workspace-mobile-layout .workspace-footer-action {
  justify-content: flex-start;
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
}

body.workspace-mobile-layout .workspace-theme-value {
  margin-left: auto;
}

body.workspace-mobile-layout .row-fold-toggle {
  width: 36px !important;
  min-width: 36px !important;
}

body.workspace-mobile-layout > .workspace-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 340;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: rgba(5, 7, 10, .58) !important;
  opacity: 0;
  pointer-events: none;
}

body.workspace-mobile-layout.workspace-menu-open > .workspace-menu-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.workspace-mobile-layout :is(.page-shell, .directory-shell, .app-shell, .invoice-shell, .finance-shell),
body.workspace-mobile-layout > .app-root {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  min-height: calc(100dvh - 60px) !important;
  margin: 0 !important;
  padding: 12px 12px 26px !important;
  gap: 12px !important;
  overflow: visible !important;
}

body.workspace-mobile-layout :is(.page-shell, .directory-shell, .app-shell) > * {
  grid-column: 1 !important;
  grid-row: auto !important;
}

body.workspace-mobile-layout :is(.page-shell > .hero-card, .directory-shell > .hero-card, .app-shell > .hero, .app-root > .app-header) {
  position: static !important;
  width: 100% !important;
  min-height: 62px !important;
  height: auto !important;
  padding: 11px 13px !important;
}

body.workspace-mobile-layout :is(.invoice-shell, .finance-shell) > .topbar {
  grid-template-columns: minmax(0, 1fr) !important;
  min-height: 0 !important;
}

body.workspace-mobile-layout :is(.invoice-shell, .finance-shell) > .topbar .brand {
  min-height: 62px;
  border-right: 0;
  border-bottom: 1px solid var(--line);
}

/* Portal control rail */
body.home-view-portals .hero-card {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  align-content: start !important;
  justify-items: center !important;
}

body.home-view-portals .hero-left-actions,
body.home-view-portals .hero-topbar {
  position: static !important;
  display: grid !important;
  grid-template-columns: repeat(3, 38px) !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 8px !important;
}

body.home-view-portals .hero-topbar {
  margin-top: 8px !important;
}

body.home-view-portals .hero-card :is(.theme-toggle, .icon-action) {
  width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
}

body.home-view-portals .hero-card .hero-logo {
  justify-self: center !important;
  width: 174px !important;
  height: auto !important;
  max-height: none !important;
  max-width: 100% !important;
  margin: 30px auto 14px !important;
}

body.home-view-portals .hero-card .session-label {
  justify-self: center;
  width: 100%;
  text-align: center !important;
}

/* Navigation stability: predictable collapse, hover and cross-module loading. */
.workspace-sidebar-collapse {
  position: relative;
  z-index: 3;
  pointer-events: auto !important;
  touch-action: manipulation;
}

.workspace-nav-link {
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease !important;
}

.workspace-nav-icon,
.workspace-action-icon {
  background-color: transparent !important;
  color: #aeb5be !important;
  opacity: 1 !important;
  visibility: visible !important;
  filter: none !important;
  transition: none !important;
  transform: translateZ(0);
}

.workspace-nav-link:hover .workspace-nav-icon,
.workspace-nav-link:focus-visible .workspace-nav-icon,
.workspace-nav-link.is-active .workspace-nav-icon,
.workspace-footer-action:hover .workspace-action-icon,
.workspace-sidebar-collapse:hover .workspace-action-icon {
  background-color: transparent !important;
  color: #ffffff !important;
  opacity: 1 !important;
}

.workspace-nav-link.is-loading {
  border-color: #4c4130 !important;
  background: #24272d !important;
  color: #f2d08e !important;
}

body.workspace-navigating .workspace-nav-link:not(.is-loading) {
  pointer-events: none;
}

@media (min-width: 1024px) {
  body.home-view-portals .hero-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }

  body.home-view-portals .hero-card .hero-logo {
    order: 1;
    width: 190px !important;
    margin: 18px auto 14px !important;
  }

  body.home-view-portals .hero-card .session-label {
    order: 2;
  }

  body.home-view-portals .hero-left-actions {
    order: 4;
    margin-top: auto !important;
  }

  body.home-view-portals .hero-topbar {
    order: 5;
    margin-top: 8px !important;
  }
}

@media (max-width: 1023px) {
  body.home-view-portals .hero-card {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    min-height: 0 !important;
  }

  body.home-view-portals .hero-card .hero-left-actions,
  body.home-view-portals .hero-card .hero-topbar {
    grid-row: 3;
    grid-template-columns: repeat(3, 40px) !important;
    margin: 14px 0 0 !important;
  }

  body.home-view-portals .hero-card .hero-left-actions {
    grid-column: 1 !important;
  }

  body.home-view-portals .hero-card .hero-topbar {
    grid-column: 2 !important;
  }

  body.home-view-portals .hero-card .hero-logo {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  body.home-view-portals .hero-card .hero-logo {
    width: 190px !important;
    margin: 14px auto 10px !important;
  }

  body.home-view-portals .hero-card .session-label {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 420px) {
  body.home-view-portals .hero-card {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.home-view-portals .hero-card .hero-left-actions,
  body.home-view-portals .hero-card .hero-topbar {
    grid-column: 1;
  }

  body.home-view-portals .hero-card .hero-left-actions {
    grid-row: 3;
  }

  body.home-view-portals .hero-card .hero-topbar {
    grid-row: 4;
    margin-top: 8px !important;
  }
}

/* Final product polish: restrained typography, flat surfaces and reliable dialogs. */
body.hex-workspace-body {
  font-weight: 400;
}

body.hex-workspace-body :is(h1, h2, h3, h4, h5, h6, strong, b) {
  letter-spacing: 0 !important;
}

body.hex-workspace-body :is(.brand h1, .hero-copy h1, .app-title, .page-title) {
  font-size: 1.12rem !important;
  font-weight: 650 !important;
  line-height: 1.25 !important;
}

body.hex-workspace-body :is(.section-head h2, .section-head h3, .panel h2, .panel h3, .editor-section h3, .card h2, .card h3) {
  font-size: .9rem !important;
  font-weight: 620 !important;
  line-height: 1.3 !important;
}

body.hex-workspace-body :is(button, .button, .primary-btn, .secondary-btn, .mini-btn, .icon-text-btn) {
  font-weight: 580 !important;
}

body.hex-workspace-body :is(.summary-grid strong, .kpi-grid strong, .stat-tile strong) {
  font-weight: 650 !important;
}

body.hex-workspace-body :is(.panel, .card, .table-panel, .editor-panel, .editor-card, .modal-card, .controls-card, .budget-card, .stats-card, .expenses-card, .actions-card, .app-card, .editor-section, .payment-summary) {
  border-radius: 6px !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.hex-workspace-body :is(.editor-section, .payment-summary, .admin-edit-card) {
  background: var(--surface-muted, var(--surface-soft, #f5f6f7)) !important;
}

.editor-overlay:not(.is-hidden) {
  z-index: 600 !important;
  place-items: start center !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.editor-overlay:not(.is-hidden) :is(.editor-panel, .editor-card, [role='dialog']) {
  width: min(920px, 100%) !important;
  max-height: calc(100dvh - 24px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.editor-panel > .editor-head,
.editor-card > .editor-head {
  position: sticky;
  top: -1px;
  z-index: 4;
  margin: -4px -4px 0;
  padding: 6px 4px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.editor-panel > .editor-actions,
.editor-card .form-actions {
  position: sticky;
  bottom: -1px;
  z-index: 4;
  margin: 0 -4px -4px;
  padding: 10px 4px 4px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

dialog[open] {
  max-width: calc(100vw - 24px) !important;
  max-height: calc(100dvh - 24px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

dialog[open]::backdrop {
  background: rgba(8, 10, 14, .64) !important;
  backdrop-filter: none !important;
}

body.home-view-settings .home-shell,
body.home-view-settings > .site-legal {
  visibility: hidden !important;
}

.home-account-dialog[open] {
  width: min(760px, calc(100vw - 24px)) !important;
  padding: 0 !important;
  border: 1px solid var(--line) !important;
  border-radius: 7px !important;
  background: var(--surface-strong) !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28) !important;
}

.home-account-dialog .home-account-form {
  max-height: calc(100dvh - 26px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px !important;
  gap: 12px !important;
}

.home-account-dialog :is(.dialog-menu, .dialog-section, .admin-edit-card) {
  border-radius: 6px !important;
  box-shadow: none !important;
}

.home-account-dialog .dialog-head h3 {
  font-size: 1.05rem !important;
  font-weight: 650 !important;
}

.home-account-dialog .dialog-section h4 {
  font-size: .72rem !important;
  font-weight: 650 !important;
  letter-spacing: 0 !important;
}

.home-account-dialog .dialog-section-copy {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.45;
}

.home-account-dialog .dialog-actions {
  position: sticky;
  bottom: -18px;
  z-index: 5;
  margin: 0 -18px -18px;
  padding: 12px 18px max(12px, env(safe-area-inset-bottom));
  background: var(--surface-strong);
}

/* Login is a compact two-zone authentication workspace, not a portal card. */
body.home-view-login {
  background: #eceef1 !important;
}

html[data-theme='dark'] body.home-view-login {
  background: #101216 !important;
}

body.home-view-login .home-shell {
  width: 100%;
  max-width: 980px !important;
  min-height: calc(100dvh - 32px);
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  padding: 24px !important;
}

body.home-view-login .auth-home-card {
  position: relative;
  isolation: isolate;
  display: grid !important;
  grid-template-columns: 42% 58%;
  grid-template-rows: 62px auto auto 1fr;
  width: min(900px, calc(100vw - 48px)) !important;
  max-width: 900px !important;
  min-height: 500px;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid #d8dbe0 !important;
  border-top: 3px solid var(--accent) !important;
  border-radius: 7px !important;
  background: var(--surface-strong) !important;
  color: var(--text) !important;
  box-shadow: 0 20px 54px rgba(20, 23, 28, .13) !important;
}

html[data-theme='dark'] body.home-view-login .auth-home-card {
  border-color: #30343b !important;
  background: #1b1e23 !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .36) !important;
}

body.home-view-login .auth-home-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  display: block !important;
  width: 42%;
  background: #17191d;
}

body.home-view-login .auth-card-head {
  grid-column: 2;
  grid-row: 1;
  align-items: start;
  justify-content: flex-end;
  padding: 16px 18px 0;
}

body.home-view-login .auth-login-logo {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: center;
  justify-self: center;
  width: min(270px, 72%) !important;
  height: auto !important;
  margin: 0 !important;
}

body.home-view-login .auth-home-card .home-logo-dark {
  display: none !important;
}

body.home-view-login .auth-home-card .home-logo-light {
  display: block !important;
}

body.home-view-login .auth-home-card h1 {
  grid-column: 2;
  grid-row: 2;
  align-self: end;
  margin: 28px 44px 0 !important;
  color: var(--text) !important;
  font-size: 1.45rem !important;
  font-weight: 650 !important;
  line-height: 1.2;
  text-align: left !important;
}

body.home-view-login .auth-home-card > p {
  grid-column: 2;
  grid-row: 3;
  margin: 8px 44px 0 !important;
  color: var(--muted) !important;
  font-size: .7rem !important;
  font-weight: 600;
  text-align: left !important;
}

body.home-view-login .home-login-form {
  grid-column: 2;
  grid-row: 4;
  align-content: start;
  gap: 13px;
  margin: 0 !important;
  padding: 25px 44px 42px;
}

body.home-view-login .auth-home-card label {
  gap: 7px;
  color: var(--muted) !important;
  font-size: .76rem;
  font-weight: 520;
}

body.home-view-login .auth-home-card input {
  min-height: 46px;
  border-color: var(--line-strong) !important;
  border-radius: 5px !important;
  background: var(--surface-muted) !important;
  color: var(--text) !important;
}

body.home-view-login .auth-home-card :is(.primary-btn, .secondary-btn) {
  min-height: 44px;
  border-radius: 5px !important;
}

body.home-view-login .auth-home-card .primary-btn {
  border-color: #b57921 !important;
  background: #c98b2e !important;
  color: #17191d !important;
}

body.home-view-login .auth-home-card .secondary-btn {
  border-color: var(--line-strong) !important;
  background: transparent !important;
  color: var(--text) !important;
}

body.home-view-login .auth-home-card .theme-toggle {
  border-color: var(--line-strong) !important;
  border-radius: 5px !important;
  background: var(--surface-muted) !important;
  color: var(--text) !important;
}

@media (max-width: 700px) {
  body.home-view-login .home-shell {
    min-height: calc(100dvh - 22px);
    padding: 12px !important;
  }

  body.home-view-login .auth-home-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 170px auto auto auto;
    min-height: 0;
    width: calc(100vw - 24px) !important;
    max-width: 560px !important;
  }

  body.home-view-login .auth-home-card::before {
    inset: 0 0 auto;
    width: 100%;
    height: 170px;
  }

  body.home-view-login .auth-card-head {
    position: absolute;
    inset: 10px 10px auto auto;
    z-index: 3;
    padding: 0;
  }

  body.home-view-login .auth-card-head .theme-toggle {
    border-color: #41464e !important;
    background: #202329 !important;
    color: #f4f5f6 !important;
  }

  body.home-view-login .auth-login-logo {
    grid-column: 1;
    grid-row: 1;
    width: min(230px, 66%) !important;
  }

  body.home-view-login .auth-home-card h1 {
    grid-column: 1;
    grid-row: 2;
    margin: 25px 22px 0 !important;
    font-size: 1.3rem !important;
  }

  body.home-view-login .auth-home-card > p {
    grid-column: 1;
    grid-row: 3;
    margin: 7px 22px 0 !important;
  }

  body.home-view-login .home-login-form {
    grid-column: 1;
    grid-row: 4;
    padding: 22px 22px 28px;
  }

  .home-account-dialog .home-account-form {
    padding: 12px !important;
  }

  .home-account-dialog .dialog-actions {
    bottom: -12px;
    margin: 0 -12px -12px;
    padding-inline: 12px;
  }
}

/* Stable vector rendering, including hover and collapsed scroll containers. */
.workspace-nav-icon, .workspace-action-icon { background: transparent !important; mask: none !important; -webkit-mask: none !important; overflow: visible; opacity: 1; }
.workspace-nav-icon svg, .workspace-action-icon svg { display: block; width: 100%; height: 100%; stroke: currentColor; }
@media (min-width:1024px) { body.workspace-sidebar-collapsed .workspace-nav-section { display: grid; justify-items: center; margin: 0; width: 100%; } }
.legend-item.is-active, body[data-theme='light'] .legend-item.is-active { border: 2px solid #b78025 !important; background: #fff0cd !important; color: #332408 !important; box-shadow: 0 0 0 2px #b7802533 !important; opacity: 1 !important; }
.legend-item.is-active::after { content: ' ✓ Sélectionné'; font-weight: 700; }
.site-quick-search { width: 100%; margin-bottom: 5px; min-height: 38px; }

.report-site-suggestions { display:grid; gap:4px; max-height:220px; overflow:auto; border:1px solid #8885; padding:6px; background:var(--surface,#fff); } .report-site-suggestions[hidden] { display:none; } .report-site-suggestions button { text-align:left; min-height:38px; }

.site-quick-results { display:grid; gap:3px; max-height:210px; overflow:auto; padding:6px; border:1px solid var(--line,#8885); border-radius:5px; background:var(--surface,#fff); }
.site-quick-results[hidden] { display:none!important; }
.site-quick-results button { text-align:left; min-height:36px; white-space:normal; }
.site-quick-results button[aria-pressed="true"] { border-color:#ae7820; box-shadow:inset 3px 0 #ae7820; }
