body.app-shell {
  --header-height:6.4rem;
  --nav-width:19rem;
  padding-top: var(--header-height);
}

.app-shell .marca {
  position: fixed;
  inset: 0 0 auto;
  height: var(--header-height);
  z-index: 40;
  padding: 0.7rem 2rem;
  gap: 1.4rem;
  justify-content: flex-start;
}

.app-shell .marca img {
  width: 17rem;
  max-width: none;
  height: 5rem;
  object-fit: contain;
}

.app-shell .marca .header-caption {
  margin-left: 1rem;
  font-size: 1.15rem;
  border-left: 1px solid #d9e3e9;
  padding-left: 2rem;
  color: #677e8c;
}

.app-shell .marca .header-user {
  margin-left: auto;
  font-size: 1.2rem;
  color: #436176;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

#toggle-sidebar {
  background: transparent;
  border: 1px solid #dbe5eb;
  color: #31566d;
  padding: 0.5rem 1rem;
  font-size: 2rem;
  line-height: 1.3;
}

.app-sidebar {
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  width: var(--nav-width);
  padding: 2rem 1.2rem;
  background: #f8fbfc;
  border-right: 1px solid #dce6eb;
  z-index: 35;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-label {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.14rem;
  color: #8497a2;
  margin: 0 1.1rem 1.5rem;
}

.app-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.app-sidebar a {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  text-decoration: none;
  padding: 1rem 0.8rem;
  color: #496476;
  font-size: 1.25rem;
  border-radius: 0.6rem;
  white-space: nowrap;
}

.app-sidebar a:hover {
  background: #edf3f5;
}

.app-sidebar a[aria-current] {
  color: #087e79;
  background: #e4f3ef;
  font-weight: 650;
  box-shadow: inset 3px 0 #0d9389;
}

.nav-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 2.4rem;
  font-size: 2.2rem;
  line-height: 1;
}

.nav-symbol svg {
  width: 2.4rem;
  height: 2.4rem;
  fill: currentColor;
  flex-shrink: 0;
}

.sidebar-logout {
  margin-top: auto;
  padding-top: 2rem;
}

.sidebar-logout button {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  width: 100%;
  padding: 1rem 0.8rem;
  border: 0;
  border-radius: 0.6rem;
  background: transparent;
  color: #496476;
  font-size: 1.25rem;
  text-align: left;
}

.sidebar-logout button:hover {
  background: #edf3f5;
}

.sidebar-compact .sidebar-logout button > span:last-child {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 760px) {
  .app-shell .sidebar-logout button > span:last-child {
    position: static;
    clip-path: none;
    width: auto;
    height: auto;
    overflow: visible;
  }
}
.sidebar-footer {
  margin: auto 0 0;
  padding-top: 3rem;
  font-size: 1rem;
  color: #879ba7;
  text-align: center;
}

.app-shell .app-content {
  margin-left: var(--nav-width);
}

.app-shell.sidebar-compact {
  --nav-width:6.6rem;
}

.sidebar-compact .app-sidebar a > span:last-child, .sidebar-compact .sidebar-label, .sidebar-compact .sidebar-footer {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.sidebar-compact .app-sidebar {
  padding: 2rem 0.8rem;
}

.sidebar-backdrop {
  position: fixed;
  inset: var(--header-height) 0 0;
  background: rgba(25, 59, 82, 0.4);
  z-index: 34;
  border-radius: 0;
}

.sidebar-backdrop[hidden] {
  display: none;
}

.has-workspace {
  height: 100dvh;
  overflow: hidden;
}

.has-workspace .app-content {
  height: calc(100dvh - var(--header-height));
  min-height: 0;
  overflow: hidden;
}

.app-shell main.workspace {
  max-width: none !important;
  height: 100%;
  min-height: 0;
  padding: 1.4rem 2rem 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workspace .lab-heading {
  flex: none;
  margin-bottom: 1rem;
  gap: 1rem;
}

.workspace .lab-heading h1 {
  font-size: 2.2rem;
  margin: 0.2rem 0;
}

.workspace .lab-heading .eyebrow, .workspace .lab-heading > div > p:not(.eyebrow) {
  display: none;
}

.workspace .lab-actions {
  flex-wrap: wrap;
}

.workspace .study-bar {
  flex: none;
  gap: 1.2rem;
  margin: 0 0 1rem;
  padding: 0 0 1rem;
}

.workspace .study-bar input {
  max-width: 24rem;
}

.workspace .study-bar span {
  font-size: 1.05rem;
}

.workspace .workspace-next {
  background: #e6f3f0;
  color: #087a74;
  white-space: nowrap;
  padding: 0.7rem 1.2rem;
  font-size: 1.15rem;
}

.workspace-tabs {
  display: flex;
  flex: none;
  gap: 0.4rem;
  overflow-x: auto;
  border-bottom: 1px solid #cddfe5;
  min-height: 4.2rem;
}

.workspace .workspace-tab {
  flex: none;
  background: transparent;
  color: #6d8292;
  border-radius: 0.6rem 0.6rem 0 0;
  border: 1px solid transparent;
  border-bottom: 3px solid transparent;
  font-size: 1.2rem;
  padding: 0.8rem 1.5rem;
}

.workspace-tab[aria-selected=true] {
  background: white !important;
  color: #0a7c76 !important;
  border-color: #d4e3e8 !important;
  border-bottom-color: #118d82 !important;
  font-weight: 650;
}

.workspace-stage {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 1.2rem 0;
}

.workspace-panel {
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.workspace-panel[hidden] {
  display: none !important;
}

.workspace .workspace-panel > .lab-card {
  margin: 0;
}

.workspace .lab-card {
  padding: 1.5rem;
  border-radius: 0.8rem;
  box-shadow: none;
}

.workspace-data {
  display: grid;
  grid-template-columns: minmax(25rem, 30rem) minmax(0, 1fr);
  gap: 1.4rem;
  overflow: hidden;
}

.workspace-data > .lab-card {
  overflow: auto;
  min-width: 0;
  min-height: 0;
  overscroll-behavior: contain;
}

.workspace .sheet-card {
  display: flex;
  flex-direction: column;
}

.workspace .sheet-card .data-grid {
  flex: 1;
  min-height: 8rem;
  max-height: none;
}

.workspace .sheet-tools {
  flex-wrap: wrap;
  gap: 0.8rem;
}

.workspace .sheet-card .section-label, .workspace .sheet-card .sheet-tools, .workspace .sheet-card .add-row, .workspace .sheet-card > .field-note {
  flex: none;
}

.workspace .data-grid td input {
  height: 3.6rem;
  padding: 0.7rem 1rem;
  font-size: 1.25rem;
}

.workspace .data-grid th {
  height: 3.8rem;
  font-size: 1.15rem;
}

.workspace-analysis {
  display: grid;
  grid-template-columns: minmax(29rem, 34rem) minmax(0, 1fr);
  gap: 1.4rem;
  overflow: hidden;
}

.workspace-analysis > .analysis-controls {
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
}

.workspace-analysis > .analysis-controls {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workspace-analysis-options {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 0.2rem 0.5rem 0.7rem 0;
  overscroll-behavior: contain;
}

.workspace-analysis-footer {
  flex: none;
  border-top: 1px solid #e0e8eb;
  background: white;
}

.workspace-analysis-footer .analyze-row {
  margin-top: 0.8rem;
}

.workspace-analysis .method-pill {
  display: none;
}

.workspace-detection-notes summary {
  font-size: 1.05rem;
}

.workspace-analysis .fit-fields {
  grid-template-columns: 1fr 1fr;
}

.workspace-analysis .analyze-row {
  flex-direction: column;
  align-items: stretch;
  gap: 0.8rem;
}

.workspace-analysis .candidate-heading {
  flex-wrap: wrap;
}

.workspace-chart-window {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: auto;
}

.workspace .result-metrics {
  gap: 0.7rem;
  flex: none;
}

.workspace .result-metrics article {
  padding: 1.1rem;
}

.workspace .result-metrics strong {
  font-size: 2rem;
}

.workspace .result-metrics article:last-child strong {
  font-size: 1.5rem;
}

.workspace .result-metrics p {
  font-size: 0.85rem;
}

.workspace .fit-quality {
  padding: 0.7rem 1rem;
  font-size: 1.05rem;
  flex: none;
}

.workspace-chart-window > .plot-card {
  flex: 1;
  min-height: 29rem;
  display: flex;
  flex-direction: column;
}

.workspace-chart-window .chart {
  flex: 1;
  min-height: 18rem;
  display: flex;
  align-items: center;
}

.workspace .chart svg {
  max-height: 100%;
}

.workspace-detail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.workspace-detail .derivative-toolbar {
  padding: 0;
  flex: none;
}

.workspace-detail .derivative-grid {
  flex: 1;
  min-height: 25rem;
  gap: 1.4rem;
}

.workspace-detail .plot-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.workspace-detail .chart {
  flex: 1;
  display: flex;
  align-items: center;
}

.workspace-report {
  max-width: 100rem;
  margin: 0 auto;
}

.workspace-report .interpretation {
  min-height: 100%;
}

#incertidumbres.workspace .workspace-data {
  grid-template-columns: minmax(28rem, 36rem) minmax(0, 1fr);
}

#incertidumbres.workspace .workspace-inventory, #incertidumbres.workspace .workspace-results {
  max-width: 115rem;
  margin: auto;
}

@media (max-width: 1100px) {
  .workspace-analysis {
    grid-template-columns: 29rem minmax(0, 1fr);
  }
  .workspace .result-metrics strong {
    font-size: 1.7rem;
  }
  .workspace .study-bar span {
    display: none;
  }
  .workspace .workspace-next {
    margin-left: auto;
  }
}
@media (max-width: 760px) {
  .app-shell {
    --nav-width:0rem;
    --header-height:5.6rem;
  }
  .app-shell .marca {
    padding: 0.5rem 1rem;
  }
  .app-shell .marca img {
    width: 14rem;
    height: 4.2rem;
  }
  .app-shell .marca .header-caption, .app-shell .marca .header-user {
    display: none;
  }
  .app-shell .app-content {
    margin-left: 0;
  }
  .app-sidebar {
    width: 21rem;
    transform: translateX(-100%);
    padding: 2rem 1.2rem;
  }
  .sidebar-open .app-sidebar {
    transform: none;
  }
  .app-shell .app-sidebar a > span:last-child, .app-shell .sidebar-label, .app-shell .sidebar-footer {
    position: static;
    clip-path: none;
    width: auto;
    height: auto;
    overflow: visible;
  }
  .app-shell main.workspace {
    padding: 1rem 1rem 0;
  }
  .workspace .lab-heading {
    align-items: center;
  }
  .workspace .lab-heading h1 {
    font-size: 1.65rem;
  }
  .workspace .lab-actions {
    gap: 0.4rem;
  }
  .workspace .lab-actions .quiet {
    padding: 0.6rem;
    font-size: 1rem;
  }
  .workspace .study-bar {
    gap: 0.6rem;
  }
  .workspace .study-bar label {
    display: none;
  }
  .workspace .study-bar input {
    width: 45%;
    font-size: 1.15rem;
  }
  .workspace .workspace-next {
    font-size: 1rem;
    padding: 0.6rem;
  }
  .workspace .workspace-tab {
    padding: 0.7rem 1rem;
    font-size: 1.1rem;
  }
  .workspace-data, .workspace-analysis, #incertidumbres.workspace .workspace-data {
    display: flex;
    flex-direction: column;
    overflow: auto;
  }
  .workspace-data > .lab-card {
    overflow: visible;
    flex: none;
  }
  .workspace .sheet-card {
    min-height: 40rem;
  }
  .workspace .sheet-card .data-grid {
    max-height: 45vh;
    flex: auto;
  }
  .workspace-analysis > .analysis-controls {
    overflow: visible;
    flex: none;
  }
  .workspace-chart-window {
    overflow: visible;
    flex: none;
  }
  .workspace-detail .derivative-grid {
    display: flex;
    flex-direction: column;
  }
  .workspace-detail .chart {
    min-height: 20rem;
  }
  .workspace .result-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .workspace .result-metrics strong {
    font-size: 1.5rem;
    overflow-wrap: anywhere;
  }
  .workspace .result-metrics article:last-child strong {
    font-size: 1.2rem;
  }
  .workspace .result-metrics article {
    padding: 0.8rem;
  }
}
@media print {
  body.app-shell {
    padding: 0;
    height: auto;
    overflow: visible;
  }
  .app-shell .marca, .app-sidebar, .sidebar-backdrop, .workspace-tabs, .workspace-next {
    display: none !important;
  }
  .app-shell .app-content {
    margin: 0;
    height: auto;
    overflow: visible;
  }
  .app-shell main.workspace, .workspace-stage, .workspace-panel {
    height: auto;
    overflow: visible;
    display: block;
  }
  .workspace-panel[hidden] {
    display: block !important;
  }
  .workspace-data, .workspace-analysis {
    display: block;
  }
  .workspace-chart-window {
    overflow: visible;
  }
  .workspace .data-grid {
    max-height: none;
    overflow: visible;
  }
}
.app-shell .app-sidebar {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.instituciones.section-home {
  padding: 1.2rem;
}

.section-home #section-status:empty {
  display: none;
}

.app-shell label:has(select[id$=-institucion]) {
  display: none;
}

#section-navigation {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
  flex: 1;
}

#section-navigation a {
  flex: none;
  padding: 0.9rem 1rem;
  white-space: nowrap;
  border-radius: 0.5rem;
  color: #456374;
  text-decoration: none;
  font-size: 1.25rem;
}

#section-navigation a[aria-current] {
  background: #e4f3ef;
  color: #087e79;
  font-weight: 700;
}

#section-navigation [hidden] {
  display: none !important;
}

.nav-context {
  font-size: 1.05rem;
  color: #557384;
  line-height: 1.5;
  padding: 0 0.8rem;
  margin: 0 0 1.4rem;
  overflow-wrap: anywhere;
}

.app-sidebar a > span:last-child {
  white-space: normal;
  line-height: 1.35;
}

.nav-inactive {
  font-size: 1.2rem;
  color: #687f8c;
  padding: 0.8rem;
}

.sidebar-compact .nav-context, .sidebar-compact .nav-inactive {
  display: none;
}

.section-home .section-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(28rem, 100%), 1fr));
  gap: 1.5rem;
  align-items: start;
}

.section-cards article {
  background: white;
  border: 1px solid #d3e3e8;
  border-radius: 0.9rem;
  padding: 1.8rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.section-cards article a {
  display: block;
  padding: 0.6rem 0;
}

.section-home #section-institution-label {
  max-width: 65rem;
}

.section-home .instituciones-stage {
  padding-top: 0;
}

@media (max-width: 1150px) {
  .app-shell .marca .header-user {
    display: none;
  }
  #section-navigation a {
    flex: none;
    padding: 0.8rem 0.7rem;
    font-size: 1.15rem;
  }
}
@media (max-width: 760px) {
  body.app-shell {
    --header-height:10rem;
  }
  .app-shell .marca {
    flex-wrap: wrap;
    gap: 0.2rem 1rem;
    align-content: center;
  }
  #section-navigation {
    order: 3;
    flex: 0 0 100%;
  }
  #section-navigation a {
    font-size: 1.15rem;
    padding: 0.8rem;
  }
  .sidebar-compact .nav-context {
    display: block;
  }
}
@media print {
  #section-navigation {
    display: none !important;
  }
}
.modality-control {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: 1.4rem;
  padding-left: 1.8rem;
  border-left: 1px solid #dbe5eb;
  font-size: 1.2rem;
  color: #557080;
  white-space: nowrap;
}

.modality-control select {
  font: inherit;
  font-weight: 650;
  color: #165e65;
  background: #edf7f4;
  border: 1px solid #bcdad3;
  border-radius: 0.7rem;
  padding: 0.8rem 2.6rem 0.8rem 1rem;
  max-width: 26rem;
  min-width: 16rem;
}

.modality-control select:focus-visible {
  outline: 3px solid #bc7014;
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .modality-control {
    order: 2;
    margin-left: auto;
    padding-left: 0;
    border: 0;
    gap: 0.5rem;
    font-size: 1.05rem;
    max-width: calc(100% - 20rem);
  }
  .modality-control select {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    padding: 0.7rem 0.3rem;
  }
  .app-shell .marca {
    gap: 0.2rem 0.5rem;
  }
  .modality-control {
    flex-direction: column;
    align-items: flex-start;
  }
  .app-shell .marca img {
    width: 12rem;
  }
}
.section-home .section-cards {
  align-items: stretch;
  grid-auto-rows: 1fr;
}

.section-cards article {
  display: flex;
  flex-direction: column;
}

.section-cards article > a:last-child {
  margin-top: auto;
}

.section-cards h2 {
  min-height: 2.8rem;
}

.section-cards p {
  overflow-wrap: anywhere;
}

.app-shell .marca .header-user #context-logo {
  width: 3.2rem;
  height: 3.2rem;
  object-fit: contain;
  flex: none;
}

.app-shell .marca .header-user #context-logo[hidden] {
  display: none;
}

#app-home {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: none;
  padding-bottom: 0.6rem;
}

#app-home .app-version {
  position: absolute;
  right: 0;
  bottom: 0;
  font-size: 1rem;
  line-height: 1;
  color: #436176;
}

#actualizaciones .instituciones-actions {
  flex-wrap: wrap;
}

#actualizaciones section {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #cfdfdf;
}

#actualizaciones small, #actualizaciones li, #actualizaciones p {
  overflow-wrap: anywhere;
}