:root {
  --acento: #4F7CAC;
  --acento-suave: #DCEAF6;
  --tinta: #242933;
  --tinta-suave: #667085;
  --blanco: #FFFFFF;
  --fondo: #F4F5F7;
  --linea: #E1E5EA;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-borde: rgba(31, 41, 55, 0.1);
  --texto-suave: #667085;
  --shadow-lg: 0 18px 48px rgba(28, 38, 54, 0.13);
  --shadow-md: 0 12px 30px rgba(28, 38, 54, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--tinta);
  background:
    radial-gradient(circle, rgba(36, 41, 51, 0.13) 1px, transparent 1.2px),
    linear-gradient(180deg, #FAFAFB 0%, var(--fondo) 100%);
  background-size: 24px 24px, 100% 100%;
  overflow-x: hidden;
}

button {
  font: inherit;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.demo-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
  height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--panel-borde);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.brand-block {
  display: grid;
  gap: 14px;
  padding-bottom: 4px;
}

.eyebrow,
.view-heading p {
  margin: 0 0 5px;
  color: var(--acento);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-block h1 {
  margin: 0;
  color: var(--tinta);
  font-size: 1.22rem;
  line-height: 1.18;
}

.status-pill {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid rgba(197, 138, 201, 0.36);
  border-radius: 999px;
  color: var(--tinta-suave);
  background: #F7F9FC;
  font-size: 0.76rem;
  font-weight: 700;
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #54A77B;
  box-shadow: 0 0 10px rgba(84, 167, 123, 0.42);
}

.filter-tabs,
.device-toggle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--linea);
  border-radius: 15px;
  background: #F7F8FA;
}

.filter-tab,
.tool-button,
.icon-button {
  border: 0;
  color: var(--tinta-suave);
  background: transparent;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.filter-tab {
  min-height: 36px;
  border-radius: 13px;
  font-size: 0.78rem;
  font-weight: 800;
}

.filter-tab.active,
.tool-button.active,
.icon-button:hover {
  color: var(--blanco);
  background: var(--acento);
  box-shadow: 0 8px 18px rgba(79, 124, 172, 0.22);
}

.view-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.view-list::-webkit-scrollbar {
  width: 8px;
}

.view-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #CBD3DD;
}

.view-section {
  margin-bottom: 22px;
}

.view-section.hidden {
  display: none;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #7B8492;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.items {
  display: grid;
  gap: 8px;
}

.view-item {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 15px;
  color: var(--tinta);
  background: #F7F8FA;
  text-align: left;
  cursor: pointer;
  transition: transform 170ms ease, background 170ms ease, border-color 170ms ease;
}

.view-item:hover {
  transform: translateY(-1px);
  background: #EFF4F8;
}

.view-item.active {
  border-color: rgba(79, 124, 172, 0.5);
  color: var(--tinta);
  background: #EAF2F9;
  box-shadow: inset 3px 0 0 var(--acento);
}

.view-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #E9EDF2;
}

.view-icon svg,
.tool-button svg,
.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.view-copy {
  min-width: 0;
}

.view-name {
  display: block;
  margin-bottom: 3px;
  font-size: 0.9rem;
  font-weight: 800;
}

.view-path {
  display: block;
  overflow: hidden;
  color: #748093;
  font-size: 0.72rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-type {
  padding: 5px 8px;
  border-radius: 999px;
  color: #5E6979;
  background: #ECEFF4;
  font-size: 0.66rem;
  font-weight: 800;
}

.workspace {
  min-width: 0;
  min-height: calc(100vh - 36px);
  display: grid;
  position: relative;
}

.current-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--linea);
  border-radius: 18px;
  background: #FBFCFE;
}

.view-heading {
  min-width: 180px;
}

.view-heading h2 {
  margin: 0;
  color: var(--tinta);
  font-size: 1.02rem;
  line-height: 1.15;
}

.view-heading h2 span {
  color: #8A94A3;
  font-weight: 700;
}

.toolbar {
  display: grid;
  gap: 8px;
}

.device-toggle {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 13px;
  font-size: 0.82rem;
  font-weight: 800;
}

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

.icon-button {
  position: relative;
  width: 100%;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--linea);
  border-radius: 14px;
  background: #F7F8FA;
}

.copy-button span {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  width: max-content;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--tinta);
  background: var(--blanco);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  font-size: 0.75rem;
  font-weight: 800;
  transition: opacity 180ms ease, transform 180ms ease;
}

.copy-button.copied span {
  opacity: 1;
  transform: translateY(0);
}

.stage-wrap {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 8px 0 10px;
  overflow: hidden;
}

.stage-wrap::before,
.stage-wrap::after {
  display: none;
}

.device-shadow {
  position: absolute;
  bottom: 3%;
  width: min(68vw, 980px);
  height: 54px;
  border-radius: 50%;
  background: rgba(40, 48, 62, 0.18);
  filter: blur(24px);
}

.device-frame {
  position: absolute;
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  pointer-events: none;
  transition: opacity 240ms ease, transform 240ms ease;
  z-index: 2;
}

.device-frame.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.phone-shell {
  position: relative;
  width: 430px;
  height: 850px;
  padding: 18px;
  border: 1px solid rgba(31, 41, 55, 0.18);
  border-radius: 52px;
  background: linear-gradient(145deg, #1E2430, #2E3645 48%, #121722);
  box-shadow: 0 28px 70px rgba(28, 38, 54, 0.26), inset 0 0 0 7px rgba(255, 255, 255, 0.04);
}

.phone-island {
  position: absolute;
  top: 28px;
  left: 50%;
  z-index: 4;
  width: 112px;
  height: 31px;
  border-radius: 999px;
  background: #05060A;
  transform: translateX(-50%);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.09);
}

.phone-demo-menu {
  position: absolute;
  bottom: 18px;
  left: 50%;
  z-index: 7;
  width: min(390px, calc(100vw - 40px));
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(31, 41, 55, 0.1);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 38px rgba(28, 38, 54, 0.22);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
}

.phone-demo-menu-title {
  grid-column: 1 / -1;
  color: var(--acento);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.phone-demo-menu button {
  min-height: 34px;
  border: 0;
  border-radius: 13px;
  color: var(--tinta);
  background: #F1F4F8;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.phone-demo-menu button.active {
  color: var(--blanco);
  background: var(--acento);
}

.phone-screen {
  width: 390px;
  height: 780px;
  overflow: hidden;
  border-radius: 36px;
  background: var(--blanco);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.laptop-shell {
  width: min(1520px, calc(100vw - 348px));
  min-width: 780px;
}

.window-bar {
  height: 48px;
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr) 94px;
  align-items: center;
  padding: 0 16px;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, #2A303B, #171C25);
  border: 1px solid rgba(31, 41, 55, 0.2);
  border-bottom: 0;
}

.window-dots {
  display: flex;
  gap: 8px;
}

.window-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.window-dots span:nth-child(1) {
  background: #FF6B64;
}

.window-dots span:nth-child(2) {
  background: #F6C358;
}

.window-dots span:nth-child(3) {
  background: #63D27C;
}

.address-chip {
  justify-self: center;
  max-width: min(520px, 100%);
  overflow: hidden;
  padding: 8px 18px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.11);
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.laptop-screen {
  width: 100%;
  height: min(820px, calc(100vh - 104px));
  min-height: 650px;
  overflow: hidden;
  border: 10px solid #171C25;
  border-top-width: 8px;
  border-radius: 0 0 18px 18px;
  background: var(--blanco);
  box-shadow: 0 26px 60px rgba(28, 38, 54, 0.28);
}

.laptop-base {
  width: 88%;
  height: 26px;
  margin: 0 auto;
  border-radius: 0 0 28px 28px;
  background: linear-gradient(180deg, #DEE0E5, #8D93A0);
  box-shadow: 0 16px 32px rgba(28, 38, 54, 0.18);
}

.frame-screen iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--blanco);
}

.loader-panel,
.error-panel {
  position: absolute;
  z-index: 6;
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 22px 24px;
  border: 1px solid rgba(31, 41, 55, 0.1);
  border-radius: 22px;
  color: var(--tinta);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.loader-panel {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.loader-panel.visible {
  opacity: 1;
  transform: translateY(0);
}

.loader-ring {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(36, 41, 51, 0.12);
  border-top-color: var(--acento);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.error-panel {
  color: var(--tinta);
  text-align: center;
}

.error-panel[hidden] {
  display: none;
}

.error-panel span {
  color: var(--texto-suave);
  font-size: 0.86rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1180px) {
  .demo-shell {
    grid-template-columns: 276px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
  }

  .sidebar {
    top: 14px;
    height: calc(100vh - 28px);
    padding: 16px;
  }

  .laptop-shell {
    width: calc(100vw - 318px);
    min-width: 560px;
  }

  .phone-frame.active {
    transform: scale(0.88);
  }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .demo-shell {
    min-height: 100vh;
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .sidebar {
    position: relative;
    top: 0;
    height: auto;
    max-height: 42vh;
    border-radius: 22px;
  }

  .brand-block {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .workspace {
    min-height: 58vh;
  }

  .toolbar {
    width: 100%;
  }

  .device-toggle {
    flex: 1;
  }

  .stage-wrap {
    min-height: 760px;
    padding: 14px 0 140px;
  }

  .phone-frame.active {
    transform: translateY(-76px) scale(0.74);
  }

  .stage-wrap.phone-mode-active .phone-demo-menu {
    display: grid;
  }

  .laptop-shell {
    width: calc(100vw - 42px);
    min-width: 0;
  }

  .laptop-screen {
    height: 62vh;
    min-height: 430px;
  }
}

@media (max-width: 560px) {
  .demo-shell {
    padding: 10px;
  }

  .sidebar,
  .current-panel {
    border-radius: 20px;
  }

  .brand-block {
    grid-template-columns: 1fr;
  }

  .filter-tabs {
    grid-template-columns: 1fr;
  }

  .view-item {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .view-type {
    grid-column: 2;
    width: max-content;
  }

  .tool-button span {
    display: none;
  }

  .device-toggle {
    grid-template-columns: repeat(2, 48px);
    flex: 0 0 auto;
  }

  .tool-button {
    min-width: 48px;
    padding: 0;
  }

  .stage-wrap {
    min-height: 640px;
    padding: 10px 10px 132px;
  }

  .phone-frame.active {
    transform: translateY(-66px) scale(0.62);
  }

  .window-bar {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .window-bar::after {
    display: none;
  }

  .address-chip {
    max-width: 100%;
    padding-inline: 10px;
    font-size: 0.68rem;
  }

  .laptop-screen {
    height: 58vh;
    min-height: 360px;
    border-width: 8px;
  }
}
