/* Shell only: never change the reading surface's width or typography. */
.product-bar {
  width: min(calc(100% - 48px), 1420px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
}
.product-identity { color: var(--accent); font-size: 0.95rem; font-weight: 600; white-space: nowrap; }
.product-navigation { display: flex; flex: 1; gap: 12px; }
.product-navigation button {
  min-height: 44px;
  padding: 8px 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  box-shadow: none;
  font-weight: 500;
  white-space: nowrap;
  transition: color 120ms, background-color 120ms;
}
.product-navigation button:last-child { margin-left: auto; }
.product-navigation button:hover { color: var(--accent); background: var(--surface-muted); }
.product-navigation button[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.product-navigation button:focus-visible,
.shell-view :focus-visible,
.shell-session-links :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.shell-view-host { width: min(calc(100% - 48px), 1420px); margin: 0 auto; padding: 4px 0 32px; }
.shell-view { max-width: 880px; margin-inline: auto; }
#view-materials { max-width: none; }
#view-my-learning { max-width: none; }
.shell-view h1 { margin: 0 0 16px; font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; }
.listening-access { max-width: 560px; margin: clamp(24px,8vh,80px) auto; padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.listening-access[hidden] { display: none; }
.listening-access h2 { margin: 0 0 12px; font-size: 24px; }
.listening-access .shell-actions { gap: 16px; margin-top: 24px; }
.listening-access a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border-radius: 8px; text-decoration: none; }
#view-listening:has(.listening-access:not([hidden])) .listening-loading { display: none; }
.shell-view p { color: var(--muted); max-width: 42rem; line-height: 1.8; }
.shell-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.shell-actions button,
.shell-view button[data-workspace-target],
.shell-session-links button { min-height: 44px; }
.shell-session-links { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
/* Each destination keeps its existing handler. Only return placement/visuals are shared. */
/* A compact text affordance, with a full touch target and explicit focus. */
.view-back { display: inline-flex; align-items: center; gap: 4px; width: fit-content; max-width: 100%; min-width: 44px; min-height: 44px; padding: 4px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--accent); font-family: inherit; font-size: .88rem; font-weight: 600; line-height: 1.4; text-align: left; white-space: normal; box-shadow: none; }
.view-back:hover { background: var(--accent-soft); color: var(--accent); transform: none; }
.view-back:active { background: var(--accent-soft); transform: none; }
.view-back:focus-visible { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: 3px; }
/* Detail owns its Home return; do not show two competing rows. */
.shell-view-host:has(> #view-materials:not([hidden]) #materials-detail:not([hidden])) > .shell-session-links { display: none; }
.creation-session-nav { margin-bottom: 4px; }
.creation-session-nav:has(> button[hidden]) { display: none; }
.shell-advanced { margin-top: 28px; color: var(--muted); }
.shell-advanced summary { min-height: 44px; cursor: pointer; align-content: center; }
/* Clip, don't display:none. Background READY/resize keeps the exact live layout.
   inert and aria-hidden remove the inactive controls from interaction/AT. */
#workspace-viewport.is-inactive { height: 0; overflow: clip; visibility: hidden; }
.shell-view-host[hidden], .shell-view[hidden], .shell-session-links button[hidden] { display: none; }
@media (max-width: 700px) {
  .product-bar { width: calc(100% - 24px); gap: 12px; flex-wrap: wrap; padding-top: 12px; }
  .product-navigation { flex-basis: 100%; gap: 0; justify-content: space-between; }
  .product-navigation button { padding-inline: 10px; }
  .product-navigation button:last-child { margin-left: 0; }
  .shell-view-host { width: calc(100% - 32px); padding-top: 4px; }
  .shell-view h1 { font-size: 1.35rem; }
}
