:root {
  --ink: #17142b;
  --muted: #686477;
  --paper: #fffdf7;
  --surface: #ffffff;
  --line: #ded9e9;
  --violet: #5b3cc4;
  --violet-dark: #3d278e;
  --violet-soft: #eee9ff;
  --pink: #f46f9c;
  --cyan: #49c7cf;
  --lime: #c6f06d;
  --danger: #b83252;
  --danger-soft: #fff0f3;
  --warning: #805a00;
  --warning-soft: #fff8d9;
  --success: #176b4a;
  --success-soft: #e9fff4;
  --shadow: 0 18px 50px rgba(42, 26, 85, 0.09);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 5%, rgba(244, 111, 156, 0.15), transparent 28rem),
    radial-gradient(circle at 95% 22%, rgba(73, 199, 207, 0.13), transparent 24rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

code,
kbd {
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

code {
  padding: 0.12rem 0.34rem;
  border-radius: 5px;
  background: rgba(91, 60, 196, 0.08);
  font-size: 0.91em;
}

kbd {
  display: inline-block;
  padding: 0.08rem 0.42rem;
  border: 1px solid #c8c1d4;
  border-bottom-width: 3px;
  border-radius: 5px;
  background: #fff;
  font-size: 0.83rem;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 3rem;
  min-height: 430px;
  padding: 5.5rem max(6vw, 2rem) 5rem;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(140deg, rgba(16, 11, 42, 0.98), rgba(62, 32, 119, 0.96)),
    #251451;
}

.hero::before,
.hero::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.hero::before {
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to right, transparent, #000 28%, #000);
}

.hero::after {
  width: 420px;
  height: 420px;
  right: -130px;
  bottom: -210px;
  border: 70px solid rgba(244, 111, 156, 0.22);
  border-radius: 50%;
}

.hero__content,
.hero__art {
  position: relative;
  z-index: 1;
}

.hero__content {
  align-self: center;
  max-width: 760px;
}

.eyebrow,
.step-label {
  margin: 0 0 0.75rem;
  color: var(--pink);
  font-size: 0.79rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(3rem, 7vw, 6.6rem);
  line-height: 0.9;
  letter-spacing: -0.065em;
}

.hero__lead {
  max-width: 650px;
  margin: 1.6rem 0 1.5rem;
  color: #e4dff2;
  font-size: clamp(1.06rem, 2vw, 1.35rem);
}

.hero code {
  background: rgba(255, 255, 255, 0.13);
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f2effa;
  font-size: 0.9rem;
  backdrop-filter: blur(8px);
}

.privacy-pill__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 5px rgba(198, 240, 109, 0.14);
}

.hero__art {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
}

.room {
  display: grid;
  width: 118px;
  height: 118px;
  place-items: center;
  border: 4px solid #15102d;
  border-radius: 16px;
  color: #1c1730;
  background: var(--pink);
  box-shadow:
    inset 0 0 0 7px rgba(255, 255, 255, 0.2),
    10px 12px 0 rgba(12, 8, 29, 0.45);
  transform: rotate(-4deg);
}

.room span {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 2rem;
  font-weight: 900;
}

.room--two {
  width: 104px;
  height: 150px;
  background: var(--cyan);
  transform: rotate(3deg) translateY(25px);
}

.room--three {
  width: 90px;
  height: 90px;
  background: var(--lime);
  transform: rotate(-2deg) translateY(-40px);
}

.connector {
  width: 48px;
  height: 8px;
  border: 2px solid #14102c;
  background: #ffdf6e;
  box-shadow: 0 5px 0 rgba(12, 8, 29, 0.45);
}

.connector--short {
  width: 34px;
}

.page-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: -2rem auto 5rem;
  position: relative;
  z-index: 2;
}

.section-nav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  margin-bottom: 1.25rem;
  padding: 0.5rem;
  overflow-x: auto;
  border: 1px solid rgba(91, 60, 196, 0.15);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.91);
  box-shadow: 0 10px 30px rgba(42, 26, 85, 0.08);
  backdrop-filter: blur(12px);
}

.section-nav a {
  flex: 1;
  min-width: max-content;
  padding: 0.72rem 0.85rem;
  border-radius: 10px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}

.section-nav a:hover {
  color: var(--violet-dark);
  background: var(--violet-soft);
}

.panel {
  margin-top: 1.4rem;
  padding: clamp(1.4rem, 3vw, 2.5rem);
  border: 1px solid rgba(63, 44, 105, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
  scroll-margin-top: 1rem;
}

.section-heading {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.step-label {
  color: var(--violet);
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0.68rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:focus-visible,
.copy-button:focus-visible,
.icon-button:focus-visible,
.room-add:focus-visible,
input:focus-visible,
.drop-zone:focus-visible {
  outline: 3px solid rgba(73, 199, 207, 0.45);
  outline-offset: 2px;
}

.button--primary {
  color: #fff;
  background: var(--violet);
  box-shadow: 0 8px 20px rgba(91, 60, 196, 0.24);
}

.button--primary:hover:not(:disabled) {
  background: var(--violet-dark);
}

.button--secondary {
  border-color: #c9c0e8;
  color: var(--violet-dark);
  background: #fff;
}

.button--ghost {
  border-color: var(--line);
  background: #fff;
}

.button--small {
  min-height: 36px;
  padding: 0.45rem 0.7rem;
  font-size: 0.82rem;
}

.button--download {
  min-width: 245px;
  color: #20183b;
  background: var(--lime);
  box-shadow: 0 9px 24px rgba(125, 174, 34, 0.22);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

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

.tutorial-card {
  position: relative;
  min-height: 250px;
  padding: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.tutorial-card__number {
  position: absolute;
  right: 1.1rem;
  top: 0.3rem;
  color: rgba(91, 60, 196, 0.1);
  font-size: 5.5rem;
  font-weight: 900;
  line-height: 1;
}

.tutorial-card h3 {
  position: relative;
  margin: 0 0 0.9rem;
  padding-right: 3rem;
  font-size: 1.1rem;
}

.tutorial-card p,
.tutorial-card ol {
  position: relative;
  margin-top: 0.5rem;
}

.tutorial-card ol {
  padding-left: 1.25rem;
}

.tutorial-card li + li {
  margin-top: 0.4rem;
}

.copy-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.75rem 0;
  padding: 0.65rem;
  border-radius: 10px;
  background: #f6f3fc;
}

.copy-row code {
  min-width: 0;
  overflow-wrap: anywhere;
  background: transparent;
}

.copy-button {
  flex: none;
  margin-left: auto;
  padding: 0.4rem 0.6rem;
  border: 1px solid #c9c0e8;
  border-radius: 7px;
  color: var(--violet-dark);
  background: #fff;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.muted,
.field-help,
.section-intro {
  color: var(--muted);
}

.muted {
  font-size: 0.88rem;
}

.naming-list {
  position: relative;
  display: grid;
  gap: 0.6rem;
  margin: 0;
}

.naming-list div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px dashed var(--line);
}

.naming-list dt {
  color: var(--muted);
  font-size: 0.84rem;
}

.naming-list dd {
  margin: 0;
}

.callout {
  margin-top: 1rem;
  padding: 1rem 1.15rem;
  border-left: 5px solid var(--cyan);
  border-radius: 8px 12px 12px 8px;
  background: #effdff;
}

.count-badge {
  flex: none;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  color: var(--violet-dark);
  background: var(--violet-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.drop-zone {
  padding: clamp(2rem, 6vw, 4.2rem) 1.5rem;
  border: 2px dashed #b8acd9;
  border-radius: 18px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(91, 60, 196, 0.04), rgba(73, 199, 207, 0.06)),
    #fcfbff;
  cursor: pointer;
  transition: border 150ms ease, background 150ms ease, transform 150ms ease;
}

.drop-zone.is-dragging {
  border-color: var(--violet);
  background: var(--violet-soft);
  transform: scale(1.005);
}

.drop-zone__icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 0.8rem;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: var(--violet);
  font-size: 1.8rem;
  font-weight: 900;
  box-shadow: 7px 7px 0 #d8cff9;
}

.drop-zone h3 {
  margin: 0;
}

.drop-zone p {
  margin: 0.5rem 0 1rem;
  color: var(--muted);
}

.drop-zone__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}

.message-stack {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}

.message,
.validation-item {
  padding: 0.72rem 0.9rem;
  border: 1px solid;
  border-radius: 10px;
  font-size: 0.9rem;
}

.message--error,
.validation-item--error {
  border-color: #f0bdc8;
  color: var(--danger);
  background: var(--danger-soft);
}

.message--success,
.validation-item--success {
  border-color: #bfe8d3;
  color: var(--success);
  background: var(--success-soft);
}

.validation-item--warning {
  border-color: #ead99d;
  color: var(--warning);
  background: var(--warning-soft);
}

.source-list {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.source-card {
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  background: #fff;
}

.source-card__header {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: #faf9fd;
}

.source-card__title {
  min-width: 0;
}

.source-card__title h3 {
  margin: 0;
  overflow: hidden;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.source-warning {
  padding: 0.08rem 0.38rem;
  border-radius: 999px;
  color: var(--warning);
  background: var(--warning-soft);
  font-weight: 800;
}

.source-actions {
  display: flex;
  flex: none;
  gap: 0.45rem;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 900;
}

.icon-button--danger {
  color: var(--danger);
}

.room-table {
  width: 100%;
  border-collapse: collapse;
}

.room-table th,
.room-table td {
  padding: 0.78rem 1rem;
  border-bottom: 1px solid #eeeaf3;
  text-align: left;
  vertical-align: middle;
}

.room-table tr:last-child td {
  border-bottom: 0;
}

.room-table th {
  color: var(--muted);
  background: #fff;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.room-name {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.87rem;
  font-weight: 700;
}

.room-add {
  padding: 0.38rem 0.62rem;
  border: 1px solid #c9c0e8;
  border-radius: 7px;
  color: var(--violet-dark);
  background: var(--violet-soft);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.room-add.is-added {
  border-color: #bfe8d3;
  color: var(--success);
  background: var(--success-soft);
  cursor: default;
}

.empty-state {
  display: flex;
  min-height: 130px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 1.5rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
}

.empty-state--compact {
  min-height: 105px;
}

.section-intro {
  margin: -0.5rem 0 1.25rem;
}

.selected-list {
  display: grid;
  gap: 0.65rem;
}

.selected-room {
  display: grid;
  grid-template-columns: auto auto minmax(190px, 1.3fr) minmax(150px, 0.9fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: opacity 120ms ease, border 120ms ease, transform 120ms ease;
}

.selected-room.is-dragging {
  opacity: 0.45;
  transform: scale(0.995);
}

.selected-room.is-drag-over {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(91, 60, 196, 0.1);
}

.drag-handle {
  color: #918aa2;
  cursor: grab;
  font-size: 1.1rem;
  letter-spacing: -0.25em;
  user-select: none;
}

.order-id {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: var(--violet);
  font-family: "Cascadia Code", Consolas, monospace;
  font-weight: 900;
}

.room-name-field label,
.source-label {
  display: block;
  margin-bottom: 0.22rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.room-name-field input,
.form-card input[type="text"],
.form-card input[type="number"] {
  width: 100%;
  min-height: 42px;
  padding: 0.55rem 0.68rem;
  border: 1px solid #cfc9d8;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.source-value {
  display: block;
  overflow: hidden;
  font-size: 0.83rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.move-actions {
  display: flex;
  gap: 0.32rem;
}

.move-actions .icon-button {
  width: 34px;
  height: 34px;
}

.id-explainer {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 11px;
  background: #f4f1fb;
}

.id-explainer__icon {
  display: grid;
  width: 24px;
  height: 24px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--violet);
  font-family: Georgia, serif;
  font-weight: 700;
}

.id-explainer p {
  margin: 0;
  color: #4d4760;
  font-size: 0.88rem;
}

.export-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  gap: 1rem;
}

.form-card,
.summary-card {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.form-card > label:not(.check-row) {
  display: block;
  margin: 0 0 0.38rem;
  font-size: 0.86rem;
  font-weight: 800;
}

.form-card > label:not(.check-row):not(:first-child) {
  margin-top: 1rem;
}

.suffix-input {
  display: flex;
  align-items: stretch;
}

.suffix-input input {
  border-radius: 8px 0 0 8px !important;
}

.suffix-input span {
  display: flex;
  align-items: center;
  padding: 0 0.8rem;
  border: 1px solid #cfc9d8;
  border-left: 0;
  border-radius: 0 8px 8px 0;
  color: var(--muted);
  background: #f7f5fa;
  font-family: "Cascadia Code", Consolas, monospace;
}

.field-help {
  margin: 0.35rem 0 0;
  font-size: 0.79rem;
}

.check-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-top: 1rem;
  padding: 0.8rem;
  border-radius: 9px;
  background: var(--warning-soft);
  cursor: pointer;
  font-size: 0.84rem;
}

.check-row input {
  margin-top: 0.2rem;
}

.summary-card {
  color: #fff;
  background: linear-gradient(145deg, #27184f, #4b2e94);
}

.summary-card h3 {
  margin: 0 0 1rem;
}

.summary-list {
  display: grid;
  gap: 0.2rem;
  margin: 0;
}

.summary-list div {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 0.8rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.summary-list div:last-child {
  border-bottom: 0;
}

.summary-list dt {
  color: #cfc5eb;
  font-size: 0.83rem;
}

.summary-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.85rem;
  text-align: right;
}

.validation-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}

.xml-inspector {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfbfe;
}

.xml-inspector summary {
  cursor: pointer;
  font-weight: 800;
}

.xml-inspector p {
  margin: 0.6rem 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.xml-inspector__actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.xml-inspector textarea {
  width: 100%;
  min-height: 170px;
  padding: 0.75rem;
  resize: vertical;
  border: 1px solid #cfc9d8;
  border-radius: 8px;
  color: #332950;
  background: #f7f5fa;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.45;
}

.download-bar {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding: 1.15rem;
  border: 1px solid #d8d1e3;
  border-radius: 14px;
  background: #f8f6fb;
}

.download-bar span {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.84rem;
}

footer {
  padding: 1.5rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.82rem;
}

.toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 20;
  max-width: min(360px, calc(100% - 2.5rem));
  padding: 0.85rem 1rem;
  border-radius: 10px;
  color: #fff;
  background: #21183f;
  box-shadow: 0 12px 35px rgba(18, 11, 36, 0.26);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

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

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 4rem;
  }

  .hero__art {
    min-height: 180px;
  }

  .tutorial-grid,
  .export-grid {
    grid-template-columns: 1fr;
  }

  .selected-room {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
  }

  .selected-room .source-info {
    grid-column: 3 / 5;
    grid-row: 2;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 3.3rem 1.2rem 4rem;
  }

  .hero__art {
    transform: scale(0.77);
    margin: -1.5rem -3rem;
  }

  .page-shell {
    width: min(100% - 1rem, 1180px);
  }

  .panel {
    border-radius: 16px;
  }

  .section-heading,
  .download-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .button--download {
    width: 100%;
    min-width: 0;
  }

  .source-card__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .room-table thead {
    display: none;
  }

  .room-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 0.6rem;
    border-bottom: 1px solid var(--line);
  }

  .room-table td {
    padding: 0.3rem;
    border: 0;
  }

  .room-table td:nth-child(2),
  .room-table td:nth-child(3),
  .room-table td:nth-child(4) {
    color: var(--muted);
    font-size: 0.76rem;
  }

  .room-table td:last-child {
    grid-column: 2;
    grid-row: 1 / 4;
    align-self: center;
  }

  .selected-room {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .selected-room .source-info {
    grid-column: 3;
    grid-row: 2;
  }

  .selected-room .move-actions {
    grid-column: 1 / 4;
    justify-content: flex-end;
  }
}

@media print {
  body {
    background: #fff;
  }

  .hero,
  .section-nav,
  #cargar,
  #seleccionar,
  #exportar,
  footer,
  #print-guide {
    display: none !important;
  }

  .page-shell {
    width: 100%;
    margin: 0;
  }

  .panel {
    border: 0;
    box-shadow: none;
  }

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