.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: 240px;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 24px 18px;
}

.brand {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 12px;
  color: var(--foreground);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 13px;
  background: var(--primary);
  color: var(--surface);
  cursor: pointer;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 24%, transparent);
  transition: transform var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}

.brand-mark:hover {
  transform: translateY(-1px);
  box-shadow: 0 11px 24px color-mix(in srgb, var(--primary) 32%, transparent);
}

.brand-mark:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 30%, transparent);
  outline-offset: 3px;
}

.mobile-brand-mark {
  display: none;
}

.brand-mark svg {
  width: 25px;
  height: 25px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 1px;
  color: var(--text-tertiary);
  font-size: 0.69rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 6px;
  margin-top: 38px;
}

.nav-item {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  padding: 0 13px;
  font-size: 0.89rem;
  font-weight: 500;
  text-align: left;
  transition: background-color var(--motion-fast) ease, color var(--motion-fast) ease;
}

.nav-item:hover {
  background: var(--surface-soft);
  color: var(--foreground);
}

.nav-item.is-active {
  background: var(--foreground);
  color: var(--surface);
}

.nav-item svg,
.topbar svg,
.button svg,
.role-label svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.format-badge,
.step-count,
.readiness-score {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  padding: 4px 9px;
  font-size: 0.67rem;
  font-weight: 600;
}

.step-count {
  flex: 0 0 auto;
  white-space: nowrap;
}

.main {
  min-height: 100vh;
  min-height: 100dvh;
  margin-left: 240px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  background: color-mix(in srgb, var(--background) 88%, transparent);
  padding: 16px clamp(22px, 4vw, 58px);
  backdrop-filter: blur(14px);
}

.eyebrow,
.section-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--text-tertiary);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.save-state {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.73rem;
}

.save-state svg {
  width: 16px;
  color: var(--user);
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.icon-button:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.icon-button svg {
  width: 19px;
}

.moon-icon,
[data-theme="dark"] .sun-icon {
  display: none;
}

[data-theme="dark"] .moon-icon {
  display: block;
}

.view {
  display: none;
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 44px clamp(22px, 4vw, 58px) 70px;
  animation: view-in var(--motion-base) ease-out;
}

.view.is-active {
  display: block;
}

.view:focus {
  outline: none;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.view-heading > div:first-child {
  max-width: 720px;
}

.intro-row {
  display: grid;
  gap: 20px;
}

.intro-row .responsibility-legend {
  justify-content: flex-start;
}

.intro-row p,
.view-heading p {
  margin-bottom: 0;
  color: var(--text-secondary);
  font-size: 0.93rem;
}

.responsibility-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.legend-item {
  --indicator-color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  padding: 7px 10px;
  color: var(--text-tertiary);
  font-size: 0.7rem;
  font-weight: 600;
  transition: border-color var(--motion-fast) ease, background-color var(--motion-fast) ease, color var(--motion-fast) ease;
}

.legend-item i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: color-mix(in srgb, var(--indicator-color) 25%, var(--surface-strong));
  opacity: 0.58;
  transition: background-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease, opacity var(--motion-fast) ease;
}

.legend-user { --indicator-color: var(--user); }
.legend-data { --indicator-color: var(--data); }
.legend-ai { --indicator-color: var(--ai); }

.legend-item.is-active {
  border-color: color-mix(in srgb, var(--indicator-color) 42%, var(--border));
  background: color-mix(in srgb, var(--indicator-color) 8%, var(--surface));
  color: var(--foreground);
}

.legend-item.is-active i {
  background: var(--indicator-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--indicator-color) 16%, transparent), 0 0 12px color-mix(in srgb, var(--indicator-color) 52%, transparent);
  opacity: 1;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 36px 0 20px;
  padding: 0;
  list-style: none;
}

.stepper li {
  position: relative;
}

.stepper li:not(:last-child)::after {
  position: absolute;
  z-index: -1;
  top: 18px;
  right: -50%;
  left: 50%;
  height: 1px;
  background: var(--border-strong);
  content: "";
}

.stepper li.is-complete:not(:last-child)::after {
  background: var(--foreground);
}

.stepper button {
  display: grid;
  width: 100%;
  min-height: 76px;
  justify-items: center;
  border: 0;
  background: transparent;
  padding: 0 8px;
  text-align: center;
}

.stepper button > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-tertiary);
  font-size: 0.72rem;
  font-weight: 650;
  transition: background-color var(--motion-fast) ease, color var(--motion-fast) ease, border-color var(--motion-fast) ease;
}

.stepper button strong,
.stepper button small {
  display: block;
}

.stepper button strong {
  margin-top: 8px;
  font-size: 0.74rem;
}

.stepper button small {
  margin-top: 1px;
  color: var(--text-tertiary);
  font-size: 0.62rem;
}

.stepper button[aria-current="step"] > span,
.stepper li.is-complete button > span {
  border-color: var(--foreground);
  background: var(--foreground);
  color: var(--surface);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.75fr);
  gap: 18px;
  align-items: start;
}
