:root {
  --bg: #050806; --panel: rgba(255, 255, 255, .035); --panel2: rgba(255, 255, 255, .06); --field: rgba(0, 0, 0, .35);
  --line: rgba(255, 255, 255, .08); --line2: rgba(255, 255, 255, .16);
  --text: #eef3ef; --text2: #c3cfc7; --muted: #87958b;
  --green: #53fc18; --green-soft: rgba(83, 252, 24, .13); --red: #ff6b6b; --yellow: #ffd23f;
  --radius: 22px;
  --font: 'Plus Jakarta Sans', system-ui, 'Segoe UI', sans-serif; --display: 'Outfit', 'Plus Jakarta Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; padding: 18px; }
body.menu-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); }
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 8px; } ::-webkit-scrollbar-thumb:hover { background: rgba(83, 252, 24, .5); }

/* fondo: luces verdes difuminadas, como en las referencias */
.bg-glow { position: fixed; inset: 0; z-index: -1; pointer-events: none; transform: translateZ(0);
  background:
    radial-gradient(620px 460px at 8% 6%, rgba(83, 252, 24, .20), transparent 70%),
    radial-gradient(700px 520px at 96% 92%, rgba(16, 185, 129, .16), transparent 70%),
    radial-gradient(500px 400px at 70% 4%, rgba(83, 252, 24, .07), transparent 70%),
    linear-gradient(160deg, #07100a, #040605 55%, #06120c); }

/* contenedor principal: una "ventana" de cristal redondeada */
/* (sin backdrop-filter: desenfocar una ventana tan grande con la vista previa animándose debajo hacía lenta la página) */
.shell { max-width: 1760px; margin: 0 auto; border-radius: 34px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(14, 22, 17, .9), rgba(8, 13, 10, .92));
  box-shadow: 0 30px 70px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .06); }

/* botones */
button {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 15px; cursor: pointer; font-weight: 500;
  transition: border-color .15s, background .15s, transform .05s, box-shadow .15s;
}
button:hover { border-color: var(--line2); background: rgba(255, 255, 255, .1); }
button:active { transform: scale(.98); }
button.primary { background: var(--green); color: #07140a; border-color: var(--green); font-weight: 700; font-family: var(--display); letter-spacing: .01em; }
button.primary:hover { background: #6bff3a; border-color: #6bff3a; }
button.primary.dirty { box-shadow: 0 0 0 3px rgba(83, 252, 24, .28), 0 6px 24px rgba(83, 252, 24, .32); }
button.ghost { background: none; border-color: transparent; color: var(--muted); }
button.ghost:hover { color: var(--text); background: var(--panel2); }
button.danger { color: var(--red); }
button.danger:hover { border-color: rgba(255, 107, 107, .45); background: rgba(255, 107, 107, .08); }
button.small { padding: 4px 11px; font-size: 12px; border-radius: 9px; }
button:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 42px; height: 42px; padding: 0; display: inline-grid; place-items: center; border-radius: 14px; }

/* campos */
input[type=text], input[type=number], input[type=password], select, textarea {
  background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 9px 13px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input[type=text]:hover, input[type=number]:hover, input[type=password]:hover, select:hover, textarea:hover { border-color: var(--line2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(83, 252, 24, .16); }
::placeholder { color: #5f6e64; }
select option { background: #0e1511; color: var(--text); }
textarea { min-height: 90px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
input[type=color] { width: 42px; height: 36px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--green); }
a { color: var(--green); }
code, kbd { background: var(--field); border: 1px solid var(--line); border-radius: 7px; padding: 1px 6px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; color: var(--green); }
.muted { color: var(--muted); }
.small-txt { font-size: 12px; }

/* cabecera */
.top { display: flex; align-items: center; gap: 14px; padding: 14px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
  position: sticky; top: 0; z-index: 10; background: rgba(11, 18, 14, .97); border-radius: 34px 34px 0 0; }
.brand { font-family: var(--display); font-weight: 800; font-size: 21px; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.logo { background: #0a120d; border: 1px solid rgba(83, 252, 24, .4); width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; box-shadow: 0 4px 18px rgba(83, 252, 24, .22); }
.logo svg { width: 78%; height: 78%; display: block; }
.chips { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.chip { font-size: 12px; padding: 5px 12px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); display: inline-flex; gap: 7px; align-items: center; color: var(--text2); }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: #4a5a50; display: inline-block; }
.chip.ok i { background: var(--green); box-shadow: 0 0 8px rgba(83, 252, 24, .7); } .chip.bad i { background: var(--red); } .chip.warn i { background: var(--yellow); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* botón hamburguesa: tres rayas */
.menu-btn { flex-direction: column; gap: 5px; align-content: center; }
.menu-btn span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text); transition: background .15s, width .15s; }
.menu-btn span:nth-child(2) { width: 12px; align-self: flex-start; margin-left: 12px; }
.menu-btn:hover span { background: var(--green); }
.menu-btn:hover span:nth-child(2) { width: 18px; margin-left: 0; }

/* menú lateral */
#scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .66); z-index: 40; animation: fadein .2s; }
#scrim[hidden] { display: none; }
#drawer { position: fixed; top: 12px; left: 12px; bottom: 12px; width: min(360px, calc(100vw - 24px)); z-index: 50; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(18, 28, 21, .94), rgba(8, 13, 10, .96)); border: 1px solid var(--line2); border-radius: 30px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7), 0 0 60px rgba(83, 252, 24, .06); transform: translateX(-110%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); overflow: hidden; }
#drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 8px 22px; }
.drawer-foot { padding: 12px 22px 18px; text-align: center; }
#tabs { flex: 1; overflow-y: auto; padding: 4px 14px 8px; }
.nav-group { margin-bottom: 14px; }
.nav-label { padding: 8px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
a.nav-card { color: inherit; text-decoration: none; }
.nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--yellow); color: #1a1400; font-weight: 700; font-size: 12px; display: grid; place-items: center; flex: none; }
.chip-btn { cursor: pointer; font: inherit; font-size: 12px; color: var(--yellow); border-color: rgba(255, 210, 63, .5); background: rgba(255, 210, 63, .08); }
.chip-btn:hover { background: rgba(255, 210, 63, .16); border-color: var(--yellow); }
.nav-card { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; padding: 12px 14px; margin-bottom: 8px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); }
.nav-card:hover { background: var(--panel2); border-color: var(--line2); }
.nav-ico { flex: none; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, .06); color: var(--text2); transition: all .15s; }
.nav-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.nav-txt b { font-family: var(--display); font-weight: 600; font-size: 15.5px; }
.nav-txt small { color: var(--muted); font-size: 12px; margin-top: 1px; }
.nav-card.on { background: linear-gradient(135deg, rgba(83, 252, 24, .16), rgba(83, 252, 24, .05)); border-color: rgba(83, 252, 24, .55); box-shadow: 0 0 24px rgba(83, 252, 24, .12); }
.nav-card.on .nav-ico { background: var(--green); color: #07140a; box-shadow: 0 4px 16px rgba(83, 252, 24, .35); }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* título de sección */
.sec-head { margin: 4px 0 20px; }
.sec-head h1 { margin: 0; font-size: 32px; font-weight: 700; letter-spacing: -.02em; }
.sec-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

/* estructura */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 520px; gap: 28px; padding: 26px 26px 30px; align-items: start; }
.layout.big { grid-template-columns: minmax(0, 1fr) 900px; }
@media (max-width: 1150px) { .layout, .layout.big { grid-template-columns: 1fr; } }
.layout.noprev { grid-template-columns: minmax(0, 1fr); }
.layout.noprev .preview { display: none; }

/* editor de clips */
.clip-grid { display: grid; grid-template-columns: minmax(300px, 460px) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1000px) { .clip-grid { grid-template-columns: 1fr; } }
.clip-stage { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 1000px) { .clip-stage { position: static; } }
.clip-canvas-wrap { display: flex; justify-content: center; padding: 14px; border-radius: 26px; background: repeating-conic-gradient(#121a15 0% 25%, #0b110d 0% 50%) 50% / 22px 22px; border: 1px solid var(--line2); }
.clip-canvas { width: min(100%, calc(70vh * var(--ar, .5625))); height: auto; aspect-ratio: var(--ar, .5625); border-radius: 16px; background: #000; cursor: grab; touch-action: none; display: block; box-shadow: 0 16px 40px rgba(0, 0, 0, .55); }
.clip-canvas:active { cursor: grabbing; }
.clip-transport { display: flex; align-items: center; gap: 12px; }
.clip-transport input[type=range] { flex: 1; min-width: 0; }
.clip-transport .muted { white-space: nowrap; }
.clip-tools .tools { align-items: center; }
.clip-item { margin-bottom: 10px; }
.clip-item .row { grid-template-columns: 90px minmax(0, 1fr); }
.clips .row { grid-template-columns: 130px minmax(0, 1fr); }
.timerow { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.tr { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.tr input { width: 74px; padding: 5px 8px; border-radius: 9px; }
.chipset { display: flex; gap: 8px; flex-wrap: wrap; }
.chipsel { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 14px; border-radius: 14px; text-align: left; }
.chipsel b { font-weight: 600; font-size: 13px; } .chipsel small { color: var(--muted); font-size: 11px; }
.chipsel.on { border-color: var(--green); background: var(--green-soft); box-shadow: 0 0 16px rgba(83, 252, 24, .14); }
.stickers { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.stk { width: 50px; height: 50px; padding: 0; font-size: 26px; border-radius: 14px; display: grid; place-items: center; }
.stk:hover { transform: translateY(-2px) scale(1.06); }
.clip-bar { height: 8px; border-radius: 6px; background: rgba(255, 255, 255, .1); margin: 12px 0 8px; overflow: hidden; }
.clip-bar i { display: block; height: 100%; width: 0; background: var(--green); border-radius: 6px; transition: width .2s; }
.clip-result { width: min(100%, 360px); border-radius: 16px; margin-top: 10px; background: #000; display: block; }
a.btn-link { display: inline-block; padding: 9px 18px; border-radius: 12px; font-weight: 700; font-family: var(--display); text-decoration: none; background: var(--panel2); border: 1px solid var(--line2); color: var(--text); }
a.btn-link.primary { background: var(--green); border-color: var(--green); color: #07140a; }
.clip-points { margin: 0; padding-left: 20px; color: var(--text2); } .clip-points li { margin-bottom: 4px; }
.clip-drop { padding: 44px 20px; }
.preview { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 12px; }
.pv-head { display: flex; gap: 8px; align-items: baseline; }
.pv-head strong { font-family: var(--display); font-size: 17px; font-weight: 600; }
.pv-head button { margin-left: auto; align-self: center; }
.pv-box { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line2); border-radius: 24px; background: #000; box-shadow: 0 16px 50px rgba(0, 0, 0, .5); }
.pv-box iframe { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; border: 0; transform-origin: 0 0; }

/* selector de alertas, por grupos */
.pills { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.pill-group { display: flex; align-items: flex-start; gap: 12px; }
.pill-label { flex: none; width: 82px; padding-top: 7px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pill-list { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 7px; border-radius: 99px; padding: 6px 14px; font-size: 13px; }
.pill.on { border-color: var(--green); background: var(--green-soft); color: #fff; box-shadow: 0 0 18px rgba(83, 252, 24, .14); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #4a5a50; }
.dot.ok { background: var(--green); box-shadow: 0 0 6px rgba(83, 252, 24, .6); }
@media (max-width: 700px) { .pill-group { flex-direction: column; gap: 4px; } .pill-label { width: auto; padding-top: 0; } }

/* tarjetas de cristal */
.card { background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .02)); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); }
.card h3 { margin: 0 0 12px; font-size: 18px; font-weight: 600; }
details.card { padding: 0; }
details.card > summary { cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 16.5px; list-style: none; padding: 16px 22px; display: flex; align-items: center; gap: 10px; border-radius: var(--radius); }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary:hover { background: rgba(255, 255, 255, .025); }
details.card > summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; flex: none; margin-right: 2px; }
details.card[open] > summary::before { transform: rotate(45deg); border-color: var(--green); }
details.card[open] > summary { border-bottom: 1px solid var(--line); border-bottom-left-radius: 0; border-bottom-right-radius: 0; margin-bottom: 0; }
details.card[open] { padding-bottom: 8px; }
details.card > :not(summary) { margin-left: 22px; margin-right: 22px; }
details.card > summary + * { margin-top: 18px; }

/* filas del formulario */
.row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 8px 14px; align-items: center; margin-bottom: 14px; }
.row > label { color: var(--text2); font-size: 13.5px; }
.row .hint { grid-column: 2; color: var(--muted); font-size: 12px; margin-top: -4px; line-height: 1.45; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline > * { flex: 1; min-width: 0; }
.inline > button, .inline > .val, .inline > input[type=color] { flex: none; }
.val { min-width: 62px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* interruptores */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--text2); }
.switch input[type=checkbox] {
  appearance: none; -webkit-appearance: none; flex: none; width: 40px; height: 23px; margin: 0; border-radius: 99px;
  background: rgba(255, 255, 255, .1); border: 1px solid var(--line2); position: relative; cursor: pointer; transition: background .15s, border-color .15s;
}
.switch input[type=checkbox]::after { content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #aab8ae; transition: transform .15s, background .15s; }
.switch input[type=checkbox]:checked { background: var(--green); border-color: var(--green); box-shadow: 0 0 14px rgba(83, 252, 24, .3); }
.switch input[type=checkbox]:checked::after { transform: translateX(17px); background: #07140a; }
.switch input[type=checkbox]:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(83, 252, 24, .25); }

.vars { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.vars button { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; padding: 2px 10px; color: var(--green); border-radius: 99px; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.variant { border: 1px dashed var(--line2); border-radius: 16px; padding: 14px; margin-bottom: 12px; background: rgba(255, 255, 255, .015); }
.variant-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.variant-head .inline { flex: 1; }
.variant-head label { white-space: nowrap; }

/* estilos listos */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.preset-tile { display: flex; flex-direction: column; align-items: stretch; gap: 3px; text-align: left; padding: 10px 10px 12px; border-radius: 18px; background: var(--panel); }
.preset-tile:hover { border-color: rgba(83, 252, 24, .55); background: var(--green-soft); transform: translateY(-2px); }
.preset-tile b { font-family: var(--display); font-weight: 600; font-size: 15px; margin-top: 8px; }
.preset-tile small { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.swatch { height: 84px; border-radius: 12px; display: grid; place-items: center; background: repeating-conic-gradient(#16201a 0% 25%, #0d130f 0% 50%) 50% / 14px 14px; overflow: hidden; }
.sw-card { width: 76%; padding: 9px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sw-card.left { flex-direction: row; width: 88%; gap: 8px; }
.sw-img { flex: none; width: 22px; height: 22px; border-radius: 6px; display: block; opacity: .9; }
.sw-lines { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.sw-card:not(.left) .sw-lines { align-items: center; }
.sw-lines i { display: block; height: 5px; border-radius: 3px; }

/* archivos */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.media-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.media-card .thumb { height: 110px; display: grid; place-items: center; background: var(--field); border-radius: 12px; overflow: hidden; }
.media-card .thumb img, .media-card .thumb video { max-width: 100%; max-height: 100%; }
.media-card .thumb audio { width: 100%; }
.media-card .name { font-size: 12px; word-break: break-all; }
.drop { border: 2px dashed var(--line2); border-radius: var(--radius); padding: 30px; text-align: center; color: var(--muted); margin-bottom: 16px; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.drop:hover { border-color: rgba(83, 252, 24, .5); }
.drop.over { border-color: var(--green); color: var(--text); background: var(--green-soft); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .03em; }
pre.log { background: rgba(0, 0, 0, .4); border: 1px solid var(--line); border-radius: 16px; padding: 14px; max-height: 60vh; overflow: auto; font: 12px/1.55 ui-monospace, Consolas, monospace; white-space: pre-wrap; }
pre.out { background: rgba(0, 0, 0, .4); border: 1px solid var(--line); border-radius: 16px; padding: 14px; max-height: 260px; overflow: auto; font: 12px ui-monospace, Consolas, monospace; white-space: pre-wrap; }
ol.steps { padding-left: 20px; } ol.steps li { margin-bottom: 8px; }

/* avisos */
#toasts { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { background: rgba(16, 24, 19, .97); border: 1px solid var(--line2); border-left: 4px solid var(--green); padding: 12px 18px; border-radius: 16px; max-width: 420px; box-shadow: 0 14px 40px rgba(0, 0, 0, .6); }
.toast.err { border-left-color: var(--red); }
.dirty-note { display: flex; gap: 12px; align-items: center; margin: 2px 0; padding: 12px 14px; border: 1px solid rgba(255, 210, 63, .45); border-radius: 16px; background: rgba(255, 210, 63, .08); color: #ffe27a; font-size: 13px; line-height: 1.4; }
.dirty-note[hidden] { display: none; }
.dirty-note button { flex: none; }

@media (max-width: 700px) {
  body { padding: 8px; }
  .shell { border-radius: 24px; }
  .top { padding: 10px 14px; border-radius: 24px 24px 0 0; }
  .row { grid-template-columns: 1fr; } .row .hint { grid-column: 1; }
  .layout { padding: 16px 14px 22px; gap: 18px; }
  .brand-name { display: none; }
  .sec-head h1 { font-size: 26px; }
}

#login { position: fixed; inset: 0; background: radial-gradient(900px 520px at 50% -10%, rgba(83, 252, 24, .12), transparent 60%), var(--bg); display: grid; place-items: center; z-index: 100; }
.login-card { width: min(390px, 92vw); padding: 28px; }
.login-card input { margin-bottom: 8px; }

.card.item { background: rgba(255, 255, 255, .015); border-style: dashed; border-color: var(--line2); }
.card.item > summary { font-size: 14px; }
