/* PLATFORM_APPEARANCE_V3_SAFE_CONTROLS_20260919
   Expanded controls are intentionally scoped. Responsive rules below 1251px
   remain owned by v1-main-map-shell.css so Appearance cannot break mobile or
   compact desktop layouts. */
:root{
  --af-page-title:var(--af-site-page-title,var(--af-site-text));
  --af-page-subtitle:var(--af-site-page-subtitle,var(--af-site-muted));
  --af-label-text:var(--af-site-label-text,var(--af-site-muted));
}

#af-main-workspace[data-dashboard-v1] :is(
  .heading-row h1,.page-heading h1,.v1-panel-head h2,.v1-panel-head h3,
  .card-head h2,.card-head h3
),
.sa-app :is(.sa-panel-head h2,.sa-panel-head h3){
  color:var(--af-page-title)!important;
}

#af-main-workspace[data-dashboard-v1] :is(
  .heading-row p,.page-heading p,.v1-panel-head p,.card-head p,.field-help
),
.sa-app :is(.sa-panel-sub,.sa-field-help){
  color:var(--af-page-subtitle)!important;
}

#af-main-workspace[data-dashboard-v1] :is(
  .af-project-label,.field-label,.form-label,.tenant-picker-copy>small
),
.sa-app :is(.sa-field>label,.sa-appearance-color>label){
  color:var(--af-label-text)!important;
}

:is(.master-canvas,.optical-v2__canvas,.af-canvas-shell,.canvas-shell){
  color:var(--af-site-canvas-text)!important;
  border-color:var(--af-site-canvas-border)!important;
}
:is(.master-canvas,.optical-v2__canvas,.af-canvas-shell,.canvas-shell) :is(h1,h2,h3,strong){
  color:var(--af-site-canvas-title)!important;
}
:is(.master-canvas,.optical-v2__canvas,.af-canvas-shell,.canvas-shell) :is(p,small){
  color:var(--af-site-canvas-muted)!important;
}
:is(.master-canvas-node,.optical-v2__aside,.optical-v2__row-card,.af-canvas-panel,.canvas-panel){
  background:var(--af-site-canvas-panel)!important;
  color:var(--af-site-canvas-text)!important;
  border-color:var(--af-site-canvas-border)!important;
}

@media (min-width:1251px){
  #af-main-workspace[data-dashboard-v1]{
    grid-template-rows:var(--af-site-topbar-height) minmax(0,1fr) 26px!important;
  }

  #af-main-workspace[data-dashboard-v1] > .af-topbar{
    height:var(--af-site-topbar-height)!important;
    min-height:var(--af-site-topbar-height)!important;
    grid-template-columns:var(--af-overview-brand-width) minmax(320px,min(var(--af-project-context-isp-width),60vw)) minmax(0,1fr) auto!important;
  }
  #af-main-workspace[data-dashboard-v1].designer-context-shell > .af-topbar{
    grid-template-columns:var(--af-overview-brand-width) minmax(420px,min(var(--af-project-context-designer-width),64vw)) minmax(0,1fr) auto!important;
  }
  #af-main-workspace[data-dashboard-v1].designer-context-shell:has(.af-main-project-selectors.has-board-sheet) > .af-topbar{
    grid-template-columns:var(--af-overview-brand-width) minmax(560px,min(calc(var(--af-project-context-designer-width) + 120px),68vw)) minmax(0,1fr) auto!important;
  }

  #af-main-workspace[data-dashboard-v1] > .af-body{
    grid-template-columns:var(--af-site-nav-width) minmax(0,1fr)!important;
  }
  #af-main-workspace[data-dashboard-v1] > .af-body > .af-nav{
    width:var(--af-site-nav-width)!important;
    max-width:var(--af-site-nav-width)!important;
    box-sizing:border-box!important;
  }

  #af-main-workspace[data-dashboard-v1] .af-shell-collapse{
    left:var(--af-site-nav-width)!important;
  }
  #af-main-workspace[data-dashboard-v1] .v1-global-nav>a{
    min-height:var(--af-site-nav-item-height)!important;
    font-size:var(--af-site-nav-font-size)!important;
    white-space:nowrap!important;
  }

  #af-main-workspace[data-dashboard-v1].sidebar-collapsed > .af-body{
    grid-template-columns:var(--af-site-nav-collapsed-width) minmax(0,1fr)!important;
  }
  #af-main-workspace[data-dashboard-v1].sidebar-collapsed > .af-body > .af-nav{
    width:var(--af-site-nav-collapsed-width)!important;
    max-width:var(--af-site-nav-collapsed-width)!important;
  }
  #af-main-workspace[data-dashboard-v1].sidebar-collapsed .af-shell-collapse{
    left:var(--af-site-nav-collapsed-width)!important;
  }
  #af-main-workspace[data-dashboard-v1].sidebar-collapsed .af-nav .v1-global-nav>a{
    width:calc(var(--af-site-nav-collapsed-width) - 22px)!important;
    max-width:calc(100% - 12px)!important;
  }

  #af-main-workspace[data-dashboard-v1] > .af-body > .af-page-stage.content{
    padding:var(--af-site-page-padding) clamp(18px,2.4vw,38px) 42px!important;
  }

  #af-main-workspace[data-dashboard-v1] .af-main-project-picker{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    flex-basis:auto!important;
  }


  #af-main-workspace[data-dashboard-v1] .topbar-brand-fixed{
    width:var(--af-overview-brand-width)!important;
    flex-basis:var(--af-overview-brand-width)!important;
  }
  #af-main-workspace[data-dashboard-v1] .af-main-project-picker{
    height:var(--af-project-context-height)!important;
    min-height:var(--af-project-context-height)!important;
    padding:var(--af-project-context-padding-y) var(--af-project-context-padding-x)!important;
    border-radius:var(--af-project-context-radius)!important;
  }
  #af-main-workspace[data-dashboard-v1] .af-main-project-selectors :is(select,.project-select-trigger){
    height:var(--af-project-selector-height)!important;
    min-height:var(--af-project-selector-height)!important;
  }
  #af-main-workspace[data-dashboard-v1] .af-main-project-selectors .tenant-picker-copy>small,
  #af-main-workspace[data-dashboard-v1] .af-main-project-selectors .project-select-label{
    font-size:var(--af-project-label-font-size)!important;
  }
  #af-main-workspace[data-dashboard-v1] .af-main-project-selectors{
    gap:var(--af-project-selector-gap)!important;
  }
  #af-main-workspace[data-dashboard-v1] .af-main-project-selectors:not(.designer-project-context){
    grid-template-columns:var(--af-project-scope-width) minmax(var(--af-project-width),1fr)!important;
  }
  #af-main-workspace[data-dashboard-v1] .af-main-project-selectors.designer-project-context:not(.has-board-sheet){
    grid-template-columns:
      clamp(60px,calc(var(--af-project-scope-width) - 42px),var(--af-project-scope-width))
      var(--af-project-group-width)
      minmax(var(--af-project-width),1fr)!important;
  }
  #af-main-workspace[data-dashboard-v1] .af-main-project-selectors.designer-project-context.has-board-sheet{
    grid-template-columns:
      clamp(60px,calc(var(--af-project-scope-width) - 56px),var(--af-project-scope-width))
      clamp(70px,calc(var(--af-project-group-width) - 20px),var(--af-project-group-width))
      minmax(var(--af-project-width),1fr)
      minmax(var(--af-project-sheet-width),1fr)!important;
  }

  #af-main-workspace[data-dashboard-v1] .af-main-project-selectors :is(select,.project-select-trigger){
    font-size:var(--af-project-selector-font-size)!important;
    white-space:nowrap!important;
  }
  #af-main-workspace[data-dashboard-v1] .af-main-project-selectors :is(
    .tenant-picker-copy,.project-select-control,.project-select-trigger,.project-select-label
  ){
    min-width:0!important;
    max-width:100%!important;
  }
  #af-main-workspace[data-dashboard-v1] .af-main-project-selectors :is(
    .project-select-label,.tenant-picker-copy>small
  ){
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
}
