/* Cloud Win — vibe terminal retro (verde neon / CRT) */
@import url("https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=VT323&display=swap");

.cw-cli-app,
.cw-cli.cw-vibe-retro {
  --cw-black: #050805;
  --cw-panel: #0a0d0a;
  --cw-neon: #00ff41;
  --cw-neon-dim: #00cc33;
  --cw-amber: #ff9f1c;
  --cw-purple: #c084fc;
  --cw-gold: #fde047;
  --cw-muted: #6b7280;
  --cw-text: #b8e0bf;
  --cw-border: rgba(0, 255, 65, 0.22);
  --cw-glow: 0 0 12px rgba(0, 255, 65, 0.35);
  --cw-font: "Share Tech Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

/* ===== App shell (sidebar + main) ===== */
.cw-cli-app {
  font-family: var(--cw-font);
  background: var(--cw-black);
  color: var(--cw-text);
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr;
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  border: 1px solid var(--cw-border);
  border-radius: 4px;
  box-shadow:
    0 0 40px rgba(0, 255, 65, 0.06),
    inset 0 0 80px rgba(0, 0, 0, 0.5);
  /* Não usar overflow:hidden no eixo Y: corta o glow do logo e ascendentes das letras */
  overflow-x: hidden;
  overflow-y: visible;
  animation: cw-cli-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Página demo: encaixa o app na altura da janela (estilo Kimsufi — scroll só no terminal) */
.cw-cli-viewport {
  box-sizing: border-box;
  height: 100%;
  max-height: 100dvh;
  min-height: 0;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 14px calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
}

.cw-cli-viewport #cloudwin-cli.cw-cli-app {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: 100%;
  /* Espaço extra para o título VT323 + text-shadow não encostar no topo */
  padding-top: 8px;
  box-sizing: border-box;
}

.cw-cli-viewport .cw-terminal-panel {
  min-height: 0;
}

.cw-cli-viewport .cw-topbar,
.cw-cli-viewport .cw-brand-block {
  flex-shrink: 0;
}

@keyframes cw-cli-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cw-cli-app,
  .cw-cli {
    animation: none;
  }
  .cw-scanlines,
  .cw-cursor-blink {
    animation: none !important;
    opacity: 0.4;
  }
}

@media (max-width: 820px) {
  .cw-cli-app {
    grid-template-columns: 1fr;
  }
  .cw-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    border-right: none;
    border-bottom: 1px solid var(--cw-border);
    max-height: none;
  }
  .cw-sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
  }
  .cw-sidebar-foot {
    width: 100%;
    margin-top: 8px;
  }
}

/* Telemóvel / ecrã estreito: compacto + sidebar atrás de “Cmds” */
@media (max-width: 768px) {
  .cw-cli-viewport {
    padding: calc(10px + env(safe-area-inset-top, 0px)) 8px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .cw-cli-viewport #cloudwin-cli.cw-cli-app {
    padding-top: 4px;
    border-radius: 3px;
  }

  .cw-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    min-width: 44px;
  }

  .cw-cli-app:not(.cw-sidebar-expanded) .cw-sidebar {
    display: none;
  }

  .cw-cli-app.cw-sidebar-expanded .cw-sidebar {
    display: flex;
    flex-direction: column;
    max-height: min(52vh, 380px);
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 12px 14px;
    gap: 6px;
  }

  .cw-sidebar-label {
    margin: 10px 0 4px;
    font-size: 9px;
  }

  .cw-sidebar-label:first-child {
    margin-top: 0;
  }

  .cw-side-cmd {
    font-size: 12px;
    padding: 8px 10px;
    min-height: 40px;
    touch-action: manipulation;
  }

  .cw-sidebar-foot {
    margin-top: 10px;
    padding: 8px 10px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .cw-topbar {
    padding: 6px 8px;
    gap: 6px;
    font-size: 11px;
  }

  .cw-menu-btn {
    padding: 6px 10px;
    min-height: 40px;
    touch-action: manipulation;
  }

  .cw-mini-status {
    display: none;
  }

  .cw-mode-toggle > span:first-child {
    display: none;
  }

  .cw-mode-toggle button {
    padding: 6px 9px;
    min-height: 36px;
    touch-action: manipulation;
  }

  .cw-cli-stage {
    padding: 8px 8px 10px;
    gap: 6px;
  }

  .cw-brand-block {
    padding: 4px 0 2px;
  }

  .cw-brand-logo {
    font-size: clamp(1.5rem, 11vw, 2rem);
    text-shadow:
      0 0 12px rgba(0, 255, 65, 0.4),
      0 0 24px rgba(0, 255, 65, 0.12);
  }

  .cw-brand-ver {
    font-size: 10px;
    margin-top: 2px;
  }

  .cw-brand-tag {
    display: none;
  }

  .cw-terminal-panel {
    min-height: 0;
  }

  .cw-cli {
    min-height: 0;
  }

  .cw-cli-head {
    padding: 6px 8px;
    gap: 6px;
  }

  .cw-badge {
    display: none;
  }

  .cw-title {
    font-size: 10px;
  }

  .cw-body {
    padding: 8px 8px 6px;
  }

  .cw-line {
    font-size: 12px;
    line-height: 1.45;
    margin-bottom: 2px;
  }

  .cw-input-row {
    padding: 8px 8px 8px;
    gap: 6px;
  }

  .cw-prompt {
    font-size: 11px;
  }

  /* Evita zoom automático no foco (iOS Safari) */
  .cw-input {
    font-size: 16px;
  }

  .cw-hint {
    font-size: 9px;
    padding: 0 8px 8px;
    line-height: 1.35;
  }

  .cw-normal-head {
    padding: 0 2px;
  }

  .cw-normal-title {
    font-size: 12px;
    margin-bottom: 4px;
  }

  .cw-normal-sub {
    font-size: 11px;
    line-height: 1.4;
  }

  .cw-normal-tab {
    font-size: 10px;
    padding: 8px 10px;
    min-height: 40px;
    touch-action: manipulation;
  }

  .cw-normal-plans {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 2px 0 6px;
  }

  .cw-normal-card {
    padding: 10px 10px 8px;
    min-height: 44px;
  }

  .cw-normal-card-name {
    font-size: 12px;
  }

  .cw-normal-detail-name {
    font-size: 14px;
  }

  .cw-normal-detail-price {
    font-size: 16px;
  }

  .cw-normal-btn-primary,
  .cw-normal-btn-secondary {
    min-height: 44px;
    touch-action: manipulation;
  }

  .cw-normal-confirm-actions {
    gap: 10px;
  }

  .cw-welcome-logo {
    font-size: clamp(1.5rem, 11vw, 2.3rem);
    letter-spacing: 0.1em;
  }

  .cw-welcome-lead {
    font-size: 13px;
  }

  .cw-welcome-row {
    flex-direction: column;
    gap: 1px;
    align-items: flex-start;
  }

  .cw-welcome-cmd,
  .cw-welcome-row .cw-kw-promo-cmd {
    min-width: 0;
  }
}

.cw-sidebar {
  background: linear-gradient(180deg, #080a08 0%, #050805 100%);
  border-right: 1px solid var(--cw-border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cw-sidebar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--cw-muted);
  text-transform: uppercase;
  margin: 16px 0 6px;
}
.cw-sidebar-label:first-child {
  margin-top: 0;
}

.cw-side-cmd {
  display: block;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  padding: 6px 8px;
  margin: 0;
  border: none;
  border-radius: 2px;
  background: transparent;
  color: var(--cw-muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.cw-side-cmd::before {
  content: "$ ";
  color: var(--cw-neon-dim);
  opacity: 0.65;
}

.cw-side-cmd:hover,
.cw-side-cmd:focus-visible {
  color: var(--cw-neon);
  background: rgba(0, 255, 65, 0.06);
  outline: none;
  text-shadow: var(--cw-glow);
}

.cw-sidebar .cw-side-cmd.cw-side-cmd-promo {
  color: var(--cw-neon);
  font-weight: 700;
  text-shadow: 0 0 12px rgba(0, 255, 65, 0.45);
}

.cw-sidebar .cw-side-cmd.cw-side-cmd-promo:hover,
.cw-sidebar .cw-side-cmd.cw-side-cmd-promo:focus-visible {
  text-shadow:
    0 0 16px rgba(0, 255, 65, 0.55),
    var(--cw-glow);
}

.cw-sidebar-foot {
  margin-top: auto;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--cw-muted);
  text-decoration: none;
  border: 1px solid var(--cw-border);
  text-align: center;
  border-radius: 2px;
  transition:
    color 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}
.cw-sidebar-foot:hover {
  color: var(--cw-neon);
  border-color: rgba(0, 255, 65, 0.45);
  box-shadow: 0 0 16px rgba(0, 255, 65, 0.12);
}

.cw-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--cw-black);
}

.cw-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--cw-border);
  font-size: 12px;
}

.cw-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Botão “Cmds”: só telemóvel / ecrã estreito (controlado no @media) */
.cw-nav-toggle {
  display: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 10px;
  border: 1px solid var(--cw-border);
  border-radius: 2px;
  background: rgba(0, 255, 65, 0.08);
  color: var(--cw-neon);
  cursor: pointer;
  touch-action: manipulation;
}

.cw-nav-toggle:hover,
.cw-nav-toggle:focus-visible {
  border-color: rgba(0, 255, 65, 0.45);
  outline: none;
}

.cw-cli-app.cw-sidebar-expanded .cw-nav-toggle {
  background: var(--cw-neon);
  color: var(--cw-black);
  border-color: var(--cw-neon);
}

.cw-menu-btn {
  font-family: inherit;
  background: transparent;
  border: 1px solid var(--cw-border);
  color: var(--cw-muted);
  padding: 6px 12px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 12px;
}
.cw-menu-btn:hover {
  color: var(--cw-neon);
  border-color: rgba(0, 255, 65, 0.4);
}

.cw-share-btn {
  color: var(--cw-neon-dim);
  border-color: rgba(0, 255, 65, 0.35);
}

.cw-share-btn:hover {
  color: var(--cw-neon);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.12);
}

.cw-mode-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--cw-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cw-mode-toggle button {
  font-family: inherit;
  font-size: 11px;
  padding: 5px 10px;
  border: 1px solid var(--cw-border);
  background: transparent;
  color: var(--cw-muted);
  cursor: pointer;
  border-radius: 2px;
}
.cw-mode-toggle button.is-active {
  color: var(--cw-black);
  background: var(--cw-neon);
  border-color: var(--cw-neon);
  box-shadow: var(--cw-glow);
}

.cw-mini-status {
  font-size: 10px;
  color: var(--cw-muted);
  border: 1px solid var(--cw-border);
  padding: 6px 10px;
  border-radius: 2px;
  max-width: 200px;
  line-height: 1.35;
}

.cw-cli-stage {
  flex: 1;
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.cw-brand-block {
  text-align: center;
  padding: 8px 0 4px;
}

.cw-brand-logo {
  font-family: "VT323", var(--cw-font);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--cw-neon);
  text-shadow:
    0 0 20px rgba(0, 255, 65, 0.5),
    0 0 40px rgba(0, 255, 65, 0.15);
  margin: 0;
}

.cw-brand-ver {
  font-size: 11px;
  color: var(--cw-muted);
  letter-spacing: 0.12em;
  margin-top: 6px;
}

.cw-brand-tag {
  font-size: 12px;
  color: var(--cw-text);
  margin-top: 8px;
  opacity: 0.9;
}

.cw-terminal-panel {
  position: relative;
  flex: 1;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  border-radius: 3px;
  border: 1px solid var(--cw-border);
  background: var(--cw-panel);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

/* CRT scanlines */
.cw-scanlines {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 3;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.13) 2px,
    rgba(0, 0, 0, 0.13) 4px
  );
  opacity: 0.55;
}

.cw-terminal-panel::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.35) 100%);
}

/* ===== Terminal box (.cw-cli) ===== */
.cw-cli {
  position: relative;
  z-index: 1;
  font-family: var(--cw-font);
  border-radius: 0;
  overflow: hidden;
  border: none;
  background: transparent;
  box-shadow: none;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.cw-cli:not(.cw-vibe-retro) {
  animation: cw-cli-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cw-cli-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid var(--cw-border);
  gap: 12px;
  flex-wrap: wrap;
}

.cw-dots {
  display: flex;
  gap: 6px;
}
.cw-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  opacity: 0.75;
}
.cw-dots span:nth-child(1) {
  background: #ff5f56;
}
.cw-dots span:nth-child(2) {
  background: #ffbd2e;
}
.cw-dots span:nth-child(3) {
  background: var(--cw-neon);
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
}

.cw-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--cw-muted);
  letter-spacing: 0.06em;
}

.cw-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--cw-amber);
  border: 1px solid rgba(255, 159, 28, 0.35);
  padding: 3px 8px;
  border-radius: 2px;
}

.cw-body {
  flex: 1;
  min-height: 0;
  padding: 12px 14px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  text-shadow: 0 0 1px rgba(0, 255, 65, 0.12);
}

/* Dentro do shell: a saída do comando ocupa o espaço livre e rola aqui (não a página) */
.cw-cli-app .cw-cli .cw-body {
  max-height: none;
}

.cw-line {
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 3px;
  color: var(--cw-text);
  word-break: break-word;
}
.cw-line.cw-pre {
  white-space: pre-wrap;
}

/* Bloco de abertura no terminal (referência: Kimsufi CLI) */
.cw-welcome-logo {
  display: block;
  font-family: "VT323", var(--cw-font);
  font-size: clamp(2.1rem, 7.5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: 0.14em;
  color: var(--cw-neon);
  text-shadow:
    0 0 22px rgba(0, 255, 65, 0.55),
    0 0 48px rgba(0, 255, 65, 0.2);
  margin: 0 0 2px;
}

.cw-welcome-ver {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--cw-muted);
  text-transform: uppercase;
}

.cw-welcome-lead {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--cw-neon);
  text-shadow: 0 0 14px rgba(0, 255, 65, 0.35);
}

.cw-welcome-muted {
  color: var(--cw-muted);
  line-height: 1.55;
}

.cw-welcome-muted strong {
  color: var(--cw-text);
  font-weight: 600;
}

.cw-welcome-section {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--cw-text);
  letter-spacing: 0.04em;
}

.cw-welcome-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.65rem 1rem;
  margin-top: 2px;
}

.cw-welcome-cmd {
  flex: 0 0 auto;
  min-width: 5.2rem;
  font-weight: 700;
  color: var(--cw-neon);
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.cw-welcome-row .cw-kw-promo-cmd {
  min-width: 5.2rem;
}

.cw-kw-g {
  color: var(--cw-neon);
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.25);
}

/* Comando promo — destaque extra no help / ls */
.cw-kw-promo-cmd {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow:
    0 0 14px rgba(0, 255, 65, 0.65),
    0 0 28px rgba(0, 255, 65, 0.25);
}
.cw-kw-c {
  color: var(--cw-amber);
}
.cw-kw-a {
  color: var(--cw-amber);
}
.cw-kw-y {
  color: var(--cw-gold);
  font-weight: 700;
  text-shadow: 0 0 12px rgba(253, 224, 71, 0.25);
}
.cw-kw-m {
  color: var(--cw-purple);
}
.cw-kw-d {
  color: var(--cw-muted);
}
.cw-kw-w {
  color: #e8f5e9;
  font-weight: 600;
}

.cw-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--cw-border);
  background: rgba(0, 0, 0, 0.25);
}

.cw-prompt {
  color: var(--cw-neon);
  flex-shrink: 0;
  font-weight: 700;
  user-select: none;
  text-shadow: var(--cw-glow);
}

.cw-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.cw-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--cw-text);
  font: inherit;
  min-width: 0;
  caret-color: var(--cw-neon);
}

.cw-cursor-blink {
  display: inline-block;
  width: 0.55em;
  height: 1.15em;
  background: var(--cw-neon);
  margin-left: 2px;
  flex-shrink: 0;
  vertical-align: text-bottom;
  animation: cw-blink 1.05s step-end infinite;
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.6);
}

@keyframes cw-blink {
  50% {
    opacity: 0;
  }
}

.cw-input-wrap:focus-within .cw-cursor-blink {
  opacity: 0;
  animation: none;
}

.cw-input.cw-input-busy ~ .cw-cursor-blink {
  opacity: 0;
  animation: none;
}

.cw-input.cw-input-busy {
  opacity: 0.85;
  cursor: progress;
}

.cw-hint {
  font-size: 10px;
  color: var(--cw-muted);
  padding: 0 14px 12px;
  letter-spacing: 0.02em;
}

.cw-link {
  color: var(--cw-amber);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cw-link:hover {
  color: var(--cw-gold);
}

/* Modo normal: menos glow / sem scanlines fortes */
.cw-cli-app.cw-mode-normal .cw-scanlines {
  opacity: 0.12;
}
.cw-cli-app.cw-mode-normal .cw-brand-logo {
  text-shadow: none;
  color: var(--cw-text);
}
.cw-cli-app.cw-mode-normal .cw-kw-g {
  text-shadow: none;
  color: var(--cw-neon-dim);
}
.cw-cli-app.cw-mode-normal .cw-terminal-panel {
  display: none;
}

.cw-normal-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 14px;
  padding: 4px 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--cw-border);
  background: var(--cw-panel);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35);
}

.cw-cli-app.cw-mode-normal .cw-normal-panel {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.cw-cli-viewport .cw-cli-app.cw-mode-normal .cw-normal-plans {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.cw-normal-head {
  padding: 0 4px;
}

.cw-normal-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cw-neon-dim);
}

.cw-normal-sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--cw-muted);
}

.cw-normal-sub strong {
  color: var(--cw-text);
  font-weight: 600;
}

.cw-normal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cw-normal-tab {
  font-family: inherit;
  font-size: 11px;
  padding: 7px 12px;
  border: 1px solid var(--cw-border);
  background: rgba(0, 0, 0, 0.35);
  color: var(--cw-muted);
  cursor: pointer;
  border-radius: 2px;
  transition:
    color 0.15s,
    border-color 0.15s,
    background 0.15s;
}

.cw-normal-tab:hover {
  color: var(--cw-neon);
  border-color: rgba(0, 255, 65, 0.35);
}

.cw-normal-tab.is-active {
  color: var(--cw-black);
  background: var(--cw-neon);
  border-color: var(--cw-neon);
  box-shadow: var(--cw-glow);
}

.cw-normal-plans {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
  max-height: min(42vh, 340px);
  overflow-y: auto;
  padding: 4px 2px 8px;
  margin: 0 -2px;
}

.cw-normal-card {
  text-align: left;
  font-family: inherit;
  margin: 0;
  padding: 12px 12px 10px;
  border: 1px solid var(--cw-border);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--cw-text);
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}

.cw-normal-card:hover {
  border-color: rgba(0, 255, 65, 0.4);
  box-shadow: 0 0 0 1px rgba(0, 255, 65, 0.12);
}

.cw-normal-card.is-selected {
  border-color: var(--cw-neon);
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.12);
  background: rgba(0, 255, 65, 0.06);
}

.cw-normal-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--cw-neon);
  margin: 0 0 4px;
}

.cw-normal-card-price {
  font-size: 12px;
  color: var(--cw-gold);
  margin: 0 0 8px;
}

.cw-normal-card-meta {
  font-size: 10px;
  line-height: 1.4;
  color: var(--cw-muted);
}

.cw-normal-card-badge {
  display: inline-block;
  margin-top: 6px;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cw-amber);
}

.cw-normal-detail {
  border-top: 1px solid var(--cw-border);
  padding-top: 12px;
  margin-top: 4px;
}

.cw-normal-placeholder {
  margin: 0;
  font-size: 12px;
  color: var(--cw-muted);
  font-style: italic;
}

.cw-normal-detail-body[hidden] {
  display: none !important;
}

.cw-normal-detail-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.cw-normal-detail-name {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--cw-text);
}

.cw-normal-detail-id {
  margin: 0;
  font-size: 11px;
  color: var(--cw-muted);
}

.cw-normal-detail-id code {
  font-family: inherit;
  color: var(--cw-purple);
}

.cw-normal-detail-price {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--cw-gold);
}

.cw-normal-specs {
  margin: 0 0 14px;
  padding-left: 1.1rem;
  font-size: 12px;
  line-height: 1.55;
  color: var(--cw-text);
}

.cw-normal-specs li {
  margin-bottom: 2px;
}

.cw-normal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cw-normal-btn-primary {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  background: var(--cw-neon);
  color: var(--cw-black);
  box-shadow: var(--cw-glow);
  transition:
    filter 0.15s,
    transform 0.1s;
}

.cw-normal-btn-primary:hover {
  filter: brightness(1.08);
}

.cw-normal-btn-primary:active {
  transform: scale(0.98);
}

.cw-normal-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

.cw-normal-btn-secondary {
  font-family: inherit;
  font-size: 12px;
  padding: 8px 14px;
  border: 1px solid var(--cw-border);
  border-radius: 3px;
  background: transparent;
  color: var(--cw-muted);
  cursor: pointer;
}

.cw-normal-btn-secondary:hover {
  color: var(--cw-text);
  border-color: rgba(0, 255, 65, 0.35);
}

.cw-normal-confirm {
  padding: 12px 14px;
  border-radius: 3px;
  border: 1px solid rgba(255, 159, 28, 0.45);
  background: rgba(255, 159, 28, 0.08);
}

.cw-normal-confirm-msg {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--cw-text);
}

.cw-normal-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cw-normal-toast {
  margin: 0;
  min-height: 1.2em;
  font-size: 11px;
  color: var(--cw-neon-dim);
}

@media (max-width: 820px) {
  .cw-normal-plans {
    max-height: min(50vh, 400px);
  }
  .cw-cli-viewport .cw-normal-plans {
    max-height: none;
  }
}

/* Standalone .cw-cli.cw-vibe-retro (sem app) */
.cw-cli.cw-vibe-retro {
  border: 1px solid var(--cw-border);
  border-radius: 4px;
  background: var(--cw-panel);
  min-height: 380px;
  position: relative;
  box-shadow: 0 0 32px rgba(0, 255, 65, 0.08);
}
.cw-cli.cw-vibe-retro .cw-body {
  max-height: min(58vh, 620px);
}

/* ===== Boot BIOS (Kimsufi-style) — só na página index demo ===== */
.cw-bios-boot {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  font-family: "VT323", "Share Tech Mono", ui-monospace, monospace;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.cw-bios-boot.cw-bios-boot--out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cw-bios-boot__inner {
  width: min(92vw, 520px);
  padding: 2rem 1.5rem;
}

.cw-bios-boot__title {
  margin: 0 0 1.25rem;
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  line-height: 1.25;
  color: #00ff41;
  text-shadow:
    0 0 8px rgba(0, 255, 65, 0.55),
    0 0 24px rgba(0, 255, 65, 0.2);
  letter-spacing: 0.04em;
}

.cw-bios-boot__checks {
  min-height: 5.5rem;
}

.cw-bios-boot__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 0 0 0.45rem;
  font-size: clamp(1.05rem, 2.8vw, 1.25rem);
  line-height: 1.3;
  color: #00ff41;
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.35);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.cw-bios-boot__row.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.cw-bios-boot__left {
  flex: 1;
  letter-spacing: 0.02em;
}

.cw-bios-boot__ok {
  flex-shrink: 0;
  color: #86efac;
  font-weight: 400;
}

.cw-bios-boot__load {
  margin: 1rem 0 0.75rem;
  font-size: clamp(1rem, 2.6vw, 1.2rem);
  color: #00ff41;
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cw-bios-boot__load.is-visible {
  opacity: 1;
}

.cw-bios-boot__track {
  height: 6px;
  background: rgba(0, 40, 20, 0.85);
  border: 1px solid rgba(0, 255, 65, 0.2);
  border-radius: 1px;
  overflow: hidden;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
}

.cw-bios-boot__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00cc33, #00ff41);
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.5);
  transition: width 0.08s linear;
}

.cw-bios-boot__fill.cw-bios-boot__fill--smooth {
  transition: width 1.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  .cw-bios-boot__row {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .cw-bios-boot__load {
    opacity: 1;
    transition: none;
  }
  .cw-bios-boot__fill {
    transition: none;
  }
  .cw-bios-boot {
    transition: opacity 0.2s ease;
  }
}
