/* Final language-aware shell positioning. Must remain the last stylesheet. */
@media (min-width:1001px){
  html[dir="rtl"] .app-shell:not(.auth-locked)>.sidebar{
    position:fixed!important;
    right:0!important;
    left:auto!important;
  }
  html[dir="ltr"] .app-shell:not(.auth-locked)>.sidebar{
    position:fixed!important;
    left:0!important;
    right:auto!important;
  }
}

@media (min-width:701px){
  html[dir="rtl"] .app-shell{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) var(--sidebar)!important;
    grid-template-areas:"main sidebar"!important;
    direction:ltr;
  }
  html[dir="rtl"] .app-shell>.sidebar{grid-area:sidebar!important;direction:rtl;border-left:0!important;border-right:1px solid var(--border)!important;}
  html[dir="rtl"] .app-shell>.main{grid-area:main!important;direction:rtl;}

  html[dir="ltr"] .app-shell{
    display:grid!important;
    grid-template-columns:var(--sidebar) minmax(0,1fr)!important;
    grid-template-areas:"sidebar main"!important;
    direction:ltr;
  }
  html[dir="ltr"] .app-shell>.sidebar{grid-area:sidebar!important;direction:ltr;border-right:1px solid var(--border)!important;border-left:0!important;}
  html[dir="ltr"] .app-shell>.main{grid-area:main!important;direction:ltr;}
}

html[dir="rtl"] .topbar{direction:rtl!important;}
html[dir="ltr"] .topbar{direction:ltr!important;}
html[dir="rtl"] .topbar-page-info{order:1!important;text-align:right!important;}
html[dir="rtl"] .top-actions{order:3!important;margin-right:auto!important;margin-left:0!important;}
html[dir="rtl"] .mobile-menu-btn{order:0!important;}
html[dir="ltr"] .mobile-menu-btn{order:0!important;}
html[dir="ltr"] .topbar-page-info{order:1!important;text-align:left!important;}
html[dir="ltr"] .top-actions{order:3!important;margin-left:auto!important;margin-right:0!important;}
html[dir="ltr"] .topbar-breadcrumb{direction:ltr!important;}
html[dir="rtl"] .topbar-breadcrumb{direction:rtl!important;}

html[dir="ltr"] .nav-item,
html[dir="ltr"] .sidebar-support-card,
html[dir="ltr"] .sidebar-account-host{text-align:left!important;}
html[dir="rtl"] .nav-item,
html[dir="rtl"] .sidebar-support-card,
html[dir="rtl"] .sidebar-account-host{text-align:right!important;}
html[dir="ltr"] .nav-item.active::before{left:-16px!important;right:auto!important;}
html[dir="rtl"] .nav-item.active::before{right:-16px!important;left:auto!important;}

@media (max-width:700px){
  html[dir="rtl"] .sidebar{
    right:0!important;left:auto!important;
    border-left:1px solid var(--border)!important;border-right:0!important;
    box-shadow:-24px 0 60px rgba(16,24,40,.18)!important;
    transform:translateX(105%)!important;
    direction:rtl!important;
  }
  html[dir="rtl"] .sidebar.mobile-open{transform:translateX(0)!important;}
  html[dir="ltr"] .sidebar{
    left:0!important;right:auto!important;
    border-right:1px solid var(--border)!important;border-left:0!important;
    box-shadow:24px 0 60px rgba(16,24,40,.18)!important;
    transform:translateX(-105%)!important;
    direction:ltr!important;
  }
  html[dir="ltr"] .sidebar.mobile-open{transform:translateX(0)!important;}
  html[dir="ltr"] .sidebar .brand,
  html[dir="ltr"] .sidebar .nav-item,
  html[dir="ltr"] .sidebar .sidebar-foot{justify-content:flex-start!important;text-align:left!important;}
  html[dir="rtl"] .sidebar .brand,
  html[dir="rtl"] .sidebar .nav-item,
  html[dir="rtl"] .sidebar .sidebar-foot{justify-content:flex-start!important;text-align:right!important;}
  html[dir="ltr"] .sidebar .nav-item.active::before{left:-12px!important;right:auto!important;}
  html[dir="rtl"] .sidebar .nav-item.active::before{right:-12px!important;left:auto!important;}
}

@media(max-width:700px){
  .app-shell>.sidebar{
    width:min(286px,calc(100vw - 56px))!important;
    max-width:calc(100vw - 56px)!important;
  }
}

/* Compact/tablet topbar: constrain the profile glyph inside the 84px shell. */
@media(min-width:701px) and (max-width:1000px){
  .app-shell:not(.auth-locked) .topbar .topbar-profile{
    width:44px!important;
    min-width:44px!important;
    max-width:44px!important;
    height:44px!important;
    min-height:44px!important;
    max-height:44px!important;
    display:grid!important;
    place-items:center!important;
    flex:0 0 44px!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  .app-shell:not(.auth-locked) .topbar .topbar-profile-text{
    display:none!important;
  }
  .app-shell:not(.auth-locked) .topbar .top-actions{
    display:flex!important;
    align-items:center!important;
    gap:6px!important;
  }
  .app-shell:not(.auth-locked) .topbar .topbar-tool,
  .app-shell:not(.auth-locked) .topbar .notification-trigger,
  .app-shell:not(.auth-locked) .topbar .global-search-trigger{
    width:40px!important;
    min-width:40px!important;
    max-width:40px!important;
    height:40px!important;
    min-height:40px!important;
    max-height:40px!important;
    display:grid!important;
    place-items:center!important;
    flex:0 0 40px!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
    border:1px solid var(--line,var(--border))!important;
    border-radius:10px!important;
    background:var(--card-bg,var(--surface))!important;
    color:var(--text-normal,var(--text))!important;
    box-shadow:none!important;
  }
  .app-shell:not(.auth-locked) .topbar .topbar-tool svg,
  .app-shell:not(.auth-locked) .topbar .notification-trigger svg,
  .app-shell:not(.auth-locked) .topbar .global-search-trigger svg{
    width:19px!important;
    min-width:19px!important;
    max-width:19px!important;
    height:19px!important;
    min-height:19px!important;
    max-height:19px!important;
    display:block!important;
    fill:none!important;
    stroke:currentColor!important;
    stroke-width:1.8!important;
    stroke-linecap:round!important;
    stroke-linejoin:round!important;
  }
  .app-shell:not(.auth-locked) .topbar .topbar-avatar{
    width:32px!important;
    min-width:32px!important;
    max-width:32px!important;
    height:32px!important;
    min-height:32px!important;
    max-height:32px!important;
    display:grid!important;
    place-items:center!important;
    overflow:hidden!important;
    border:0!important;
    border-radius:9px!important;
    background:var(--accent-panel,var(--accent-soft))!important;
    color:var(--accent-text,var(--accent))!important;
    box-shadow:none!important;
  }
  .app-shell:not(.auth-locked) .topbar .topbar-avatar svg{
    width:18px!important;
    min-width:18px!important;
    max-width:18px!important;
    height:18px!important;
    min-height:18px!important;
    max-height:18px!important;
    fill:none!important;
    stroke:currentColor!important;
    stroke-width:1.9!important;
    stroke-linecap:round!important;
    stroke-linejoin:round!important;
  }
}

/* BLC navigation shell adaptation: unified sidebar + page context header. */
.app-shell:not(.auth-locked) .topbar-page-info{
  min-width:0!important;
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:12px!important;
}
.topbar-page-icon{
  width:44px;
  height:44px;
  min-width:44px;
  display:grid;
  place-items:center;
  flex:0 0 44px;
  border:1px solid color-mix(in srgb,var(--accent-text,var(--accent)) 18%,var(--line,var(--border)));
  border-radius:13px;
  background:color-mix(in srgb,var(--accent-panel,var(--accent-soft)) 88%,var(--card-bg,var(--surface)));
  color:var(--accent-text,var(--accent));
  box-shadow:0 1px 2px color-mix(in srgb,var(--text-strong,var(--text)) 5%,transparent);
}
.topbar-page-icon svg{
  width:22px;
  height:22px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.topbar-page-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:4px;
}
.topbar-page-copy .topbar-home{
  min-width:0!important;
  max-width:100%!important;
}
.topbar-page-copy .topbar-home h1{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.app-shell:not(.auth-locked) .topbar-page-copy .topbar-breadcrumb{
  min-width:0;
  max-width:100%;
  display:flex!important;
  align-items:center;
  gap:6px;
  margin:0;
  color:var(--text-muted,var(--muted));
  font-size:11px;
  line-height:1.25;
  white-space:nowrap;
  overflow:hidden;
}
.topbar-page-copy .topbar-breadcrumb.hidden{display:flex!important;}
.topbar-page-copy .topbar-breadcrumb button{
  flex:0 0 auto;
  padding:0;
  border:0;
  background:transparent;
  color:var(--accent-text,var(--accent));
  font:inherit;
  font-weight:750;
}
.topbar-page-copy .topbar-breadcrumb strong{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  color:var(--text-muted,var(--muted));
  font-weight:650;
}
html[dir="rtl"] .topbar-page-copy{align-items:flex-start;text-align:right;}
html[dir="ltr"] .topbar-page-copy{align-items:flex-start;text-align:left;}
html[dir="ltr"] .sidebar .nav-item svg{transform:none!important;}

.sidebar nav{
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain!important;
  touch-action:pan-y!important;
  scrollbar-width:thin!important;
}
.sidebar .nav-item{
  width:100%;
  border:1px solid transparent!important;
  transition:background .16s ease,color .16s ease,border-color .16s ease!important;
}
.sidebar .nav-item.active{
  background:color-mix(in srgb,var(--accent-panel,var(--accent-soft)) 88%,transparent)!important;
  border-color:color-mix(in srgb,var(--accent-text,var(--accent)) 12%,transparent)!important;
  color:var(--accent-text,var(--accent))!important;
  box-shadow:none!important;
}
.sidebar .nav-item.active::before{display:none!important;}
.sidebar .nav-item:focus-visible{
  outline:2px solid color-mix(in srgb,var(--accent-text,var(--accent)) 55%,transparent)!important;
  outline-offset:2px!important;
}
.sidebar .sidebar-foot.sidebar-account-host{
  min-width:0;
  display:grid!important;
  grid-template-columns:1fr;
  gap:8px;
  margin-top:auto!important;
  padding:14px 4px 0!important;
  border:0!important;
  border-top:1px solid var(--line,var(--border))!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
.sidebar-support-card{
  width:100%;
  min-width:0;
  display:grid!important;
  grid-template-columns:32px minmax(0,1fr) 18px;
  align-items:center!important;
  gap:9px!important;
  padding:9px 5px!important;
  border:0!important;
  border-radius:10px!important;
  background:transparent!important;
  color:var(--text-strong,var(--text))!important;
  text-align:start!important;
  box-shadow:none!important;
  transition:background .16s ease,color .16s ease!important;
}
.sidebar-support-card:hover,
.sidebar-support-card:focus-visible{
  background:var(--card-hover,var(--surface-soft))!important;
  outline:0!important;
}
.sidebar-support-icon{
  width:30px;
  height:30px;
  display:grid!important;
  place-items:center;
  border-radius:9px;
  background:var(--accent-panel,var(--accent-soft));
  color:var(--accent-text,var(--accent));
}
.sidebar-support-icon svg,
.sidebar-support-arrow{
  display:block;
  fill:none;
  stroke:currentColor!important;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.sidebar-support-icon svg{width:17px!important;height:17px!important;margin:0!important;}
.sidebar-support-copy{
  min-width:0;
  display:grid!important;
  gap:1px;
  margin:0!important;
  color:inherit!important;
}
.sidebar-support-copy strong{
  display:block!important;
  overflow:hidden;
  color:var(--text-strong,var(--text))!important;
  font-size:12px!important;
  line-height:1.25!important;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.sidebar-support-copy small{
  display:block!important;
  overflow:hidden;
  color:var(--accent-text,var(--accent))!important;
  font-size:9.5px!important;
  line-height:1.35!important;
  font-weight:700!important;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.sidebar-support-arrow{
  width:15px!important;
  height:15px!important;
  color:var(--text-muted,var(--muted));
  transition:transform .16s ease,color .16s ease;
}
html[dir="rtl"] .sidebar-support-arrow{transform:scaleX(-1);}
.sidebar-support-card:hover .sidebar-support-arrow,
.sidebar-support-card:focus-visible .sidebar-support-arrow{color:var(--accent-text,var(--accent));}
html[dir="rtl"] .sidebar-support-card:hover .sidebar-support-arrow,
html[dir="rtl"] .sidebar-support-card:focus-visible .sidebar-support-arrow{transform:scaleX(-1) translateX(-2px);}
html[dir="ltr"] .sidebar-support-card:hover .sidebar-support-arrow,
html[dir="ltr"] .sidebar-support-card:focus-visible .sidebar-support-arrow{transform:translateX(2px);}
.sidebar-version{
  display:flex!important;
  align-items:center;
  justify-content:center;
  gap:5px;
  margin:0!important;
  color:var(--text-muted,var(--muted))!important;
  text-align:center!important;
  font-size:8.5px!important;
  line-height:1.3!important;
  white-space:nowrap;
}
html[data-theme="dark"] .sidebar-support-card,
.dark-theme .sidebar-support-card{background:transparent!important;border:0!important;}

@media(min-width:1001px){
  .sidebar .sidebar-foot.sidebar-account-host{grid-row:auto!important;}
  .topbar-page-copy .topbar-home h1{font-size:19px!important;}
}

@media(min-width:701px) and (max-width:1000px){
  .app-shell:not(.auth-locked) .topbar-page-info{gap:9px!important;}
  .topbar-page-icon{
    width:38px;
    height:38px;
    min-width:38px;
    flex-basis:38px;
    border-radius:10px;
  }
  .topbar-page-icon svg{width:19px;height:19px;}
  .topbar-page-copy .topbar-home h1{font-size:17px!important;}
  .topbar-page-copy .topbar-breadcrumb{font-size:9.5px;gap:4px;}
  .sidebar .sidebar-foot.sidebar-account-host{gap:4px!important;padding-top:8px!important;}
  .sidebar-support-card{
    min-height:42px;
    grid-template-columns:1fr!important;
    place-items:center;
    padding:6px 2px!important;
  }
  .sidebar-support-icon{width:30px;height:30px;}
  .sidebar-support-copy,.sidebar-support-arrow{display:none!important;}
  .sidebar-version{font-size:0!important;line-height:1!important;}
  .sidebar-version span{display:none!important;}
  .sidebar-version::after{content:"v5.0.0";font-size:8px;line-height:1.2;}
}

@media(max-width:700px){
  .app-shell:not(.auth-locked) .topbar-page-info{
    gap:9px!important;
    overflow:hidden!important;
  }
  .topbar-page-icon{
    width:36px;
    height:36px;
    min-width:36px;
    flex-basis:36px;
    border-radius:10px;
  }
  .topbar-page-icon svg{width:18px;height:18px;}
  .topbar-page-copy{gap:3px;overflow:hidden;}
  .topbar-page-copy .topbar-home h1{font-size:17px!important;}
  .topbar-page-copy .topbar-breadcrumb{font-size:9.5px;gap:4px;}
  .sidebar .sidebar-foot.sidebar-account-host{gap:4px!important;padding:10px 0 0!important;}
  .sidebar-support-card{
    grid-template-columns:30px minmax(0,1fr) 15px!important;
    gap:8px!important;
    min-height:48px;
    padding:7px 3px!important;
  }
  .sidebar-support-icon{width:30px;height:30px;}
  .sidebar-support-icon svg{width:17px!important;height:17px!important;}
  .sidebar-support-copy strong{font-size:11.5px!important;text-align:start!important;}
  .sidebar-support-copy small{font-size:9.5px!important;text-align:start!important;}
  .sidebar-support-arrow{width:14px!important;height:14px!important;}
  .sidebar-version{
    padding-top:1px;
    border:0!important;
    background:transparent!important;
    font-size:8px!important;
    line-height:1.25!important;
  }
  .sidebar-version span{display:inline!important;}
}

@media(max-width:700px) and (max-height:680px){
  .sidebar .sidebar-foot.sidebar-account-host{padding-top:7px!important;}
  .sidebar-support-card{grid-template-columns:28px minmax(0,1fr) 14px!important;min-height:40px;padding:5px 2px!important;}
  .sidebar-support-icon{width:28px;height:28px;}
  .sidebar-support-copy strong{font-size:10.5px!important;}
  .sidebar-support-copy small{display:none!important;}
  .sidebar-version{font-size:0!important;}
  .sidebar-version span{display:none!important;}
  .sidebar-version::after{content:"v5.0.0";font-size:8px;}
}

/* Final shell refinement: clean brand, stable desktop footer, title-first breadcrumb. */
.topbar-page-icon{display:none!important;}
.app-shell:not(.auth-locked) .topbar-page-info{
  min-width:0!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  justify-content:center!important;
  gap:0!important;
}
.topbar-page-copy{
  width:100%!important;
  max-width:100%!important;
  gap:3px!important;
}
.topbar-page-copy .topbar-home{order:0!important;}
.app-shell:not(.auth-locked) .topbar-page-copy .topbar-breadcrumb{order:1!important;}

.sidebar .brand-home{
  border:0!important;
  background:transparent!important;
  color:var(--text-strong,var(--text))!important;
  cursor:pointer;
}
.sidebar-logo-image{
  display:block;
  object-fit:contain;
  flex:0 0 auto;
}
.sidebar-brand-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:2px;
  direction:ltr;
  text-align:left;
}
.sidebar-brand-copy strong{
  color:var(--text-strong,var(--text));
  font-weight:900;
  line-height:1;
  letter-spacing:-.5px;
}
.sidebar-brand-copy small{
  color:var(--text-muted,var(--muted));
  font-weight:600;
  line-height:1.2;
  white-space:nowrap;
}

@media(min-width:1001px){
  html[dir] .app-shell:not(.auth-locked)>.sidebar{
    height:100dvh!important;
    max-height:100dvh!important;
    display:grid!important;
    grid-template-rows:84px minmax(0,1fr) auto!important;
    gap:0!important;
    padding:0 12px 10px!important;
    overflow:hidden!important;
  }
  .sidebar .brand{
    grid-row:1!important;
    min-height:84px!important;
    height:84px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    margin:0 -12px!important;
    padding:0 12px!important;
    border-bottom:1px solid var(--line,var(--border))!important;
    overflow:hidden!important;
  }
  .sidebar .brand-home{
    width:100%!important;
    min-width:0!important;
    min-height:62px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:10px!important;
    padding:0 8px!important;
    border-radius:12px!important;
    direction:ltr!important;
    overflow:hidden!important;
  }
  .sidebar .brand-home:hover,
  .sidebar .brand-home:focus-visible{
    background:var(--card-hover,var(--surface-soft))!important;
    outline:0!important;
  }
  .sidebar-logo-image{width:44px!important;height:44px!important;}
  .sidebar-brand-copy strong{font-size:18px!important;}
  .sidebar-brand-copy small{font-size:10px!important;}
  .sidebar .trial-badge{display:none!important;}
  .sidebar nav{
    grid-row:2!important;
    min-height:0!important;
    align-self:stretch!important;
    margin:0!important;
    padding:12px 0 8px!important;
    gap:3px!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
  }
  .sidebar .sidebar-foot.sidebar-account-host{
    grid-row:3!important;
    align-self:end!important;
    min-height:0!important;
    margin:0!important;
    padding:10px 0 0!important;
    gap:4px!important;
    overflow:hidden!important;
  }
  .sidebar-support-card{
    min-height:44px!important;
    grid-template-columns:30px minmax(0,1fr) 14px!important;
    gap:8px!important;
    padding:6px 3px!important;
  }
  .sidebar-support-icon{width:30px!important;height:30px!important;}
  .sidebar-support-copy strong{font-size:11.5px!important;}
  .sidebar-support-copy small{font-size:9px!important;}
  .sidebar-support-arrow{width:14px!important;height:14px!important;}
  .sidebar-version{
    min-width:0!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    justify-items:center!important;
    gap:1px!important;
    padding:0 2px!important;
    font-size:8px!important;
    line-height:1.2!important;
    white-space:normal!important;
  }
  .sidebar-version span{display:block!important;max-width:100%;}
  .sidebar-version span[aria-hidden="true"]{display:none!important;}
}

@media(min-width:701px) and (max-width:1000px){
  .sidebar .brand-home{
    width:100%!important;
    min-height:54px!important;
    display:grid!important;
    place-items:center!important;
    padding:0!important;
  }
  .sidebar-logo-image{width:38px!important;height:38px!important;}
  .sidebar-brand-copy{display:none!important;}
}

@media(max-width:700px){
  .sidebar .brand-home{
    width:100%!important;
    min-height:44px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:8px!important;
    padding:0 4px!important;
    direction:ltr!important;
  }
  .sidebar-logo-image{width:32px!important;height:32px!important;}
  .sidebar-brand-copy strong{font-size:14px!important;}
  .sidebar-brand-copy small{font-size:9px!important;}
}

/* Shell symmetry pass: full-bleed mobile header and invariant desktop rail. */
@media(min-width:1001px){
  html[dir] .app-shell:not(.auth-locked){
    --blc-sidebar-fixed-width:218px;
    --blc-shell-header-height:76px;
  }
  html[dir="rtl"] .app-shell:not(.auth-locked){
    grid-template-columns:minmax(0,1fr) var(--blc-sidebar-fixed-width)!important;
  }
  html[dir="ltr"] .app-shell:not(.auth-locked){
    grid-template-columns:var(--blc-sidebar-fixed-width) minmax(0,1fr)!important;
  }
  html[dir] .app-shell:not(.auth-locked)>.sidebar{
    width:var(--blc-sidebar-fixed-width)!important;
    min-width:var(--blc-sidebar-fixed-width)!important;
    max-width:var(--blc-sidebar-fixed-width)!important;
    flex:0 0 var(--blc-sidebar-fixed-width)!important;
    grid-template-rows:var(--blc-shell-header-height) minmax(0,1fr) auto!important;
  }
  .app-shell:not(.auth-locked) .topbar{
    height:var(--blc-shell-header-height)!important;
    min-height:var(--blc-shell-header-height)!important;
  }
  .sidebar .brand{
    height:var(--blc-shell-header-height)!important;
    min-height:var(--blc-shell-header-height)!important;
    padding:0 12px!important;
  }
  .sidebar .brand-home{
    min-height:56px!important;
    gap:9px!important;
    padding-inline:10px!important;
  }
  html[dir="rtl"] .sidebar .brand-home{justify-content:flex-end!important;}
  html[dir="ltr"] .sidebar .brand-home{justify-content:flex-start!important;}
  .sidebar-logo-image{width:40px!important;height:40px!important;}
  .sidebar-brand-copy strong{font-size:16px!important;}
  .sidebar-brand-copy small{font-size:9.5px!important;}
}

@media(max-width:700px){
  .app-shell>.main{
    overflow-x:clip!important;
  }
  .app-shell:not(.auth-locked) .topbar{
    width:calc(100% + 24px)!important;
    max-width:none!important;
    min-height:76px!important;
    height:76px!important;
    margin:0 0 18px!important;
    margin-inline:-12px!important;
    padding:10px 14px!important;
    border-radius:0!important;
    box-sizing:border-box!important;
  }
  .app-shell:not(.auth-locked) .topbar-page-info{
    min-width:0!important;
    align-self:stretch!important;
  }
  .sidebar{
    grid-template-rows:76px auto minmax(0,1fr) auto!important;
    padding:0 14px max(12px,env(safe-area-inset-bottom))!important;
  }
  .sidebar .brand{
    height:76px!important;
    min-height:76px!important;
    margin:0 -14px!important;
    padding:0 14px!important;
    display:flex!important;
    align-items:center!important;
    border-bottom:1px solid var(--line,var(--border))!important;
  }
  .sidebar .brand-home{
    min-height:54px!important;
    gap:10px!important;
    padding-inline:8px!important;
    border-radius:11px!important;
  }
  html[dir="rtl"] .sidebar .brand-home{justify-content:flex-end!important;}
  html[dir="ltr"] .sidebar .brand-home{justify-content:flex-start!important;}
  .sidebar-logo-image{width:38px!important;height:38px!important;}
  .sidebar-brand-copy strong{font-size:16px!important;}
  .sidebar-brand-copy small{font-size:10px!important;}
  .sidebar .trial-badge{
    width:100%!important;
    max-width:none!important;
    min-height:50px!important;
    margin:10px 0 8px!important;
    padding:8px 10px!important;
    display:grid!important;
    grid-template-columns:auto minmax(0,1fr)!important;
    align-items:center!important;
    gap:10px!important;
    border:1px solid var(--line,var(--border))!important;
    border-radius:12px!important;
    background:color-mix(in srgb,var(--card-bg,var(--surface)) 92%,var(--accent-panel,var(--accent-soft)))!important;
    box-shadow:none!important;
  }
  .sidebar .trial-badge>div{
    min-width:0!important;
    display:grid!important;
    gap:1px!important;
    text-align:start!important;
  }
  .sidebar .trial-badge strong{font-size:12px!important;line-height:1.25!important;}
  .sidebar .trial-badge small{font-size:9.5px!important;line-height:1.3!important;}
  .sidebar .trial-badge .plan-pill{
    padding:5px 8px!important;
    border-radius:8px!important;
    font-size:9px!important;
  }
  .sidebar nav{padding-top:4px!important;}
}

@media(max-width:700px) and (max-height:760px){
  .sidebar{grid-template-rows:68px auto minmax(0,1fr) auto!important;}
  .sidebar .brand{height:68px!important;min-height:68px!important;}
  .sidebar-logo-image{width:34px!important;height:34px!important;}
  .sidebar .trial-badge{min-height:44px!important;margin:6px 0!important;padding-block:6px!important;}
}

/* Desktop and tablet LTR calculator units must not overlap their inputs. */
@media(min-width:701px){
  html[dir="ltr"] #calculator .input-with-unit input{
    padding-left:12px!important;
    padding-right:72px!important;
  }
  html[dir="ltr"] #calculator .input-with-unit>span{
    left:auto!important;
    right:12px!important;
    inset-inline-start:auto!important;
    inset-inline-end:12px!important;
  }
}

/* Narrow phones need full-width date and guest fields in every language. */
@media(max-width:430px){
  #calculator .calculator-event-grid>label:has(#calculatorEventDate),
  #calculator .calculator-event-grid>label:has(#calculatorGuestCount){
    grid-column:1/-1!important;
    min-width:0!important;
  }
  #calculator #calculatorEventDate{
    width:100%!important;
    min-width:0!important;
    direction:ltr!important;
    text-align:left!important;
    padding-left:42px!important;
    padding-right:12px!important;
  }
  #calculator label.date-empty::after{
    display:none!important;
    content:none!important;
  }
  #calculator .calculator-event-grid .input-with-unit{
    width:100%!important;
    min-width:0!important;
  }
  #calculator .calculator-event-grid .input-with-unit input{
    flex:1 1 0!important;
    width:0!important;
    min-width:0!important;
    field-sizing:fixed!important;
  }
}

/* Authorization visibility must win over responsive nav display rules. */
.sidebar nav .nav-item.system-admin-only.hidden{display:none!important;}

/* Keep the settings content genuinely LTR in English without changing its grid composition. */
html[dir="ltr"] #settings.settings-page,
html[dir="ltr"] #settings .settings-rail,
html[dir="ltr"] #settings .settings-main{
  direction:ltr!important;
}
html[dir="ltr"] #settings .settings-quick-nav button{
  text-align:left!important;
}

/* Reserve a stable icon gutter for search controls after every page-level cascade. */
html[dir="ltr"] .events-search-control input,
html[dir="ltr"] .customers-search-control input,
html[dir="ltr"] #quotes.quotes-page .quotes-search-control input{
  padding-left:44px!important;
  padding-right:12px!important;
}
html[dir="ltr"] .events-search-control svg,
html[dir="ltr"] .customers-search-control svg,
html[dir="ltr"] #quotes.quotes-page .quotes-search-control svg{
  left:14px!important;
  right:auto!important;
  inset-inline-start:14px!important;
  inset-inline-end:auto!important;
}
html[dir="rtl"] .events-search-control input,
html[dir="rtl"] .customers-search-control input,
html[dir="rtl"] #quotes.quotes-page .quotes-search-control input{
  padding-right:44px!important;
  padding-left:12px!important;
}
html[dir="rtl"] .events-search-control svg,
html[dir="rtl"] .customers-search-control svg,
html[dir="rtl"] #quotes.quotes-page .quotes-search-control svg{
  right:14px!important;
  left:auto!important;
  inset-inline-start:14px!important;
  inset-inline-end:auto!important;
}
