.stj-shell-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0;
  min-height: 100vh;
}

.stj-shell-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 1rem;
}

.stj-shell-brand {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.9rem;
}

.stj-shell-sidebar nav {
  display: grid;
  gap: 0.35rem;
}

.stj-shell-sidebar a {
  display: block;
  text-decoration: none;
  color: var(--color-muted);
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius);
}

.stj-shell-sidebar a:hover {
  background: rgba(21, 101, 192, 0.08);
  color: var(--color-primary);
}

.stj-shell-sidebar a.is-active {
  background: rgba(21, 101, 192, 0.16);
  color: var(--color-primary-strong);
  font-weight: 700;
}

.stj-shell-main {
  min-width: 0;
}

.stj-shell-context {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: 0.85rem;
  margin-bottom: 1rem;
  display: grid;
  gap: 0.75rem;
}

.stj-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  color: var(--color-muted);
  font-size: 0.78rem;
}

.stj-breadcrumbs a {
  color: inherit;
  text-decoration: none;
}

.stj-breadcrumbs strong {
  color: var(--color-text);
}

.stj-shell-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 0.75rem;
}

.stj-shell-meta-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.75rem;
  background: var(--color-canvas);
}

.stj-shell-meta-card h2 {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
}

.stj-shell-meta-card p {
  margin: 0.35rem 0 0;
  color: var(--color-text);
  font-size: 0.83rem;
}

.stj-shell-meta-card code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  color: var(--color-primary);
  overflow-wrap: anywhere;
}

.stj-shell-badge {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.7rem;
}

.stj-shell-badge[data-level="pronto"] {
  background: rgba(0, 163, 140, 0.16);
  color: #0b6e60;
}

.stj-shell-badge[data-level="parcial"] {
  background: rgba(21, 101, 192, 0.14);
  color: #0b4f9c;
}

.stj-shell-badge[data-level="bloqueado"] {
  background: rgba(198, 40, 40, 0.16);
  color: #8f1d1d;
}

.stj-root-route-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
}

.stj-root-route-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.8rem;
  background: var(--color-canvas);
}

.stj-root-route-card h3 {
  margin: 0;
  font-size: 0.96rem;
}

.stj-root-route-card p {
  margin: 0.5rem 0 0;
  color: var(--color-muted);
}

.stj-root-route-card code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  color: var(--color-primary);
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .stj-shell-layout {
    grid-template-columns: 1fr;
  }

  .stj-shell-sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .stj-shell-sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}