:root {
  color-scheme: light;
  --bg: #eef1f5;
  --panel: #ffffff;
  --ink: #18202b;
  --muted: #667085;
  --line: #d7dce4;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --good: #0f8a5f;
  --warn: #a16207;
  --bad: #b42318;
  --bad-bg: #fef3f2;
  --chip: #f2f4f7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 980px;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  min-height: 34px;
  padding: 0 12px;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: #98a2b3;
}

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

button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

button.primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.app-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #f8fafc;
  padding: 18px;
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background: #111827;
  color: #facc15;
  font-weight: 800;
  letter-spacing: 0;
}

.brand h1,
.workspace-header h2,
.section-heading h3 {
  margin: 0;
  letter-spacing: 0;
}

.brand h1 {
  font-size: 17px;
}

.brand p,
.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.toolbar,
.header-actions,
.section-heading,
.canvas-tools,
.option-row,
.node-actions,
.meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar {
  margin-bottom: 24px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.server-switcher {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.server-switcher label,
.server-switcher-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.server-switcher select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
  color: var(--ink);
}

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

.server-actions button {
  padding: 0 8px;
}

/* API Key secure modal */
.api-key-dialog {
  width: min(520px, calc(100vw - 32px));
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 28px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
}

.api-key-dialog h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.api-key-dialog-label {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.api-key-dialog-label code {
  background: #f0f4ff;
  border: 1px solid #c7d2fe;
  border-radius: 4px;
  padding: 1px 5px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  color: #3730a3;
}

.api-key-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.api-key-input {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  cursor: text;
  user-select: all;
}

.copy-btn {
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 100px;
}

.api-key-warning {
  margin: 0 0 20px;
  padding: 10px 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #9a3412;
  font-size: 12px;
}

.dialogue-list {
  display: grid;
  gap: 14px;
}

.npc-group {
  display: grid;
  gap: 6px;
}

.npc-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 28px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: #344054;
  text-align: left;
}

.npc-group-header:hover:not(:disabled) {
  border-color: transparent;
  background: rgba(37, 99, 235, 0.06);
}

.npc-group-header strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.npc-chevron {
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 4px;
  background: #eef2ff;
  color: #1d4ed8;
  font-size: 12px;
  line-height: 1;
}

.npc-group-header > span {
  min-width: 24px;
  border-radius: 999px;
  background: #e4e7ec;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}

.npc-group-items {
  display: grid;
  gap: 6px;
}

.npc-group-items[hidden] {
  display: none;
}

.dialogue-item {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.dialogue-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.dialogue-item-main {
  display: grid;
  width: 100%;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.dialogue-item-main:hover:not(:disabled) {
  border-color: transparent;
}

.dialogue-item-main strong {
  display: block;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialogue-meta,
.dialogue-meta span {
  display: inline-flex;
  margin-right: 6px;
  color: var(--muted);
  font-size: 12px;
}

.dialogue-actions {
  display: inline-grid;
  grid-template-columns: 62px 34px;
  gap: 6px;
  align-items: center;
}

.dialogue-actions button {
  min-height: 28px;
  padding: 0 6px;
  font-size: 12px;
}

.dialogue-actions .danger {
  border-color: #fecdca;
  background: var(--bad-bg);
  color: var(--bad);
}

.dialogue-menu {
  position: relative;
}

.dialogue-menu summary {
  display: grid;
  width: 34px;
  min-height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #344054;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.dialogue-menu summary::-webkit-details-marker {
  display: none;
}

.dialogue-menu[open] summary {
  border-color: var(--accent);
  color: var(--accent);
}

.dialogue-menu div {
  position: absolute;
  right: 0;
  z-index: 20;
  display: grid;
  width: 142px;
  gap: 4px;
  margin-top: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.dialogue-menu div button {
  justify-content: flex-start;
  width: 100%;
  min-height: 30px;
}

.workspace {
  min-width: 0;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 78px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.workspace-header h2 {
  font-size: 22px;
}

.editor-grid {
  display: grid;
  grid-template-columns: 360px 8px 1fr 8px 320px;
  gap: 0;
  padding: 0;
  height: calc(100vh - 78px);
  overflow: hidden;
}

.resizer {
  background: transparent;
  cursor: col-resize;
  transition: background 0.2s;
  position: relative;
  z-index: 10;
}

.resizer:hover, 
.resizer.dragging {
  background: var(--accent);
}

.resizer::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 30px;
  background: var(--line);
  border-radius: 2px;
}

.nodes-panel, .details-panel, .result-panel {
  border: none !important;
  border-radius: 0 !important;
  height: 100%;
}

.nodes-panel { border-right: 1px solid var(--line) !important; }
.result-panel { border-left: 1px solid var(--line) !important; }

.details-panel,
.nodes-panel,
.result-panel,
.flow-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.details-panel,
.result-panel {
  padding: 14px;
}

.details-panel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 !important; /* El padding lo maneja el wrapper interno */
}

.inspector-panel {
  height: 100%;
}

#inspectorContainer {
  height: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.inspector-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.inspector-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
}

.inspector-footer {
  flex-shrink: 0;
  padding: 15px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  padding: 9px 10px;
}

textarea {
  min-height: 76px;
  resize: vertical;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #f8fafc;
  color: var(--muted);
}

.meta-row span {
  border-radius: 999px;
  background: var(--chip);
  color: #475467;
  padding: 4px 9px;
  font-size: 12px;
}

.nodes-panel {
  padding: 14px;
  align-self: start;
  min-height: calc(100vh - 112px);
}

.flow-panel {
  margin: 16px;
  padding: 14px;
}

.section-heading {
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-heading h3 {
  font-size: 16px;
}

.panel-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.canvas-tools span {
  min-width: 48px;
  color: var(--muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.nodes-container {
  display: grid;
  gap: 12px;
}

.dialogue-tree {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 190px);
  overflow: auto;
  padding-right: 4px;
}

.tree-root,
.tree-branch,
.tree-children {
  display: grid;
  gap: 6px;
}

.tree-children {
  margin-left: 16px;
  padding-left: 10px;
  border-left: 1px solid #e4e7ec;
}

.tree-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  text-align: left;
}

.tree-item i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #cbd5e1;
}

.tree-item.ok i {
  background: #22c55e;
}

.tree-item.warn {
  border-color: #fbbf24;
}

.tree-item.warn i {
  background: #f59e0b;
}

.tree-item.error {
  border-color: #fda29b;
}

.tree-item.error i {
  background: #ef4444;
}

.tree-item span {
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
  padding: 2px 7px;
  font-size: 11px;
  text-align: center;
}

.tree-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.tree-item.active {
  border-color: var(--accent);
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.tree-item.node span {
  background: #e0f2fe;
  color: #0369a1;
}

.tree-item.option span {
  background: #dcfce7;
  color: #166534;
}

.tree-item.action span {
  background: #fef3c7;
  color: #92400e;
}

.tree-item.component span {
  background: #ede9fe;
  color: #5b21b6;
}

.tree-item.condition span {
  background: #fce7f3;
  color: #9d174d;
}

.inspector-heading {
  display: grid;
  gap: 2px;
  margin-bottom: 10px;
}

.inspector-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.inspector-heading h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.inspector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.visual-settings {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fcfcfd;
}

.visual-toggle-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fcfcfd;
}

.visual-toggle-card div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.visual-toggle-card strong {
  font-size: 13px;
}

.visual-toggle-card span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-heading.compact {
  margin-bottom: 0;
}

.section-heading.compact h4 {
  margin: 0;
  font-size: 14px;
}

.inline-toggle {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-height: auto;
  font-size: 12px;
  font-weight: 700;
}

.inline-toggle input {
  width: auto;
  min-height: auto;
}

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

.glyph-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: #111318;
  color: #f8fafc;
  font-size: 18px;
}

.resource-pack-dialog {
  width: min(1200px, calc(100vw - 32px));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.resource-pack-dialog::backdrop {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

.resource-pack-shell {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.resource-pack-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
  min-height: 560px;
}

.resource-pack-assets,
.resource-pack-preview {
  display: grid;
  align-content: start;
  gap: 12px;
}

.resource-asset-list {
  display: grid;
  gap: 10px;
  max-height: 610px;
  overflow: auto;
  padding-right: 4px;
}

.resource-template-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.resource-template-bar button {
  min-height: 34px;
}

.resource-asset-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 160px;
  gap: 16px;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.resource-asset-row:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.resource-thumb {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #0f172a;
  color: #facc15;
  font-size: 24px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.resource-thumb img,
.rp-portrait img,
.rp-option img,
.rp-chat-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.resource-fields {
  display: grid;
  grid-template-columns: 1.25fr 0.7fr 1fr 0.55fr 0.55fr;
  gap: 8px;
}

.resource-row-actions,
.resource-actions {
  display: grid;
  gap: 8px;
}

.resource-row-actions button,
.resource-row-actions .file-button {
  width: 100%;
  min-height: 32px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-button {
  position: relative;
  min-height: 36px;
  cursor: pointer;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.resource-live-preview {
  display: grid;
  gap: 12px;
}

.rp-minecraft-box {
  position: relative;
  min-height: 360px;
  border: 2px solid #1e293b;
  border-radius: 12px;
  padding: 32px;
  background: 
    linear-gradient(rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.9)),
    url('https://www.transparenttextures.com/patterns/carbon-fibre.png'),
    #0f172a;
  color: #f8fafc;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.rp-minecraft-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.rp-dialog-panel {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 7px;
  padding: 14px;
  background: rgb(10 10 12 / 82%);
  overflow: hidden;
}

.rp-background-glyph {
  position: absolute;
  right: 10px;
  bottom: 6px;
  color: rgb(255 255 255 / 18%);
  font-size: 38px;
}

.rp-portrait {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid rgb(255 255 255 / 18%);
  background: #272a32;
}

.rp-dialog-copy strong {
  display: block;
  margin-bottom: 6px;
}

.rp-dialog-copy p {
  margin: 0;
  line-height: 1.45;
}

.rp-options {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  margin-left: 90px;
}

.rp-option {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 24px;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 5px;
  padding: 5px 8px;
  background: rgb(35 35 39 / 88%);
}

.rp-option i {
  color: #9ee7ff;
  font-style: normal;
  text-align: right;
}

.rp-chat-preview {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 210px;
  padding: 46px 18px 18px;
  overflow: hidden;
  font-family: "Minecraft", "Courier New", monospace;
  text-shadow: 2px 2px 0 #000;
}

.rp-chat-background {
  position: absolute;
  inset: 22px 10px 10px;
  z-index: 0;
  opacity: 0.72;
  pointer-events: none;
}

.rp-chat-background img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.rp-chat-header,
.rp-chat-lines,
.rp-chat-options {
  position: relative;
  z-index: 1;
}

.rp-chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffd45a;
}

.rp-chat-portrait {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.1);
}

.rp-chat-lines {
  color: #f8fafc;
  line-height: 1.35;
}

.rp-chat-options {
  display: grid;
  gap: 3px;
  margin-top: 6px;
  color: #fff94a;
}

.rp-chat-options > div {
  display: grid;
  grid-template-columns: 24px 24px minmax(0, 1fr);
  gap: 4px;
  align-items: center;
}

.rp-chat-selector,
.rp-chat-number {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 18px;
}

.rp-glyph,
.rp-empty {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  min-height: 22px;
}

.rp-background-glyph-layer {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  display: grid;
  place-items: center;
}

.rp-background-glyph-layer img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.rp-icon-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.rp-icon-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.rp-glyph-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.05);
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.rp-glyph-strip span {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 80px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.rp-glyph-strip span:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.06);
}

.rp-glyph-strip img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.rp-glyph-strip small {
  color: var(--muted);
}

.pixel-editor-dialog {
  width: min(1200px, calc(100vw - 32px));
  max-height: 95vh;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 0;
  background: #0f172a;
  color: #f3f4f6;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.pixel-editor-dialog .simulation-topbar {
  background: #1f2937;
  border-bottom: 1px solid #374151;
  padding: 16px 20px;
}

.pixel-editor-dialog .simulation-topbar h3 {
  color: #facc15;
}

.pixel-editor-shell {
  display: block;
  overflow-y: auto;
  max-height: calc(95vh - 70px);
  padding: 10px;
}

.pixel-editor-layout {
  display: grid;
  grid-template-columns: 110px 1fr 300px;
  gap: 40px;
  align-items: stretch;
  padding: 30px;
  background: #0f172a;
  min-height: 700px;
}

.pixel-editor-toolbar {
  display: flex;
  flex-direction: column;
  gap: 25px;
  background: #1e293b;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid #334155;
  width: 130px; /* Aumentado para acomodar la paleta */
}

.tool-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid #334155;
}

.tool-buttons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.tool-group:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.tool-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 18px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0f172a;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.tool-btn:hover {
  background: #334155;
  border-color: #facc15;
}

.tool-btn.active {
  background: #facc15;
  border-color: #facc15;
  color: #0f172a;
  box-shadow: 0 0 15px rgba(250, 204, 21, 0.4);
}

.pixel-palette {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
  width: 100%;
}

.palette-color {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  transition: transform 0.1s;
}

.palette-color:hover {
  transform: scale(1.15);
  border-color: white;
  z-index: 10;
}

.color-picker-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.color-picker-wrapper label {
  font-size: 11px;
  font-weight: 800;
  color: #facc15;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

#pixelColorInput {
  width: 100%;
  height: 34px;
  padding: 0;
  border: 2px solid #334155;
  background: #0f172a;
  border-radius: 6px;
  cursor: pointer;
}

.pixel-editor-center {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #020617;
  border-radius: 12px;
  border: 1px solid #1e293b;
  padding: 40px;
  overflow: hidden;
  position: relative;
  min-height: 500px;
}

.canvas-wrapper {
  position: relative;
  box-shadow: 0 0 50px rgba(0,0,0,0.8);
  border: 2px solid #334155;
  background: #000;
  display: flex;
}

.pixel-canvas {
  display: block;
  image-rendering: pixelated;
  max-width: 100%;
  max-height: 100%;
  cursor: crosshair;
  background-image: 
    linear-gradient(45deg, #111827 25%, transparent 25%),
    linear-gradient(-45deg, #111827 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #111827 75%),
    linear-gradient(-45deg, transparent 75%, #111827 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-color: #030712;
}

.pixel-editor-sidebar {
  display: flex;
  flex-direction: column;
  gap: 25px;
  background: #1e293b;
  padding: 25px;
  border-radius: 16px;
  border: 1px solid #334155;
  color: #94a3b8;
}

.io-group {
  display: grid;
  gap: 10px;
}

.pixel-editor-sidebar button, 
.pixel-editor-sidebar .button-link {
  background: #334155;
  border: 1px solid #475569;
  color: white;
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.pixel-editor-sidebar button:hover,
.pixel-editor-sidebar .button-link:hover {
  background: #475569;
  border-color: #facc15;
}

.pixel-editor-sidebar button.primary {
  background: #eab308;
  color: #000;
  border-color: #facc15;
}

.pixel-editor-sidebar button.primary:hover {
  background: #facc15;
  transform: translateY(-1px);
}

.template-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.template-group p {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

@media (max-width: 960px) {
  .resource-pack-layout,
  .resource-asset-row,
  .resource-fields {
    grid-template-columns: 1fr;
  }

  .resource-thumb {
    width: 100%;
  }
}

button.danger {
  border-color: #fecdca;
  background: var(--bad-bg);
  color: var(--bad);
}

.node-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfcfd;
  padding: 12px;
  scroll-margin-top: 18px;
}

.node-card.start {
  border-color: #22c55e;
}

.node-top {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.node-components,
.options {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.component-card {
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.component-text {
  border-left: 4px solid #38bdf8;
}

.component-option {
  border-left: 4px solid #22c55e;
}

.component-note {
  border-left: 4px solid #f59e0b;
}

.component-condition {
  border-left: 4px solid #8b5cf6;
}

.component-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.component-header strong {
  font-size: 13px;
}

.component-fields {
  display: grid;
  grid-template-columns: 120px minmax(130px, 1fr);
  gap: 8px;
}

.component-fields label:last-child {
  grid-column: 1 / -1;
}

.add-component-btn {
  min-width: 34px;
  padding: 0;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.more-menu {
  position: relative;
}

.more-menu summary {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.more-menu summary::-webkit-details-marker {
  display: none;
}

.menu-panel {
  position: absolute;
  right: 0;
  z-index: 20;
  display: grid;
  gap: 4px;
  min-width: 190px;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
}

.menu-panel button {
  justify-content: flex-start;
  width: 100%;
  min-height: 30px;
  border: 0;
  text-align: left;
}

.menu-panel button:hover:not(:disabled) {
  background: #f2f4f7;
}

.menu-panel .danger {
  color: var(--bad);
}

.option-row {
  display: grid;
  grid-template-columns: 110px minmax(130px, 1fr) 170px auto auto;
  align-items: end;
}

.option-row label,
.action-row label {
  font-size: 12px;
}

.actions-block {
  display: grid;
  gap: 8px;
  margin: 8px 0 0 118px;
  padding-left: 10px;
  border-left: 2px solid #e4e7ec;
}

.action-row {
  display: grid;
  grid-template-columns: 120px minmax(120px, 1fr) 88px auto;
  gap: 8px;
  align-items: end;
}

.result-panel {
  align-self: start;
}

#resultLog {
  min-height: 160px;
  max-height: calc(100vh - 600px);
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: 6px;
  background: #111827;
  color: #e5e7eb;
  white-space: pre-wrap;
}

.dialogue-preview {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.preview-head strong {
  font-size: 14px;
}

.preview-head button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.preview-node {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
}

.preview-node span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.preview-node p {
  margin: 0;
}

.preview-options {
  display: grid;
  gap: 6px;
}

.preview-options button {
  justify-content: flex-start;
  width: 100%;
  min-height: 32px;
  text-align: left;
}

.preview-log {
  display: grid;
  gap: 4px;
  max-height: 130px;
  overflow: auto;
  margin: 0;
  padding: 8px 8px 8px 22px;
  border-radius: 6px;
  background: #111827;
  color: #e5e7eb;
  font-size: 12px;
}

.error-banner {
  border: 1px solid #fda29b;
  border-radius: 6px;
  background: var(--bad-bg);
  color: var(--bad);
  padding: 10px;
  font-weight: 650;
}

.graph-view {
  position: relative;
  min-height: 360px;
  max-height: 520px;
  overflow: auto;
  margin-bottom: 14px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(#eef2f7 1px, transparent 1px),
    linear-gradient(90deg, #eef2f7 1px, transparent 1px),
    #f8fafc;
  background-size: 24px 24px;
  cursor: crosshair;
}

.flow-canvas {
  position: relative;
  width: 1800px;
  height: 1200px;
  transform-origin: 0 0;
}

.flow-svg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.flow-edge {
  fill: none;
  stroke: #111827;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.flow-edge.exit {
  stroke: #ef4444;
}

.flow-edge.missing {
  stroke: #f97316;
  stroke-dasharray: 7 5;
}

.flow-edge.preview {
  stroke: var(--accent);
  stroke-dasharray: 8 6;
  stroke-width: 3;
}

.flow-edge-label {
  fill: #334155;
  font-size: 12px;
  paint-order: stroke;
  stroke: #f8fafc;
  stroke-width: 4px;
}

.flow-card {
  position: absolute;
  width: 220px;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.flow-node-port {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent);
  border-radius: 999px;
  background: #fff;
  transform: translateY(-50%);
}

.flow-node-port.left {
  left: -8px;
}

.flow-node-port.right {
  right: -8px;
}

.flow-node-port.start {
  border-color: #22c55e;
  background: #22c55e;
}

.flow-node-port.active {
  border-color: #38bdf8;
  background: #38bdf8;
}

.flow-node-port.free {
  border-color: #cbd5e1;
  background: #fff;
}

.flow-card.start {
  border-color: #22c55e;
}

.flow-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16), 0 8px 20px rgba(15, 23, 42, 0.1);
}

.flow-card.dragging {
  cursor: grabbing;
  opacity: 0.92;
}

.flow-card strong {
  display: block;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-card p {
  display: -webkit-box;
  margin: 0 0 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.flow-card .flow-option,
.flow-card > span {
  display: flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 22px;
  margin: 4px 4px 0 0;
  border-radius: 999px;
  background: var(--chip);
  color: #475467;
  padding: 2px 26px 2px 24px;
  font-size: 11px;
  gap: 5px;
  position: relative;
}

.flow-option.active {
  background: #ecfdf3;
  color: #027a48;
}

.flow-option.terminal {
  background: #fef3f2;
  color: #b42318;
}

.flow-option.broken {
  background: #fff7ed;
  color: #c2410c;
}

.flow-option-input {
  position: absolute;
  left: 5px;
  top: 50%;
  width: 11px;
  height: 11px;
  border: 2px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  transform: translateY(-50%);
}

.flow-connector {
  position: absolute;
  right: -8px;
  top: 50%;
  width: 15px;
  height: 15px;
  min-height: 15px;
  border: 2px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  padding: 0;
  cursor: crosshair;
  transform: translateY(-50%);
}

.flow-connector.active {
  border-color: #22c55e;
  background: #22c55e;
}

.flow-connector.terminal {
  border-color: #ef4444;
  background: #ef4444;
}

.flow-connector.broken {
  border-color: #f97316;
  background: #f97316;
}

.flow-connector:hover {
  filter: brightness(0.92);
}

.flow-card.missing {
  border-color: #fda29b;
  background: #fff7f7;
}

.exit-card {
  position: absolute;
  min-width: 88px;
  border-radius: 999px;
  background: #ef4444;
  color: #111827;
  font-weight: 800;
  padding: 10px 16px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.22);
}

.graph-edge {
  display: block;
  color: var(--muted);
  font-size: 12px;
  padding-left: 12px;
}

.confirm-dialog {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
}

.confirm-dialog::backdrop,
.simulation-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.confirm-dialog form {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.confirm-dialog h3,
.confirm-dialog p {
  margin: 0;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.simulation-dialog {
  width: min(860px, calc(100vw - 32px));
  border: 1px solid #111827;
  border-radius: 8px;
  padding: 0;
  background: #0b1020;
  color: #f8fafc;
}

.simulation-shell {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.simulation-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.simulation-topbar span {
  color: #93c5fd;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.simulation-topbar h3 {
  margin: 0;
  color: #fff;
  letter-spacing: 0;
}

.simulation-topbar button {
  border-color: #334155;
  background: #111827;
  color: #e5e7eb;
}

.placeholder-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid #1f2937;
  border-radius: 8px;
  background: #111827;
}

.placeholder-bar label {
  color: #cbd5e1;
  font-size: 12px;
}

.placeholder-bar input {
  border-color: #334155;
  background: #020617;
  color: #f8fafc;
}

.minecraft-chat {
  display: grid;
  gap: 10px;
  min-height: 430px;
  padding: 14px;
  border: 2px solid #1f2937;
  border-radius: 8px;
  background:
    linear-gradient(rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.72)),
    repeating-linear-gradient(45deg, #334155 0 10px, #1f2937 10px 20px);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.04);
  font-family: Consolas, "Courier New", monospace;
}

.mc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #cbd5e1;
  font-size: 12px;
}

.mc-toolbar button {
  min-height: 28px;
  border-color: #334155;
  background: #020617;
  color: #e5e7eb;
  font-size: 12px;
}

.mc-lines {
  display: grid;
  align-content: end;
  gap: 8px;
  min-height: 230px;
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.42);
}

.mc-line {
  width: fit-content;
  max-width: 88%;
  padding: 7px 10px;
  border-radius: 4px;
  color: #f8fafc;
  text-shadow: 1px 1px #000;
}

.mc-line span {
  font-weight: 800;
}

.mc-line.npc {
  background: rgba(22, 163, 74, 0.42);
  border-left: 3px solid #22c55e;
}

.mc-line.npc span {
  color: #86efac;
}

.mc-line.player {
  justify-self: end;
  background: rgba(37, 99, 235, 0.42);
  border-right: 3px solid #60a5fa;
}

.mc-line.player span {
  color: #93c5fd;
}

.mc-line.system {
  justify-self: center;
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
}

.mc-command-title {
  justify-self: center;
  max-width: 92%;
  padding: 9px 14px;
  border: 1px solid #facc15;
  border-radius: 4px;
  background: rgba(250, 204, 21, 0.16);
  color: #fef3c7;
  font-weight: 800;
  text-align: center;
  text-shadow: 1px 1px #000;
}

.mc-ended {
  padding: 12px;
  border: 1px solid #f87171;
  border-radius: 4px;
  background: rgba(127, 29, 29, 0.4);
  color: #fecaca;
  font-family: Consolas, "Courier New", monospace;
  font-weight: 800;
  text-align: center;
  text-shadow: 1px 1px #000;
}

.mc-options {
  display: grid;
  gap: 8px;
}

.mc-option {
  justify-content: flex-start;
  min-height: 40px;
  border-color: #475569;
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  text-align: left;
  font-family: Consolas, "Courier New", monospace;
}

.mc-option small {
  display: block;
  margin-top: 4px;
  color: #fca5a5;
  font-size: 11px;
}

.mc-option.locked {
  border-color: #7f1d1d;
  background: rgba(127, 29, 29, 0.48);
  color: #fecaca;
}

.mc-option:hover:not(:disabled) {
  border-color: #facc15;
  background: #1e293b;
}

.mc-option span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 4px;
  background: #facc15;
  color: #111827;
  font-weight: 800;
}

.mc-option.end {
  justify-content: center;
  color: #fecaca;
}

.mc-placeholder {
  color: #facc15;
  font-weight: 800;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.status-published {
  color: var(--good);
}

.status-draft {
  color: var(--warn);
}

.status-error {
  color: var(--bad);
}

@media (max-width: 1100px) {
  body {
    min-width: 760px;
  }

  .app-shell {
    grid-template-columns: 250px 1fr;
  }

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

  .flow-panel {
    margin: 12px;
  }
}

.site-body,
.auth-body {
  min-width: 0;
  background: #f5f7fb;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 16px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid rgba(215, 220, 228, 0.82);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 22px;
}

.site-nav a,
.text-link,
.auth-row a {
  color: #344054;
  font-weight: 650;
  text-decoration: none;
}

.site-actions,
.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  font-weight: 750;
  text-decoration: none;
}

.button-link.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.button-link.large {
  min-height: 46px;
  padding: 0 18px;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(420px, 1.18fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  min-height: calc(100vh - 72px);
  padding: clamp(32px, 7vw, 86px) clamp(18px, 5vw, 64px);
}

.hero-copy h1 {
  margin: 8px 0 14px;
  font-size: clamp(48px, 8vw, 92px);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-lead {
  max-width: 640px;
  margin: 0 0 24px;
  color: #475467;
  font-size: clamp(18px, 2vw, 23px);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 620px;
  margin: 28px 0 0;
}

.hero-metrics div,
.workflow-step,
.feature-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.hero-metrics div {
  padding: 12px;
}

.hero-metrics dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-metrics dd {
  margin: 2px 0 0;
  font-weight: 800;
}

.product-preview {
  display: grid;
  grid-template-columns: 170px 1fr;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid #cfd6e3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}

.preview-sidebar {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  border-right: 1px solid var(--line);
  background: #111827;
  color: #f8fafc;
}

.preview-sidebar span {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: #facc15;
}

.preview-sidebar button {
  justify-content: flex-start;
  border-color: #334155;
  background: #1f2937;
  color: #e5e7eb;
  text-align: left;
}

.preview-sidebar button.active {
  border-color: #60a5fa;
  background: #1d4ed8;
}

.preview-workspace {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  background: #eef1f5;
}

.preview-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.preview-top span {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
}

.preview-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 14px;
  padding: 14px;
}

.preview-tree,
.preview-inspector {
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.tree-chip {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font-weight: 750;
}

.tree-chip.node {
  border-color: #7dd3fc;
  background: #e0f2fe;
  color: #0369a1;
}

.tree-chip.option {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}

.tree-chip.condition {
  border-color: #f9a8d4;
  background: #fce7f3;
  color: #9d174d;
}

.tree-chip.action {
  border-color: #fcd34d;
  background: #fef3c7;
  color: #92400e;
}

.preview-inspector span,
.auth-terminal span,
.auth-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.preview-inspector strong {
  font-size: 20px;
}

.preview-inspector label {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

.preview-inspector i {
  color: var(--accent);
  font-style: normal;
}

.feature-band,
.workflow-band,
.pricing-band {
  padding: clamp(42px, 7vw, 82px) clamp(18px, 5vw, 64px);
}

.section-copy {
  display: grid;
  gap: 8px;
  max-width: 820px;
  margin-bottom: 22px;
}

.section-copy h2,
.pricing-band h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.05;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-grid article,
.workflow-step {
  padding: 18px;
}

.feature-grid article span,
.workflow-step span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #111827;
  color: #facc15;
  font-weight: 850;
}

.feature-grid h3,
.workflow-step h3 {
  margin: 16px 0 8px;
  font-size: 22px;
}

.feature-grid p,
.workflow-step p,
.pricing-band p {
  margin: 0;
  color: var(--muted);
}

.workflow-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  background: #fff;
}

.pricing-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  background: #111827;
  color: #fff;
}

.pricing-band p {
  max-width: 640px;
  color: #cbd5e1;
}

.auth-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(320px, 520px);
  width: min(980px, 100%);
  min-height: 640px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}

.auth-panel {
  display: grid;
  align-content: center;
  gap: 24px;
  padding: clamp(28px, 5vw, 48px);
}

.auth-heading h1 {
  margin: 4px 0 8px;
  font-size: 42px;
}

.auth-heading p {
  margin: 0;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form button {
  min-height: 44px;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.check-row {
  display: inline-flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.check-row input {
  width: auto;
}

.auth-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.auth-visual {
  position: relative;
  display: grid;
  align-content: center;
  gap: 16px;
  padding: clamp(28px, 5vw, 48px);
  background:
    linear-gradient(rgba(17, 24, 39, 0.86), rgba(17, 24, 39, 0.86)),
    repeating-linear-gradient(45deg, #334155 0 12px, #1f2937 12px 24px);
  color: #fff;
}

.auth-terminal,
.auth-stat {
  border: 1px solid #334155;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.72);
  padding: 18px;
}

.auth-terminal strong,
.auth-stat strong {
  display: block;
  margin: 8px 0;
  color: #facc15;
  font-size: 22px;
}

.auth-terminal p,
.auth-stat p {
  margin: 8px 0 0;
  color: #cbd5e1;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

@media (max-width: 920px) {
  .site-header,
  .hero-section,
  .feature-grid,
  .workflow-band,
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .site-nav {
    display: none;
  }

  .site-header {
    gap: 14px;
  }

  .site-actions {
    justify-content: end;
  }

  .product-preview {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .preview-sidebar {
    grid-template-columns: 38px 1fr;
  }

  .preview-sidebar button {
    display: none;
  }

  .preview-grid,
  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .pricing-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-visual {
    min-height: 320px;
  }
}

.admin-body {
  min-width: 0;
  background: #eef1f5;
}

.admin-shell {
  min-height: 100vh;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(18px, 5vw, 56px);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-hero {
  padding: 34px clamp(18px, 5vw, 56px) 20px;
}

.admin-hero h1 {
  margin: 4px 0 8px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1;
}

.admin-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(480px, 1fr);
  gap: 16px;
  padding: 16px clamp(18px, 5vw, 56px) 42px;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  padding: 0 clamp(18px, 5vw, 56px) 4px;
}

.admin-metrics article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.admin-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
  line-height: 1;
}

.admin-card {
  display: grid;
  align-content: start;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.admin-card h2 {
  margin: 0;
  font-size: 22px;
}

.admin-list-card {
  min-width: 0;
}

.credential-box {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  background: #f0fdf4;
  color: #166534;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.admin-table {
  display: grid;
  gap: 8px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 190px) minmax(140px, 190px) 90px auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfcfd;
  padding: 10px;
}

.admin-row strong,
.admin-row span {
  display: block;
}

.admin-row span {
  color: var(--muted);
  font-size: 12px;
}

.admin-row code {
  overflow: hidden;
  border-radius: 6px;
  background: #111827;
  color: #facc15;
  padding: 7px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.admin-row-actions button {
  min-height: 30px;
  padding: 0 8px;
}

.admin-sync-card {
  margin: 0 clamp(18px, 5vw, 56px) 42px;
}

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

.sync-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 92px 92px 110px 130px minmax(180px, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: #fcfcfd;
  padding: 10px;
}

.sync-row.success {
  border-left-color: var(--good);
}

.sync-row.not_found,
.sync-row.error {
  border-left-color: var(--bad);
}

.sync-row strong,
.sync-row span {
  display: block;
}

.sync-row span,
.sync-row p {
  color: var(--muted);
  font-size: 12px;
}

.sync-row p {
  margin: 0;
}

.sync-row code {
  overflow: hidden;
  border-radius: 6px;
  background: #111827;
  color: #facc15;
  padding: 7px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-status {
  width: fit-content;
  border-radius: 999px;
  background: var(--chip);
  padding: 4px 8px;
  font-weight: 800;
}

@media (max-width: 980px) {
  .admin-grid,
  .admin-row,
  .admin-metrics,
  .sync-row {
    grid-template-columns: 1fr;
  }

  .admin-row-actions {
    justify-content: flex-start;
  }
}

/* ==========================================================================
   PREMIUM FLOW INSPECTOR
   ========================================================================== */

.inspector-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.inspector-header {
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 12px;
  margin-bottom: 8px;
}

.inspector-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.inspector-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
}

.flow-section {
  background: white;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  position: relative;
}

/* Indicadores de Rama */
.flow-section::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  border-radius: 10px 0 0 10px;
}

.flow-section.requirements { border-color: #bfdbfe; }
.flow-section.requirements::before { background: #3b82f6; }

.flow-section.success { border-color: #bbf7d0; }
.flow-section.success::before { background: #10b981; }

.flow-section.failure { border-color: #fecaca; }
.flow-section.failure::before { background: #ef4444; }

.flow-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.flow-header .title {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.flow-section.requirements .title { color: #2563eb; }
.flow-section.success .title { color: #059669; }
.flow-section.failure .title { color: #dc2626; }

.flow-item-row {
  background: #f8fafc;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  position: relative;
  border: 1px solid #e2e8f0;
}

.flow-item-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.flow-item-row .remove-mini-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.flow-item-row .remove-mini-btn:hover { color: #ef4444; }

.logic-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: #94a3b8;
  margin-bottom: 1px;
}

/* Botones de Agregar */
.add-mini-btn {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 16px;
  transition: all 0.2s;
}

.add-mini-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

/* Estilo de Inputs en el Flujo */
.flow-item-main input,
.flow-item-main select {
  background: white;
  border: 1px solid #cbd5e1;
  padding: 6px 10px;
  font-size: 0.85rem;
  border-radius: 6px;
}

.flow-item-main input:focus {
  border-color: #3b82f6;
  outline: none;
}
