/* Hallmark · macrostructure: Workbench · tone: trustworthy utility · anchor hue: river-blue + signal-orange */
:root {
  color-scheme: light;
  --bg: oklch(98.2% 0.004 235);
  --bg-2: oklch(93% 0.014 225);
  --surface: oklch(99.4% 0.002 240);
  --surface-2: oklch(96% 0.008 225);
  --ink: oklch(16% 0.018 246);
  --muted: oklch(42% 0.018 244);
  --line: oklch(76% 0.014 232);
  --soft-line: oklch(88% 0.01 232);
  --route: oklch(36% 0.105 198);
  --route-dark: oklch(24% 0.06 230);
  --signal: oklch(63% 0.155 34);
  --violet: oklch(38% 0.082 202);
  --moss: oklch(56% 0.1 145);
  --success-bg: oklch(91% 0.075 145);
  --success-ink: oklch(25% 0.08 145);
  --danger-bg: oklch(91% 0.065 32);
  --danger-ink: oklch(30% 0.1 32);
  --font-display: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 8px;
  --pill: 999px;
  --z-sticky: 20;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font-body);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  min-width: 320px;
  overflow-x: clip;
}
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  color: var(--ink);
  background:
    linear-gradient(90deg, oklch(16% 0.018 240 / 0.026) 1px, transparent 1px) 50% 0 / 64px 64px,
    linear-gradient(180deg, var(--bg) 0%, oklch(96.2% 0.008 230) 52%, var(--bg-2) 100%);
}


body[data-tier="advanced"] {
  --bg: oklch(80.5% 0.035 83);
  --bg-2: oklch(88% 0.048 87);
  --surface: oklch(92.2% 0.047 88);
  --surface-2: oklch(85.8% 0.038 84);
  --surface-3: oklch(76.5% 0.034 79);
  --ink: oklch(22.5% 0.018 68);
  --muted: oklch(38.5% 0.02 70);
  --line: oklch(63.5% 0.032 78);
  --soft-line: oklch(72% 0.03 82);
  --route: oklch(45% 0.118 31);
  --signal: oklch(57% 0.12 43);
  --water: oklch(51% 0.058 174);
  --water-soft: oklch(76% 0.04 178 / 0.36);
  --map-green: oklch(50% 0.072 142);
  --map-red: oklch(49% 0.14 29);
  --map-yellow: oklch(70% 0.09 86);
  --stamp-ink: oklch(18% 0.012 68);
  --success-bg: oklch(82% 0.07 126);
  --success-ink: oklch(28% 0.078 132);
  --danger-bg: oklch(82% 0.064 41);
  --danger-ink: oklch(34% 0.118 30);
  --cobble-line: oklch(39% 0.02 68 / 0.052);
  background:
    radial-gradient(circle at 18% 14%, color-mix(in oklch, var(--map-yellow), transparent 76%), transparent 28%),
    radial-gradient(circle at 82% 22%, color-mix(in oklch, var(--map-red), transparent 94%), transparent 30%),
    linear-gradient(180deg, var(--bg) 0%, color-mix(in oklch, var(--bg), var(--surface-2) 34%) 100%);
  font-family: var(--font-body);
}

body[data-tier="advanced"],
body[data-tier="advanced"] .hero-workbench,
body[data-tier="advanced"] .zed-empty-pane,
body[data-tier="advanced"] .zed-blank {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 44px 28px at 27px 24px, transparent 68%, var(--cobble-line) 69.5%, transparent 72%),
    radial-gradient(ellipse 52px 32px at 82px 64px, transparent 69%, var(--cobble-line) 70.5%, transparent 73%),
    radial-gradient(ellipse 38px 24px at 126px 28px, transparent 69%, var(--cobble-line) 70.5%, transparent 73%);
  background-size: 148px 92px;
}

button,
input,
textarea { font: inherit; }

button {
  border: 1px solid var(--ink);
  border-radius: var(--pill);
  padding: 0.86rem 1.16rem;
  color: var(--surface);
  background: var(--ink);
  font-weight: 900;
  cursor: pointer;
  transition: transform 180ms var(--ease-out), background-color 180ms var(--ease-out), border-color 180ms var(--ease-out), color 180ms var(--ease-out);
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--signal);
  border-color: var(--signal);
  color: var(--ink);
}

button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

button.secondary {
  background: oklch(99% 0.002 235 / 0.78);
  color: var(--ink);
}

button.danger {
  background: var(--danger-ink);
  border-color: var(--danger-ink);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 3px;
}

.shell {
  width: min(1320px, calc(100vw - 64px));
  margin: 0 auto;
  padding: 18px 0 56px;
}

.canvas {
  min-height: min(760px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  padding: 20px 0 38px;
}

.canvas::after {
  content: "";
  display: none;
  width: 100%;
  height: 44px;
  align-self: end;
  background:
    linear-gradient(var(--ink), var(--ink)) 0 0 / 100% 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 10px / 100% 4px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 23px / 100% 6px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 39px / 100% 3px no-repeat;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 56px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--ink);
  background: color-mix(in oklch, var(--bg), var(--surface) 72%);
}

.window-controls {
  display: none;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--surface);
  font-family: var(--font-display);
  font-weight: 900;
  box-shadow: inset -7px -5px 0 var(--signal), inset 6px 4px 0 var(--route);
}

.topbar strong,
.topbar span { display: block; }
.topbar strong {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 900;
}
.topbar span,
.route-badge {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
}

.route-badge {
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
  padding: 0.52rem 0.78rem;
}

.hero-workbench {
  display: grid;
  grid-template-columns: minmax(190px, 260px) minmax(0, 1fr);
  min-height: clamp(520px, 70vh, 720px);
  border: 1px solid color-mix(in oklch, var(--ink), var(--line) 42%);
  border-radius: var(--radius);
  overflow: hidden;
  background: color-mix(in oklch, var(--surface), white 60%);
  box-shadow: 0 28px 64px oklch(17% 0.018 250 / 0.1);
}

.hero-rail {
  display: grid;
  align-content: start;
  gap: 9px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, color-mix(in oklch, var(--surface-2), var(--bg) 35%), color-mix(in oklch, var(--bg), var(--surface) 42%));
  padding: 14px;
}

.rail-search {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  padding: 0.68rem 0.78rem;
  font-size: 0.92rem;
  font-weight: 800;
}

.rail-label {
  margin: 4px 0 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.rail-item {
  width: 100%;
  border-color: transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  padding: 0.72rem 0.78rem;
  text-align: left;
  font-weight: 900;
}

.rail-item.active,
.rail-item:hover:not(:disabled) {
  transform: none;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.hero-editor {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-width: 0;
}

.editor-tabs {
  display: flex;
  min-height: 38px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklch, var(--surface-2), white 28%);
}

.editor-tab {
  display: inline-flex;
  align-items: center;
  border-right: 1px solid var(--line);
  padding: 0 14px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
}

.editor-tab.active {
  color: var(--ink);
  background: var(--surface);
}

.editor-titlebar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding: clamp(24px, 4vw, 54px) clamp(22px, 5vw, 64px);
}


body[data-tier="advanced"] .shell {
  width: 100vw;
  margin: 0;
  padding: 0;
}

body[data-tier="advanced"] .canvas {
  min-height: 100vh;
  gap: 0;
  padding: 0;
}

body[data-tier="advanced"] .topbar {
  position: static;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 38px;
  gap: 14px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, color-mix(in oklch, var(--map-red), transparent 84%) 0 28%, transparent 28% 100%),
    color-mix(in oklch, var(--surface-2), var(--bg) 36%);
}

body[data-tier="advanced"] .window-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
}

body[data-tier="advanced"] .window-controls span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

body[data-tier="advanced"] .window-controls span:nth-child(1) { background: var(--danger-ink); }
body[data-tier="advanced"] .window-controls span:nth-child(2) { background: var(--signal); }
body[data-tier="advanced"] .window-controls span:nth-child(3) { background: var(--success-ink); }

body[data-tier="advanced"] .brand-lockup {
  position: relative;
  min-width: 0;
  gap: 8px;
}

body[data-tier="advanced"] .brand-mark {
  display: none;
}

body[data-tier="advanced"] .brand-lockup::before {
  content: "";
  width: 30px;
  height: 22px;
  border: 1px solid color-mix(in oklch, var(--stamp-ink), transparent 28%);
  border-radius: 4px;
  background:
    color-mix(in oklch, var(--surface), white 6%)
    url("./assets/cursus-publicus/postal-tablet-mark.png") center / 145% auto no-repeat;
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--surface), var(--stamp-ink) 10%);
  filter: grayscale(0.34) contrast(1.08);
}

body[data-tier="advanced"] .topbar strong {
  display: inline;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 720;
}

body[data-tier="advanced"] .topbar .brand-lockup span {
  display: inline;
  margin-left: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 680;
}

body[data-tier="advanced"] .route-badge {
  border-color: var(--line);
  border-radius: 4px;
  background:
    linear-gradient(90deg, color-mix(in oklch, var(--map-green), transparent 62%), transparent 34%),
    color-mix(in oklch, var(--surface), white 12%);
  color: var(--ink);
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 720;
}

body[data-tier="advanced"] .hero-workbench {
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: calc(100vh - 38px);
  border: 0;
  border-radius: 0;
  background: var(--bg);
  box-shadow: none;
}

body[data-tier="advanced"] .hero-rail {
  gap: 0;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 16px 52px, var(--map-red) 0 2px, transparent 2.8px),
    radial-gradient(circle at 22px 132px, var(--map-green) 0 2px, transparent 2.8px),
    linear-gradient(178deg, transparent 0 34%, color-mix(in oklch, var(--water), transparent 72%) 34.4% 36%, transparent 36.5%),
    color-mix(in oklch, var(--surface-2), var(--bg) 24%);
  padding: 0;
}

body[data-tier="advanced"] .rail-search {
  height: 38px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: color-mix(in oklch, var(--surface), white 8%);
  color: var(--muted);
  padding: 0.55rem 0.86rem;
  font-size: 0.84rem;
  font-weight: 650;
}

body[data-tier="advanced"] .rail-item {
  min-height: 44px;
  border-radius: 0;
  padding: 0.62rem 0.86rem;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 660;
}

body[data-tier="advanced"] .rail-item.active {
  border-color: transparent;
  background:
    linear-gradient(90deg, var(--map-red) 0 3px, transparent 3px),
    color-mix(in oklch, var(--surface), white 10%);
}

body[data-tier="advanced"] .editor-tabs {
  min-height: 38px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, color-mix(in oklch, var(--map-red), transparent 72%) 0 32px, transparent 32px),
    color-mix(in oklch, var(--surface-2), var(--bg) 26%);
}

body[data-tier="advanced"] .hero-editor {
  grid-template-rows: auto minmax(0, 1fr);
}

body[data-tier="advanced"] .editor-tab {
  min-width: 112px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 680;
}

body[data-tier="advanced"] .editor-tab.active {
  background: var(--surface);
}

body[data-tier="advanced"] .workspace-layout {
  display: none;
}

body[data-tier="advanced"] .work-menu {
  top: 12px;
  align-self: stretch;
  align-content: start;
  grid-auto-rows: max-content;
  border-right: 1px solid var(--line);
  background: color-mix(in oklch, var(--surface-2), var(--bg) 18%);
}

body[data-tier="advanced"] .work-main {
  gap: 0;
  background: var(--surface);
}

body[data-tier="advanced"] .panel,
body[data-tier="advanced"] .approval-strip {
  border-width: 0 0 1px;
  border-radius: 0;
  box-shadow: none;
  background: color-mix(in oklch, var(--surface), white 22%);
}

body[data-tier="advanced"] .section-title {
  align-items: start;
}

body[data-tier="advanced"] .section-title button {
  flex: 0 0 auto;
}

body[data-tier="advanced"] .work-main > :last-child {
  border-bottom: 0;
}

body[data-tier="advanced"] h2 {
  font-size: clamp(1.18rem, 1.4vw, 1.55rem);
  line-height: 1.08;
}

.plain-kicker {
  margin: 0 0 0.65rem;
  color: var(--route);
  font-size: 0.98rem;
  font-weight: 950;
}

h1,
h2,
h3,
h4,
p { margin-top: 0; }

h1,
h2,
h3 {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0;
  text-wrap: balance;
}

h1 {
  width: min(100%, 820px);
  margin-bottom: 0.9rem;
  font-size: clamp(2.8rem, 6vw, 6.25rem);
  line-height: 0.92;
}

h2 {
  margin-bottom: 0.72rem;
  font-size: clamp(1.55rem, 2.2vw, 2.35rem);
  line-height: 0.98;
}

h3 { font-size: 1.18rem; }
h4 { margin: 1rem 0 0.35rem; color: var(--route); font-size: 0.92rem; }

.promise {
  max-width: 780px;
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 1.38rem;
  font-weight: 750;
  line-height: 1.54;
  text-wrap: pretty;
}

.hero-copy {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.7vw, 1.32rem);
  font-weight: 750;
  line-height: 1.45;
}

.capture-box {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: clamp(20px, 3.5vw, 44px) clamp(22px, 5vw, 64px);
  text-align: left;
}

.capture-head,
.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.capture-label {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--ink);
  font-weight: 950;
}

.capture-modes,
.tag-list,
.action-row,
.memory-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.capture-modes span,
.coverage-list span,
.source-card span,
.stack-list span,
.action-list span,
.card-list span,
.loop-card span {
  display: inline-flex;
  width: fit-content;
  border-radius: var(--pill);
  padding: 0.28rem 0.52rem;
  background: color-mix(in oklch, var(--surface-2), white 35%);
  color: var(--route-dark);
  font-size: 0.74rem;
  font-weight: 950;
}

textarea {
  width: 100%;
  min-height: 168px;
  resize: vertical;
  border: 1px solid color-mix(in oklch, var(--line), var(--ink) 12%);
  border-radius: var(--radius);
  background: oklch(100% 0 0);
  color: var(--ink);
  padding: 1.08rem 1.12rem;
  font-size: 1.08rem;
  font-weight: 650;
  line-height: 1.52;
}

.action-row {
  margin: 14px 0 0;
}

.memory-actions {
  margin: 14px 0 10px;
}

.memory-output ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.memory-output li {
  margin: 0.2rem 0;
}

.capture-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.45;
}

.product-ribbon {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 20px 0;
  border: 1px solid var(--ink);
  background: var(--ink);
}

.product-ribbon article {
  min-height: 166px;
  padding: 18px;
  background: var(--surface);
}

.product-ribbon span {
  color: var(--signal);
  font-weight: 950;
}

.product-ribbon strong {
  display: block;
  margin: 0.55rem 0 0.5rem;
  font-size: 1.1rem;
}

.product-ribbon p,
.panel p,
.stack-list p,
.card-list p,
.coverage-list p,
.source-card p,
.loop-card p {
  color: var(--muted);
  line-height: 1.5;
}

.grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 22px;
}

.work-menu {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
}

.work-main {
  display: grid;
  gap: 18px;
}

.approval-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.78fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid color-mix(in oklch, var(--ink), var(--line) 46%);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px 24px;
}
.approval-strip h2,
.approval-strip p {
  margin-bottom: 0;
}

.add-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  margin-bottom: 14px;
  padding: 12px 14px;
}

.add-item summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 950;
}

.add-item .payment-contact-form {
  margin-top: 14px;
}

.status-grid,
.work-grid,
.final-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.75fr);
}

.middle-grid {
  grid-template-columns: minmax(620px, 1.45fr) minmax(320px, 0.75fr);
}

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

.panel {
  border: 1px solid color-mix(in oklch, var(--ink), var(--line) 46%);
  border-radius: var(--radius);
  background: color-mix(in oklch, var(--surface), white 45%);
  padding: 22px;
}

.room-status {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.room-status div,
.workspace-output,
.memory-output,
.plan-output,
.approval-output,
.summary-output,
.check-list,
.loop-output,
.stack-list article,
.card-list article,
.action-list article,
.coverage-list article,
.source-card,
.tag-list article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px;
}

.room-status span,
.plan-grid span,
dl dt {
  display: block;
  margin-bottom: 0.32rem;
  color: var(--route);
  font-size: 0.76rem;
  font-weight: 950;
}

.room-status strong,
.workspace-output strong,
.stack-list strong,
.card-list strong,
.action-list strong,
.coverage-list strong,
.source-card strong {
  display: block;
  color: var(--ink);
  line-height: 1.24;
}

.state-timeline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 12px 0;
}

.timeline-step {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface);
}

.timeline-step.done { background: var(--success-bg); color: var(--success-ink); }
.timeline-step.current { border-color: var(--signal); box-shadow: inset 0 -4px 0 var(--signal); }
.timeline-step span { display: block; font-weight: 950; }
.timeline-step small,
small { color: var(--muted); line-height: 1.42; }

.stack-list,
.card-list,
.action-list,
.source-list,
.coverage-list,
.check-list,
.loop-output {
  display: grid;
  gap: 10px;
}

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

.plan-grid div,
.question-strip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 13px;
}

.plan-grid p,
.question-strip ul,
.summary-output ul {
  margin: 0.35rem 0 0;
  color: var(--muted);
  line-height: 1.46;
}

.question-strip { margin-top: 10px; }
.question-strip strong { display: block; }

.payment-contact-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.payment-contact-form label {
  display: grid;
  gap: 5px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 950;
}

.payment-contact-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
  padding: 0.78rem 0.85rem;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: var(--surface-2);
  font-size: 0.78rem;
  font-weight: 950;
}

tr:last-child td { border-bottom: 0; }
tr.blocked { background: color-mix(in oklch, var(--danger-bg), var(--surface) 74%); }
tr.ready { background: color-mix(in oklch, var(--success-bg), var(--surface) 74%); }

.pill {
  display: inline-flex;
  border-radius: var(--pill);
  padding: 0.35rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.2;
}

.pill.blocked,
.summary-status.blocked,
.check.fail span,
.loop-card.blocked span { color: var(--danger-ink); background: var(--danger-bg); }
.pill.ready,
.summary-status.done,
.check.pass span,
.loop-card.ready span { color: var(--success-ink); background: var(--success-bg); }

.approval-panel p { color: var(--muted); }
.checkline {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 18px 0;
  color: var(--ink);
  font-weight: 750;
  line-height: 1.45;
}

.checkline input {
  width: 18px;
  height: 18px;
  margin-top: 0.22rem;
  accent-color: var(--signal);
}

dl { margin: 12px 0 0; }
dd { margin: 0.25rem 0 0.8rem; color: var(--muted); line-height: 1.42; }

.check {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.check span,
.summary-status {
  border-radius: var(--pill);
  padding: 0.3rem 0.5rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 950;
}

.check strong { display: block; margin-bottom: 0.2rem; }
.check small { display: block; }
.summary-status { display: inline-flex; margin-bottom: 0.9rem; }
.summary-output ul { padding-left: 1.15rem; }
.retention { border-top: 1px solid var(--line); padding-top: 12px; }

.tag-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
}

.tag-list article strong { display: block; margin-bottom: 0.3rem; }

.coverage-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.coverage-list article.wired { border-color: var(--success-ink); }
.coverage-list article.demoed { border-color: var(--route); }
.coverage-list article.modeled { border-color: var(--signal); }
.coverage-list article.planned { border-color: var(--line); }

.activity-panel ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-panel li {
  display: grid;
  grid-template-columns: 110px 220px 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px;
}

.activity-panel span { color: var(--muted); }
.activity-panel strong { color: var(--route); }
.activity-panel p { margin: 0; }

.empty { color: var(--muted); }


.advanced-workbench {
  display: grid;
  grid-template-columns: minmax(390px, 0.42fr) minmax(0, 1fr) 286px;
  grid-template-rows: minmax(0, 1fr) 34px;
  min-height: 100%;
  background: var(--bg);
}

.advanced-workbench[hidden] {
  display: none;
}

.advanced-thread-main,
.advanced-change-rail {
  min-width: 0;
  min-height: 0;
}

.advanced-thread-rail {
  display: grid;
  align-content: start;
  gap: 9px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(178deg, transparent 0 58%, color-mix(in oklch, var(--water), transparent 74%) 58.2% 60%, transparent 60.4%),
    color-mix(in oklch, var(--surface-2), var(--bg) 12%);
  padding: 12px;
}

.rail-search.compact {
  padding: 0.58rem 0.68rem;
  font-size: 0.86rem;
}

.thread-row {
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  padding: 0.66rem 0.7rem;
  text-align: left;
  font-size: 0.92rem;
  font-weight: 850;
}

.thread-row.active,
.thread-row:hover:not(:disabled) {
  transform: none;
  background: color-mix(in oklch, var(--surface), white 28%);
  color: var(--ink);
}

.advanced-thread-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 94% 8%, color-mix(in oklch, var(--map-yellow), transparent 68%), transparent 18%),
    var(--surface);
}

.advanced-thread-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  padding: 0 12px 0 16px;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 900;
}

.advanced-thread-title small {
  display: block;
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.thread-tools {
  display: flex;
  gap: 4px;
}

.thread-tools span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  border: 0;
  border-radius: 4px;
  padding: 0;
  background: transparent;
  color: var(--muted);
}

.thread-tools span:hover {
  transform: none;
  background: color-mix(in oklch, var(--surface-2), var(--bg) 18%);
  color: var(--ink);
}

.agent-thread {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  padding: 10px;
}

.thread-message {
  width: min(100%, 620px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 98% 50%, color-mix(in oklch, var(--map-red), transparent 72%) 0 18px, transparent 19px),
    color-mix(in oklch, var(--surface), white 18%);
  padding: 10px 12px;
}

.thread-message.assistant {
  border-color: color-mix(in oklch, var(--map-red), var(--line) 50%);
  background:
    linear-gradient(0deg, color-mix(in oklch, var(--map-red), transparent 91%), transparent),
    color-mix(in oklch, var(--surface), var(--bg-2) 18%);
}

.thread-message span,
.context-shelf span {
  display: block;
  margin-bottom: 0.34rem;
  color: var(--route);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.thread-message p {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 720;
  line-height: 1.45;
}

.context-shelf {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.context-shelf article {
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in oklch, var(--water), transparent 88%), transparent 42%),
    color-mix(in oklch, var(--surface-2), white 18%);
  padding: 10px;
}

.context-shelf strong {
  display: block;
  color: var(--ink);
  font-size: 0.94rem;
}

.context-shelf p {
  margin: 0.36rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.35;
}

.agent-composer {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in oklch, var(--surface), white 18%);
  padding: 10px 12px;
}

.composer-placeholder {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 690;
}

.agent-run-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  background:
    linear-gradient(90deg, color-mix(in oklch, var(--map-red), transparent 80%) 0 1px, transparent 1px 100%) 0 0 / 44px 100%,
    color-mix(in oklch, var(--surface-2), white 18%);
}

.agent-run-strip article {
  min-height: 98px;
  border-right: 1px solid var(--line);
  padding: 12px 14px;
}

.agent-run-strip article:last-child {
  border-right: 0;
}

.agent-run-strip span,
.change-list span {
  display: block;
  margin-bottom: 0.34rem;
  color: var(--route);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.agent-run-strip strong,
.change-list strong {
  display: block;
  color: var(--ink);
  font-size: 0.96rem;
}

.agent-run-strip p,
.change-list small {
  margin: 0.28rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.35;
}

.advanced-change-rail {
  border-left: 1px solid var(--line);
  background:
    radial-gradient(circle at 86% 96%, color-mix(in oklch, var(--water), transparent 78%), transparent 24%),
    color-mix(in oklch, var(--surface), white 5%);
}

.change-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklch, var(--surface-2), white 10%);
  text-align: center;
}

.change-tabs strong,
.change-tabs span {
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  font-weight: 900;
}

.change-tabs span {
  border-left: 1px solid var(--line);
  color: var(--muted);
}

.change-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.change-list article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, color-mix(in oklch, var(--map-red), transparent 86%) 0 9px, transparent 9px),
    color-mix(in oklch, var(--surface), white 12%);
  padding: 11px;
}

.advanced-statusbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(90deg, color-mix(in oklch, var(--stamp-ink), transparent 92%) 0 1px, transparent 1px 100%) 0 0 / 22px 100%,
    color-mix(in oklch, var(--surface-2), var(--bg) 26%);
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
}

.zed-empty-pane {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 190px;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}

.zed-blank {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 0;
  border-bottom: 1px solid var(--line);
  padding: clamp(12px, 2vw, 28px);
  background:
    linear-gradient(180deg, color-mix(in oklch, var(--surface), transparent 76%), transparent 48%),
    url("./assets/cursus-publicus/peutinger-map-full.png") 50% 52% / min(88%, 860px) auto no-repeat,
    var(--bg);
}

.cursus-artifact-board {
  position: relative;
  width: min(94%, 760px);
  height: min(72%, 430px);
  min-height: 294px;
  isolation: isolate;
}

.cursus-artifact-board img {
  position: absolute;
  display: block;
  max-width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.artifact-map-full {
  inset: 2% 7% auto;
  width: 86%;
  opacity: 0.18;
  mix-blend-mode: multiply;
  filter: saturate(0.82) contrast(0.98);
  z-index: 0;
}

.artifact-map-strip {
  top: 4%;
  left: 3%;
  width: 94%;
  opacity: 0.95;
  filter: saturate(0.9) contrast(1.02) drop-shadow(0 1px 0 color-mix(in oklch, var(--stamp-ink), transparent 70%));
  z-index: 2;
}

.artifact-tablet {
  left: 1%;
  bottom: 5%;
  width: min(30%, 210px);
  opacity: 0.78;
  filter: grayscale(0.18) contrast(1.1);
  z-index: 4;
}

.artifact-relief {
  right: 2%;
  bottom: 2%;
  width: min(42%, 310px);
  opacity: 0.9;
  filter: grayscale(0.16) saturate(0.72) contrast(1.02);
  z-index: 3;
}

.artifact-sketch {
  left: 35%;
  bottom: 1%;
  width: min(34%, 250px);
  opacity: 0.67;
  filter: grayscale(0.32) contrast(1.04);
  z-index: 5;
}

.zed-debugger {
  display: grid;
  grid-template-columns: minmax(150px, 0.34fr) minmax(160px, 0.52fr) minmax(240px, 1fr);
  min-height: 0;
  background:
    linear-gradient(90deg, color-mix(in oklch, var(--water), transparent 84%) 0 32%, transparent 32%),
    color-mix(in oklch, var(--surface-2), var(--bg) 18%);
}

.debug-title,
.debug-empty,
.debug-actions {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 12px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 680;
}

.debug-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.debug-actions {
  display: grid;
  align-content: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink);
}

.debug-actions span {
  display: block;
  color: var(--ink);
  font-size: 0.94rem;
}

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

@media (max-width: 1120px) {
  .hero-workbench,
  body[data-tier="advanced"] .hero-workbench,
  .workspace-layout,
  .approval-strip,
  .status-grid,
  .work-grid,
  .middle-grid,
  .final-grid,
  .product-grid { grid-template-columns: 1fr; }
  .product-ribbon { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-menu { position: static; }
  .payment-contact-form { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .advanced-workbench {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto 34px;
    min-width: 0;
  }
  .advanced-thread-rail,
  .advanced-change-rail {
    border-left: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .zed-empty-pane {
    min-height: 560px;
  }
  .cursus-artifact-board {
    width: min(96%, 720px);
    min-height: 320px;
  }
}

@media (max-width: 720px) {
  .shell { width: min(100% - 24px, 1320px); padding-top: 10px; }
  .topbar { position: static; align-items: flex-start; flex-direction: column; }
  .route-badge { width: 100%; }
  .canvas { min-height: auto; gap: 42px; padding-bottom: 20px; }
  .canvas::after { height: 30px; background-size: 100% 2px, 100% 3px, 100% 4px, 100% 2px; background-position: 0 0, 0 8px, 0 19px, 0 29px; }
  .blank-slate { text-align: left; justify-items: start; }
  .hero-workbench, body[data-tier="advanced"] .hero-workbench { grid-template-columns: minmax(0, 1fr); min-height: auto; }
  .hero-rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .editor-titlebar { flex-direction: column; }
  .editor-tabs { overflow-x: auto; }
  h1 { font-size: clamp(2.65rem, 13vw, 4.25rem); line-height: 0.94; }
  .promise { font-size: 1.08rem; }
  .capture-box,
  .panel { padding: 16px; }
  .capture-head,
  .section-title { flex-direction: column; }
  .action-row,
  .action-row button { width: 100%; }
  .action-row { display: grid; grid-template-columns: 1fr; }
  .agent-run-strip { grid-template-columns: 1fr; }
  .advanced-statusbar { gap: 10px; overflow-x: auto; }
  .zed-empty-pane {
    grid-template-rows: minmax(330px, 1fr) auto;
    min-height: 520px;
  }
  .zed-debugger {
    grid-template-columns: 1fr;
  }
  .debug-title,
  .debug-empty,
  .debug-actions {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .cursus-artifact-board {
    width: 100%;
    min-height: 300px;
  }
  .artifact-tablet {
    width: min(34%, 150px);
  }
  .artifact-relief {
    width: min(46%, 210px);
  }
  .artifact-sketch {
    left: 30%;
    width: min(39%, 180px);
  }
  .room-status,
  .state-timeline,
  .plan-grid,
  .product-ribbon,
  .approval-strip,
  .payment-contact-form,
  .activity-panel li { grid-template-columns: 1fr; }
  .product-ribbon article { min-height: 0; }
  .check { grid-template-columns: 1fr; }
}
