:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #667085;
  --line: #d8dee8;
  --panel: #f8fafc;
  --accent: #0f766e;
  --accent-2: #b45309;
  --danger: #b42318;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #edf1f5;
  color: var(--ink);
}

button,
input,
textarea,
select {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #14b8a6;
  outline-offset: 2px;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  grid-template-rows: 56px minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 44px minmax(0, 1fr) 320px;
}

.app-shell.inspector-collapsed {
  grid-template-columns: 280px minmax(0, 1fr) 44px;
}

.app-shell.sidebar-collapsed.inspector-collapsed {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
}

.topbar {
  grid-column: 1 / -1;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.sidebar,
.inspector {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #ffffff;
  transition: width 160ms ease;
}

.sidebar {
  border-right: 1px solid var(--line);
}

.inspector {
  border-left: 1px solid var(--line);
}

.collapsible-panel.collapsed {
  overflow: hidden;
}

.panel-content {
  height: 100%;
  min-width: 0;
  overflow: auto;
  padding-top: 48px;
}

.panel-toggle {
  position: absolute;
  top: 9px;
  z-index: 30;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: #475569;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.panel-toggle:hover {
  border-color: #5eead4;
  background: #f0fdfa;
  color: #0f766e;
}

.sidebar-toggle {
  right: 8px;
}

.inspector-toggle {
  left: 8px;
}

.collapsible-panel.collapsed .panel-toggle {
  left: 8px;
  right: auto;
}

.sidebar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sidebar-action {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px;
  color: #334155;
  text-align: left;
}

.sidebar-action:hover {
  border-color: #5eead4;
  background: #f0fdfa;
}

.sidebar-action > span:nth-child(2) {
  overflow: hidden;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
}

.sidebar-action small,
.accordion-toggle small {
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
}

.sidebar-action small.attention-count {
  border-radius: 999px;
  background: #7c3aed;
  padding: 2px 5px;
  color: #ffffff;
}

.sidebar-action-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  font-size: 17px;
}

.category-symbol {
  border: 3px solid #0f766e;
  border-radius: 6px;
  box-shadow: inset 0 0 0 3px #ccfbf1;
}

.accordion-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin-bottom: 8px;
}

.accordion-toggle {
  display: grid;
  min-width: 0;
  flex: 1;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  padding: 5px 2px;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
}

.accordion-toggle:hover {
  color: #0f766e;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.48);
  padding: 24px;
}

.modal-card {
  display: flex;
  width: min(520px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
}

.modal-card-wide {
  width: min(760px, 100%);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 18px;
}

.modal-header h2 {
  margin: 0;
  color: #1e293b;
  font-size: 18px;
}

.modal-header p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}

.modal-body {
  overflow: auto;
  padding: 18px;
}

.bucket-token-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.bucket-connect-message {
  min-height: 38px;
  margin: 0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
  color: #475569;
  font-size: 12px;
}

.bucket-connect-message.ready {
  background: #f0fdfa;
  color: #115e59;
}

.bucket-choice-list,
.stored-project-list {
  display: grid;
  gap: 8px;
}

.bucket-choice {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid #99f6e4;
  border-radius: 9px;
  background: #f0fdfa;
  padding: 11px;
  color: #115e59;
  text-align: left;
}

.bucket-choice.local {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
}

.bucket-choice:hover {
  box-shadow: 0 0 0 2px rgb(20 184 166 / 15%);
}

.bucket-choice span,
.stored-project-info span {
  color: #64748b;
  font-size: 11px;
}

.stored-project-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 34px;
  gap: 8px;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  padding: 10px;
}

.stored-project-card.active {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.stored-project-info {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.modal-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.language-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  padding: 6px 9px 6px 11px;
  font-size: 12px;
  font-weight: 700;
}

.language-chip small {
  color: #64748b;
  font-size: 10px;
}

.language-chip button {
  border: 0;
  background: transparent;
  color: #b42318;
  font-size: 16px;
  line-height: 1;
}

.empty-state {
  display: block;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 18px;
  color: #64748b;
  font-size: 12px;
  text-align: center;
}

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

.category-card {
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #f8fafc;
  padding: 10px;
}

.category-default-setting {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  border: 1px solid #c7d2fe;
  border-radius: 9px;
  background: #eef2ff;
  padding: 10px;
}

.color-field {
  width: 48px;
  min-width: 48px;
  padding: 3px;
}

.dialog-type-grid {
  display: grid;
  gap: 8px;
}

.dialog-type-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
}

.dialog-type-select-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) 34px;
  gap: 7px;
  align-items: center;
}

.dialog-type-selection-color,
.dialog-type-marker {
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 999px;
}

.dialog-type-selection-color {
  width: 12px;
  height: 12px;
  box-shadow: 0 0 0 1px rgb(15 23 42 / 12%);
}

.dialog-type-selection-color.empty {
  border: 1px dashed #94a3b8;
  background: transparent;
  box-shadow: none;
}

.workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 44px minmax(0, 1fr);
}

.workspace:has(.conflict-banner) {
  grid-template-rows: auto 44px minmax(0, 1fr);
}

.conflict-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #f59e0b;
  background: #fffbeb;
  padding: 8px 12px;
  color: #713f12;
  font-size: 12px;
  font-weight: 650;
}

.canvas-wrap {
  position: relative;
  overflow: hidden;
  background-color: #f4f7fb;
  background-image:
    linear-gradient(#dce4ee 1px, transparent 1px),
    linear-gradient(90deg, #dce4ee 1px, transparent 1px);
  background-size: 28px 28px;
  cursor: grab;
  user-select: none;
}

.canvas-wrap.dragging {
  cursor: grabbing;
}

.canvas-wrap.connecting {
  cursor: crosshair;
}

.connection-hint {
  border: 1px solid #99f6e4;
  border-radius: 999px;
  background: #f0fdfa;
  padding: 4px 9px;
  color: #115e59;
  font-size: 11px;
  font-weight: 750;
}

.connection-hint.jump {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

.canvas-stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 4000px;
  height: 3000px;
  transform-origin: 0 0;
}

.selection-marquee {
  position: absolute;
  z-index: 50;
  border: 2px solid #0f766e;
  background: rgba(20, 184, 166, 0.14);
  pointer-events: none;
}

.node {
  position: absolute;
  width: 240px;
  min-height: 118px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.11);
  cursor: move;
}

.node.selected {
  border-color: #0f766e;
  outline: 3px solid #14b8a6;
  outline-offset: 3px;
  box-shadow: 0 0 0 7px rgba(20, 184, 166, 0.15), 0 10px 24px rgba(16, 24, 40, 0.15);
}

.node.selected::after {
  content: "✓";
  position: absolute;
  top: -13px;
  right: -13px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #0f766e;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
}

.node.dragging {
  z-index: 80;
  cursor: grabbing;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.28);
}

.node.group-dragging {
  z-index: 70;
  cursor: grabbing;
}

.node.group-dragging.dragging {
  z-index: 80;
}

.node.dragging.selected {
  box-shadow: 0 0 0 7px rgba(20, 184, 166, 0.16), 0 18px 42px rgba(15, 23, 42, 0.3);
}

.node.start {
  border-color: #b45309;
}

.node.start .node-title::before {
  content: "Start";
  display: inline-flex;
  margin-right: 8px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 11px;
  font-weight: 700;
}

.node-title {
  border-bottom: 1px solid #e2e8f0;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
}

.node-text {
  padding: 10px;
  color: #344054;
  font-size: 13px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.canvas-trigger-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.canvas-trigger-chip {
  display: inline-block;
  overflow: hidden;
  max-width: 170px;
  border: 1px solid #bae6fd;
  border-radius: 999px;
  background: #f0f9ff;
  padding: 2px 7px;
  color: #075985;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-trigger-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 8px;
  z-index: 7;
  max-width: 224px;
}

.edge-trigger-object {
  overflow: visible;
  pointer-events: auto;
}

.edge-trigger-list {
  display: flex;
  justify-content: center;
  cursor: pointer;
}

.edge-trigger-list .canvas-trigger-chip {
  border-color: #99f6e4;
  background: #f0fdfa;
  color: #115e59;
  box-shadow: 0 2px 5px rgb(15 118 110 / 14%);
}

.jump-trigger-list .canvas-trigger-chip {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.port {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  background: #0f766e;
  transform: translateY(-50%);
  box-shadow: 0 0 0 1px #0f766e;
}

.port::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 999px;
}

.port.in {
  left: -9px;
}

.port.out {
  right: -9px;
  cursor: crosshair;
}

.jump-port {
  bottom: -9px;
  left: 50%;
  top: auto;
  background: #b45309;
  box-shadow: 0 0 0 1px #b45309;
  transform: translateX(-50%);
}

.node.connection-target .port.in {
  animation: target-pulse 900ms ease-in-out infinite alternate;
  background: #14b8a6;
  box-shadow: 0 0 0 5px rgba(20, 184, 166, 0.22);
  cursor: crosshair;
}

.node.connection-target {
  outline: 2px dashed rgba(15, 118, 110, 0.48);
  outline-offset: 2px;
  cursor: crosshair;
}

.node.jump-target {
  outline: 2px dashed rgba(180, 83, 9, 0.62);
  outline-offset: 2px;
  cursor: crosshair;
}

.node.jump-target .port.in {
  animation: target-pulse 900ms ease-in-out infinite alternate;
  background: #d97706;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.24);
  cursor: crosshair;
}

.node.connection-source {
  box-shadow: 0 0 0 5px rgba(15, 118, 110, 0.16), 0 10px 24px rgba(16, 24, 40, 0.12);
}

.cross-link-badge {
  position: absolute;
  right: 8px;
  bottom: 7px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #fbbf24;
  border-radius: 999px;
  background: #fffbeb;
  padding: 2px 7px;
  color: #92400e;
  font-size: 10px;
  font-weight: 850;
}

.node-comment-badge {
  position: absolute;
  z-index: 8;
  top: -13px;
  left: 12px;
  border: 1px solid #a78bfa;
  border-radius: 999px;
  background: #f5f3ff;
  padding: 3px 7px;
  color: #6d28d9;
  font-size: 10px;
  font-weight: 850;
  box-shadow: 0 2px 7px rgb(76 29 149 / 16%);
}

.node-comment-badge:hover {
  background: #ede9fe;
}

@keyframes target-pulse {
  from {
    transform: translateY(-50%) scale(1);
  }

  to {
    transform: translateY(-50%) scale(1.22);
  }
}

.edge-path {
  fill: none;
  stroke: #0f766e;
  stroke-width: 3;
  cursor: pointer;
}

.edge-path.conditional-path {
  stroke: #7c3aed;
}

.edge-path.selected {
  stroke-width: 5;
}

.pending-edge-path {
  stroke-width: 3;
  stroke-dasharray: 6 5;
  opacity: 0.85;
}

.cross-dialog-info {
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  padding: 9px;
  color: #78350f;
  font-size: 11px;
}

.cross-dialog-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.cross-dialog-route span {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cross-dialog-route span:last-child {
  text-align: right;
}

.cross-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 9px;
}

.jump-path {
  stroke: #b45309;
  stroke-dasharray: 8 6;
}

.jump-path.conditional-jump-path {
  stroke: #db2777;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: #1f2937;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 650;
}

.btn:hover {
  background: #f8fafc;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn.primary {
  border-color: #0f766e;
  background: #0f766e;
  color: #ffffff;
}

.btn.danger {
  border-color: #fecaca;
  color: var(--danger);
}

.icon-btn {
  width: 34px;
  min-width: 34px;
  padding: 0;
}

.field {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  padding: 8px 9px;
  color: #1f2937;
  font-size: 13px;
}

.term-editor {
  display: grid;
  gap: 7px;
}

.property-editor {
  display: grid;
  gap: 7px;
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
}

.property-editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.property-pair-list,
.property-definition-list {
  display: grid;
  gap: 7px;
}

.property-pair {
  display: grid;
  grid-template-columns: minmax(90px, 0.85fr) minmax(100px, 1fr) 34px;
  gap: 6px;
  align-items: center;
}

.property-pair-new {
  border-radius: 8px;
  background: #f8fafc;
  padding: 7px;
}

.property-value-autocomplete {
  position: relative;
  min-width: 0;
}

.property-value-suggestions {
  position: absolute;
  z-index: 35;
  top: calc(100% + 3px);
  right: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgb(15 23 42 / 14%);
}

.property-value-suggestions button {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
  padding: 8px 9px;
  color: #334155;
  font-size: 12px;
  text-align: left;
}

.property-value-suggestions button:last-child {
  border-bottom: 0;
}

.property-value-suggestions button:hover {
  background: #f0fdfa;
  color: #0f766e;
}

.property-definition-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
}

.node-comments {
  display: grid;
  gap: 8px;
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
}

.node-comments-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.node-comments-heading small {
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: #ede9fe;
  color: #6d28d9;
  font-size: 10px;
  font-weight: 800;
}

.node-comment-list,
.comment-overview-list {
  display: grid;
  gap: 8px;
}

.node-comment {
  border-left: 3px solid #a78bfa;
  border-radius: 6px;
  background: #faf5ff;
  padding: 8px;
}

.node-comment header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 20px;
  gap: 5px;
  align-items: center;
}

.node-comment header strong,
.node-comment header span {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-comment header span {
  color: #7c3aed;
}

.node-comment p,
.comment-overview-card p {
  margin: 6px 0 0;
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.comment-delete {
  border: 0;
  background: transparent;
  color: #b42318;
  font-size: 16px;
}

.comment-overview-card {
  border: 1px solid #ddd6fe;
  border-radius: 9px;
  background: #faf5ff;
  padding: 11px;
}

.comment-overview-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.comment-overview-card > header > div {
  display: grid;
  gap: 2px;
}

.comment-overview-card > header span,
.comment-overview-card footer {
  color: #64748b;
  font-size: 11px;
}

.comment-overview-card footer {
  display: flex;
  gap: 6px;
  margin-top: 9px;
  border-top: 1px solid #ede9fe;
  padding-top: 7px;
}

.comment-overview-card footer strong {
  overflow: hidden;
  color: #475569;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.activity-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  padding: 10px;
}

.activity-symbol {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 12px;
  font-weight: 900;
}

.activity-info {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.activity-info span,
.activity-info small {
  overflow: hidden;
  color: #64748b;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.term-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.term-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #99f6e4;
  border-radius: 999px;
  background: #f0fdfa;
  padding: 4px 7px 4px 9px;
  color: #115e59;
  font-size: 11px;
  font-weight: 750;
}

.term-chip button {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #0f766e;
  font-size: 14px;
  line-height: 1;
}

.term-chip button:hover {
  background: #ccfbf1;
}

.term-empty {
  color: #94a3b8;
  font-size: 11px;
}

.term-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
  align-items: start;
}

.term-autocomplete {
  position: relative;
}

.term-suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + 3px);
  right: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgb(15 23 42 / 14%);
}

.term-suggestions button {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
  padding: 8px 9px;
  color: #334155;
  font-size: 12px;
  text-align: left;
}

.term-suggestions button:last-child {
  border-bottom: 0;
}

.term-suggestions button:hover,
.term-suggestions button:focus {
  background: #f0fdfa;
  color: #0f766e;
}

.section-title {
  margin: 0 0 8px;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.list-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  padding: 8px;
  text-align: left;
}

.list-item:hover {
  background: #f8fafc;
}

.list-item.active {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.dialog-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: stretch;
  border: 1px solid transparent;
  border-radius: 7px;
}

.dialog-list-row:hover {
  background: #f8fafc;
}

.dialog-list-row.active {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.character-list-card {
  position: relative;
  display: block;
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
}

.character-list-card.active {
  border-color: #7c3aed;
  box-shadow: 0 0 0 2px rgb(124 58 237 / 14%);
}

.character-type-marker {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 10px;
  height: 10px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgb(15 23 42 / 18%);
}

.character-list-name {
  display: block;
  overflow: hidden;
  padding-right: 20px;
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-dialog-pins {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.character-dialog-pin {
  overflow: hidden;
  max-width: 100%;
  border: 1px solid #c4b5fd;
  border-radius: 999px;
  background: #f5f3ff;
  padding: 4px 9px;
  color: #6d28d9;
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-dialog-pin:hover {
  border-color: #8b5cf6;
  background: #ede9fe;
}

.dialog-select {
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 8px;
  text-align: left;
}

.dialog-list-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.dialog-type-marker {
  width: 9px;
  height: 9px;
  box-shadow: 0 0 0 1px rgb(15 23 42 / 12%);
}

.dialog-play-button {
  align-self: center;
  width: 28px;
  height: 28px;
  border: 1px solid #99f6e4;
  border-radius: 999px;
  background: #ffffff;
  color: #0f766e;
  font-size: 11px;
}

.dialog-play-button:hover {
  background: #0f766e;
  color: #ffffff;
}

.dialog-play-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.play-window {
  display: grid;
  width: min(460px, 100%);
  max-height: min(680px, calc(100vh - 48px));
  grid-template-rows: auto minmax(180px, 1fr) auto;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.36);
}

.play-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 14px 16px;
}

.play-header h2 {
  margin: 0;
  color: #1e293b;
  font-size: 16px;
}

.play-header p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 11px;
}

.play-messages {
  overflow: auto;
  padding: 16px;
}

.chat-message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  margin-bottom: 13px;
}

.chat-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: #0f766e;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
}

.chat-content {
  border: 1px solid #dbe3ec;
  border-radius: 4px 12px 12px 12px;
  background: #ffffff;
  padding: 9px 11px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.chat-content strong {
  color: #0f766e;
  font-size: 11px;
}

.chat-content p {
  margin: 3px 0 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.play-controls {
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 12px 14px;
}

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

.play-prompt {
  margin-bottom: 2px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.play-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  background: #f0fdfa;
  padding: 9px 10px;
  color: #115e59;
  text-align: left;
}

.play-choice:hover {
  border-color: #14b8a6;
  background: #ccfbf1;
}

.play-choice span {
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
}

.play-choice small {
  flex: 0 0 auto;
  color: #7c3aed;
  font-size: 9px;
  font-weight: 800;
}

.play-ended {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.play-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  color: #64748b;
}

.play-typing > span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #14b8a6;
  animation: typing-dot 800ms ease-in-out infinite alternate;
}

.play-typing > span:nth-child(2) {
  animation-delay: 160ms;
}

.play-typing > span:nth-child(3) {
  animation-delay: 320ms;
}

.play-typing small {
  margin-left: 5px;
  font-size: 10px;
}

@keyframes typing-dot {
  from {
    opacity: 0.35;
    transform: translateY(1px);
  }

  to {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #94a3b8;
}

.status-dot.ok {
  background: #10b981;
}

.status-dot.warn {
  background: #f59e0b;
}

.status-dot.error {
  background: #ef4444;
}

.mode-badge {
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  padding: 5px 9px;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
}

.read-only .sidebar input,
.read-only .sidebar textarea,
.read-only .sidebar select,
.read-only .inspector > div input,
.read-only .inspector > div textarea,
.read-only .inspector > div select,
.read-only .inspector > div button {
  pointer-events: none;
}

.read-only .field:not([readonly]) {
  background: #f8fafc;
}

.version-panel {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.version-list {
  max-height: 220px;
  overflow: auto;
}

.version-row {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 2px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #ffffff;
  padding: 8px;
  text-align: left;
}

.version-row:hover,
.version-row.active {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.version-row strong {
  font-size: 12px;
}

.version-row span {
  overflow: hidden;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-row .current-version-badge {
  display: inline-flex;
  margin-left: 5px;
  overflow: visible;
  border-radius: 999px;
  background: #ccfbf1;
  padding: 2px 6px;
  color: #0f766e;
  font-family: inherit;
  font-size: 9px;
  font-weight: 800;
  vertical-align: middle;
}

.version-preview {
  margin-top: 12px;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: #f0f9ff;
  padding: 10px;
}

.preview-text {
  margin: 8px 0;
  color: #475569;
  font-size: 11px;
  line-height: 1.4;
}

.validation-row {
  border-left: 3px solid #f59e0b;
  background: #fffbeb;
  padding: 7px 8px;
  color: #713f12;
  font-size: 12px;
}

.property-kind {
  color: #0f766e;
  font-size: 13px;
  font-weight: 800;
}

.multi-selection-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  border: 1px solid #99f6e4;
  border-radius: 9px;
  background: #f0fdfa;
  padding: 12px;
  color: #115e59;
}

.multi-selection-summary strong {
  font-size: 24px;
}

.multi-selection-summary span {
  font-size: 12px;
  font-weight: 700;
}

.dialog-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.dialog-summary > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px;
  text-align: center;
}

.dialog-summary strong {
  color: #0f766e;
  font-size: 16px;
}

.dialog-summary span {
  overflow: hidden;
  color: #64748b;
  font-size: 9px;
  text-overflow: ellipsis;
}

.dialog-character-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dialog-character-chip {
  display: inline-flex;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  padding: 5px 9px;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.readonly-value {
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #f8fafc;
  padding: 8px 9px;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .app-shell.sidebar-collapsed {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .app-shell.inspector-collapsed {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .app-shell.sidebar-collapsed.inspector-collapsed {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .inspector {
    position: absolute;
    right: 0;
    top: 56px;
    bottom: 0;
    width: 320px;
    box-shadow: -18px 0 32px rgba(16, 24, 40, 0.12);
    z-index: 20;
  }

  .inspector.collapsed {
    width: 44px;
  }
}

@media (max-width: 680px) {
  .modal-backdrop {
    padding: 12px;
  }

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