.shell {
  transition: grid-template-columns 0.2s ease;
}

.workspace-picker {
  display: block;
  margin: 0 0 14px;
}

.workspace-picker > span {
  display: block;
  margin: 0 10px 7px;
  color: #7a8294;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.workspace-picker select {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
}

.context {
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.context-toggle {
  position: fixed;
  top: 22px;
  right: 374px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: #555d70;
  box-shadow: 0 4px 12px #151b2d12;
  cursor: pointer;
  transition: right 0.2s ease;
}

.context-toggle:hover {
  color: var(--indigo);
  border-color: #b8b5ec;
}

.context-collapsed .shell {
  grid-template-columns: 264px minmax(460px, 1fr) 0;
}

.context-collapsed .context {
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%);
}

.context-collapsed .context-toggle {
  right: 14px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 28px;
  border: 1px dashed #cfd3df;
  border-radius: 14px;
  background: #fafafe;
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
  font-size: 18px;
}

.node small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.node.missing {
  border-style: dashed;
  border-color: #d07878;
  color: #9a4141;
  background: #fff8f8;
  cursor: not-allowed;
}

.edge.missing {
  height: 0;
  border-top: 1px dashed #d07878;
  background: transparent;
}

.markdown a[href^="/?workspace="] {
  color: var(--indigo);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.auth-action {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--indigo);
  border-radius: 9px;
  padding: 9px 13px;
  background: var(--indigo);
  color: white;
  text-decoration: none;
  font-weight: 650;
}

.auth-action:hover {
  background: #4438c7;
}

.public-view .workspace-picker,
.public-view #history,
.public-view .tabs [data-tab="activity"],
.public-view #recent,
.public-view .boundary {
  display: none;
}

.public-view .tabs {
  grid-template-columns: 1fr;
}

/* Tighter application frame */
:root {
  --line: #e7e8ee;
  --soft: #f7f7fa;
}

.shell {
  grid-template-columns: 248px minmax(520px, 1fr) 360px;
}

.sidebar {
  padding: 24px 16px 18px;
  background: #fbfbfc;
}

.brand {
  margin: 0 8px 22px;
  font-size: 25px;
  letter-spacing: -1px;
}

.workspace-picker select,
.search {
  height: 40px;
  border-radius: 9px;
  box-shadow: none;
}

.search {
  margin-bottom: 24px;
}

nav {
  gap: 2px;
}

nav button {
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
}

.reader {
  padding: 0 48px 80px;
}

.reader-header {
  position: sticky;
  top: 0;
  z-index: 6;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
}

.header-actions {
  align-items: center;
}

.header-actions button,
.auth-action {
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 13px;
}

article {
  max-width: 720px;
  margin-top: 52px;
}

h1 {
  font-size: 44px;
  line-height: 1.08;
  letter-spacing: -1.8px;
}

.meta {
  gap: 8px;
  padding-bottom: 20px;
}

.badge {
  padding: 3px 7px;
  background: #f4f4f8;
  border-color: #e2e3ea;
  color: #555d70;
}

.markdown {
  padding-top: 26px;
  color: #34394a;
}

.markdown img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.markdown pre {
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f7fa;
}

.context {
  background: #fafafa;
}

.tabs {
  height: 61px;
  padding: 0 16px;
}

.graph {
  height: calc(100vh - 61px);
  min-height: 480px;
  border-bottom: 0;
  background-size: 24px 24px;
  background-image: radial-gradient(#dfe1e8 .8px, transparent .8px);
}

.node {
  border-color: #b8d7d6;
  border-radius: 9px;
  box-shadow: 0 5px 16px #20283b0a;
}

.node.center {
  box-shadow: 0 10px 28px #5549d830;
}

.node.archived {
  border-style: dashed;
  border-color: #aeb3bf;
  background: #f4f4f6;
  color: #737988;
  cursor: not-allowed;
}

.edge.archived {
  background: #aeb3bf;
}

.boundary {
  display: none;
}

.context-toggle {
  top: 17px;
  right: 344px;
}

.context-collapsed .shell {
  grid-template-columns: 248px minmax(520px, 1fr) 0;
}

@media (max-width: 1050px) {
  .context-toggle { right: 344px; }
  .context-collapsed .context-toggle { right: 14px; }
}

@media (max-width: 700px) {
  .context-toggle { display: none; }
  .context-collapsed .context { display: none; }
  .workspace-picker { max-width: 280px; }
}
