@import url("/fonts.css");

:root {
  --background: 30 15% 96%;
  --foreground: 230 25% 12%;
  --card: 0 0% 100%;
  --muted: 30 10% 90%;
  --muted-foreground: 230 10% 45%;
  --primary: 12 76% 61%;
  --primary-deep: 12 76% 52%;
  --secondary: 280 60% 35%;
  --border: 30 10% 88%;
  --border-soft: 30 10% 92%;
  --ring: 12 76% 61%;
  --radius: 0.75rem;
  --gradient-primary: linear-gradient(135deg, hsl(12 76% 61%), hsl(280 60% 45%));
  --gradient-glow: linear-gradient(135deg, hsl(12 76% 61% / 0.3), hsl(280 60% 45% / 0.3));
  --shadow-glow: 0 0 40px hsl(12 76% 61% / 0.15);
  --shadow-card: 0 4px 24px hsl(230 25% 12% / 0.06);
  --ease-sqncr: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --off: hsl(var(--background));
  --ink: hsl(var(--foreground));
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font-family: inherit; font-feature-settings: inherit; }
::selection { background: hsl(12 76% 61% / 0.22); }

@keyframes sq-in { from { opacity: 0; transform: translateY(14px) scale(0.965); } to { opacity: 1; transform: none; } }
@keyframes sq-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sq-draw { from { stroke-dashoffset: var(--len, 600); opacity: 0.2; } to { stroke-dashoffset: 0; opacity: 1; } }
@keyframes sq-glow { 0%, 100% { opacity: 0.35; transform: scale(1); } 50% { opacity: 0.8; transform: scale(1.06); } }
@keyframes sq-ghost { 0%, 100% { opacity: 0.5; } 50% { opacity: 0.9; } }
@keyframes sq-bar { 0%, 100% { transform: scaleY(0.22); } 50% { transform: scaleY(1); } }
@keyframes sq-sweep { 0% { transform: translateX(-30%); } 100% { transform: translateX(130%); } }
@keyframes sq-slide-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes sq-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

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

.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 640px;
  overflow: hidden;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 24px;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(30 15% 96% / 0.86);
  backdrop-filter: blur(14px);
  flex: 0 0 auto;
  z-index: 40;
}
.brand { display: flex; align-items: baseline; gap: 14px; }
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: hsl(var(--primary-deep));
  margin: 0;
  text-transform: uppercase;
}
.top h1 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 4px 0 0;
  font-style: normal;
  font-family: Inter, sans-serif;
}
.context {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  padding-left: 14px;
  border-left: 1px solid hsl(var(--border));
}
.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.more-actions { position: relative; }
.more-actions > summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid hsl(var(--border));
  background: #fff;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.more-actions > summary::-webkit-details-marker { display: none; }
.more-actions-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 188px;
  padding: 8px;
  border: 1px solid hsl(var(--border));
  border-radius: 16px;
  background: hsl(0 0% 100% / 0.96);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 32px hsl(230 25% 12% / 0.12);
  z-index: 50;
}
.more-actions-menu .btn { width: 100%; text-align: left; }

.toggle {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background: #fff;
}
.toggle button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
}
.toggle button.on {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
}

.btn {
  cursor: pointer;
  border: 1px solid hsl(var(--border));
  background: #fff;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.btn.primary {
  border: none;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  padding: 10px 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn.primary .live-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: hsl(var(--primary));
  animation: sq-dot 2s ease-in-out infinite;
}
.btn.primary.hot { background: hsl(var(--primary)); color: #fff; }
button:disabled { opacity: 0.4; cursor: not-allowed; }

.screen { flex: 1; min-height: 0; display: flex; }
.screen[hidden] { display: none !important; }

.speak {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 32px 24px;
  overflow: auto;
}
.speak-inner {
  width: 100%;
  max-width: 780px;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  text-align: center;
}
.speak-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: hsl(var(--primary-deep));
}
.speak-inner h2 {
  margin: 0;
  font-size: clamp(2rem, 1.5rem + 2.2vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  max-width: 16em;
  text-wrap: balance;
}
.speak-inner h2 em {
  font-style: italic;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
}
.speak-copy {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: hsl(var(--muted-foreground));
  max-width: 44ch;
}

.mic-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.mic-glow {
  position: absolute;
  inset: -18px;
  border-radius: 999px;
  background: var(--gradient-glow);
  filter: blur(26px);
  animation: sq-glow 3s ease-in-out infinite;
  pointer-events: none;
}
.mic {
  position: relative;
  width: 104px;
  height: 104px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: var(--gradient-primary);
  box-shadow: 0 10px 40px hsl(12 76% 61% / 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mic-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 38px;
}
.mic-bars span {
  width: 5px;
  height: 38px;
  border-radius: 999px;
  background: hsl(0 0% 100% / 0.92);
  transform-origin: center;
  animation: sq-bar 1.1s ease-in-out infinite;
  animation-play-state: paused;
}
.mic.hot .mic-bars span { animation-play-state: running; }
.mic-hint { font-size: 13px; font-weight: 600; color: hsl(var(--muted-foreground)); }

.transcript {
  width: 100%;
  border: 1px solid hsl(var(--border));
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  text-align: left;
}
.transcript-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid hsl(var(--border-soft));
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: hsl(var(--muted-foreground));
}
.transcript-meta { font-size: 11px; font-weight: 600; color: hsl(var(--primary-deep)); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.transcript-body {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0;
  resize: vertical;
  background: transparent;
  color: hsl(var(--foreground));
  padding: 18px;
  min-height: 132px;
  max-height:180px;
  overflow:auto;
  overflow-wrap:anywhere;
  text-align:left;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13.5px;
  line-height: 1.75;
}
.transcript-body::placeholder { color: hsl(var(--muted-foreground)); }
.transcript-body:focus-visible { outline: 2px solid hsl(var(--primary)); outline-offset: -3px; }
.caret {
  display: inline-block;
  width: 8px;
  height: 16px;
  margin-left: 2px;
  vertical-align: -2px;
  background: hsl(var(--primary));
  animation: sq-dot 1s steps(1, end) infinite;
}
.placeholder { color: hsl(230 10% 62%); font-style: italic; }
.transcript-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  padding: 14px 18px;
  border-top: 1px solid hsl(var(--border-soft));
  background: hsl(30 15% 98%);
}
.transcript-foot input {
  flex: 1;
  border: 1px solid hsl(var(--border));
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  background: #fff;
  color: hsl(var(--foreground));
  outline: none;
}
.transcript-foot input:focus { border-color: hsl(var(--primary)); }
.build-btn {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 11px 22px;
  font-size: 13px;
  font-weight: 600;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.hints {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.stage {
  position: relative;
  flex: 1;
  display: flex;
  min-height: 0;
  min-width: 0;
}
.board {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.goalbar {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 24px;
  border-bottom: 1px solid hsl(var(--border));
  background: #fff;
  flex: 0 0 auto;
}
.goalbar .kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: hsl(var(--primary-deep));
  margin-bottom: 4px;
}
.goalbar .title { font-size: 15px; font-weight: 700; letter-spacing: -0.015em; }
.goalbar .done { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 2px; }
.stats { display: flex; gap: 22px; margin-left: auto; }
.stat { text-align: right; }
.stat b {
  display: block;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: hsl(var(--primary-deep));
}
.stat span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: hsl(var(--muted-foreground));
}

.canvas-wrap { flex: 1; position: relative; min-height: 0; }
.graph-lage {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  pointer-events: none;
}
.graph-lage[hidden] { display: none; }
.lage-chip {
  pointer-events: auto;
  border: 1px solid hsl(12 76% 61% / 0.35);
  background: hsl(12 50% 98% / 0.94);
  color: hsl(var(--primary-deep));
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.lage-chip[data-lage="open"] { border-color: hsl(230 10% 80%); background: hsl(0 0% 100% / 0.94); color: hsl(var(--foreground)); }
.lage-chip[data-lage="loop"] { border-color: hsl(280 40% 78%); background: hsl(280 40% 98% / 0.94); color: hsl(var(--secondary)); }
.card-peek {
  position: absolute;
  z-index: 12;
  width: min(260px, calc(100% - 24px));
  padding: 12px 14px;
  border: 1px solid hsl(var(--border));
  border-radius: 16px;
  background: hsl(0 0% 100% / 0.96);
  box-shadow: 0 12px 32px hsl(230 25% 12% / 0.12);
  pointer-events: none;
}
.card-peek[hidden] { display: none; }
.card-peek strong { display: block; font-size: 14px; line-height: 1.3; margin: 2px 0 6px; }
.card-peek p { margin: 0 0 4px; font-size: 12px; line-height: 1.45; color: hsl(var(--muted-foreground)); }
.card-peek .peek-kind { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: hsl(var(--primary-deep)); }
.card-peek .peek-alert { color: hsl(var(--primary-deep)); font-weight: 600; }
.card-peek .peek-kicker { display: block; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; }
.card-peek .peek-alert[data-lage="conflict"] { color: hsl(var(--secondary)); }
.card-peek .peek-detail { overflow-wrap: anywhere; }
.step-lage { margin: 0 0 12px; padding: 12px; border: 1px solid hsl(12 76% 61% / 0.35); border-radius: 12px; background: hsl(12 50% 98%); }
.step-lage-item { margin: 0 0 8px; font-size: 13px; line-height: 1.4; color: hsl(var(--foreground)); }
.step-lage-item:last-of-type { margin-bottom: 0; }
.step-lage-kicker { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: hsl(var(--primary-deep)); margin-bottom: 2px; }
.step-lage[data-state="conflict"] { border-color: hsl(280 40% 78%); background: hsl(280 40% 98%); }
.step-lage[data-state="conflict"] .step-lage-kicker, .step-lage-item[data-lage="conflict"] .step-lage-kicker { color: hsl(var(--secondary)); }
.lage-chip[data-lage="friction"] { border-color: hsl(280 40% 78%); background: hsl(280 40% 98% / 0.94); color: hsl(var(--secondary)); }
.card-link-line {
  position: fixed;
  left: 0;
  top: 0;
  height: 2px;
  background: hsl(var(--primary));
  transform-origin: 0 50%;
  pointer-events: none;
  z-index: 40;
}
.card-link-line[hidden] { display: none; }
.card-link {
  position: absolute;
  right: -7px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  padding: 0;
  border: 2px solid hsl(var(--primary));
  border-radius: 999px;
  background: #fff;
  cursor: crosshair;
  opacity: 0;
  z-index: 3;
}
.card:hover .card-link, .card.is-on .card-link, .card-link:focus-visible { opacity: 1; }
.card.has-friction { box-shadow: 0 0 0 1px hsl(12 76% 61% / 0.35); }
.card.is-open-role .owner-name { color: hsl(var(--muted-foreground)); }
.canvas {
  position: absolute;
  inset: 0;
  overflow: auto;
  background: hsl(var(--background));
  overscroll-behavior: contain;
}
.canvas[data-view="flow"], .canvas[data-view="swim"] { touch-action: none; }
.canvas[data-view="roles"], .canvas[data-view="xml"] { padding-right: var(--inspector-width, 0px); }
.canvas[data-view="roles"] {
  padding: 88px 24px 130px 24px;
  padding-right: calc(24px + var(--inspector-width, 0px));
  touch-action: pan-x pan-y;
}
@media (min-width: 900px) {
  .canvas[data-view="roles"] { padding-left: 360px; }
}
.world { position: relative; transform-origin: 0 0; }
.canvas .world { margin: 0; }
.canvas-space { display: block; }
.canvas.can-pan, .canvas.can-pan .card { cursor:grab; }
.canvas.is-panning, .canvas.is-panning .card { cursor:grabbing; user-select:none; }
.canvas[data-view="xml"] { padding-right:var(--inspector-width,0px); }
.lane-guide {
  position: absolute;
  border-left: 1px dashed hsl(30 10% 84%);
}
.lane-lab {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: hsl(var(--muted-foreground));
}
.lane-lab b { color: hsl(var(--primary-deep)); font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: 0; }
.pkg {
  position: absolute;
  border: 1px dashed hsl(12 76% 61% / 0.3);
  border-radius: 20px;
  background: hsl(12 76% 61% / 0.035);
  animation: sq-fade 0.6s var(--ease-sqncr) both;
  pointer-events: none;
}
.pkg span {
  position: absolute;
  left: 16px;
  top: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: hsl(12 76% 44%);
  background: #fff;
  border: 1px solid hsl(12 76% 61% / 0.3);
  border-radius: 999px;
  padding: 4px 10px;
}
.ghost {
  position: absolute;
  border: 1px dashed hsl(30 10% 80%);
  border-radius: 16px;
  background: hsl(0 0% 100% / 0.45);
  animation: sq-ghost 1.6s ease-in-out infinite;
  pointer-events: none;
}
.card {
  position: absolute;
  cursor: grab;
  border: 1px solid hsl(var(--border));
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
  animation: sq-in 0.55s var(--ease-sqncr) both;
  transition: border-color 0.2s var(--ease-sqncr), box-shadow 0.2s var(--ease-sqncr);
}
.card button { cursor: pointer; }
.card .card-link { cursor: crosshair; }
.card.is-moving {
  cursor: grabbing;
  z-index: 6;
  animation: none;
  transition: none;
  box-shadow: 0 16px 40px hsl(230 25% 12% / 0.16);
  user-select: none;
}
.canvas.is-moving-card .edges { opacity: 0.35; }
.card:hover { border-color: hsl(12 76% 61% / 0.45); }
.card.is-on {
  border-width: 2px;
  border-color: hsl(var(--primary));
  box-shadow: 0 10px 34px hsl(12 76% 61% / 0.22);
}
.card.is-trigger { background: linear-gradient(160deg, #fff, hsl(12 76% 61% / 0.07)); border-color: hsl(12 76% 61% / 0.35); }
.card.is-output { background: linear-gradient(160deg, #fff, hsl(280 60% 45% / 0.07)); border-color: hsl(280 60% 45% / 0.35); }
.card.is-decision { border-radius: 18px; }
.card-top { display: flex; align-items: center; gap: 7px; }
.role-dot { width: 7px; height: 7px; border-radius: 999px; flex: 0 0 auto; }
.role-dot.sq { border-radius: 2px; }
.card-kind {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.card-dur {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 600;
  color: hsl(230 10% 58%);
  font-variant-numeric: tabular-nums;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.22;
  flex: 0 0 auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card.swim .card-title { font-size: 16px; }
.card-done {
  font-size: 11.5px;
  line-height: 1.45;
  color: hsl(var(--muted-foreground));
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-role {
  margin-top: auto;
  font-size: 10px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.edge-lab {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--background));
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
}
.edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.edges path.line-under {
  fill: none;
  pointer-events: none;
}
.edges path.line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: sq-draw 0.75s var(--ease-sqncr) both;
}
.edges path.head { animation: sq-fade 0.4s 0.5s both; }
.edges path.hit { pointer-events: stroke; cursor: pointer; }
.edges path.hit:focus-visible { outline: none; stroke: hsl(12 76% 61% / .35); }

.swim-lane {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 0 16px;
  width: 100%;
  border-radius: 22px;
  background: color-mix(in srgb, var(--lane, hsl(230 10% 50%)) 8%, hsl(30 15% 97%));
  border: 1px solid color-mix(in srgb, var(--lane, hsl(230 10% 50%)) 16%, transparent);
  pointer-events: none;
  z-index: 0;
}
.swim-lane .who { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: -0.01em; max-width: 176px; }
.swim-lane .meta { font-size: 10.5px; color: hsl(var(--muted-foreground)); padding-left: 17px; max-width: 176px; }
.world .card { z-index: 1; }

.sweep {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.sweep i {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 180px;
  background: linear-gradient(90deg, transparent, hsl(12 76% 61% / 0.16), transparent);
  animation: sq-sweep 2.2s linear infinite;
}

.build-dock {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
}
.build-card {
  pointer-events: auto;
  width: min(560px, 100%);
  border: 1px solid hsl(var(--border));
  border-radius: 18px;
  background: hsl(0 0% 100% / 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 40px hsl(230 25% 12% / 0.12);
  padding: 18px 20px;
  animation: sq-in 0.5s both;
}
.build-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.build-head .pulse {
  width: 9px; height: 9px; border-radius: 999px;
  background: hsl(var(--primary));
  animation: sq-dot 1.2s ease-in-out infinite;
}
.build-bar {
  height: 4px;
  border-radius: 999px;
  background: hsl(var(--muted));
  overflow: hidden;
  margin-bottom: 14px;
}
.build-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--gradient-primary);
  transition: width 0.25s linear;
}
.phase { display: flex; align-items: center; gap: 10px; font-size: 12px; margin: 7px 0; }
.phase i {
  width: 14px; height: 14px; border-radius: 999px;
  border: 1px solid hsl(30 10% 84%);
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; color: #fff; flex: 0 0 auto;
}
.phase.is-done i { background: hsl(var(--primary)); border-color: hsl(var(--primary)); }
.phase.is-on { font-weight: 600; color: hsl(12 76% 44%); }
.phase.is-on i { border-color: hsl(var(--primary)); }
.phase .note { margin-left: auto; font-variant-numeric: tabular-nums; color: hsl(230 10% 58%); }

.zoom[hidden] { display: none; }
.zoom {
  position: absolute;
  right: 20px;
  bottom: 20px;
  display: flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background: hsl(0 0% 100% / 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 24px hsl(230 25% 12% / 0.08);
  z-index: 5;
}
.zoom button {
  cursor: pointer;
  border: none;
  background: transparent;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
}
.zoom .fit { width: auto; padding: 0 10px; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.type-look[hidden] { display: none; }
.type-look {
  position: absolute;
  left: 16px;
  bottom: 20px;
  display: flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background: hsl(0 0% 100% / 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 24px hsl(230 25% 12% / 0.08);
  z-index: 5;
}
.type-look button {
  cursor: pointer;
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
}
.type-look button.on {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
}

.roles {
  padding: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 18px;
  max-width: none;
  width: max-content;
  min-height: calc(100vh - 250px);
  box-sizing: border-box;
}
.person {
  border: 1px solid hsl(var(--border));
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-card);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 300px;
  min-width: 300px;
  max-width: 300px;
  box-sizing: border-box;
  animation: sq-in 0.55s var(--ease-sqncr) both;
}
.person-head { display: flex; align-items: flex-start; gap: 12px; }
.avatar {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex: 0 0 auto;
}
.person h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.015em; }
.person .kind {
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em; margin-top: 3px;
}
.person .count { margin-left: auto; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: hsl(var(--muted-foreground)); }
.person .owns { font-size: 13px; line-height: 1.6; color: hsl(var(--muted-foreground)); margin: 0; display: block; }
.person-items {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-top: 1px solid hsl(var(--border-soft));
  padding-top: 12px;
}
.person-items button {
  text-align: left; border: none; background: transparent; cursor: pointer;
  padding: 7px 8px; margin: 0 -8px; border-radius: 8px;
  display: flex; flex-direction: row; align-items: flex-start; gap: 10px;
  white-space: normal;
}
.person-items button:hover { background: hsl(30 10% 94%); }
.person-items .ty { font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; color: hsl(230 10% 58%); width: 96px; flex: 0 0 auto; padding-top: 3px; }
.person-items .nm { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; overflow: visible; }
.handoff {
  font-size: 11.5px; color: hsl(var(--muted-foreground));
  border-top: 1px solid hsl(var(--border-soft)); padding-top: 12px;
  flex: none; max-width: none;
}
.handoff b { color: hsl(var(--foreground)); font-weight: 600; }

.xml-wrap { padding: 28px; max-width: 1100px; margin: 0 auto; }
.xml-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.xml-box {
  border: 1px solid hsl(var(--border));
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-card);
  padding: 22px 0;
  overflow: auto;
  max-height: calc(100vh - 240px);
}
.xml-line {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre;
}

.ticket {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 33.333%;
  min-width: 320px;
  max-width: 560px;
  z-index: 8;
  border-left: 1px solid hsl(var(--border));
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-shadow: -16px 0 40px hsl(230 25% 12% / 0.08);
  animation: sq-slide-in 0.35s var(--ease-sqncr) both;
}
.ticket[hidden], .ticket.is-empty { display: none; }
.ticket-head {
  padding: 22px 26px 18px;
  border-bottom: 1px solid hsl(var(--border-soft));
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 0 0 auto;
}
.ticket-head input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  margin-left: -8px;
  padding: 8px 10px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: transparent;
  color: hsl(var(--foreground));
  outline: none;
}
.ticket-head input:focus { border-color: hsl(var(--primary)); background: hsl(30 15% 98%); }
.ticket-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.field { display: flex; flex-direction: column; gap: 10px; }
.field label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: hsl(var(--muted-foreground));
}
.field label.done { color: hsl(var(--primary-deep)); }
.field textarea, .field input, .field select {
  width: 100%;
  border: 1px solid hsl(var(--border));
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.55;
  color: hsl(var(--foreground));
  background: hsl(30 15% 98%);
  outline: none;
}
.field textarea {
  min-height: 168px;
  resize: vertical;
}
.field textarea#t-done {
  min-height: 128px;
}
.field textarea:focus, .field input:focus, .field select:focus {
  border-color: hsl(var(--primary));
  background: #fff;
}
.chip {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  border: 1px solid hsl(var(--border));
  border-radius: 7px;
  padding: 5px 8px;
  display: inline-block;
  margin: 0 6px 6px 0;
}
.pill {
  font-size: 10.5px;
  font-weight: 600;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  padding: 4px 10px;
  color: hsl(var(--muted-foreground));
}
.wire {
  text-align: left;
  cursor: pointer;
  border: 1px solid hsl(var(--border));
  border-radius: 10px;
  background: #fff;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.wire:hover { border-color: hsl(12 76% 61% / 0.4); }
.ticket-foot {
  padding: 16px 22px;
  border-top: 1px solid hsl(var(--border-soft));
  display: flex;
  gap: 10px;
  background: hsl(30 15% 98%);
}
.ticket-foot button { flex: 1; border-radius: 10px; padding: 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.danger {
  border: 1px solid hsl(0 84% 60% / 0.3);
  background: hsl(0 84% 60% / 0.06);
  color: hsl(0 70% 45%);
}

.status {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
  padding: 0 24px 10px;
}
.status.slow { color: hsl(var(--primary-deep)); }

@media (max-width: 900px) {
  html, body { overflow: auto; }
  .app { height: auto; min-height: 100%; }
  .ticket { width: 100%; min-width: 0; max-width: none; }
  .top { flex-direction: column; align-items: flex-start; }
}

/* Personal workspace: calm motion, legible detail and an always-present edit surface. */
[hidden] { display:none !important; }
.app { min-height:0; height:100dvh; }
.top { gap:16px; padding:14px 24px; }
.brand { min-width:150px; }
.context { max-width:210px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.controls { gap:6px; }
.controls .btn { padding:8px 12px; }
.transcript-foot textarea { flex:1; min-width:0; width:100%; resize:vertical; border:1px solid hsl(var(--border)); border-radius:12px; padding:12px; font-size:14px; line-height:1.5; }
button:focus-visible, [role=button]:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline:2px solid hsl(var(--secondary)); outline-offset:3px; }
.board-tools { position:relative; display:flex; gap:8px; align-items:center; padding:10px 24px; border-bottom:1px solid hsl(var(--border)); }
.board-tools > span { margin-right:auto; color:hsl(var(--muted-foreground)); font-size:12px; }
.board-tools .btn { padding:6px 12px; }
.checks { position:relative; font-size:12px; color:hsl(var(--muted-foreground)); }
.checks summary { cursor:pointer; padding:6px 10px; border:1px solid hsl(12 76% 61% / .2); border-radius:999px; background:hsl(12 50% 98%); color:hsl(12 76% 39%); white-space:nowrap; }
.checks ul { position:absolute; top:100%; right:0; z-index:15; width:min(440px,calc(100vw - 32px)); max-height:260px; overflow:auto; margin:8px 0 0; padding:16px 20px 16px 34px; border:1px solid hsl(var(--border)); border-radius:14px; background:#fff; box-shadow:0 12px 32px hsl(230 25% 12% / .1); line-height:1.6; }
.checks li+li { margin-top:8px; }
.canvas-compose { flex:none; border-top:1px solid hsl(var(--border)); background:hsl(var(--card)); padding:12px 24px 16px; }
.canvas-compose, .model-panel { margin-right:var(--inspector-width,0px); }
.compose-context { font-size:11px; color:hsl(var(--muted-foreground)); margin-bottom:7px; }
.compose-row { display:flex; align-items:center; gap:12px; }
.compose-row textarea { border:1px solid hsl(var(--border)); background:hsl(30 15% 98%); border-radius:14px; padding:12px 16px; resize:vertical; font-size:14px; line-height:1.5; width:100%; min-width:0; max-height:180px; }
.compose-row .build-btn { border-radius:999px; }
.model-panel { flex:none; border-top:1px solid hsl(var(--border)); padding:12px 24px; background:hsl(30 15% 98%); font-size:12px; max-height:min(36vh,320px); overflow:auto; overscroll-behavior:contain; }
.model-panel p { margin:4px 0; color:hsl(var(--muted-foreground)); }
.model-panel[data-state="failed"] { background:hsl(12 50% 98%); border-top-color:hsl(12 76% 61% / .25); }
.request-notice { display:flex; align-items:center; gap:24px; max-width:1200px; }
.notice-copy { flex:1; min-width:0; }
.notice-kicker { font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:.14em; color:hsl(12 76% 39%); }
.notice-copy h2 { margin:5px 0; font-size:15px; line-height:1.4; letter-spacing:-.015em; }
.notice-copy p { line-height:1.5; overflow-wrap:anywhere; }
.notice-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.request-original { margin-top:8px; color:hsl(var(--muted-foreground)); }
.request-original summary { cursor:pointer; font-size:11px; }
.request-original p { max-height:80px; overflow:auto; }
.model-working { display:flex; align-items:center; gap:14px; }
.model-working > div { flex:1; }
.model-working .live-dot { width:8px; height:8px; flex:none; background:hsl(var(--primary)); border-radius:50%; animation:sq-dot 1.4s ease-in-out infinite; }
#model-elapsed { font-variant-numeric:tabular-nums; color:hsl(var(--muted-foreground)); }
.indeterminate { overflow:hidden; height:3px; border-radius:999px; background:hsl(var(--muted)); margin-top:10px; }
.indeterminate::after { content:''; display:block; width:30%; height:100%; background:var(--gradient-primary); animation:working 2s ease-in-out infinite; }
@keyframes working { from { transform:translateX(-100%); } to { transform:translateX(430%); } }
.proposal-head { display:flex; gap:8px; align-items:center; }
.proposal-head > :first-child { margin-right:auto; }
.change-list { max-height:190px; overflow:auto; margin-top:8px; }
.change-list details { padding:6px 0; border-top:1px solid hsl(var(--border)); }
.change-list summary { cursor:pointer; }
.change-list summary span { color:hsl(var(--secondary)); font-weight:600; }
.diff-field { display:grid; grid-template-columns:90px 1fr 1fr; gap:12px; padding:8px; white-space:pre-wrap; overflow-wrap:anywhere; }
.diff-field del { color:hsl(var(--muted-foreground)); }
.diff-field ins { color:hsl(var(--secondary)); text-decoration:none; }
.diff-field > b { text-transform:capitalize; font-size:11px; padding-top:5px; }
.diff-before, .diff-after { padding:9px 12px; border:1px solid hsl(var(--border)); border-radius:10px; background:#fff; }
.diff-after { border-color:hsl(280 60% 45% / .2); background:hsl(280 40% 98%); }
.diff-field small { display:block; margin-bottom:5px; font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:.1em; color:hsl(var(--muted-foreground)); }
.added-detail { display:grid; gap:8px; padding:10px 12px; margin:6px 0; border:1px solid hsl(var(--border)); border-radius:10px; background:#fff; }
.added-detail > div { display:grid; grid-template-columns:90px 1fr; gap:12px; }
.added-detail dt { font-size:11px; color:hsl(var(--muted-foreground)); }
.added-detail dd { margin:0; overflow-wrap:anywhere; }
.canvas-empty { max-width:450px; margin:60px auto; padding:24px; text-align:center; color:hsl(var(--muted-foreground)); }
.canvas-empty h2 { color:hsl(var(--foreground)); font-weight:600; }
.build-source { margin-top:28px; max-height:180px; overflow:auto; text-align:left; padding:20px 24px; border:1px solid hsl(var(--border)); border-radius:16px; background:#fff; box-shadow:var(--shadow-card); }
.build-source small { display:block; margin-bottom:10px; color:hsl(var(--primary-deep)); font-size:10px; font-weight:600; letter-spacing:.12em; text-transform:uppercase; }
.build-source p { margin:0; color:hsl(var(--foreground)); font-size:14px; line-height:1.65; }
.build-skeleton {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px 36px;
  gap: 22px;
}
.build-skeleton-copy { text-align: center; max-width: 420px; }
.build-skeleton-copy h2 {
  margin: 10px 0 0;
  color: hsl(var(--foreground));
  font-size: clamp(22px, 4vw, 28px);
  letter-spacing: -.025em;
  font-weight: 600;
}
.build-skeleton-world {
  position: relative;
  width: min(820px, 100%);
  aspect-ratio: 820 / 340;
  max-height: min(280px, 42vh);
  overflow: hidden;
}
.build-skeleton-world .edges { position: absolute; inset: 0; width: 100%; height: 100%; }
.build-skeleton-world .edges path.line {
  stroke: hsl(230 10% 78%);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}
.build-skeleton-world .edges path.head { fill: hsl(230 10% 78%); }
.skel-card {
  left: 0;
  top: 0;
  width: 28%;
  height: 36%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 16px 18px;
}
.skel-card i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: hsl(30 10% 86%);
}
.skel-card i:nth-child(1) { width: 34%; height: 6px; }
.skel-card i:nth-child(2) { width: 78%; }
.skel-card i:nth-child(3) { width: 52%; }
@media (max-width: 520px) {
  .build-skeleton { padding: 18px 12px 24px; gap: 16px; }
  .skel-card { padding: 12px 14px; gap: 8px; }
  .skel-card i { height: 6px; }
}
.world { margin:16px; }
.card { animation:none; padding:16px; gap:6px; }
.pkg, .person { animation:sq-fade .18s ease-out both; }
.edges path.line, .edges path.head { animation:none; }
.card-title { display:block; -webkit-line-clamp:unset; overflow:visible; overflow-wrap:anywhere; font-size:15.5px; line-height:1.25; }
.card.swim .card-title { font-size:16px; }
.card-done { flex-shrink:0; max-height:34px; }
.card-role { margin-top:auto; min-height:15px; color:hsl(var(--muted-foreground)) !important; }
.card-state { font-size:10px; color:hsl(var(--muted-foreground)); }
.card-footer { display:flex; align-items:center; gap:8px; margin-top:auto; min-height:15px; }
.card-footer .card-role { min-width:0; margin:0; }
.card-footer .card-state { flex:none; margin-left:auto; }
.card[data-status="done"] .card-state { color:hsl(280 60% 38%); font-weight:600; }
.card[data-status="in_progress"] .card-state, .card[data-status="blocked"] .card-state { color:hsl(12 76% 39%); font-weight:600; }
.card[data-status="blocked"] { border-style:dashed; border-color:hsl(12 76% 61% / .55); }
.card[data-status="skipped"] .card-title { color:hsl(var(--muted-foreground)); }
.card-dur { max-width:85px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:hsl(var(--muted-foreground)); }
.ticket { width:36%; max-width:560px; min-width:380px; z-index:12; animation:sq-slide-in .18s ease-out both; }
.ticket-head { padding:18px 22px 14px; }
.ticket:focus { outline:none; }
.ticket-head #t-title { display:block; width:100%; resize:none; overflow:auto; min-height:34px; max-height:30dvh; padding:6px 0; border:1px solid transparent; border-radius:6px; background:transparent; color:hsl(var(--foreground)); font:700 19px/1.35 Inter,sans-serif; letter-spacing:-.02em; }
.ticket-head #t-title:hover { border-color:hsl(var(--border)); }
.ticket-head #t-title:focus { border-color:hsl(var(--primary)); outline:2px solid hsl(12 76% 61% / .15); outline-offset:2px; }
.ticket-body { gap:20px; padding:22px; }
.field textarea { min-height:92px; padding:12px; font-size:14px; }
.field textarea#t-desc { min-height:104px; }
.field textarea#t-done { min-height:82px; }
.acceptance-field label { color:hsl(12 76% 39%); }
.acceptance-field textarea { border-color:hsl(12 76% 61% / .3); background:hsl(12 76% 61% / .025); }
.role-explanation, .field-hint { margin:0; font-size:12px; line-height:1.5; color:hsl(var(--muted-foreground)); }
.field-error { margin:4px 0 0; padding:8px 10px; border-radius:8px; background:hsl(12 50% 97%); color:hsl(12 76% 39%); font-size:12px; line-height:1.5; }
[aria-invalid="true"] { border-color:hsl(var(--primary)) !important; }
.data-fields textarea { min-height:70px; font-size:12px; line-height:1.6; }
.data-fields { display:grid; gap:14px; }
.ticket .field label { text-transform:uppercase; letter-spacing:.12em; }
.ticket-foot button { flex:1; cursor:pointer; border:1px solid hsl(var(--border)); background:#fff; border-radius:10px; padding:11px; font:600 12.5px Inter,sans-serif; color:hsl(var(--foreground)); }
.ticket-foot button:hover { background:hsl(var(--muted)); }
.ticket-foot button.danger { color:hsl(0 65% 42%); border-color:hsl(0 65% 42% / .25); background:hsl(0 65% 42% / .04); }
.field input,.field select { padding:10px 12px; font-size:13px; }
.field-pair { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.field-pair > * { min-width:0; }
.wire-row { display:flex; gap:6px; align-items:center; }
.wire { flex:1; min-width:0; display:block; overflow-wrap:anywhere; font-size:12px; }
.retarget { flex:1; min-width:0; padding:9px 12px; font:600 13px Inter,sans-serif; border:1px solid hsl(var(--border)); border-radius:10px; background:#fff; color:hsl(var(--foreground)); }
.retarget:focus-visible { outline:2px solid hsl(var(--secondary)); outline-offset:2px; }
.wire small { display:block; color:hsl(var(--muted-foreground)); margin-top:4px; }
.remove-wire { padding:6px 10px; align-self:center; }
.blocked-note { margin:0 0 12px; padding:12px; border:1px solid hsl(var(--border)); border-radius:12px; font-size:12px; background:hsl(var(--muted)); }
.blocked-note strong { display:block; margin-bottom:4px; font-weight:600; }
.blocked-note[data-state="blocked"] { border-color:hsl(0 58% 72%); background:hsl(0 65% 98%); }
.blocked-note[data-state="blocked"] strong { color:hsl(0 67% 34%); }
.goalbar .done { max-height:38px; overflow:auto; }
.goalbar .title { overflow-wrap:anywhere; }
.roles { display:flex; flex-direction:row; flex-wrap:nowrap; gap:18px; width:max-content; }
.xml-box { max-height:none; }
.xml-head { position:sticky; top:0; z-index:3; background:hsl(var(--background)); padding:10px 0 14px; }
.xml-head .done { font-size:12px; line-height:1.5; margin-top:3px; color:hsl(var(--muted-foreground)); }
.status { flex:none; min-height:27px; padding:5px 24px; max-height:65px; overflow:auto; letter-spacing:0; }
.placeholder { color:hsl(var(--muted-foreground)); }
@media (max-width:1000px) {
  .context { display:none; }
  .top { flex-wrap:wrap; gap:10px; padding:12px 16px; }
  .controls { flex:1; }
  .goalbar { padding:12px 16px; gap:16px; }
  .stats { gap:12px; }
  .stat b { font-size:17px; }
  .stat span { font-size:9px; }
  .ticket { width:46%; }
}
@media (max-width:600px) {
  .top { align-items:center; }
  .brand { width:100%; }
  .top h1 { font-size:18px; }
  .controls { justify-content:flex-start; gap:6px; }
  .toggle { width:100%; justify-content:space-between; }
  .toggle button { flex:1; padding:6px 10px; }
  .controls .btn { font-size:11px; padding:7px 11px; }
  .goalbar { align-items:flex-start; }
  .goalbar .done { display:none; }
  .goalbar .title { font-size:13px; }
  .stats { gap:9px; }
  .stat b { font-size:16px; }
  .stat span { font-size:8px; }
  .board-tools { flex-wrap:wrap; padding:8px 12px; }
  .board-tools > span { width:100%; font-size:10px; }
  .board-tools .btn { font-size:11px; }
  .checks { position:static; font-size:11px; }
  .checks ul { left:12px; right:12px; width:auto; }
  .canvas-compose { padding:8px 12px 10px; }
  .compose-row { gap:7px; align-items:stretch; }
  .compose-row textarea { padding:10px; font-size:13px; }
  .compose-row .build-btn { padding:8px 12px; font-size:11px; white-space:normal; max-width:112px; }
  .compose-context { font-size:10px; }
  .ticket { width:100%; min-width:0; max-width:none; top:auto; height:min(56dvh,480px); max-height:56dvh; border-left:0; border-top:1px solid hsl(var(--border)); border-radius:20px 20px 0 0; box-shadow:0 -18px 48px hsl(230 25% 12% / .12); }
  .stage:has(#ticket:not([hidden])) .canvas-compose,
  .stage:has(#ticket:not([hidden])) .model-panel { display:none; }
  .ticket-head { padding:14px 18px; }
  .ticket-body { padding:18px; }
  .model-panel { padding:10px 12px; }
  .model-working { flex-wrap:wrap; gap:8px; }
  .request-notice { align-items:stretch; flex-direction:column; gap:10px; }
  .model-working > div { min-width:180px; }
  .model-working p { font-size:11px; }
  .proposal-head { flex-wrap:wrap; }
  .proposal-head > :first-child { width:100%; }
  .change-list { max-height:100px; }
  .diff-field { grid-template-columns:1fr; }
  .transcript-foot { flex-direction:column; align-items:stretch; padding:12px; }
  .transcript-foot textarea { flex:auto; }
  .speak { padding:24px 16px; }
  .speak-inner { gap:22px; }
  .speak-inner h2 { font-size:30px; }
  .status { font-size:10px; padding:5px 12px; }
}
@media (prefers-reduced-motion:reduce) { .indeterminate::after { animation:none; width:100%; opacity:.5; } }
:root { --primary-deep:12 76% 42%; }
.card.is-trigger { background:hsl(12 50% 98%); }
.card.is-output { background:hsl(280 40% 98%); }
.edge-lab { z-index:2; max-width:230px; font-size:11px; line-height:14px; letter-spacing:0; white-space:normal; overflow-wrap:anywhere; text-align:center; pointer-events:none; }
.pkg span { color:hsl(12 76% 39%); }

.person-name { border:0; background:transparent; color:inherit; font:inherit; padding:0; text-align:left; cursor:pointer; }
.person-name:hover { text-decoration:underline; text-underline-offset:3px; }

.person-items .ty { color:hsl(var(--muted-foreground)); }
.edge-lab.selected { color:hsl(var(--primary-deep)); border-color:hsl(12 76% 61% / .35); background:hsl(12 50% 98%); }
.model-panel[data-state="response"] { background:hsl(280 30% 98%); }
.model-panel[data-state="response"] .notice-kicker { color:hsl(var(--secondary)); }
@media (max-height:500px) {
  html, body { height:auto; min-height:100%; overflow:auto; }
  .app { height:auto; min-height:100dvh; overflow:visible; }
  .screen { flex:none; }
  .speak { overflow:visible; }
  .canvas-wrap { flex:none; height:280px; }
  .ticket { position:fixed; top:0; bottom:0; z-index:30; }
  .model-panel { max-height:50vh; }
}

/* Step type and ownership use separate visual cues. */
.type-dot { width:8px; height:8px; border-radius:50%; flex:none; }
.card[data-kind="decision"] { background:hsl(280 45% 98%); border-color:hsl(280 35% 81%); }
.card[data-kind="blocker"] { background:hsl(0 50% 98%); border-color:hsl(0 42% 80%); }
.card[data-kind="trigger"] { background:hsl(12 65% 98%); }
.card[data-kind="output"] { background:hsl(158 35% 98%); border-color:hsl(158 26% 77%); }
.card.is-on { border-color:hsl(var(--primary)); }
.card-footer { align-items:flex-end; gap:8px; padding-top:9px; border-top:1px solid hsl(var(--border)); margin-top:auto; }
.card-footer .card-role { display:flex; flex:1; flex-direction:column; gap:4px; white-space:normal; overflow:visible; font-size:11px; color:hsl(var(--foreground)) !important; }
.owner-caption { font-size:9px; font-weight:500; color:hsl(var(--muted-foreground)); }
.owner-name { display:flex; align-items:baseline; gap:6px; overflow-wrap:anywhere; }
.owner-name .role-dot { align-self:center; width:6px; height:6px; }
.card-footer .card-state { font-size:9px; max-width:64px; text-align:right; }
.card.swim .card-footer .card-role { display:flex; }
.type-legend { display:flex; flex-wrap:wrap; align-items:center; gap:8px 16px; padding:8px 20px; border-bottom:1px solid hsl(var(--border)); font-size:10px; color:hsl(var(--muted-foreground)); }
.type-legend span { display:inline-flex; gap:6px; align-items:center; }
.type-legend .legend-help { margin-left:auto; }
.connection-detail { position:relative; padding:12px; margin-top:10px; background:hsl(var(--background)); border:1px solid hsl(var(--border)); border-radius:12px; display:flex; flex-direction:column; gap:7px; }
.connection-detail.has-friction { border-color:hsl(12 76% 61% / .35); }
.connection-detail .wire { background:transparent; }
.connection-detail label { font-size:10px; margin-top:4px; }
.connection-detail .field-hint { margin:0; }
.handoff-friction { margin-top:8px; padding-top:8px; border-top:1px solid hsl(var(--border-soft)); }
.handoff-friction summary { cursor:pointer; font-size:12px; font-weight:600; color:hsl(var(--primary-deep)); padding:4px 0; }
.handoff-friction summary:focus-visible { outline:2px solid hsl(var(--secondary)); outline-offset:3px; }
.handoff-friction input, .handoff-friction textarea, .handoff-friction select { width:100%; padding:8px 10px; border:1px solid hsl(var(--border)); border-radius:10px; font:inherit; font-size:13px; background:white; color:var(--ink); }
.handoff-friction textarea { resize:vertical; }
.shadow-flag { display:flex; gap:8px; align-items:flex-start; font-size:12px; line-height:1.45; margin-top:8px; }
.shadow-flag input { width:auto; margin-top:3px; }
.friction-index { display:flex; flex-wrap:wrap; gap:7px; margin:8px 0 4px; }
.friction-chip { text-align:left; white-space:normal; font-size:11px; line-height:1.4; padding:8px 10px; border-radius:999px; border:1px solid hsl(12 76% 61% / .35); background:hsl(12 50% 98%); color:hsl(var(--primary-deep)); }
.friction-chip small { display:block; font-size:10px; color:hsl(var(--muted-foreground)); font-weight:500; }
.edge-lab.has-friction { color:hsl(var(--primary-deep)); border-color:hsl(12 76% 61% / .4); background:hsl(12 50% 98%); }
button.edge-lab { pointer-events:auto; cursor:pointer; font-family:inherit; line-height:14px; z-index:2; }
button.edge-lab:hover, button.edge-lab:focus-visible { border-color:hsl(var(--primary)); outline:2px solid hsl(12 76% 61% / .25); }
.edge-lab[data-state="blocked"] { color:hsl(0 62% 36%); border-color:hsl(0 42% 80%); }
.edge-lab[data-state="passed"] { color:hsl(158 42% 28%); border-color:hsl(158 26% 77%); }
.edge-lab[data-kind="produces"], .edge-lab[data-kind="relates"] { font-weight:500; }
.connection-detail[data-kind="depends"] { border-color:hsl(12 40% 82%); }
.connection-detail[data-role] .wire small { text-transform:none; }
.speech-notice { flex:none; padding:12px 20px; border-bottom:1px solid hsl(12 60% 83%); background:hsl(12 65% 97%); display:flex; gap:16px; align-items:center; }
.speech-notice[hidden] { display:none; }
.speech-notice p { font-size:12px; line-height:1.5; margin:0; }
.speech-notice .speech-actions { display:flex; flex-wrap:wrap; gap:8px; margin-left:auto; flex-shrink:0; }
.speech-notice a { text-decoration:underline; }
@media(max-width:700px) { .speech-notice { align-items:flex-start; flex-direction:column; gap:8px; padding:10px 14px; max-height:30dvh; overflow:auto; }.speech-notice .speech-actions { margin-left:0; }.type-legend { gap:7px 12px; padding:8px 14px; }.type-legend .legend-help { display:none; } }
@media(prefers-reduced-motion:reduce) { .pkg,.person,.ticket { animation:none !important; } }
.build-stages { display:flex; align-items:center; gap:24px; list-style:none; padding:0; margin:0 0 12px; font-size:11px; }
.build-stages li { display:flex; align-items:center; gap:7px; color:hsl(var(--muted-foreground)); }
.build-stages li span { width:22px; height:22px; border-radius:50%; border:1px solid hsl(var(--border)); display:grid; place-items:center; font-size:10px; }
.build-stages .complete { color:hsl(158 42% 28%); }
.build-stages .complete span { background:hsl(158 35% 94%); border-color:hsl(158 26% 77%); }
.build-stages .active { color:hsl(var(--primary-deep)); }
.build-stages .active span { border-color:currentColor; }
.build-stages .pending { color:hsl(var(--muted-foreground)); }
.build-receipt { display:flex; align-items:center; gap:16px; font-size:13px; }
.build-receipt p { font-size:12px; margin:6px 0 0; line-height:1.5; }
.build-receipt button { margin-left:auto; flex:none; }
@media(max-width:600px) { .build-stages { gap:10px; align-items:flex-start; }.build-stages li { flex:1; flex-direction:column; align-items:flex-start; gap:4px; font-size:10px; }.build-receipt { align-items:flex-start; } }

.swim-lane[data-role="_none"] { --lane: hsl(230 8% 52%); }
.swim-lane[data-role="_none"] .role-dot { background:hsl(230 10% 65%) !important; }

/* Details remain compact until a step needs independent responsibility. */
.card-facts { display:flex; flex-wrap:wrap; gap:4px 8px; font-size:10px; line-height:1.4; color:hsl(var(--muted-foreground)); padding:2px 0 7px; flex-shrink:0; }
.card-facts span { padding:3px 6px; border-radius:6px; background:hsl(var(--muted)); }
.checklist-promotion { display:flex; flex-direction:column; gap:8px; }
.checklist-row { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid hsl(var(--border)); font-size:12px; line-height:1.5; }
.checklist-row span { flex:1; overflow-wrap:anywhere; }
.checklist-row .btn { flex:none; padding:6px 10px; font-size:10px; }

.atlas-entry { color:inherit; text-underline-offset:3px; }

.card-facts span { color:hsl(230 12% 35%); }

.example-bar { display:flex; align-items:center; gap:16px; padding:8px 24px; border-bottom:1px solid hsl(var(--border)); background:white; font-size:11px; flex:none; }
.example-bar[hidden] { display:none; }
.example-bar a { color:hsl(var(--foreground)); text-underline-offset:3px; }
.example-bar span { margin-left:auto; color:hsl(var(--muted-foreground)); }
.example-bar .btn { padding:6px 12px; font-size:11px; }
@media(max-width:650px){.example-bar{padding:8px 12px;gap:10px;flex-wrap:wrap}.example-bar span{display:none}.example-bar button{margin-left:auto}}

/* The captured brief remains readable without changing the workflow or selection. */
.source-description { position:static; flex:none; font-size:12px; color:hsl(var(--foreground)); }
.source-description summary { cursor:pointer; padding:6px 10px; border:1px solid hsl(var(--border)); border-radius:999px; background:white; white-space:nowrap; }
.source-description summary:focus-visible { outline:2px solid hsl(var(--ring)); outline-offset:3px; }
.source-description-panel { position:absolute; top:100%; left:24px; z-index:16; width:min(620px,calc(100% - 48px)); margin-top:8px; padding:16px 18px; background:white; border:1px solid hsl(var(--border)); border-radius:14px; box-shadow:0 12px 32px hsl(230 25% 12% / .1); }
.source-description-note { margin:0 0 12px; color:hsl(var(--muted-foreground)); font-size:11px; line-height:1.5; }
#source-description-text { max-height:30vh; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; font-size:13px; line-height:1.65; }
@media(max-width:600px){.source-description{font-size:11px}.source-description-panel{left:12px;width:calc(100% - 24px);padding:14px}.source-description-note{font-size:10px}#source-description-text{font-size:12px}}
#mobile-actions{display:none}
.mobile-actions-dialog{width:min(420px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:0;border:1px solid hsl(var(--border));border-radius:22px;background:#fff;color:hsl(var(--foreground));box-shadow:0 20px 70px hsl(230 25% 12% / .18)}
.mobile-actions-dialog::backdrop{background:hsl(230 25% 12% / .24);backdrop-filter:blur(3px)}
.mobile-actions-dialog header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px;border-bottom:1px solid hsl(var(--border))}
.mobile-actions-dialog h2{font-size:18px;margin:0;letter-spacing:-.02em}
.mobile-actions-body{padding:18px;display:grid;gap:16px;overflow:auto}
.mobile-file-actions,.mobile-edit-actions{display:flex;flex-wrap:wrap;gap:8px}
.mobile-edit-actions{border-top:1px solid hsl(var(--border));padding-top:16px}
.mobile-source-actions{display:grid;gap:12px}
.mobile-source-actions #graph-health{font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}
.mobile-actions-dialog .source-description-panel{position:static;width:100%;max-height:none;margin-top:10px;box-shadow:none;padding:12px}
@media(max-width:600px){
  .top{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;padding:10px 12px}
  .top .brand{grid-column:1;grid-row:1;width:auto;min-width:0}
  .top .eyebrow{display:none}
  .top h1{margin:0;font-size:17px}
  .top .controls{display:contents}
  .top #listen{grid-column:2;grid-row:1}
  .top #mobile-actions{display:block;grid-column:3;grid-row:1}
  .top #views{grid-column:1 / -1;grid-row:2}
  .goalbar{padding:10px 12px;gap:12px}
  .goalbar .kicker{font-size:9px}
  .board-tools{flex-wrap:nowrap;padding:8px 12px;gap:8px}
  .type-legend{padding:7px 12px}
}

.clarification-turn { margin:12px 0; padding-left:12px; border-left:2px solid hsl(var(--border)); }
.clarification-turn > b { font-size:11px; color:hsl(var(--muted-foreground)); }
.clarification-turn > p { white-space:pre-wrap; overflow-wrap:anywhere; }

.transcript-body { min-height: 44px; max-height: 180px; overflow: hidden; resize: none; padding: 12px 18px; }
.compose-row textarea { min-height: 42px; max-height: 160px; overflow: hidden; resize: none; }

.app.is-canvas .top {
  position: absolute;
  top: 0;
  left: 0;
  right: var(--inspector-width, 0px);
  z-index: 20;
  background: transparent;
  border: none;
  padding: 10px 12px;
  pointer-events: none;
}
.app.is-canvas .top .brand { display: none; }
.app.is-canvas .top .controls,
.app.is-canvas .top .toggle,
.app.is-canvas .top .btn { pointer-events: auto; }
.app.is-canvas .top .controls {
  width: 100%;
  justify-content: flex-end;
  padding: 6px 8px;
  border: 1px solid hsl(var(--border));
  border-radius: 18px;
  background: hsl(0 0% 100% / 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 28px hsl(230 25% 12% / 0.08);
}
.app.is-canvas .board { position: relative; }
.app.is-canvas .goalbar {
  position: absolute;
  top: 62px;
  left: 12px;
  z-index: 8;
  max-width: min(380px, 42%);
  padding: 10px 14px;
  border: 1px solid hsl(var(--border));
  border-radius: 16px;
  background: hsl(0 0% 100% / 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 28px hsl(230 25% 12% / 0.08);
  gap: 12px;
}
.app.is-canvas .goalbar .stats { display: none; }
.app.is-canvas .board-tools {
  position: absolute;
  top: 62px;
  right: calc(12px + var(--inspector-width, 0px));
  left: auto;
  z-index: 8;
  max-width: none;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 6px;
  border: none;
  background: transparent;
}
.app.is-canvas #graph-health,
.app.is-canvas #source-description { display: none; }
.app.is-canvas .graph-lage {
  position: absolute;
  left: 12px;
  top: 148px;
  z-index: 8;
  max-width: min(420px, 46%);
}
.app.is-canvas .board-tools .btn,
.app.is-canvas .board-tools summary {
  background: hsl(0 0% 100% / 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 18px hsl(230 25% 12% / 0.06);
}
.app.is-canvas .type-legend { display: none; }
.app.is-canvas .canvas-compose {
  position: absolute;
  left: 12px;
  right: calc(12px + var(--inspector-width, 0px));
  bottom: 12px;
  z-index: 9;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid hsl(var(--border));
  border-radius: 18px;
  background: hsl(0 0% 100% / 0.94);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 32px hsl(230 25% 12% / 0.1);
}
.app.is-canvas .model-panel:not([hidden]) {
  position: absolute;
  left: 12px;
  right: calc(12px + var(--inspector-width, 0px));
  bottom: 86px;
  z-index: 11;
  margin: 0;
  border: 1px solid hsl(var(--border));
  border-radius: 16px;
  background: hsl(0 0% 100% / 0.96);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 32px hsl(230 25% 12% / 0.1);
  max-height: min(28vh, 240px);
}
.app.is-canvas .compose-context {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.app.is-canvas .zoom { bottom: 118px; right: 16px; }
.app.is-canvas .type-look { bottom: 118px; left: 16px; }
.app.is-canvas .status {
  position: absolute;
  left: 16px;
  bottom: 0;
  z-index: 6;
  padding: 4px 0;
  pointer-events: none;
}
.app.is-canvas .ticket { z-index: 22; }
.app.chrome-hidden.is-canvas .graph-lage { top: 72px; }
.app.chrome-hidden.is-canvas .goalbar,
.app.chrome-hidden.is-canvas .board-tools,
.app.chrome-hidden.is-canvas .top .toggle,
.app.chrome-hidden.is-canvas .top #undo,
.app.chrome-hidden.is-canvas .top #more-actions,
.app.chrome-hidden.is-canvas .top #clear,
.app.chrome-hidden.is-canvas .top #export-image,
.app.chrome-hidden.is-canvas .top #export,
.app.chrome-hidden.is-canvas .top #import {
  display: none;
}
.app.chrome-hidden.is-canvas .top { justify-content: flex-end; }
.app.chrome-hidden.is-canvas .top .controls { width: max-content; max-width: 100%; margin-left: auto; }
.app.chrome-hidden.is-canvas .top #listen,
.app.chrome-hidden.is-canvas .top #chrome-toggle,
.app.chrome-hidden.is-canvas .top #mobile-actions { visibility: visible; pointer-events: auto; }

@media (max-width: 600px) {
  .app.is-canvas .graph-lage { top: 200px; max-width: calc(100% - 24px); }
  .more-actions { display: none; }
  .app.is-canvas .top { right: 0; }
  .app.is-canvas .top .controls { display: contents; }
  .app.is-canvas .goalbar { max-width: calc(100% - 24px); top: 96px; }
  .app.is-canvas .board-tools { top: 148px; right: 12px; max-width: calc(100% - 24px); flex-wrap: wrap; }
  .app.is-canvas .canvas-compose { left: 8px; right: 8px; bottom: 8px; }
  .app.is-canvas .zoom { bottom: 78px; }
  .app.is-canvas .type-look { bottom: 78px; left: 8px; }
  .app.is-canvas .top #chrome-toggle { grid-column: 1 / -1; grid-row: 3; justify-self: start; }
}

/* Three type looks. Schrift = current caption. Farbe = rail. Kante = silhouette, not flowchart. */
.app[data-type-look="farbe"] .card {
  border-left-width: 6px;
  border-left-color: var(--type-color);
}
.app[data-type-look="farbe"] .card[data-kind="work"] { background: hsl(215 40% 98%); border-color: hsl(215 30% 82%); }
.app[data-type-look="farbe"] .card[data-kind="trigger"] { background: hsl(12 70% 97%); }
.app[data-type-look="farbe"] .card[data-kind="decision"] { background: hsl(280 50% 97%); }
.app[data-type-look="farbe"] .card[data-kind="output"] { background: hsl(158 40% 97%); }
.app[data-type-look="farbe"] .card[data-kind="blocker"] { background: hsl(0 55% 97%); }
.app[data-type-look="farbe"] .type-dot { width: 10px; height: 10px; }
.app[data-type-look="farbe"] .card-kind { font-size: 10.5px; }

.app[data-type-look="kante"] .card[data-kind="trigger"] { border-radius: 4px 22px 22px 4px; }
.app[data-type-look="kante"] .card[data-kind="work"] { border-radius: 12px; }
.app[data-type-look="kante"] .card[data-kind="decision"] { border-radius: 28px; }
.app[data-type-look="kante"] .card[data-kind="output"] { border-radius: 40px; }
.app[data-type-look="kante"] .card[data-kind="blocker"] { border-radius: 4px; }
.app[data-type-look="kante"] .card.is-decision { border-radius: 28px; }

/* Form: design-agent sheet 3a — rounded path() silhouettes, Lucide glyphs, zoom LOD. */
.card-icon { display: none; }
.card-mark { display: none; }
.card-sil { display: none; }
.app[data-type-look="form"] .card-sil {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  filter: drop-shadow(0 6px 18px hsl(230 25% 12% / 0.09));
}
.app[data-type-look="form"] .card-sil-ring,
.app[data-type-look="form"] .card-sil-fill {
  position: absolute;
  inset: 0;
}
.app[data-type-look="form"] .card-sil-ring {
  background: color-mix(in srgb, var(--type-color) 55%, transparent);
  clip-path: var(--shape-near);
}
.app[data-type-look="form"] .card-sil-fill {
  background: #fff;
  clip-path: var(--shape-near-in);
}
.app[data-type-look="form"] .card-icon {
  display: block;
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--type-color);
}
.app[data-type-look="form"] .card {
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
  gap: 0;
  border-radius: 0;
}
.app[data-type-look="form"] .card:hover { border: 0; }
.app[data-type-look="form"] .card.is-on,
.app[data-type-look="form"] .card.has-friction {
  border: 0;
  box-shadow: none;
}
.app[data-type-look="form"] .card.is-trigger,
.app[data-type-look="form"] .card.is-output,
.app[data-type-look="form"] .card.is-decision,
.app[data-type-look="form"] .card[data-kind="blocker"],
.app[data-type-look="form"] .card[data-kind="trigger"],
.app[data-type-look="form"] .card[data-kind="work"],
.app[data-type-look="form"] .card[data-kind="decision"],
.app[data-type-look="form"] .card[data-kind="output"] {
  background: transparent;
  border: 0;
  border-radius: 0;
}
.app[data-type-look="form"] .card > *:not(.card-sil) { position: relative; z-index: 1; }
.app[data-type-look="form"] .type-dot { display: none; }
.app[data-type-look="form"] .card-kind {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--type-color) !important;
}
.app[data-type-look="form"] .card-top {
  gap: 8px;
  height: 16px;
  margin: 0;
  color: var(--type-color);
}
.app[data-type-look="form"] .card-dur {
  font-size: 10px;
  color: hsl(230 10% 58%);
}
.app[data-type-look="form"] .card-title,
.app[data-type-look="form"] .card-open {
  margin: 10px 0 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.24;
  color: hsl(230 25% 12%);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.app[data-type-look="form"] .card-open:focus-visible,
.app[data-type-look="form"] .owner-edit:focus-visible,
.app[data-type-look="form"] .status-edit:focus-visible {
  outline: 2px solid hsl(12 76% 61%);
  outline-offset: 2px;
}
.app[data-type-look="form"] .card-done {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: hsl(230 10% 45%);
  -webkit-line-clamp: 1;
  max-height: 18px;
}
.app[data-type-look="form"] .card-facts { padding: 8px 0 0; }
.app[data-type-look="form"] .card-facts span {
  font-size: 10px;
  font-weight: 600;
  color: hsl(230 10% 45%);
  border: 1px solid hsl(30 10% 88%);
  background: hsl(30 15% 98%);
  border-radius: 6px;
  padding: 3px 7px;
}
.app[data-type-look="form"] .card-footer {
  position: relative;
  display: block;
  border-top: 1px solid hsl(30 10% 92%);
  padding-top: 10px;
  margin-top: auto;
  min-height: 34px;
  align-items: unset;
}
.app[data-type-look="form"] .card-footer .card-role {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 72px;
  font-size: 11.5px;
  color: hsl(var(--foreground)) !important;
}
.app[data-type-look="form"] .owner-caption {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: hsl(230 10% 62%);
}
.app[data-type-look="form"] .owner-name {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--role-color, hsl(230 10% 52%));
}
.app[data-type-look="form"] .owner-name .role-dot { display: none; }
.app[data-type-look="form"] .card-footer .card-state,
.app[data-type-look="form"] .status-edit {
  position: absolute;
  right: 0;
  bottom: 0;
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  color: hsl(230 10% 45%);
  background: hsl(30 10% 94%);
  border-radius: 5px;
  padding: 2px 7px;
  max-width: none;
  text-align: center;
}
.app[data-type-look="form"] .card.is-on .card-sil-ring { background: hsl(12 76% 58%); }
.app[data-type-look="form"] .card.is-on .card-sil-fill { clip-path: var(--shape-near-sel); }
.app[data-type-look="form"] .card.is-on .card-sil {
  filter: drop-shadow(0 10px 30px hsl(12 76% 61% / 0.3));
}
.app[data-type-look="form"] .card.is-on .card-state,
.app[data-type-look="form"] .card.is-on .status-edit {
  color: hsl(12 76% 42%);
  background: hsl(12 76% 61% / 0.14);
}
.app[data-type-look="form"] .card[data-status="waiting"] .card-sil-fill {
  background: linear-gradient(160deg, hsl(0 0% 100%), hsl(35 84% 50% / 0.1));
}
.app[data-type-look="form"] .card[data-status="waiting"] .card-sil-ring {
  background: hsl(35 84% 50% / 0.6);
}
.app[data-type-look="form"] .card[data-status="waiting"] .card-state,
.app[data-type-look="form"] .card[data-status="waiting"] .status-edit {
  color: hsl(35 84% 32%);
  background: hsl(35 84% 50% / 0.16);
}
.app[data-type-look="form"] .card[data-status="done"] .card-sil-fill {
  background: linear-gradient(160deg, hsl(0 0% 100%), hsl(158 58% 32% / 0.08));
}
.app[data-type-look="form"] .card[data-status="done"] .card-sil-ring {
  background: hsl(158 58% 38% / 0.55);
}
.app[data-type-look="form"] .card[data-status="done"] .card-state,
.app[data-type-look="form"] .card[data-status="done"] .status-edit {
  color: hsl(158 58% 26%);
  background: hsl(158 58% 32% / 0.14);
}
.app[data-type-look="form"] .card[data-status="blocked"] .card-sil { filter: none; }
.app[data-type-look="form"] .card[data-status="blocked"] .card-sil-ring {
  background: hsl(230 8% 62% / 0.5);
}
.app[data-type-look="form"] .card[data-status="blocked"] .card-sil-fill {
  background: hsl(30 12% 97%);
}
.app[data-type-look="form"] .card[data-status="blocked"] .card-top,
.app[data-type-look="form"] .card[data-status="blocked"] .card-title,
.app[data-type-look="form"] .card[data-status="blocked"] .card-open,
.app[data-type-look="form"] .card[data-status="blocked"] .card-done,
.app[data-type-look="form"] .card[data-status="blocked"] .card-facts,
.app[data-type-look="form"] .card[data-status="blocked"] .card-footer { opacity: 0.55; }
.app[data-type-look="form"] .card[data-status="blocked"] .card-state,
.app[data-type-look="form"] .card[data-status="blocked"] .status-edit {
  color: hsl(230 8% 46%);
  background: hsl(230 8% 62% / 0.16);
}
.app[data-zoom-band="mid"] .card-done,
.app[data-zoom-band="mid"] .card-facts,
.app[data-zoom-band="mid"] .card-footer,
.app[data-zoom-band="mid"] .card-dur { display: none; }
.app[data-zoom-band="far"] .card-top,
.app[data-zoom-band="far"] .card-title,
.app[data-zoom-band="far"] .card-done,
.app[data-zoom-band="far"] .card-facts,
.app[data-zoom-band="far"] .card-footer,
.app[data-zoom-band="far"] .card-link { display: none; }
.app[data-zoom-band="far"][data-type-look="form"] .card-mark {
  display: grid;
  place-items: center;
  position: absolute;
  inset: 0;
  z-index: 2;
  color: #fff;
}
.app[data-zoom-band="far"][data-type-look="form"] .card-mark .card-icon {
  width: 88px;
  height: 88px;
  color: #fff;
  stroke-width: 1.3;
}
.app[data-zoom-band="far"][data-type-look="form"] .card-sil-ring {
  clip-path: var(--shape-far);
  background: var(--type-color);
}
.app[data-zoom-band="far"][data-type-look="form"] .card-sil-fill { opacity: 0; }
.app[data-zoom-band="far"][data-type-look="form"] .card[data-status="waiting"] .card-sil-ring,
.app[data-zoom-band="far"][data-type-look="form"] .card[data-status="done"] .card-sil-ring,
.app[data-zoom-band="far"][data-type-look="form"] .card[data-status="blocked"] .card-sil-ring,
.app[data-zoom-band="far"][data-type-look="form"] .card.is-on .card-sil-ring {
  background: var(--type-color);
}

.mark-lib {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px 8px;
}
.mark-lib[hidden] { display: none; }
.mark-lib-kicker {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: hsl(230 10% 52%);
  flex: none;
}
.mark-lib-row { display: flex; flex-wrap: wrap; gap: 6px; }
.mark-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid hsl(30 10% 88%);
  background: #fff;
  border-radius: 999px;
  padding: 5px 10px 5px 7px;
  font: 600 11px Inter, sans-serif;
  color: hsl(230 25% 12%);
  cursor: grab;
}
.mark-chip:hover, .mark-chip.is-armed { border-color: hsl(12 76% 61% / .55); background: hsl(12 70% 98%); }
.mark-chip .mark-icon { width: 14px; height: 14px; }
.mark-chip[data-kind="bottleneck"] { color: hsl(32 72% 38%); }
.mark-chip[data-kind="problem"] { color: hsl(12 76% 42%); }
.mark-chip[data-kind="question"] { color: hsl(280 48% 42%); }
.mark-chip[data-kind="fast"] { color: hsl(158 45% 32%); }
.mark-chip[data-kind="gain"] { color: hsl(158 50% 30%); }
.mark-chip[data-kind="important"] { color: hsl(12 70% 42%); }
.step-marks {
  position: absolute;
  top: 10px;
  right: 12px;
  display: flex;
  gap: 4px;
  z-index: 4;
}
.step-mark {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid hsl(30 10% 86%);
  border-radius: 8px;
  background: #fff;
  color: hsl(12 76% 42%);
  box-shadow: 0 4px 12px hsl(230 25% 12% / .08);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.step-mark .mark-icon { width: 14px; height: 14px; }
.step-mark[data-kind="bottleneck"] { color: hsl(32 72% 38%); }
.step-mark[data-kind="problem"] { color: hsl(12 76% 42%); }
.step-mark[data-kind="question"] { color: hsl(280 48% 42%); }
.step-mark[data-kind="fast"], .step-mark[data-kind="gain"] { color: hsl(158 45% 32%); }
.step-mark.on-edge {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 5;
}
.mark-ghost {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid hsl(12 76% 61% / .4);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px hsl(230 25% 12% / .14);
}
.mark-ghost .mark-icon { width: 15px; height: 15px; }
.mark-pop {
  position: absolute;
  z-index: 24;
  width: min(280px, calc(100% - 24px));
  padding: 12px;
  border: 1px solid hsl(var(--border));
  border-radius: 16px;
  background: hsl(0 0% 100% / .97);
  box-shadow: 0 16px 40px hsl(230 25% 12% / .14);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mark-pop[hidden] { display: none; }
.mark-pop-kind { margin: 0; font-size: 13px; font-weight: 700; }
.mark-pop-label { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: hsl(230 10% 52%); }
.mark-pop textarea {
  width: 100%;
  border: 1px solid hsl(var(--border));
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  resize: vertical;
}
.mark-pop-actions { display: flex; gap: 8px; justify-content: flex-end; }
.mark-pop-actions button { font: 600 12px Inter, sans-serif; border-radius: 999px; padding: 6px 12px; border: 1px solid hsl(var(--border)); background: #fff; cursor: pointer; }
#mark-delete { color: hsl(12 76% 39%); }
.card.is-drop { outline: 2px dashed hsl(12 76% 61%); outline-offset: 2px; }
path.hit.is-drop { stroke: hsl(12 76% 61% / .35); }

/* Geteilte Nur-Ansicht: keine Bearbeitung, keine Sprache, kein Modell. */
body.view-only #screen-speak,
body.view-only #canvas-compose,
body.view-only #listen,
body.view-only #undo,
body.view-only #more-actions,
body.view-only #add-node,
body.view-only #add-role,
body.view-only #edit-goal,
body.view-only #review-workflow { display: none !important; }
body.view-only .ticket :is(input, textarea, select, button),
body.view-only .canvas :is(input, textarea, select, [contenteditable]) { pointer-events: none; }
