:root {
  --canvas: #eceeea;
  --canvas-deep: #e3e5e0;
  --paper: #fbf9f2;
  --paper-strong: #fffdf7;
  --note: #f4e9a9;
  --note-light: #faf3c9;
  --graphite: #252421;
  --muted: #76736c;
  --pencil: #8b8982;
  --pencil-light: #c8c6be;
  --purple: #7657d6;
  --purple-deep: #5f43bd;
  --purple-wash: #eee9ff;
  --border: rgba(68, 66, 60, 0.19);
  --shadow: 0 18px 50px rgba(44, 43, 38, 0.11);
  --rail-width: 224px;
  --header-height: 76px;
  --drawer-width: min(460px, calc(100vw - var(--rail-width) - 48px));
  --font-display: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-utility: "SFMono-Regular", "Menlo", "Consolas", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--graphite);
  background:
    radial-gradient(circle at 12% 14%, rgba(255, 255, 255, 0.7), transparent 22%),
    linear-gradient(135deg, var(--canvas), var(--canvas-deep));
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

button,
textarea,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(118, 87, 214, 0.34);
  outline-offset: 3px;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.app-shell {
  display: flex;
  width: 100vw;
  height: 100vh;
  min-height: 620px;
}

.boot-message {
  margin: auto;
  color: var(--muted);
}

.project-rail {
  position: relative;
  z-index: 30;
  display: flex;
  flex: 0 0 var(--rail-width);
  flex-direction: column;
  height: 100vh;
  padding: 22px 14px 16px;
  border-right: 1px solid rgba(58, 58, 52, 0.15);
  background:
    linear-gradient(rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.06)),
    var(--canvas);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 7px 26px;
  color: inherit;
  text-decoration: none;
}

.wordmark-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px 9px 11px 8px;
  color: white;
  background: var(--graphite);
  box-shadow: 2px 3px 0 rgba(37, 36, 33, 0.17);
  font-family: var(--font-display);
  font-size: 19px;
}

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

.wordmark strong {
  font-size: 15px;
  letter-spacing: 0.04em;
}

.wordmark small {
  margin-top: 2px;
  color: var(--muted);
  font: 8px/1 var(--font-utility);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rail-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px 9px;
  color: var(--muted);
  font-size: 11px;
}

.rail-label b {
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 20px;
  font: 10px var(--font-utility);
}

.project-list {
  display: grid;
  gap: 6px;
}

.project-switch {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr 7px;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 60px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 12px 9px 13px 10px;
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.project-switch:hover {
  border-color: rgba(58, 57, 52, 0.1);
  background: rgba(255, 255, 255, 0.42);
  transform: translateX(2px);
}

.project-switch.is-current {
  border-color: rgba(58, 57, 52, 0.13);
  background: rgba(251, 249, 242, 0.88);
  box-shadow: 0 7px 18px rgba(56, 54, 48, 0.07);
}

.project-switch > span:nth-child(2) {
  min-width: 0;
}

.project-switch strong,
.project-switch small {
  display: block;
}

.project-switch strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-switch small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.project-switch i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
}

.project-switch.is-current i {
  background: var(--purple);
  box-shadow: 0 0 0 4px var(--purple-wash);
}

.project-monogram {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(58, 57, 52, 0.18);
  border-radius: 9px 7px 10px 8px;
  background: rgba(255, 255, 255, 0.52);
  font-family: var(--font-display);
  font-size: 14px;
}

.project-switch.is-current .project-monogram {
  color: white;
  border-color: var(--graphite);
  background: var(--graphite);
}

.new-project {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 12px 8px 0;
  padding: 8px 4px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.new-project span {
  font-size: 17px;
}

.rail-foot {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 13px 10px 2px;
  border-top: 1px dashed var(--pencil-light);
}

.rail-foot strong,
.rail-foot small {
  display: block;
}

.rail-foot strong {
  font-size: 10px;
  font-weight: 600;
}

.rail-foot small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.local-dot {
  width: 8px;
  height: 8px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 0 1px var(--purple);
}

.project-shell {
  min-width: 0;
  flex: 1;
}

.project-header {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  height: var(--header-height);
  padding: 0 26px 0 30px;
  border-bottom: 1px solid rgba(58, 57, 52, 0.15);
  background: rgba(251, 249, 242, 0.77);
  backdrop-filter: blur(14px);
}

.project-identity > .eyebrow {
  margin-bottom: 3px;
}

.project-identity > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.project-identity h1 {
  margin: 0;
  font: 700 18px/1.1 var(--font-display);
}

.project-path {
  color: var(--muted);
  font: 8px var(--font-utility);
}

.eyebrow {
  display: block;
  color: var(--muted);
  font: 9px/1.3 var(--font-utility);
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.view-tabs {
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(58, 57, 52, 0.14);
  border-radius: 13px 10px 12px 11px;
  background: rgba(231, 231, 226, 0.7);
  box-shadow: inset 0 1px 2px rgba(64, 62, 57, 0.06);
}

.view-tabs button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px 7px 9px 8px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.view-tabs button.is-active {
  color: white;
  background: var(--graphite);
  box-shadow: 1px 2px 0 rgba(37, 36, 33, 0.2);
}

.view-tabs svg {
  width: 15px;
  height: 15px;
}

.archive-button {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(58, 57, 52, 0.22);
  border-radius: 10px 7px 11px 8px;
  background: var(--paper-strong);
  box-shadow: 2px 3px 0 rgba(58, 57, 52, 0.09);
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
}

.archive-button:hover {
  color: var(--purple-deep);
  border-color: rgba(118, 87, 214, 0.36);
}

.archive-button svg {
  width: 15px;
  height: 15px;
}

.main-canvas {
  position: relative;
  height: calc(100vh - var(--header-height));
  overflow: auto;
  background:
    linear-gradient(90deg, transparent 23px, rgba(70, 68, 62, 0.032) 24px, transparent 25px),
    linear-gradient(transparent 23px, rgba(70, 68, 62, 0.032) 24px, transparent 25px);
  background-size: 25px 25px;
  transition: padding-right 220ms ease;
}

.main-canvas.has-drawer {
  padding-right: min(180px, 12vw);
}

.view-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 38px 24px;
}

.view-intro h2 {
  margin: 7px 0 8px;
  font: 700 clamp(24px, 2.4vw, 36px)/1.18 var(--font-display);
  letter-spacing: -0.035em;
}

.view-intro p {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

.timeline-legend {
  display: flex;
  gap: 18px;
  padding-bottom: 4px;
  white-space: nowrap;
}

.timeline-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
}

.timeline-legend i {
  display: inline-block;
}

.legend-chat {
  width: 16px;
  height: 11px;
  border: 1px solid var(--pencil);
  background: var(--paper);
  transform: rotate(-3deg);
}

.legend-version {
  width: 12px;
  height: 12px;
  background: var(--note);
  transform: rotate(3deg);
}

.timeline-scroll {
  width: calc(100% - 38px);
  height: calc(100vh - 226px);
  min-height: 460px;
  margin-left: 38px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(118, 87, 214, 0.34) transparent;
}

.timeline-scroll::-webkit-scrollbar {
  height: 7px;
}

.timeline-scroll::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: rgba(118, 87, 214, 0.3);
}

.timeline-stage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--chat-count), 270px) 100px;
  gap: 58px;
  align-items: start;
  width: max-content;
  min-width: 100%;
  height: 100%;
  min-height: 455px;
  padding: 104px 100px 35px 72px;
}

.timeline-wire {
  position: absolute;
  top: 80px;
  left: 26px;
  width: calc(100% - 60px);
  height: 3px;
  border-radius: 50%;
  background: var(--pencil);
  transform: rotate(-0.25deg);
}

.timeline-wire::before,
.timeline-wire::after {
  position: absolute;
  top: -2px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--pencil);
  border-radius: 50%;
  background: var(--canvas);
  content: "";
}

.timeline-wire::before {
  left: 0;
}

.timeline-wire::after {
  right: 0;
}

.wire-shadow {
  top: 84px;
  height: 1px;
  opacity: 0.27;
  transform: rotate(0.18deg);
}

.wire-start {
  position: absolute;
  top: 48px;
  left: 30px;
  color: var(--pencil);
  font: 13px var(--font-display);
  transform: rotate(-4deg);
}

.wire-start::after {
  position: absolute;
  top: 20px;
  left: 48px;
  width: 26px;
  height: 16px;
  border-top: 1px solid var(--pencil);
  border-radius: 50%;
  content: "";
  transform: rotate(24deg);
}

.chat-node {
  position: relative;
  z-index: 2;
  width: 270px;
  transform: rotate(var(--card-tilt));
  transform-origin: top center;
  transition: transform 180ms ease;
}

.chat-node:hover,
.chat-node.is-selected {
  transform: rotate(0) translateY(-3px);
}

.wire-clasp {
  position: absolute;
  top: -28px;
  left: 50%;
  width: 1px;
  height: 28px;
  background: var(--pencil);
}

.wire-clasp::before {
  position: absolute;
  top: -5px;
  left: -4px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--pencil);
  border-radius: 50%;
  background: var(--canvas);
  content: "";
}

.chat-card {
  min-height: 170px;
  padding: 18px 18px 16px;
  border: 1px solid rgba(70, 68, 62, 0.28);
  border-radius: 5px 2px 6px 3px;
  background:
    radial-gradient(circle at 16% 22%, rgba(82, 79, 70, 0.035) 0 1px, transparent 1px),
    var(--paper);
  background-size: 9px 9px;
  box-shadow: 4px 8px 18px rgba(48, 47, 42, 0.1), 2px 3px 0 rgba(65, 63, 57, 0.08);
}

.chat-node.is-selected .chat-card {
  border-color: rgba(118, 87, 214, 0.68);
  box-shadow: 0 0 0 3px var(--purple-wash), 5px 9px 18px rgba(48, 47, 42, 0.11);
}

.chat-meta {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 8px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--pencil-light);
}

.agent-badge,
.revision-agent {
  display: grid;
  place-items: center;
  border-radius: 8px 6px 8px 6px;
  color: white;
  background: var(--graphite);
  font: 700 11px var(--font-utility);
}

.agent-badge {
  width: 30px;
  height: 30px;
}

.chat-meta strong,
.chat-meta small {
  display: block;
}

.chat-meta strong {
  font-size: 9px;
}

.chat-meta small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.chat-meta b {
  color: var(--purple-deep);
  font: 8px var(--font-utility);
}

.chat-card h3 {
  margin: 14px 0 8px;
  font: 700 17px/1.4 var(--font-display);
  letter-spacing: -0.02em;
}

.chat-card > p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.surface-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 13px;
}

.surface-tags span {
  padding: 3px 7px;
  border: 1px solid rgba(70, 68, 62, 0.12);
  border-radius: 10px 7px 9px 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  font-size: 8px;
}

.version-stack {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 9px;
  padding-top: 26px;
}

.version-note {
  position: relative;
  width: 116px;
  min-height: 112px;
  padding: 17px 12px 12px;
  border: 1px solid rgba(102, 91, 35, 0.22);
  border-radius: 2px;
  text-align: left;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.2), transparent 38%),
    var(--note);
  box-shadow: 3px 5px 10px rgba(76, 69, 35, 0.11);
  cursor: pointer;
  transform: rotate(var(--note-tilt));
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.version-note::before {
  position: absolute;
  top: -27px;
  left: 50%;
  width: 1px;
  height: 27px;
  background: var(--pencil);
  content: "";
}

.version-note:hover,
.version-note.is-selected {
  z-index: 3;
  transform: rotate(0) translateY(-4px);
  box-shadow: 0 0 0 3px rgba(118, 87, 214, 0.15), 4px 7px 14px rgba(76, 69, 35, 0.14);
}

.version-note.is-selected {
  border-color: var(--purple);
}

.note-pin {
  position: absolute;
  top: -4px;
  left: calc(50% - 4px);
  width: 8px;
  height: 8px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 1px 2px rgba(50, 42, 80, 0.3);
}

.version-number {
  display: block;
  margin-bottom: 8px;
  color: var(--purple-deep);
  font: 700 9px var(--font-utility);
}

.version-note strong {
  display: block;
  min-height: 38px;
  font: 700 13px/1.45 var(--font-display);
}

.version-note small {
  display: block;
  margin-top: 8px;
  color: rgba(62, 57, 34, 0.6);
  font-size: 8px;
}

.timeline-now {
  position: relative;
  padding-top: 11px;
  color: var(--purple-deep);
}

.timeline-now > span {
  position: absolute;
  top: -28px;
  left: 8px;
  width: 16px;
  height: 16px;
  border: 4px solid var(--purple-wash);
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 0 1px var(--purple);
}

.timeline-now strong,
.timeline-now small {
  display: block;
}

.timeline-now strong {
  font: 16px var(--font-display);
}

.timeline-now small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.scroll-hint {
  position: fixed;
  right: 24px;
  bottom: 14px;
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.03em;
}

.scroll-hint span {
  color: var(--purple);
}

.product-map-view {
  width: min(1180px, calc(100% - 54px));
  margin: 0 auto;
  padding-bottom: 50px;
}

.product-map-view .view-intro {
  padding-right: 8px;
  padding-left: 8px;
}

.map-summary {
  display: grid;
  grid-template-columns: auto auto 1px auto auto;
  gap: 8px;
  align-items: end;
  padding-bottom: 4px;
}

.map-summary strong {
  font: 700 24px/1 var(--font-display);
}

.map-summary span {
  padding-bottom: 2px;
  color: var(--muted);
  font-size: 8px;
}

.map-summary i {
  width: 1px;
  height: 24px;
  margin: 0 8px;
  background: var(--pencil-light);
}

.map-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 8px 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--pencil-light);
}

.map-section-head > div,
.capability-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.map-section-head strong,
.map-section-head small,
.capability-title strong,
.capability-title small {
  display: block;
}

.map-section-head strong,
.capability-title strong {
  font: 700 14px var(--font-display);
}

.map-section-head small,
.capability-title small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.map-section-head > span {
  color: var(--muted);
  font-size: 8px;
}

.section-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--pencil);
  border-radius: 50% 46% 52% 44%;
  font: 12px var(--font-display);
}

.surface-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
  align-items: start;
}

.surface-card {
  position: relative;
  min-height: 330px;
  padding: 20px 19px 16px;
  border: 1px solid rgba(70, 68, 62, 0.22);
  border-radius: 5px 2px 7px 3px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.22), transparent 18%),
    var(--paper);
  box-shadow: 3px 6px 15px rgba(48, 47, 42, 0.08);
  transform: rotate(var(--surface-tilt));
}

.surface-card::before {
  position: absolute;
  top: -8px;
  left: calc(50% - 32px);
  width: 64px;
  height: 17px;
  background: rgba(209, 202, 164, 0.58);
  content: "";
  transform: rotate(-1.5deg);
}

.surface-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.surface-index {
  color: rgba(118, 87, 214, 0.4);
  font: 700 28px/1 var(--font-display);
}

.surface-head h3 {
  margin: 3px 0 0;
  font: 700 20px var(--font-display);
}

.surface-card > p {
  min-height: 42px;
  margin: 15px 0 16px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

.feature-list {
  display: grid;
  gap: 7px;
}

.feature-list button {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 66px;
  padding: 11px 11px 10px;
  border: 1px solid rgba(70, 68, 62, 0.13);
  border-radius: 8px 5px 9px 6px;
  text-align: left;
  background: rgba(255, 255, 255, 0.54);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.feature-list button:hover {
  border-color: rgba(118, 87, 214, 0.4);
  background: white;
  transform: translateX(2px);
}

.feature-list button strong,
.feature-list button small {
  display: block;
}

.feature-list button strong {
  margin-bottom: 5px;
  font-size: 11px;
}

.feature-list button small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.feature-list button svg {
  width: 15px;
  color: var(--purple);
}

.surface-card footer {
  position: absolute;
  right: 19px;
  bottom: 15px;
  left: 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px dashed var(--pencil-light);
  font-size: 8px;
}

.surface-card footer span {
  color: var(--muted);
}

.surface-card footer strong {
  overflow: hidden;
  max-width: 62%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capability-lane {
  position: relative;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  align-items: center;
  margin: 28px 8px 0;
  padding: 20px;
  border: 1px dashed rgba(70, 68, 62, 0.32);
  border-radius: 7px 4px 8px 5px;
  background: rgba(251, 249, 242, 0.54);
}

.capability-line {
  position: absolute;
  top: 50%;
  left: 172px;
  width: calc(100% - 190px);
  height: 1px;
  background: var(--pencil-light);
}

.capability-list {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.capability-list button {
  display: grid;
  grid-template-columns: 9px 1fr auto;
  gap: 9px;
  align-items: center;
  min-width: 190px;
  min-height: 55px;
  padding: 9px 11px;
  border: 1px solid rgba(70, 68, 62, 0.18);
  border-radius: 8px 5px 8px 6px;
  text-align: left;
  background: var(--paper-strong);
  box-shadow: 2px 3px 0 rgba(58, 57, 52, 0.06);
  cursor: pointer;
}

.capability-list button strong,
.capability-list button small {
  display: block;
}

.capability-list button strong {
  font-size: 10px;
}

.capability-list button small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.capability-list button svg {
  width: 14px;
  color: var(--purple);
}

.capability-dot {
  width: 8px;
  height: 8px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 0 1px var(--purple);
}

.empty-view {
  display: grid;
  width: min(680px, calc(100% - 40px));
  margin: 120px auto 0;
  place-items: center;
  text-align: center;
}

.empty-wire {
  width: 100%;
  height: 1px;
  background: var(--pencil);
  transform: rotate(-1deg);
}

.empty-card {
  margin-top: -1px;
  padding: 18px 30px;
  border: 1px solid var(--border);
  background: var(--paper);
  box-shadow: var(--shadow);
  font: 17px var(--font-display);
}

.empty-view h2 {
  margin: 30px 0 8px;
  font: 700 26px var(--font-display);
}

.empty-view p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.empty-view button {
  margin-top: 20px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--paper);
  cursor: pointer;
}

.drawer-backdrop {
  position: fixed;
  z-index: 35;
  inset: var(--header-height) 0 0 var(--rail-width);
  visibility: hidden;
  opacity: 0;
  background: rgba(37, 36, 33, 0.16);
  transition: opacity 220ms ease, visibility 220ms ease;
}

.drawer-backdrop.is-visible {
  visibility: visible;
  opacity: 1;
}

.detail-drawer {
  position: fixed;
  z-index: 40;
  top: calc(var(--header-height) + 12px);
  right: 12px;
  bottom: 12px;
  width: var(--drawer-width);
  overflow-y: auto;
  padding: 23px 25px 26px;
  border: 1px solid rgba(63, 61, 55, 0.28);
  border-radius: 7px 3px 8px 5px;
  background:
    radial-gradient(circle at 14% 12%, rgba(77, 73, 62, 0.03) 0 1px, transparent 1px),
    var(--paper-strong);
  background-size: 8px 8px;
  box-shadow: -18px 18px 60px rgba(37, 36, 33, 0.18);
  animation: drawer-in 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.detail-drawer::before {
  position: absolute;
  top: -2px;
  left: 50%;
  width: 84px;
  height: 18px;
  background: rgba(207, 200, 164, 0.6);
  content: "";
  transform: translate(-50%, -35%) rotate(-1deg);
}

@keyframes drawer-in {
  from {
    opacity: 0;
    transform: translateX(28px) rotate(0.4deg);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 19px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--pencil-light);
}

.drawer-type {
  color: var(--purple-deep);
  font: 700 9px var(--font-utility);
  letter-spacing: 0.12em;
}

.drawer-close {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.drawer-close:hover {
  color: var(--purple-deep);
  background: var(--purple-wash);
}

.drawer-close svg {
  width: 15px;
}

.version-title {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 14px;
  align-items: center;
}

.version-title > span {
  display: grid;
  height: 55px;
  place-items: center;
  border: 1px solid rgba(102, 91, 35, 0.2);
  background: var(--note);
  box-shadow: 2px 3px 0 rgba(76, 69, 35, 0.1);
  font: 700 12px var(--font-utility);
  transform: rotate(-2deg);
}

.version-title h2,
.feature-drawer h2 {
  margin: 0;
  font: 700 26px/1.25 var(--font-display);
  letter-spacing: -0.035em;
}

.version-title p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.feature-eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--purple-deep);
  font: 9px var(--font-utility);
}

.drawer-lead {
  margin: 17px 0 22px;
  color: #55524b;
  font: 14px/1.8 var(--font-display);
}

.drawer-section {
  margin-top: 23px;
}

.drawer-section h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 11px;
  font-size: 11px;
}

.drawer-section h3 span {
  color: var(--purple);
  font: 8px var(--font-utility);
}

.decision-list {
  display: grid;
  gap: 8px;
}

.decision-list article {
  padding: 12px 13px;
  border-left: 2px solid var(--purple);
  background: var(--purple-wash);
}

.decision-list strong {
  font-size: 10px;
}

.decision-list p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.linked-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.linked-feature {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 62px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 7px 4px 8px 5px;
  text-align: left;
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
}

.linked-feature:hover {
  border-color: var(--purple);
}

.linked-feature small,
.linked-feature strong {
  display: block;
}

.linked-feature small {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 7px;
}

.linked-feature strong {
  font-size: 10px;
}

.linked-feature svg {
  width: 14px;
  color: var(--purple);
}

.evidence-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.evidence-grid > div {
  min-width: 0;
}

.evidence-grid p {
  margin: 7px 0;
  color: var(--muted);
  font-size: 8px;
}

.open-issue {
  margin-top: 22px;
  padding: 12px 14px;
  border: 1px dashed rgba(102, 91, 35, 0.3);
  background: var(--note-light);
  transform: rotate(-0.5deg);
}

.open-issue span {
  font: 11px var(--font-display);
}

.open-issue p {
  margin: 5px 0 0;
  color: #6a6347;
  font-size: 9px;
}

.drawer-source {
  display: grid;
  margin-top: 26px;
  padding-top: 13px;
  border-top: 1px dashed var(--pencil-light);
}

.drawer-source span,
.drawer-source small {
  color: var(--muted);
  font-size: 8px;
}

.drawer-source strong {
  margin: 4px 0;
  font: 13px/1.5 var(--font-display);
}

.behavior-card {
  padding: 15px;
  border: 1px solid rgba(70, 68, 62, 0.18);
  border-radius: 7px 3px 8px 4px;
  background: rgba(244, 233, 169, 0.36);
}

.behavior-card > span {
  color: var(--muted);
  font: 8px var(--font-utility);
}

.behavior-card p {
  margin: 7px 0 11px;
  font: 13px/1.65 var(--font-display);
}

.behavior-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.behavior-card b {
  padding: 3px 7px;
  border: 1px solid rgba(70, 68, 62, 0.14);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.58);
  font-size: 8px;
  font-weight: 500;
}

.plain-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plain-list li {
  position: relative;
  padding-left: 15px;
  color: #514f49;
  font-size: 9px;
  line-height: 1.55;
}

.plain-list li::before {
  position: absolute;
  top: 5px;
  left: 1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--purple);
  content: "";
}

.code-map {
  display: grid;
  gap: 8px;
}

.code-map > div {
  display: grid;
  gap: 5px;
  padding: 10px 11px;
  border: 1px solid rgba(70, 68, 62, 0.12);
  background: rgba(255, 255, 255, 0.5);
}

.code-map span {
  color: var(--muted);
  font-size: 8px;
}

.code-map code {
  overflow: hidden;
  color: #49464f;
  font: 8px/1.5 var(--font-utility);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.revision-list {
  position: relative;
  display: grid;
  gap: 5px;
}

.revision-list::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 15px;
  width: 1px;
  background: var(--pencil-light);
  content: "";
}

.revision-list button {
  position: relative;
  display: grid;
  grid-template-columns: 31px 1fr auto;
  gap: 9px;
  align-items: center;
  min-height: 56px;
  padding: 8px 7px 8px 0;
  border: 0;
  border-radius: 8px;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.revision-list button:hover {
  background: var(--purple-wash);
}

.revision-agent {
  z-index: 1;
  width: 31px;
  height: 31px;
}

.revision-list strong,
.revision-list small {
  display: block;
}

.revision-list strong {
  font-size: 9px;
}

.revision-list small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.revision-list time {
  color: var(--muted);
  font-size: 7px;
}

.modify-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 46px;
  margin-top: 25px;
  padding: 0 15px;
  border: 0;
  border-radius: 9px 6px 10px 7px;
  color: white;
  background: var(--graphite);
  box-shadow: 3px 4px 0 rgba(37, 36, 33, 0.17);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.modify-button:hover {
  background: var(--purple-deep);
}

.modify-note {
  margin: 9px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 8px;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px 6px 10px 7px;
  color: white;
  background: var(--graphite);
  box-shadow: var(--shadow);
  font-size: 10px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1040px) {
  :root {
    --rail-width: 190px;
  }

  .project-header {
    grid-template-columns: 1fr auto;
  }

  .project-identity {
    display: none;
  }

  .archive-button {
    min-width: 38px;
  }

  .archive-button span {
    display: none;
  }

  .surface-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .capability-lane {
    grid-template-columns: 1fr;
  }

  .capability-line {
    display: none;
  }

  .capability-list {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  :root {
    --rail-width: 72px;
    --header-height: 66px;
    --drawer-width: calc(100vw - 20px);
  }

  body {
    overflow: auto;
  }

  .project-rail {
    padding: 14px 8px;
  }

  .wordmark {
    justify-content: center;
    padding: 0 0 20px;
  }

  .wordmark > span:last-child,
  .rail-label span,
  .project-switch > span:nth-child(2),
  .project-switch i,
  .new-project:not(:focus) {
    font-size: 0;
  }

  .rail-label {
    justify-content: center;
  }

  .project-switch {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 8px 0;
  }

  .new-project {
    justify-content: center;
    margin: 10px 0;
  }

  .new-project span {
    font-size: 18px;
  }

  .rail-foot > span:last-child {
    display: none;
  }

  .rail-foot {
    justify-content: center;
  }

  .project-header {
    padding: 0 12px;
  }

  .view-tabs button {
    padding: 0 10px;
  }

  .view-tabs button span {
    display: none;
  }

  .main-canvas.has-drawer {
    padding-right: 0;
  }

  .view-intro {
    align-items: flex-start;
    padding: 23px 20px 17px;
  }

  .timeline-legend,
  .map-summary {
    display: none;
  }

  .timeline-scroll {
    width: calc(100% - 20px);
    margin-left: 20px;
  }

  .product-map-view {
    width: calc(100% - 28px);
  }

  .product-map-view .view-intro {
    padding-right: 0;
    padding-left: 0;
  }

  .surface-grid {
    grid-template-columns: 1fr;
  }

  .capability-list {
    display: grid;
  }

  .capability-list button {
    min-width: 0;
  }

  .drawer-backdrop {
    inset: var(--header-height) 0 0 var(--rail-width);
  }

  .detail-drawer {
    top: calc(var(--header-height) + 10px);
    right: 10px;
    bottom: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
