/* Sfera CRM Projects v2.35.0 · final component composition
   All tones are the approved dashboard palette; no Basalt/NexLink colors. */

/* Portfolio: the two KPI surfaces are siblings on the page, NOT inside
   a white frame. The directory below is independently surfaced. */
#projects-view .projects-shell:not(.projects-shell--detail):has(.projects-dashboard-overview){
  width:100%!important;max-width:none!important;min-width:0!important;
  margin:0!important;padding:0 0 24px!important;
  border:0!important;border-radius:0!important;
  background:transparent!important;background-image:none!important;
  box-shadow:none!important;
}
#projects-view .projects-shell:not(.projects-shell--detail):has(.projects-dashboard-overview) [data-projects-content],
#projects-view .projects-shell:not(.projects-shell--detail) .projects-dashboard-overview{
  width:100%!important;max-width:none!important;min-width:0!important;
  margin-left:0!important;margin-right:0!important;padding:0!important;
  background:transparent!important;border:0!important;box-shadow:none!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-dashboard-overview{
  display:grid!important;grid-template-columns:minmax(0,1.55fr) minmax(310px,.87fr)!important;
  align-items:stretch!important;gap:15px!important;margin-bottom:17px!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) :is(.projects-health-feature,.projects-workload-feature){
  border:1px solid #e2eaf5!important;border-radius:17px!important;
  background:#fff!important;box-shadow:0 8px 22px rgba(24,55,95,.045)!important;
}
#projects-view .projects-shell:not(.projects-shell--detail) .projects-feature-title{
  display:block!important;margin:0 0 7px!important;padding:0!important;
  background:transparent!important;border:0!important;box-shadow:none!important;
  font:650 15px/1.35 Poppins,"Open Sans",sans-serif!important;
  color:#173566!important;letter-spacing:-.015em!important;
}
#projects-view .projects-health-feature--compact .projects-health-feature__total{
  align-self:center!important;min-height:103px!important;
}
#projects-view .projects-health-feature--compact .projects-health-feature__total>strong{
  margin:7px 0 3px!important;
}
#projects-view .projects-workload-feature .projects-workload-feature__primary{
  margin:0 52px 17px 0!important;
}
#projects-view .projects-workload-feature .projects-workload-feature__primary>strong{
  display:block;margin:4px 0 5px!important;
}
#projects-view .projects-health-feature--compact .projects-feature-icon{
  width:40px!important;height:40px!important;min-width:40px!important;
  background:#0e2166!important;color:#fff!important;
}
/* The portfolio contextual chat action comes from a separate action enhancer:
   normalize EVERY cell-level icon target, not only the original buttons. */
#projects-view .projects-directory td[data-label="Azioni"] .projects-row-actions{
  display:flex!important;align-items:center!important;justify-content:flex-end!important;
  flex-wrap:nowrap!important;gap:7px!important;min-width:max-content!important;
}
#projects-view .projects-directory td[data-label="Azioni"] :is(button,a,[role="button"]){
  display:inline-grid!important;place-items:center!important;box-sizing:border-box!important;
  flex:0 0 37px!important;width:37px!important;min-width:37px!important;
  max-width:37px!important;height:37px!important;min-height:37px!important;max-height:37px!important;
  margin:0!important;padding:0!important;
  border-radius:10px!important;line-height:0!important;
}
#projects-view .projects-directory td[data-label="Azioni"] :is(button,a,[role="button"]) :is(svg,svg *) {
  transform:none!important;
}
#projects-view .projects-directory td[data-label="Azioni"] :is(button,a,[role="button"])>svg,
#projects-view .projects-directory td[data-label="Azioni"] :is(button,a,[role="button"]) svg{
  display:block!important;width:17px!important;height:17px!important;
  min-width:17px!important;max-width:17px!important;min-height:17px!important;max-height:17px!important;
  margin:0!important;stroke-width:1.8!important;flex:0 0 17px!important;
}

/* Project identity: top line is name/status + actions; second line is a
   4-column fact strip which spans the full card. */
#projects-view .projects-shell--detail .projects-detail__top.sfera-pd-hero{
  display:flex!important;flex-direction:column!important;
  align-items:stretch!important;justify-content:space-between!important;
  width:100%!important;max-width:none!important;gap:0!important;
  padding:20px clamp(18px,2vw,27px) 18px!important;
  background:#fff!important;box-shadow:0 6px 20px rgba(22,47,94,.045)!important;
}
#projects-view .projects-shell--detail .sfera-pd-hero__primary{
  display:flex!important;flex-wrap:nowrap!important;
  justify-content:space-between!important;align-items:center!important;
  width:100%!important;min-width:0!important;gap:20px!important;
}
#projects-view .projects-shell--detail .sfera-pd-hero__identity{
  display:flex!important;align-items:center!important;flex:1 1 auto!important;
  min-width:0!important;width:auto!important;margin:0!important;padding:0!important;
}
#projects-view .projects-shell--detail .sfera-pd-hero__headline{min-width:0!important}
#projects-view .projects-shell--detail .sfera-pd-hero__identity h1{
  margin:0!important;max-width:100%!important;
  font:650 clamp(23px,2.15vw,30px)/1.2 Poppins,sans-serif!important;
  letter-spacing:-.03em!important;
}
#projects-view .projects-shell--detail .sfera-pd-hero__status{
  display:flex!important;flex-wrap:wrap!important;gap:7px!important;margin:11px 0 0!important;
}
#projects-view .projects-shell--detail .sfera-pd-header-controls{
  display:flex!important;align-items:center!important;justify-content:flex-end!important;
  flex:0 0 auto!important;align-self:center!important;min-width:0!important;
  margin:0!important;padding:0!important;
}
#projects-view .projects-shell--detail .sfera-pd-header-controls .projects-actions{
  display:flex!important;align-items:center!important;justify-content:flex-end!important;
  flex-wrap:wrap!important;gap:8px!important;
}
#projects-view .projects-shell--detail .sfera-pd-header-controls .projects-actions>button{
  min-width:38px!important;max-width:38px!important;
  width:38px!important;height:38px!important;min-height:38px!important;max-height:38px!important;
  padding:0!important;margin:0!important;display:inline-grid!important;place-items:center!important;
  border-radius:10px!important;flex:0 0 38px!important;
}
#projects-view .projects-shell--detail .sfera-pd-hero__facts{
  display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;
  width:100%!important;max-width:none!important;align-items:start!important;
  gap:0!important;margin:18px 0 0!important;padding:15px 0 0!important;
  border-top:1px solid #eaf0f6!important;
}
#projects-view .projects-shell--detail .sfera-pd-hero__facts>div,
#projects-view .projects-shell--detail .sfera-pd-hero__facts>div:first-child{
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:5px!important;
  min-width:0!important;max-width:none!important;
  margin:0!important;padding:0 18px!important;
  border:0!important;background:transparent!important;
}
#projects-view .projects-shell--detail .sfera-pd-hero__facts>div:first-child{
  padding-left:0!important;
}
#projects-view .projects-shell--detail .sfera-pd-hero__facts>div+div{
  border-left:1px solid #e6edf6!important;
}
#projects-view .projects-shell--detail .sfera-pd-hero__facts span{
  color:#8397af!important;font:550 10px/1.35 "Open Sans",sans-serif!important;
}
#projects-view .projects-shell--detail .sfera-pd-hero__facts strong{
  color:#284e7d!important;font:600 12px/1.45 "Open Sans",sans-serif!important;
  overflow-wrap:anywhere!important;
}

/* History rail: solid opaque surfaces with clearly separated data rows.
   No translucent nested "cards" or low-opacity text. */
#projects-view .projects-shell--detail .sfera-pd-history-insights{
  opacity:1!important;visibility:visible!important;
  background:#fff!important;background-image:none!important;
  border:1px solid #e1e9f5!important;backdrop-filter:none!important;
  box-shadow:0 7px 22px rgba(20,46,90,.045)!important;
  overflow:hidden!important;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__section,
#projects-view .projects-shell--detail .sfera-pd-history-insights__actor,
#projects-view .projects-shell--detail .sfera-pd-history-insights__days{
  opacity:1!important;background:#fff!important;background-image:none!important;
  backdrop-filter:none!important;box-shadow:none!important;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__section{
  padding:16px 0 0!important;gap:0!important;
  border:0!important;border-radius:0!important;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__section+.sfera-pd-history-insights__section{
  border-top:1px solid #e7edf5!important;margin-top:15px!important;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__section-heading{
  margin:0 0 13px!important;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__section-heading h3{
  color:#153869!important;font:650 12px/1.35 Poppins,sans-serif!important;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__section-heading span{
  color:#6883a2!important;font-weight:550!important;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__actor{
  display:grid!important;gap:6px!important;padding:10px 0 11px!important;
  border:0!important;border-bottom:1px solid #edf1f7!important;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__actor:last-of-type{
  border-bottom:0!important;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__actor>div:first-child span{
  color:#355779!important;font:600 11px/1.4 "Open Sans",sans-serif!important;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__actor>div:first-child strong{
  color:#123767!important;font:650 12px Poppins,sans-serif!important;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__actor>small{
  color:#718ca8!important;font:500 10px/1.4 "Open Sans",sans-serif!important;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__track{
  opacity:1!important;background:#e5edf7!important;height:6px!important;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__track i{
  background:#4587dc!important;opacity:1!important;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__days i{
  opacity:1!important;background:#5492e0!important;
}
#projects-view .projects-shell--detail .sfera-pd-history-insights__days strong{
  color:#385e8b!important;
}

/* The Template tabs follow Timeline / Registro / Ritmo: navy selection,
   white text and a calm neutral rail, never white-on-grey selected. */
#projects-dialog.projects-template-studio .projects-template-studio__tabs{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  width:100%!important;max-width:none!important;gap:5px!important;
  padding:5px!important;margin:0 0 15px!important;
  border:1px solid #e0e9f4!important;border-radius:12px!important;
  background:#eef3f9!important;box-shadow:none!important;
}
#projects-dialog.projects-template-studio .projects-template-studio__tabs>button{
  display:grid!important;place-items:center!important;
  width:100%!important;min-width:0!important;height:43px!important;
  min-height:43px!important;margin:0!important;padding:9px 15px!important;
  border:0!important;border-radius:9px!important;
  color:#657b9d!important;background:transparent!important;
  font:650 12px/1.3 Poppins,sans-serif!important;
  box-shadow:none!important;
  transition:background .18s ease,color .18s ease,box-shadow .18s ease!important;
}
#projects-dialog.projects-template-studio .projects-template-studio__tabs>button[aria-selected="true"],
#projects-dialog.projects-template-studio .projects-template-studio__tabs>button[aria-selected="true"]:hover{
  background:#0e2166!important;color:#fff!important;
  box-shadow:0 3px 9px rgba(14,33,102,.16)!important;
}
#projects-dialog.projects-template-studio .projects-template-studio__tabs>button[aria-selected="false"]:hover{
  background:#e4edf8!important;color:#0e2166!important;
}

/* General data: one refined form with balanced columns and aligned controls. */
#projects-dialog.projects-template-studio .sfera-template-settings{
  width:100%!important;max-width:none!important;
  margin:0!important;padding:clamp(17px,2vw,26px)!important;
  background:#fff!important;border:1px solid #e1eaf5!important;border-radius:15px!important;
  box-shadow:0 5px 18px rgba(21,46,89,.035)!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__heading{
  align-items:center!important;margin:0 0 19px!important;padding:0 0 15px!important;
  background:#fff!important;border-bottom:1px solid #edf1f7!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__heading h3{
  color:#143766!important;font:650 16px/1.3 Poppins,sans-serif!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__heading p{
  color:#8195ad!important;font:450 11px/1.4 "Open Sans",sans-serif!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__columns{
  display:grid!important;grid-template-columns:minmax(0,1.45fr) minmax(260px,1fr)!important;
  gap:clamp(22px,3vw,42px)!important;align-items:start!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__identity,
#projects-dialog.projects-template-studio .sfera-template-settings__configuration{
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:15px!important;
  align-content:start!important;min-width:0!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__configuration{
  padding-left:clamp(18px,2.2vw,30px)!important;
  border-left:1px solid #e9eff7!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__columns h4{
  margin:0 0 2px!important;padding:0!important;
  font:650 13px/1.35 Poppins,sans-serif!important;color:#244777!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__columns .sfera-template-field{
  min-width:0!important;gap:8px!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__columns .sfera-template-field>span{
  min-height:17px!important;margin:0!important;
  font:600 11px/1.3 "Open Sans",sans-serif!important;color:#526e91!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__columns .sfera-template-field :is(input:not([type="hidden"]),textarea){
  display:block!important;width:100%!important;box-sizing:border-box!important;
  min-height:45px!important;margin:0!important;padding:10px 13px!important;
  border:1px solid #dce5f2!important;border-radius:10px!important;
  background:#fff!important;color:#1b406d!important;
  font:500 12px/1.5 "Open Sans",sans-serif!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__columns .sfera-template-settings__description textarea{
  min-height:147px!important;resize:vertical!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__configuration .sfera-template-switch{
  margin-top:5px!important;min-height:69px!important;
  background:#f7faff!important;border:1px solid #e3ebf5!important;
  border-radius:10px!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__note{
  margin:19px 0 0!important;padding:13px 0 0!important;
  border-top:1px solid #eaf0f7!important;color:#6984a4!important;
}

/* Fully custom HTML/CSS select — its hidden input remains the actual form
   value and the accessible listbox handles keyboard navigation. */
#projects-dialog.projects-template-studio .sfera-template-choice{
  position:relative!important;min-width:0!important;width:100%!important;
}
#projects-dialog.projects-template-studio .sfera-template-choice input[type="hidden"]{
  display:none!important;width:0!important;height:0!important;min-height:0!important;padding:0!important;
}
#projects-dialog.projects-template-studio .sfera-template-choice__trigger{
  display:flex!important;align-items:center!important;justify-content:space-between!important;
  gap:12px!important;width:100%!important;min-height:45px!important;
  margin:0!important;padding:10px 13px!important;
  border:1px solid #dce5f2!important;border-radius:10px!important;
  background:#fff!important;box-shadow:none!important;
  color:#254b7b!important;text-align:left!important;
  font:550 12px/1.35 "Open Sans",sans-serif!important;
  transition:border-color .16s ease,box-shadow .16s ease!important;
}
#projects-dialog.projects-template-studio .sfera-template-choice__trigger svg{
  width:17px!important;height:17px!important;flex:0 0 17px!important;
  fill:none!important;stroke:#587da9!important;stroke-width:1.85!important;
  transition:transform .16s ease!important;
}
#projects-dialog.projects-template-studio .sfera-template-choice.is-open .sfera-template-choice__trigger{
  border-color:#83b4f0!important;box-shadow:0 0 0 3px #eaf3ff!important;
}
#projects-dialog.projects-template-studio .sfera-template-choice.is-open .sfera-template-choice__trigger svg{
  transform:rotate(180deg)!important;
}
#projects-dialog.projects-template-studio .sfera-template-choice__options{
  position:absolute!important;top:calc(100% + 6px)!important;left:0!important;right:0!important;
  z-index:110!important;display:grid!important;gap:4px!important;
  padding:6px!important;border:1px solid #dce7f5!important;border-radius:11px!important;
  background:#fff!important;box-shadow:0 12px 28px rgba(24,50,98,.13)!important;
}
#projects-dialog.projects-template-studio .sfera-template-choice__options[hidden]{
  display:none!important;
}
#projects-dialog.projects-template-studio .sfera-template-choice__options button{
  display:flex!important;flex-direction:column!important;align-items:flex-start!important;
  gap:3px!important;min-height:52px!important;width:100%!important;
  margin:0!important;padding:9px 11px!important;border:0!important;
  border-radius:8px!important;background:#fff!important;box-shadow:none!important;
  text-align:left!important;
}
#projects-dialog.projects-template-studio .sfera-template-choice__options button:hover,
#projects-dialog.projects-template-studio .sfera-template-choice__options button:focus-visible{
  background:#eef6ff!important;outline:2px solid transparent!important;
}
#projects-dialog.projects-template-studio .sfera-template-choice__options button[aria-selected="true"]{
  background:#edf5ff!important;
}
#projects-dialog.projects-template-studio .sfera-template-choice__options button strong{
  font:650 11px/1.3 Poppins,sans-serif!important;color:#234975!important;
}
#projects-dialog.projects-template-studio .sfera-template-choice__options button small{
  font:450 10px/1.3 "Open Sans",sans-serif!important;color:#7c90aa!important;
}

/* Task tab: a clear navigation rail and a single flat editing canvas.
   Strip old nested cards and dark heading inherited from legacy style sheets. */
#projects-dialog.projects-template-studio .sfera-template-workspace{
  grid-template-columns:minmax(245px,300px) minmax(0,1fr)!important;
  gap:14px!important;min-width:0!important;
}
#projects-dialog.projects-template-studio .sfera-template-task-nav,
#projects-dialog.projects-template-studio .sfera-template-editor{
  background:#fff!important;opacity:1!important;box-shadow:0 5px 17px rgba(22,48,93,.038)!important;
}
#projects-dialog.projects-template-studio .sfera-template-editor__header{
  display:flex!important;align-items:center!important;justify-content:space-between!important;
  min-height:80px!important;padding:16px 20px!important;margin:0!important;
  background:#fff!important;background-image:none!important;
  border:0!important;border-bottom:1px solid #e7edf6!important;
  border-radius:15px 15px 0 0!important;box-shadow:none!important;
}
#projects-dialog.projects-template-studio .sfera-template-editor__heading{
  min-width:0!important;
}
#projects-dialog.projects-template-studio .sfera-template-editor__heading h3{
  color:#0e2166!important;font:650 17px/1.3 Poppins,sans-serif!important;
}
#projects-dialog.projects-template-studio .sfera-template-editor__heading p{
  color:#718aa8!important;font:450 10px/1.45 "Open Sans",sans-serif!important;
}
#projects-dialog.projects-template-studio .sfera-template-editor__scroll{
  padding:0!important;background:#fff!important;
}
#projects-dialog.projects-template-studio .sfera-template-editor__grid{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:0!important;align-items:start!important;background:#fff!important;
}
#projects-dialog.projects-template-studio .sfera-template-editor__grid>.sfera-template-surface{
  margin:0!important;padding:19px 20px!important;
  background:#fff!important;border:0!important;border-radius:0!important;
  box-shadow:none!important;min-width:0!important;
}
#projects-dialog.projects-template-studio .sfera-template-editor__grid>.sfera-template-task-content{
  grid-column:1/-1!important;grid-row:auto!important;
  border-bottom:1px solid #e9eff7!important;
}
#projects-dialog.projects-template-studio .sfera-template-editor__grid>.sfera-template-task-content textarea{
  min-height:112px!important;
}
#projects-dialog.projects-template-studio .sfera-template-editor__grid>.sfera-template-task-people{
  grid-column:1!important;grid-row:auto!important;
  border-right:1px solid #e9eff7!important;
}
#projects-dialog.projects-template-studio .sfera-template-editor__grid>.sfera-template-task-planning{
  grid-column:2!important;grid-row:auto!important;
}
#projects-dialog.projects-template-studio .sfera-template-editor__grid>.sfera-template-related{
  grid-column:1/-1!important;grid-row:auto!important;
  border-top:1px solid #e9eff7!important;
}
#projects-dialog.projects-template-studio .sfera-template-editor__grid>.sfera-template-technical{
  grid-column:1/-1!important;grid-row:auto!important;
  border-top:1px solid #e9eff7!important;border-radius:0!important;
  margin:0!important;box-shadow:none!important;
}
#projects-dialog.projects-template-studio .sfera-template-editor__grid .sfera-template-section-heading{
  padding:0 0 10px!important;margin:0 0 14px!important;
  background:#fff!important;border-bottom:1px solid #edf1f6!important;
}
#projects-dialog.projects-template-studio .sfera-template-editor__grid .sfera-template-section-heading :is(h4,h3){
  font:650 13px/1.35 Poppins,sans-serif!important;color:#254977!important;
}
#projects-dialog.projects-template-studio .sfera-template-editor__grid .sfera-template-section-heading p{
  font:450 10px/1.35 "Open Sans",sans-serif!important;color:#8399b1!important;
}
#projects-dialog.projects-template-studio .sfera-template-task-nav__header{
  border-bottom:1px solid #edf1f7!important;margin-bottom:8px!important;
}
#projects-dialog.projects-template-studio .sfera-template-tree__group-heading{
  background:#f2f6fc!important;
}
#projects-dialog.projects-template-studio .sfera-template-tree__node .sfera-template-task-nav__item.is-selected{
  background:#eaf3ff!important;color:#0e2166!important;
}

/* Tablet/mobile behavior follows the same hierarchy without clipping controls. */
@media(max-width:1200px){
  #projects-view .projects-shell:not(.projects-shell--detail) .projects-dashboard-overview{
    grid-template-columns:minmax(0,1.25fr) minmax(280px,.85fr)!important;
  }
  #projects-dialog.projects-template-studio .sfera-template-settings__columns{
    grid-template-columns:minmax(0,1.2fr) minmax(240px,1fr)!important;
    gap:20px!important;
  }
}
@media(max-width:920px){
  #projects-view .projects-shell:not(.projects-shell--detail) .projects-dashboard-overview{
    grid-template-columns:minmax(0,1fr)!important;
  }
  #projects-view .projects-shell--detail .sfera-pd-hero__primary{
    align-items:flex-start!important;
  }
  #projects-view .projects-shell--detail .sfera-pd-hero__facts{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    row-gap:16px!important;
  }
  #projects-view .projects-shell--detail .sfera-pd-hero__facts>div:nth-child(odd){
    padding-left:0!important;border-left:0!important;
  }
  #projects-dialog.projects-template-studio .sfera-template-editor__grid{
    grid-template-columns:minmax(0,1fr)!important;
  }
  #projects-dialog.projects-template-studio .sfera-template-editor__grid>.sfera-template-task-people,
  #projects-dialog.projects-template-studio .sfera-template-editor__grid>.sfera-template-task-planning{
    grid-column:1!important;grid-row:auto!important;border-right:0!important;
    border-bottom:1px solid #e9eff7!important;
  }
}
@media(max-width:760px){
  #projects-view .projects-shell--detail .sfera-pd-hero__primary{
    flex-direction:column!important;gap:14px!important;
  }
  #projects-view .projects-shell--detail .sfera-pd-header-controls{
    align-self:flex-start!important;width:100%!important;justify-content:flex-start!important;
  }
  #projects-view .projects-shell--detail .sfera-pd-header-controls .projects-actions{
    justify-content:flex-start!important;
  }
  #projects-dialog.projects-template-studio .sfera-template-settings__columns{
    grid-template-columns:minmax(0,1fr)!important;gap:18px!important;
  }
  #projects-dialog.projects-template-studio .sfera-template-settings__configuration{
    padding:18px 0 0!important;border-left:0!important;
    border-top:1px solid #e9eff7!important;
  }
  #projects-dialog.projects-template-studio .sfera-template-workspace{
    grid-template-columns:minmax(0,1fr)!important;
  }
  #projects-dialog.projects-template-studio .sfera-template-editor__grid{
    grid-template-columns:minmax(0,1fr)!important;
  }
}
@media(max-width:480px){
  #projects-view .projects-shell--detail .sfera-pd-hero__facts{
    grid-template-columns:minmax(0,1fr)!important;gap:11px!important;
  }
  #projects-view .projects-shell--detail .sfera-pd-hero__facts>div,
  #projects-view .projects-shell--detail .sfera-pd-hero__facts>div+div{
    padding:0!important;border-left:0!important;
  }
  #projects-dialog.projects-template-studio .sfera-template-settings{
    padding:14px!important;
  }
  #projects-dialog.projects-template-studio .sfera-template-settings__heading{
    align-items:flex-start!important;
  }
  #projects-dialog.projects-template-studio .sfera-template-settings__count{
    align-self:flex-start!important;
  }
}
@media(prefers-reduced-motion:reduce){
  #projects-dialog.projects-template-studio .sfera-template-choice__trigger,
  #projects-dialog.projects-template-studio .sfera-template-choice__trigger svg,
  #projects-dialog.projects-template-studio .projects-template-studio__tabs>button,
  #projects-dialog.projects-template-studio .sfera-template-choice__options button{
    transition:none!important;animation:none!important;
  }
}


/* v2.35.1 / project drawer — status belongs on one compact toolbar, not
   a row of stretched cards. Reset inherited dashboard drawer flex sizing. */
#projects-workstream-drawer .sfera-pd-drawer-tools{
  display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;align-content:center!important;
  gap:9px!important;min-height:0!important;height:auto!important;
  padding:9px 16px!important;
  background:#f5f8fc!important;border-bottom:1px solid #e5edf6!important;
}
#projects-workstream-drawer .sfera-pd-drawer-tools .dashboard-team-drawer__status{
  display:flex!important;flex:initial!important;flex-wrap:wrap!important;
  align-items:center!important;align-content:center!important;
  justify-content:flex-start!important;gap:6px!important;
  width:auto!important;min-width:0!important;max-width:none!important;
  min-height:0!important;height:auto!important;max-height:none!important;
  margin:0!important;padding:0!important;
  background:transparent!important;border:0!important;
}
#projects-workstream-drawer .sfera-pd-drawer-tools .dashboard-team-drawer__status>span{
  display:inline-flex!important;flex:0 0 auto!important;
  align-items:center!important;justify-content:center!important;
  align-self:center!important;gap:5px!important;
  box-sizing:border-box!important;
  height:28px!important;min-height:28px!important;max-height:28px!important;
  margin:0!important;padding:0 10px!important;
  line-height:1!important;white-space:nowrap!important;
  font:550 10px/1 "Open Sans",sans-serif!important;
  border-radius:8px!important;
}
#projects-workstream-drawer .sfera-pd-drawer-tools .dashboard-team-drawer__status>span strong{
  font:650 12px/1 Poppins,"Open Sans",sans-serif!important;
  color:inherit!important;
}
#projects-workstream-drawer .sfera-pd-drawer-tools .sfera-pd-drawer-toggle{
  display:inline-flex!important;justify-self:end!important;align-self:center!important;
  align-items:center!important;flex:0 0 auto!important;
  width:auto!important;max-width:none!important;
  height:29px!important;min-height:29px!important;max-height:29px!important;
  margin:0!important;padding:0!important;gap:8px!important;
  line-height:1.2!important;white-space:nowrap!important;
}
#projects-workstream-drawer .sfera-pd-drawer-tools .sfera-pd-drawer-toggle__label{
  font:550 11px/1.2 "Open Sans",sans-serif!important;color:#355b85!important;
}
#projects-workstream-drawer .sfera-pd-drawer-tools .sfera-pd-drawer-toggle__switch{
  box-sizing:border-box!important;flex:0 0 33px!important;
  width:33px!important;height:19px!important;
}
#projects-workstream-drawer .sfera-pd-drawer-tools .sfera-pd-drawer-toggle__switch::after{
  width:13px!important;height:13px!important;
}
#projects-workstream-drawer .sfera-pd-drawer-tools .sfera-pd-drawer-toggle input:checked+.sfera-pd-drawer-toggle__switch::after{
  transform:translateX(14px)!important;
}

/* v2.35.1 / Template: the source of the collision was two nested grid systems
   interacting with historic positioning rules. Each column is a single vertical
   stack; reset child placement instead of adding another grid on top. */
#projects-dialog.projects-template-studio .sfera-template-settings__columns{
  display:grid!important;grid-template-columns:minmax(0,1.18fr) minmax(0,.82fr)!important;
  align-items:start!important;column-gap:clamp(22px,2.8vw,38px)!important;
  row-gap:18px!important;min-width:0!important;max-width:100%!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__columns>.sfera-template-settings__identity,
#projects-dialog.projects-template-studio .sfera-template-settings__columns>.sfera-template-settings__configuration{
  display:flex!important;flex-direction:column!important;flex-wrap:nowrap!important;
  align-items:stretch!important;justify-content:flex-start!important;
  gap:16px!important;width:100%!important;max-width:100%!important;
  min-width:0!important;margin:0!important;
  grid-row:auto!important;grid-column:auto!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__columns>.sfera-template-settings__configuration{
  border-left:1px solid #e7eef6!important;
  padding:0 0 0 clamp(18px,2vw,29px)!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__columns :is(h4,.sfera-template-field,.sfera-template-switch){
  position:static!important;float:none!important;
  grid-area:auto!important;grid-row:auto!important;grid-column:auto!important;
  align-self:stretch!important;place-self:auto!important;
  box-sizing:border-box!important;width:100%!important;max-width:100%!important;
  min-width:0!important;margin:0!important;
  transform:none!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__columns h4{
  display:block!important;flex:0 0 auto!important;
  min-height:0!important;height:auto!important;
  padding:0 0 11px!important;margin:0!important;
  border-bottom:1px solid #e9eff6!important;
  font:650 13px/1.4 Poppins,"Open Sans",sans-serif!important;
  color:#264a79!important;
  overflow-wrap:break-word!important;
  white-space:normal!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__columns .sfera-template-field{
  display:flex!important;flex-direction:column!important;
  align-items:stretch!important;gap:8px!important;
  height:auto!important;min-height:0!important;
  padding:0!important;background:transparent!important;border:0!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__columns .sfera-template-field>span{
  display:flex!important;flex-wrap:wrap!important;align-items:center!important;
  gap:4px!important;position:static!important;
  width:100%!important;min-width:0!important;max-width:100%!important;
  min-height:0!important;height:auto!important;margin:0!important;
  padding:0!important;font:600 11px/1.35 "Open Sans",sans-serif!important;
  overflow-wrap:break-word!important;white-space:normal!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__columns .sfera-template-field :is(input:not([type="hidden"]),textarea,.sfera-template-choice){
  box-sizing:border-box!important;position:relative!important;
  width:100%!important;max-width:100%!important;min-width:0!important;
  margin:0!important;grid-area:auto!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__columns .sfera-template-settings__description textarea{
  min-height:136px!important;height:auto!important;resize:vertical!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__columns .sfera-template-settings__configuration .sfera-template-switch{
  display:flex!important;align-items:center!important;justify-content:space-between!important;
  flex-direction:row!important;gap:12px!important;
  min-height:65px!important;height:auto!important;
  padding:12px 14px!important;
  background:#f6f9fe!important;border:1px solid #e1eaf6!important;
  border-radius:10px!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__configuration .sfera-template-choice__options{
  top:calc(100% + 6px)!important;max-width:100%!important;
  overflow-x:hidden!important;z-index:160!important;
}
#projects-dialog.projects-template-studio .sfera-template-settings__columns .sfera-template-switch>span{
  display:flex!important;flex-direction:column!important;
  align-items:flex-start!important;gap:4px!important;
  min-width:0!important;width:auto!important;
}

/* Shared modal audit: prevent field overflow and accidental horizontal
   scrolling in create/edit project, task, confirmation and Template dialogs. */
#projects-dialog:not([hidden]) .task-v2-dialog{
  min-width:0!important;box-sizing:border-box!important;
}
#projects-dialog:not([hidden]) .task-v2-dialog__body{
  min-width:0!important;overflow-x:hidden!important;
}
#projects-dialog:not([hidden]) :is(.projects-form-grid,.task-v2-form-section,.task-v3-form-section,.projects-field){
  min-width:0!important;max-width:100%!important;box-sizing:border-box!important;
}
#projects-dialog:not([hidden]) .projects-field :is(input:not([type="checkbox"]),select,textarea){
  min-width:0!important;max-width:100%!important;box-sizing:border-box!important;
}
#projects-dialog:not([hidden]) :is(.projects-close,.task-v2-icon-button):focus-visible,
#projects-workstream-drawer :is(.dashboard-team-drawer__close,.sfera-pd-drawer-toggle input):focus-visible{
  outline:2px solid #0b7ff0!important;outline-offset:2px!important;
}
#projects-dialog .projects-force-completion{
  display:flex!important;flex-direction:column!important;align-items:flex-start!important;
  gap:8px!important;
}
#projects-dialog .projects-force-completion__check{
  display:flex!important;align-items:center!important;gap:9px!important;
  min-height:36px!important;cursor:pointer!important;
  font:550 12px/1.4 "Open Sans",sans-serif!important;
  color:#3d5f89!important;
}
#projects-dialog .projects-force-completion__check input{
  flex:0 0 auto!important;accent-color:#0b7ff0!important;
}

/* Narrow drawers: retain the badge row but move the toggle to a right-aligned
   second line rather than stretching each badge to occupy the available height. */
@media(max-width:720px){
  #projects-workstream-drawer .sfera-pd-drawer-tools{
    grid-template-columns:minmax(0,1fr)!important;
    gap:7px!important;padding:9px 12px!important;
  }
  #projects-workstream-drawer .sfera-pd-drawer-tools .sfera-pd-drawer-toggle{
    justify-self:end!important;
  }
  #projects-dialog.projects-template-studio .sfera-template-settings__columns{
    grid-template-columns:minmax(0,1fr)!important;
  }
  #projects-dialog.projects-template-studio .sfera-template-settings__columns>.sfera-template-settings__configuration{
    border-left:0!important;border-top:1px solid #e7eef6!important;
    padding:17px 0 0!important;
  }
}
@media(max-width:400px){
  #projects-workstream-drawer .sfera-pd-drawer-tools .dashboard-team-drawer__status>span{
    height:27px!important;min-height:27px!important;max-height:27px!important;
    padding:0 8px!important;font-size:9.5px!important;
  }
}
@media(prefers-reduced-motion:reduce){
  #projects-dialog:not([hidden]) *,
  #projects-workstream-drawer:not([hidden]) *{
    transition:none!important;animation:none!important;scroll-behavior:auto!important;
  }
}
