:root{
  --bg:#0D0D12;
  --surface:#16161D;
  --surface-2:#1E1E27;
  --border:#2A2A35;
  --text:#EDEDF2;
  --text-dim:#8E8E9C;
  --violet:#8B5CF6;
  --violet-dim:#6D3FD1;
  --lime:#C6FF3D;
}
*{box-sizing:border-box; margin:0; padding:0;}
button{ background:none; border:none; color:inherit; font-family:inherit; cursor:pointer; }
body{
  background:var(--bg);
  color:var(--text);
  font-family:'Inter',sans-serif;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
  min-height:100vh;
}
.display{ font-family:'Space Grotesk',sans-serif; }
.mono{ font-family:'IBM Plex Mono',monospace; }

/* ---------- toolbar ---------- */
.toolbar{
  position:sticky;
  top:0;
  z-index:20;
  display:flex;
  align-items:center;
  gap:14px;
  padding:18px;
  background:rgba(13,13,18,.85);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border);
}
.hamburger{
  width:22px; height:16px;
  position:relative;
  cursor:pointer;
  flex-shrink:0;
  background:none; border:none;
}
.hamburger span{
  display:block;
  position:absolute;
  height:2px;
  width:100%;
  background:var(--text);
  border-radius:2px;
  left:0;
}
.hamburger span:nth-child(1){top:0;}
.hamburger span:nth-child(2){top:7px; width:70%;}
.hamburger span:nth-child(3){top:14px;}
.toolbar-title{
  font-family:'Space Grotesk',sans-serif;
  font-weight:500;
  font-size:19px;
  letter-spacing:.01em;
}

/* ---------- landing screen ---------- */
.hero{
  min-height:calc(100vh - 120px);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:24px;
  position:relative;
}
.hero::before{
  content:"";
  position:absolute;
  inset:0;
  background: radial-gradient(circle at 50% 30%, rgba(139,92,246,.16), transparent 60%);
  pointer-events:none;
}
.hero-title{
  font-size:52px;
  font-weight:700;
  letter-spacing:-.02em;
  position:relative;
  display:inline-block;
}
.hero-title .x{ color:var(--lime); }
.hero-title.glitch{ animation: settle 1.1s cubic-bezier(.2,.9,.3,1) both; }
.hero-title.glitch::after{
  content:attr(data-text);
  position:absolute;
  left:0; top:0;
  width:100%;
  color:var(--violet);
  overflow:hidden;
  animation: glitch-slice 1.1s cubic-bezier(.2,.9,.3,1) both;
  opacity:.7;
}
@keyframes settle{
  0%{ filter:blur(6px); opacity:0; transform:translateY(6px);}
  40%{ filter:blur(1px); opacity:1; }
  100%{ filter:blur(0); transform:translateY(0);}
}
@keyframes glitch-slice{
  0%{ clip-path:inset(0 0 0 0); transform:translate(0,0); opacity:.8;}
  8%{ clip-path:inset(20% 0 40% 0); transform:translate(-4px,0); }
  16%{ clip-path:inset(60% 0 5% 0); transform:translate(3px,0); }
  24%{ clip-path:inset(10% 0 70% 0); transform:translate(-2px,0); }
  32%{ clip-path:inset(0 0 0 0); transform:translate(0,0); opacity:0;}
  100%{ opacity:0; }
}
.hero-sub{
  margin-top:14px;
  color:var(--text-dim);
  font-size:15px;
  max-width:280px;
  line-height:1.5;
}
.site-footer{
  padding:20px 24px calc(20px + env(safe-area-inset-bottom));
  text-align:center;
  font-size:12.5px;
  color:var(--text-dim);
  border-top:1px solid var(--border);
}
.site-footer a{ color:var(--lime); text-decoration:none; }
.cta{
  margin-top:40px;
  background:var(--violet);
  color:#fff;
  border:none;
  font-family:'Space Grotesk',sans-serif;
  font-weight:500;
  font-size:16px;
  padding:15px 34px;
  border-radius:12px;
  cursor:pointer;
  box-shadow:0 8px 24px -8px rgba(139,92,246,.6);
  transition:transform .15s ease, box-shadow .15s ease;
  text-decoration:none;
  display:inline-block;
}
.cta:active{ transform:scale(.97); }
.status-line{
  margin-top:56px;
  color:var(--text-dim);
  font-size:12px;
  display:flex;
  gap:6px;
  align-items:center;
  justify-content:center;
  font-family:'IBM Plex Mono',monospace;
}
.status-line .dot{
  width:6px; height:6px; border-radius:50%;
  background:var(--lime);
  box-shadow:0 0 8px var(--lime);
}

/* ---------- repositories screen ---------- */
.search{
  margin:16px 18px 8px;
  display:flex;
  align-items:center;
  gap:10px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:12px;
  padding:11px 14px;
  max-width:520px;
}
.search input{
  background:none; border:none; outline:none;
  color:var(--text);
  font-family:'Inter',sans-serif;
  font-size:14.5px;
  width:100%;
}
.search input::placeholder{ color:#5c5c6b; }
.search svg{ flex-shrink:0; opacity:.6; }

.section-label{
  padding:18px 18px 8px;
  font-size:13px;
  color:var(--text-dim);
}

.repo-list{
  padding:0 18px 24px;
  display:flex;
  flex-direction:column;
  gap:10px;
  max-width:520px;
}
.repo-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:14px;
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:6px;
  text-decoration:none;
  color:inherit;
  position:relative;
}
.stretched-link{
  position:absolute;
  inset:0;
  z-index:0;
}
.repo-name{
  font-family:'Space Grotesk',sans-serif;
  font-weight:500;
  font-size:16px;
}
.repo-owner{
  font-family:'IBM Plex Mono',monospace;
  font-size:12px;
  color:var(--violet);
  text-decoration:none;
  position:relative;
  z-index:1;
}
.repo-desc{
  font-size:13.5px;
  color:var(--text-dim);
  line-height:1.4;
}
.repo-meta{
  display:flex;
  gap:14px;
  margin-top:6px;
  font-family:'IBM Plex Mono',monospace;
  font-size:11.5px;
  color:#6e6e7d;
}
.repo-meta span{ display:flex; align-items:center; gap:5px; }
.tag-dot{ width:5px; height:5px; border-radius:50%; background:var(--lime); display:inline-block; }

.empty-state{
  margin:40px 18px;
  padding:28px 20px;
  border:1px dashed var(--border);
  border-radius:14px;
  text-align:center;
  color:var(--text-dim);
  font-size:14px;
}

/* ---------- side drawer ---------- */
.scrim{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  opacity:0;
  pointer-events:none;
  transition:opacity .25s ease;
  z-index:30;
}
.drawer{
  position:fixed;
  top:0; bottom:0; left:0;
  width:78%;
  max-width:300px;
  background:var(--surface);
  border-right:1px solid var(--border);
  transform:translateX(-100%);
  transition:transform .28s cubic-bezier(.2,.9,.3,1);
  z-index:31;
  display:flex;
  flex-direction:column;
  padding:22px 18px;
}
body.drawer-open .scrim{ opacity:1; pointer-events:auto; }
body.drawer-open .drawer{ transform:translateX(0); }

.drawer-brand{
  font-family:'Space Grotesk',sans-serif;
  font-size:18px;
  margin-bottom:28px;
}
.drawer-brand .x{ color:var(--lime); }
.drawer-home-link{
  margin-top:auto;
  display:flex; align-items:center; gap:8px;
  font-family:'Space Grotesk',sans-serif;
  font-size:14px;
  color:var(--text-dim);
  text-decoration:none;
  padding-top:14px;
}
.drawer-home-link .x{ color:var(--lime); }
.drawer-item{
  display:flex;
  align-items:center;
  gap:12px;
  padding:13px 10px;
  border-radius:10px;
  color:var(--text);
  text-decoration:none;
  font-size:14.5px;
  cursor:pointer;
  background:none;
  border:none;
  width:100%;
  text-align:left;
  font-family:'Inter',sans-serif;
}
.drawer-item.primary{
  background:var(--violet);
  color:#fff;
  font-weight:500;
  justify-content:center;
  margin-top:6px;
}
.drawer-item .icon{ width:18px; text-align:center; opacity:.8; flex-shrink:0; }
.drawer-item.current{ background:var(--surface-2); color:var(--lime); }
.drawer-item.current .icon{ opacity:1; }
.drawer-divider{ height:1px; background:var(--border); margin:14px 0; }

/* ---------- auth forms ---------- */
.auth-wrap{
  max-width:420px;
  margin:0 auto;
  padding:32px 20px;
}
.auth-form{
  display:flex;
  flex-direction:column;
  gap:16px;
}
.field{
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:13px;
  color:var(--text-dim);
}
.field input{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:10px;
  padding:12px 14px;
  color:var(--text);
  font-family:'Inter',sans-serif;
  font-size:15px;
  outline:none;
  width:100%;
}
.field input:focus{ border-color:var(--violet); }
.field input[type="file"]{ padding:9px 10px; font-size:13px; }
.form-error{
  background:rgba(239,68,68,.12);
  border:1px solid rgba(239,68,68,.35);
  color:#FCA5A5;
  padding:12px 14px;
  border-radius:10px;
  font-size:13.5px;
  margin-bottom:18px;
}
.auth-alt{
  text-align:center;
  margin-top:22px;
  font-size:13.5px;
  color:var(--text-dim);
}
.auth-alt a{ color:var(--violet); text-decoration:none; }

.password-field{ position:relative; }
.password-field input{ padding-right:44px; }
.password-toggle{
  position:absolute; right:4px; top:50%; transform:translateY(-50%);
  background:none; border:none; color:var(--text-dim); cursor:pointer;
  width:34px; height:34px; display:flex; align-items:center; justify-content:center;
}

/* ---------- profile ---------- */
.profile-header{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  padding:36px 20px 20px;
}
.avatar{
  width:84px; height:84px;
  border-radius:50%;
  object-fit:cover;
  border:1px solid var(--border);
}
.avatar-fallback{
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg, var(--violet), var(--violet-dim));
  color:#fff;
  font-size:32px;
  font-weight:500;
}
.profile-name{ margin-top:14px; font-size:20px; }
.profile-username{ color:var(--text-dim); font-size:13px; margin-top:2px; }

/* ---------- iconos (Material Symbols) ---------- */
.material-symbols-outlined{
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align:middle;
  line-height:1;
  user-select:none;
}
.toolbar-back{
  display:flex;
  align-items:center;
  justify-content:center;
  width:34px; height:34px;
  margin-left:-6px;
  color:var(--text);
  text-decoration:none;
  flex-shrink:0;
  border-radius:8px;
}
.toolbar-back:active{ background:var(--surface); }
.cta .material-symbols-outlined{ font-size:19px; margin-right:6px; vertical-align:-4px; }

/* ---------- flash messages ---------- */
.flash{
  margin:14px 18px 0;
  padding:12px 14px;
  border-radius:10px;
  font-size:13.5px;
  background:rgba(139,92,246,.12);
  border:1px solid rgba(139,92,246,.35);
  color:var(--text);
}
.flash-error{
  background:rgba(239,68,68,.12);
  border-color:rgba(239,68,68,.35);
  color:#FCA5A5;
}

/* ---------- avatar (editable) ---------- */
.avatar-wrap{
  position:relative;
  display:inline-block;
  cursor:pointer;
}
.avatar-edit-badge{
  position:absolute;
  bottom:-2px; right:-2px;
  width:28px; height:28px;
  border-radius:50%;
  background:var(--violet);
  color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-size:16px;
  border:2px solid var(--bg);
}

/* ---------- settings dropdown (perfil) ---------- */
.settings-menu{
  position:fixed;
  top:64px; right:14px;
  width:230px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:14px;
  padding:8px;
  z-index:41;
  opacity:0;
  transform:translateY(-8px) scale(.98);
  pointer-events:none;
  transition:opacity .18s ease, transform .18s ease;
  box-shadow:0 20px 40px -10px rgba(0,0,0,.5);
}
.settings-menu form{ width:100%; }
.settings-menu .drawer-item{ padding:11px 10px; font-size:14px; }
body.settings-open .settings-menu{
  opacity:1;
  transform:translateY(0) scale(1);
  pointer-events:auto;
}
body.settings-open [data-settings-scrim]{ opacity:1; pointer-events:auto; z-index:40; }

/* ---------- delete account dialog ---------- */
.delete-dialog{
  position:fixed;
  left:50%; top:50%;
  transform:translate(-50%, -50%) scale(.96);
  width:88%;
  max-width:360px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:16px;
  padding:24px 20px;
  z-index:51;
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease, transform .2s ease;
}
.delete-title{ font-size:19px; margin-bottom:10px; }
.delete-warning{
  font-size:13.5px;
  color:var(--text-dim);
  line-height:1.5;
  margin-bottom:18px;
}
body.delete-open .delete-dialog{
  opacity:1;
  transform:translate(-50%, -50%) scale(1);
  pointer-events:auto;
}
body.delete-open [data-delete-scrim]{ opacity:1; pointer-events:auto; z-index:50; }

.toolbar-back:last-child{ margin-left:0; margin-right:-6px; }

/* ---------- floating action button ---------- */
.fab{
  position:fixed;
  right:20px; bottom:28px;
  width:58px; height:58px;
  border-radius:50%;
  background:var(--violet);
  color:#fff;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 10px 28px -6px rgba(139,92,246,.7);
  text-decoration:none;
  z-index:15;
}
.fab .material-symbols-outlined{ font-size:28px; }
.fab:active{ transform:scale(.95); }
.fab-panel{ bottom:96px; z-index:16; }
.cta-hosting{
  background:linear-gradient(135deg, #229ED9, var(--violet));
  box-shadow:0 10px 28px -8px rgba(34,158,217,.5);
}
.cta-yoinks{
  background:var(--lime);
  color:#0D0D12;
  box-shadow:0 10px 24px -10px rgba(198,255,61,.55);
}

/* ---------- info dialog (mismo look que delete-dialog) ---------- */
body.info-open [data-info-scrim]{ opacity:1; pointer-events:auto; }

/* ---------- spinner de carga ---------- */
.spinner{
  display:inline-block;
  width:19px; height:19px;
  border:2.5px solid rgba(255,255,255,.35);
  border-top-color:#fff;
  border-radius:50%;
  animation:cx-spin .7s linear infinite;
  vertical-align:-4px;
}
@keyframes cx-spin{ to{ transform:rotate(360deg); } }
button[disabled], .cta[aria-disabled="true"]{ opacity:.75; pointer-events:none; }

.settings-toggle{
  width:34px; height:34px;
  display:flex; align-items:center; justify-content:center;
  background:transparent;
  border:1.5px solid var(--violet);
  border-radius:10px;
  color:var(--violet);
  margin-right:-6px;
  flex-shrink:0;
}
.settings-toggle:active{ background:rgba(139,92,246,.15); }

/* ---------- selector de archivos (reemplaza el input nativo feo) ---------- */
.file-picker{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px;
}
.file-picker-input{
  position:absolute;
  width:1px; height:1px;
  opacity:0;
  overflow:hidden;
}
.file-picker-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  background:var(--violet);
  color:#fff;
  padding:10px 16px;
  border-radius:8px;
  font-size:13.5px;
  font-weight:500;
  cursor:pointer;
  white-space:nowrap;
  flex-shrink:0;
}
.file-picker-btn:active{ background:var(--violet-dim); }
.file-picker-btn .material-symbols-outlined{ font-size:18px; }
.file-picker-text{
  font-size:12.5px;
  color:var(--text-dim);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  min-width:0;
}

/* ---------- hosting: status dots ---------- */
.tag-dot-off{ width:5px; height:5px; border-radius:50%; background:#EF4444; display:inline-block; }
.tag-dot-zombie{ width:5px; height:5px; border-radius:50%; background:#F59E0B; display:inline-block; }

/* ---------- hosting: bottombar (BB) ---------- */
.bottombar{
  position:fixed; left:0; right:0; bottom:0;
  display:flex;
  background:rgba(13,13,18,.92);
  backdrop-filter:blur(10px);
  border-top:1px solid var(--border);
  padding:6px 4px calc(6px + env(safe-area-inset-bottom));
  z-index:20;
}
.bb-item{
  flex:1;
  display:flex; flex-direction:column; align-items:center; gap:3px;
  padding:6px 2px;
  color:var(--text-dim);
  text-decoration:none;
  border-radius:10px;
}
.bb-item .material-symbols-outlined{ font-size:22px; }
.bb-item span.bb-label{ font-size:10.5px; }
.bb-item.active{ color:var(--violet); }
.panel-body{ padding:16px 16px 96px; }

/* ---------- hosting: panel de inicio ---------- */
.bot-token-row{
  display:flex; align-items:center; justify-content:space-between;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:10px;
  padding:12px 14px;
  margin-bottom:10px;
}
.bot-token-row .mono{ font-size:13px; color:var(--text-dim); }
.limit-row{
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 2px;
  font-size:13px;
  border-bottom:1px solid var(--border);
}
.limit-row:last-child{ border-bottom:none; }
.limit-row .limit-value{ font-family:'IBM Plex Mono',monospace; color:var(--text-dim); }
.limit-row.over .limit-value{ color:#FCA5A5; }
.activate-toggle{
  width:100%;
  display:flex; align-items:center; justify-content:center; gap:10px;
  padding:15px;
  border-radius:12px;
  font-family:'Space Grotesk',sans-serif;
  font-weight:500;
  font-size:15px;
  background:var(--violet);
  color:#fff;
  margin:16px 0 20px;
}
.activate-toggle.is-on{ background:var(--surface-2); color:var(--lime); border:1px solid var(--lime); }

/* ---------- hosting: dependencias ---------- */
.dep-item{
  display:flex; align-items:center; gap:12px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:10px;
  padding:12px 14px;
  margin-bottom:8px;
  text-align:left;
  width:100%;
}
.dep-status{ width:9px; height:9px; border-radius:50%; background:var(--lime); flex-shrink:0; }
.dep-status.pending{ background:transparent; border:1.5px solid var(--text-dim); }
.dep-name{ font-family:'IBM Plex Mono',monospace; font-size:13.5px; }
.dep-version{ font-size:11.5px; color:var(--text-dim); }
.dep-size{ margin-left:auto; font-size:11.5px; color:var(--text-dim); flex-shrink:0; }

/* ---------- hosting: consola ---------- */
.console-box{
  background:#0A0A0E;
  border:1px solid var(--border);
  border-radius:10px;
  padding:12px 14px;
  font-family:'IBM Plex Mono',monospace;
  font-size:12px;
  line-height:1.6;
  color:#B8B8C4;
  height:calc(100vh - 240px);
  overflow-y:auto;
  white-space:pre-wrap;
  word-break:break-word;
}
.console-line-err{ color:#FCA5A5; }
.console-line-warn{ color:#FBBF24; }

/* ---------- hosting: toggle (reinicio automático) ---------- */
.switch-row{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 2px;
}
.switch{
  position:relative;
  width:42px; height:25px;
  border-radius:20px;
  background:var(--surface-2);
  border:1px solid var(--border);
  flex-shrink:0;
}
.switch::after{
  content:'';
  position:absolute; top:2px; left:2px;
  width:19px; height:19px;
  border-radius:50%;
  background:var(--text-dim);
  transition:transform .15s ease, background .15s ease;
}
.switch.on::after{ transform:translateX(17px); background:var(--lime); }
.switch.locked{ opacity:.4; }
.premium-chip{
  font-size:10px; font-family:'IBM Plex Mono',monospace;
  color:var(--violet); border:1px solid var(--violet);
  border-radius:6px; padding:2px 6px; margin-left:6px;
}

/* ---------- yoinks: barra de progreso ---------- */
.progress-track{
  width:100%; height:8px;
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:6px;
  overflow:hidden;
}
.progress-fill{
  height:100%;
  width:0%;
  background:linear-gradient(90deg, var(--violet), var(--lime));
  transition:width .3s ease;
}
