/* Shared workspace shell. Tokens (--page, --paper, --ink, --muted, --line, --accent, --accent-soft, --accent-line, --focus) come from the page. */
:root { --shell-width: 248px; }
@media (max-width: 999px) { :root { --shell-width: 216px; } }
@media (max-width: 599px) { :root { --shell-width: 0px; } }

.shell-sidebar { position: fixed; z-index: 60; inset: 0 auto 0 0; display: flex; flex-direction: column; width: var(--shell-width); border-right: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: 14px; }
.shell-bar { display: flex; align-items: center; gap: 8px; min-height: 64px; padding: 12px 16px 8px 20px; }
.shell-brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); font-size: 20px; font-weight: 750; letter-spacing: -.5px; text-decoration: none; }
.shell-brand:hover { text-decoration: none; }
/* Same mark as the public homepage: one slanted bar. */
.shell-mark, .brand-mark-unified { display: inline-block; flex: none; width: 12px; height: 20px; border-radius: 2px; background: var(--accent); transform: skewX(-15deg); }
.shell-bar-context, .shell-menu-button { display: none; }
.shell-panel { display: flex; flex: 1; flex-direction: column; min-height: 0; padding: 4px 12px 12px; }
/* Only the navigation scrolls on short screens; context stays on top and the account menu at the bottom. */
.shell-nav { flex: 1 1 auto; min-height: 0; margin: 0 -12px; padding: 0 12px; overflow-y: auto; overscroll-behavior: contain; }

.shell-context { display: grid; gap: 4px; padding: 0 0 12px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.shell-back { display: inline-flex; align-items: center; gap: 6px; width: fit-content; min-height: 44px; padding: 0 8px; margin-left: -4px; border-radius: 8px; color: var(--muted); font-size: 13px; text-decoration: none; }
.shell-back:hover { color: var(--ink); background: var(--page); text-decoration: none; }
.shell-back .shell-icon { width: 16px; height: 16px; }
.shell-context-name { display: grid; gap: 2px; padding: 0 8px; min-width: 0; }
.shell-context-org { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.shell-context-name strong { font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.shell-nav ul, .shell-steps { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.shell-nav-link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border: 1px solid transparent; border-radius: 8px; color: var(--ink); font-size: 14px; text-decoration: none; }
.shell-nav-link:hover { background: var(--page); text-decoration: none; }
.shell-nav-link[aria-current="page"] { border-color: var(--accent-line); background: var(--accent-soft); font-weight: 600; }
.shell-nav-group > .shell-nav-link[aria-current="page"] { border-color: transparent; background: transparent; }
.shell-icon { flex: none; width: 20px; height: 20px; color: var(--muted); }
.shell-nav-link[aria-current] .shell-icon { color: var(--accent); }
.shell-nav-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.shell-nav-meta { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 400; }
.shell-steps { padding: 2px 0 6px 22px; }
.shell-step-link { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px; border: 1px solid transparent; border-radius: 8px; color: var(--ink); font-size: 13px; text-decoration: none; }
.shell-step-link:hover { background: var(--page); text-decoration: none; }
.shell-step-link[aria-current="step"] { border-color: var(--accent-line); background: var(--accent-soft); font-weight: 600; }
.shell-step-mark { display: inline-grid; flex: none; place-items: center; width: 20px; height: 20px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.shell-step-link.complete .shell-step-mark { border-color: transparent; color: var(--good, #286747); }
.shell-step-link.stale .shell-step-mark, .shell-step-link.partial .shell-step-mark, .shell-step-link.draft .shell-step-mark { border-color: var(--warn, #805c1d); color: var(--warn, #805c1d); }
.shell-step-link[aria-current="step"] .shell-step-mark { border-color: var(--accent); color: var(--accent); }
.shell-step-check { width: 16px; height: 16px; }
.shell-step-label { min-width: 0; overflow-wrap: anywhere; }

.shell-account { position: relative; flex: none; padding-top: 8px; border-top: 1px solid var(--line); margin-top: 8px; }
.shell-account > summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px; border-radius: 8px; cursor: pointer; list-style: none; }
.shell-account > summary::-webkit-details-marker { display: none; }
.shell-account > summary:hover { background: var(--page); }
.shell-avatar { display: inline-grid; flex: none; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; color: var(--accent); font-size: 13px; font-weight: 600; }
.shell-account-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-account-chevron { flex: none; width: 16px; height: 16px; color: var(--muted); transform: rotate(180deg); }
.shell-account[open] .shell-account-chevron { transform: none; }
.shell-account-menu { position: absolute; left: 0; right: 0; bottom: calc(100% - 8px); z-index: 2; display: grid; gap: 2px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: 0 12px 32px rgb(15 23 42 / 14%); }
.shell-menu-item { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.shell-menu-item:hover { background: var(--page); text-decoration: none; }
.shell-sidebar a:focus-visible, .shell-sidebar button:focus-visible, .shell-account > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Phones: one top row (brand, current event, menu); the same entries open as a drawer. */
@media (max-width: 599px) {
  .shell-sidebar { position: sticky; top: 0; inset: auto; width: 100%; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .shell-bar { min-height: 56px; padding: 6px 4px 6px 16px; }
  .shell-brand { font-size: 18px; }
  .shell-bar-context { display: block; flex: 1; min-width: 0; padding-left: 10px; border-left: 1px solid var(--line); color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .shell-menu-button { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-left: auto; border: 0; border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; }
  .shell-menu-button .shell-icon { color: var(--ink); }
  .shell-nav { flex: none; overflow: visible; }
  .shell-panel { display: none; position: absolute; top: 100%; left: 0; right: 0; max-height: calc(100dvh - 56px); overflow-y: auto; overscroll-behavior: contain; padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); border-bottom: 1px solid var(--line); background: var(--paper); box-shadow: 0 16px 32px rgb(15 23 42 / 16%); }
  .shell-open .shell-panel { display: flex; }
  .shell-icon-close, .shell-open .shell-icon-menu { display: none; }
  .shell-open .shell-icon-close { display: block; }
  .shell-account-menu { position: static; margin-top: 4px; box-shadow: none; }
}
@media (prefers-reduced-motion: no-preference) { .shell-account-chevron { transition: transform .15s ease; } }
@media (forced-colors: active) { .shell-nav-link[aria-current], .shell-step-link[aria-current] { border-color: CanvasText; } .shell-mark { background: CanvasText; } }
