/* SudoSIM 2.12.9 — contextual navigation and breadcrumb UX */
.topbar {
  min-height: 76px;
  height: auto;
  padding-top: 10px;
  padding-bottom: 10px;
}
.topbar-location {
  display: flex !important;
  align-items: center;
  gap: 12px !important;
  min-width: 0;
  flex: 1;
}
.topbar-context-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.topbar-context-copy #topTitle {
  margin: 0;
  line-height: 1.15;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.025em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.context-back {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 19px;
  font-weight: 800;
}
.context-back.visible { display: inline-flex; }
.context-back:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: var(--panel-2);
}
.context-breadcrumb {
  display: none;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}
.context-breadcrumb.visible { display: flex; }
.context-breadcrumb button {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.context-breadcrumb button:hover {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.context-breadcrumb .crumb-separator {
  color: color-mix(in srgb, var(--muted) 55%, transparent);
  font-size: 13px;
}
.context-breadcrumb .crumb-current {
  color: var(--text);
  max-width: min(34vw, 420px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Make entry points clearer without changing the underlying workflow. */
[data-control].ux-open-exercise::after { content: ""; }
.list-item .list-actions .ux-open-exercise { white-space: nowrap; }

@media (max-width: 820px) {
  .topbar { padding-left: 16px; padding-right: 16px; min-height: 72px; }
  .topbar-location { gap: 8px !important; }
  .context-back { width: 36px; height: 36px; flex-basis: 36px; }
  .context-breadcrumb { max-width: calc(100vw - 230px); overflow: hidden; }
  .context-breadcrumb .crumb-current { max-width: 42vw; }
  .topbar-context-copy #topTitle { font-size: 16px; }
}
@media (max-width: 600px) {
  .topbar { gap: 8px; }
  .context-breadcrumb { max-width: calc(100vw - 150px); }
  .context-breadcrumb button:first-child,
  .context-breadcrumb .crumb-separator:first-of-type { display: none; }
  .context-breadcrumb .crumb-current { max-width: 48vw; }
  .top-actions .btn.secondary.small { display: none; }
}
