:root { --bg:#1e1f22; --panel:#2b2d31; --panel2:#313338; --line:#3f4147; --text:#dbdee1; --muted:#949ba4; --brand:#5865f2; --red:#f23f42; --green:#23a55a; --yellow:#f0b232; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin:0; background:var(--bg); color:var(--text); font:15px/1.4 "gg sans","Segoe UI",system-ui,sans-serif; }
code { background:var(--bg); padding:1px 5px; border-radius:3px; font-size:12px; }
.muted { color:var(--muted); font-size:13px; }
.spacer { flex:1; }

/* barra superior */
.top { display:flex; align-items:center; gap:10px; padding:10px 16px; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.brand { font-weight:700; font-size:16px; margin-right:8px; }
.brand-link { border:0; background:transparent; color:inherit; padding:0; cursor:pointer; font:inherit; text-align:left; }
.tabs { display:flex; gap:4px; background:var(--panel); padding:3px; border-radius:6px; }
.tabs button { background:transparent; color:var(--muted); padding:6px 12px; }
.tabs button.on { background:var(--brand); color:#fff; }
.tabs.small { margin-bottom:10px; width:max-content; }
.dest { display:flex; gap:10px; align-items:center; padding:10px 16px; border-bottom:1px solid var(--line); background:var(--panel); flex-wrap:wrap; }
.dest select { width:auto; flex:0 1 260px; min-width:0; }
.pill { background:var(--panel2); border:1px solid var(--line); border-radius:99px; padding:3px 10px; font-size:12px; color:var(--yellow); max-width:100%; overflow-wrap:anywhere; }
.pill a { color:inherit; }

.cols { display:grid; gap:16px; padding:16px; max-width:1400px; margin:0 auto; }
@media (min-width:1000px) { .cols { grid-template-columns:minmax(0,1.05fr) minmax(0,1fr); align-items:start; } .right { position:sticky; top:12px; max-height:calc(100vh - 24px); overflow:auto; } }
.right { display:grid; gap:16px; grid-template-columns:minmax(0,1fr); }
.right > *, .cols > * { min-width:0; }

.card { background:var(--panel); border:1px solid var(--line); border-radius:8px; padding:14px; margin-bottom:16px; }
.right .card { margin-bottom:0; }
.card > h2, .card > .h { margin:0 0 10px; font-size:13px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); display:flex; justify-content:space-between; align-items:center; gap:8px; }

/* formularios */
.f { display:block; margin-top:10px; }
.lbl { display:flex; justify-content:space-between; font-size:12px; color:var(--muted); margin-bottom:4px; }
.count.over { color:var(--red); }
input[type=text], input[type=url], input[type=password], textarea, select { width:100%; background:var(--bg); color:var(--text); border:1px solid var(--line); border-radius:4px; padding:8px 10px; font:inherit; }
input:focus, textarea:focus, select:focus { outline:2px solid var(--brand); outline-offset:-1px; }
textarea { resize:vertical; min-height:64px; }
.row { display:grid; gap:10px; grid-template-columns:1fr 1fr; }
.row3 { display:grid; gap:10px; grid-template-columns:1fr 1fr 90px; }
@media (max-width:560px) { .row, .row3 { grid-template-columns:1fr; } }
.chk { display:inline-flex; align-items:center; gap:6px; font-size:13px; color:var(--muted); cursor:pointer; margin:0; }
.chk input { width:auto; }
input[type=color] { width:48px; height:34px; border:1px solid var(--line); border-radius:4px; background:var(--bg); padding:2px; }
.color-row { display:flex; gap:10px; align-items:center; }
.color-row input.hex { width:110px; flex:0 0 auto; text-transform:uppercase; font-family:monospace; }
button { background:var(--brand); color:#fff; border:0; border-radius:4px; padding:8px 14px; font:inherit; font-weight:600; cursor:pointer; }
button.ghost { background:var(--panel2); border:1px solid var(--line); }
button.mini { padding:3px 8px; font-size:12px; background:var(--panel2); border:1px solid var(--line); }
button.danger { background:transparent; color:var(--red); padding:3px 8px; font-size:12px; }
button:disabled { opacity:.5; cursor:default; }
.actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }

/* editor */
.etabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:12px; align-items:center; }
.etabs button { background:var(--panel2); border:1px solid var(--line); color:var(--muted); padding:5px 10px; }
.etabs button.on { background:var(--brand); color:#fff; border-color:var(--brand); }
.item { border:1px solid var(--line); border-radius:8px; padding:10px 12px 12px; margin-top:10px; background:var(--panel2); }
.item .head { display:flex; justify-content:space-between; align-items:center; gap:8px; font-size:12px; color:var(--muted); font-weight:700; text-transform:uppercase; letter-spacing:.03em; }
.item .tools { display:flex; gap:4px; }
.item.container { border-left:4px solid var(--brand); background:var(--panel); }
.item .children { margin-left:4px; }
.sub { border:1px solid var(--line); border-radius:6px; padding:8px; margin-top:8px; background:var(--bg); }
.addbar { display:flex; gap:6px; flex-wrap:wrap; margin-top:12px; }
.addbar span { font-size:12px; color:var(--muted); align-self:center; }
.raw { color:var(--muted); font-style:italic; font-size:13px; margin-top:6px; }
.problems { list-style:none; margin:10px 0 0; padding:0; font-size:13px; color:var(--yellow); }
.problems li::before { content:"⚠️ "; }
.problems:empty { display:none; }

pre { margin:0; background:var(--bg); border:1px solid var(--line); border-radius:6px; padding:10px; max-height:340px; overflow:auto; font:12px/1.45 ui-monospace,Consolas,monospace; white-space:pre; }
dialog { background:var(--panel); color:var(--text); border:1px solid var(--line); border-radius:8px; width:min(600px,94vw); padding:0; }
dialog::backdrop { background:rgba(0,0,0,.6); }
.dlg { padding:16px; } .dlg h3 { margin:0 0 10px; }
.lib { max-height:50vh; overflow:auto; }
.lib-row { display:flex; gap:8px; align-items:center; padding:8px; border:1px solid var(--line); border-radius:6px; margin-bottom:6px; background:var(--panel2); }
.lib-row .name { flex:1; overflow-wrap:anywhere; }
.badge { font-size:11px; background:var(--bg); border-radius:3px; padding:1px 6px; color:var(--muted); }
.status { min-height:18px; margin-top:8px; font-size:13px; } .status.err { color:var(--red); } .status.ok { color:var(--green); }
.toast { position:fixed; bottom:16px; left:50%; transform:translateX(-50%); background:var(--panel2); border:1px solid var(--line); padding:10px 16px; border-radius:8px; max-width:92vw; z-index:50; box-shadow:0 6px 24px rgba(0,0,0,.4); overflow-wrap:anywhere; }
.toast.ok { border-color:var(--green); } .toast.err { border-color:var(--red); }
.toast a { color:#00a8fc; }

/* login */
.login-page { display:grid; place-items:center; min-height:100vh; }
.login { width:min(360px,92vw); display:grid; gap:10px; margin:0; } .login h1 { margin:0; font-size:20px; }

/* vista previa estilo Discord */
.discord { background:var(--panel2); border-radius:8px; padding:16px; overflow-x:auto; }
.msg-head { display:flex; gap:10px; align-items:center; margin-bottom:4px; }
.avatar { width:40px; height:40px; border-radius:50%; background:var(--brand); flex:none; display:grid; place-items:center; font-weight:700; color:#fff; }
.msg-head b { color:#fff; } .msg-head .tag { background:var(--brand); color:#fff; font-size:10px; padding:1px 5px; border-radius:3px; margin-left:6px; }
.msg-body { margin-left:50px; display:grid; gap:6px; max-width:540px; }
.msg-content, .e-desc, .v-text { overflow-wrap:anywhere; }
.empty { color:var(--muted); font-style:italic; }
.embed { display:grid; background:#2b2d31; border-left:4px solid var(--brand); border-radius:4px; padding:8px 16px 16px 12px; gap:4px; }
.embed .grid { display:grid; grid-template-columns:1fr auto; gap:8px; }
.e-author { display:flex; align-items:center; gap:8px; font-size:14px; font-weight:600; color:#fff; margin-top:8px; }
.e-author img { width:24px; height:24px; border-radius:50%; }
.e-title { font-size:16px; font-weight:700; color:#fff; margin-top:8px; overflow-wrap:anywhere; } .e-title a { color:#00a8fc; text-decoration:none; }
.e-desc { font-size:14px; margin-top:8px; }
.e-thumb { width:80px; height:80px; object-fit:cover; border-radius:4px; margin-top:8px; }
.e-fields { display:grid; grid-template-columns:repeat(12,1fr); gap:8px; margin-top:8px; }
.e-field { grid-column:1 / -1; min-width:0; } .e-field.inline { grid-column:span 4; }
.e-field .n { font-size:14px; font-weight:700; color:#fff; overflow-wrap:anywhere; } .e-field .v { font-size:14px; overflow-wrap:anywhere; }
.e-image { max-width:100%; max-height:300px; border-radius:4px; margin-top:16px; }
.e-footer { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--muted); margin-top:8px; } .e-footer img { width:20px; height:20px; border-radius:50%; }
.discord a { color:#00a8fc; } .discord code { background:#1e1f22; padding:1px 4px; border-radius:3px; font-size:13px; }
.discord .h1 { font-size:24px; font-weight:700; color:#fff; } .discord .h2 { font-size:20px; font-weight:700; color:#fff; } .discord .h3 { font-size:16px; font-weight:700; color:#fff; }
.discord .subtext { font-size:12px; color:var(--muted); } .discord .q { border-left:4px solid #4e5058; padding-left:8px; }
/* V2 */
.v-cont { background:#2b2d31; border-left:4px solid #4e5058; border-radius:8px; padding:12px 14px; display:grid; gap:8px; }
.v-cont.spoiler { filter:blur(6px); }
.v-sep { padding:4px 0; } .v-sep.lg { padding:10px 0; } .v-sep hr { border:0; border-top:1px solid #4e5058; margin:0; }
.v-sec { display:grid; grid-template-columns:1fr auto; gap:12px; align-items:center; }
.v-thumb { width:80px; height:80px; object-fit:cover; border-radius:6px; }
.v-btn { display:inline-block; background:#4e5058; color:#fff; padding:6px 14px; border-radius:4px; font-size:14px; font-weight:600; }
.v-row { display:flex; gap:8px; flex-wrap:wrap; }
.v-gal { display:grid; gap:4px; grid-template-columns:repeat(2,1fr); border-radius:8px; overflow:hidden; }
.v-gal.n1 { grid-template-columns:1fr; } .v-gal img { width:100%; height:100%; max-height:260px; object-fit:cover; display:block; }
.v-raw { background:var(--bg); color:var(--muted); border-radius:6px; padding:8px; font-size:12px; font-style:italic; }

/* botones con estilo, menús, archivos y subidas */
.upl { display:flex; gap:6px; align-items:center; } .upl input[type=text] { flex:1; min-width:0; }
.action { margin-top:8px; padding:8px 10px; border:1px dashed var(--line); border-radius:6px; background:rgba(0,0,0,.12); }
.v-btn { display:inline-block; padding:6px 14px; border-radius:4px; font-size:13px; font-weight:600; color:#fff; background:#4e5058; margin:2px 6px 2px 0; }
.v-btn.s1 { background:#5865f2; } .v-btn.s2 { background:#4e5058; } .v-btn.s3 { background:#248046; } .v-btn.s4 { background:#da373c; } .v-btn.s5 { background:#4e5058; }
.v-btn.off { opacity:.5; }
.v-select { display:flex; justify-content:space-between; align-items:center; gap:8px; background:#1e1f22; border:1px solid #3f4147; border-radius:4px; padding:8px 12px; font-size:14px; color:#b5bac1; margin:4px 0; }
.v-file { display:inline-block; background:#1e1f22; border:1px solid #3f4147; border-radius:6px; padding:10px 14px; font-size:14px; margin:4px 0; }
input[type=number] { width:100%; background:var(--bg); color:var(--text); border:1px solid var(--line); border-radius:4px; padding:8px 10px; font:inherit; }

/* paleta de componentes, archivos y emojis */
.palette { position:sticky; top:0; z-index:20; margin:0 -14px 12px; padding:10px 14px; background:var(--panel); border-bottom:1px solid var(--line); box-shadow:0 6px 10px -8px rgba(0,0,0,.6); }
.pal-top { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:8px; font-size:13px; }
.pal-top select { width:auto; min-width:0; max-width:100%; flex:0 1 240px; }
.pal-btns { display:flex; gap:6px; flex-wrap:wrap; }
.pal-btn { display:inline-flex; align-items:center; gap:6px; background:var(--panel2); border:1px solid var(--line); color:var(--text); border-radius:6px; padding:7px 10px; font-size:13px; font-weight:600; cursor:pointer; }
.pal-btn:hover { border-color:var(--brand); background:#3b3e45; }
.pal-btn .ico { font-size:16px; }
@media (max-width:640px) { .pal-btns { flex-wrap:nowrap; overflow-x:auto; padding-bottom:4px; } .pal-btn { flex:none; } }
.item.container.target { outline:2px solid var(--brand); outline-offset:-2px; }
.item.container > .head { cursor:pointer; }
.badge.here { background:var(--brand); color:#fff; margin-left:8px; font-size:11px; }
.item.flash { animation:flash 1.4s ease-out; }
@keyframes flash { from { box-shadow:0 0 0 3px var(--brand); } to { box-shadow:0 0 0 0 transparent; } }
.autosave { color:var(--muted); font-size:12px; max-width:260px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dlg.wide { width:min(760px,94vw); }
dialog:has(.dlg.wide) { width:min(760px,94vw); }
.fgrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; margin:12px 0; max-height:55vh; overflow:auto; }
.ftile { background:var(--panel2); border:1px solid var(--line); border-radius:8px; padding:8px; display:flex; flex-direction:column; gap:4px; min-width:0; }
.ftile img, .ftile .ficon { width:100%; height:90px; object-fit:contain; background:var(--bg); border-radius:4px; display:grid; place-items:center; font-size:32px; }
.ftile .fname { font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ftile .fsize { font-size:11px; color:var(--muted); }
.ftile .actions { margin-top:4px; }
.emoji-bar { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:8px; }
.emoji-bar select, .emoji-bar input { width:auto; flex:1 1 160px; min-width:0; }
.emoji-free { display:flex; gap:8px; align-items:center; margin-bottom:10px; padding:8px; background:var(--bg); border-radius:6px; }
.emoji-free input { flex:1; min-width:0; }
.egrid { display:flex; flex-wrap:wrap; gap:4px; max-height:50vh; overflow:auto; padding:6px; background:var(--bg); border-radius:6px; }
.egroup { width:100%; font-size:12px; color:var(--muted); margin:6px 0 2px; text-transform:uppercase; }
.emo { width:40px; height:40px; display:grid; place-items:center; background:transparent; border:1px solid transparent; border-radius:6px; padding:0; cursor:pointer; }
.emo:hover { background:var(--panel2); border-color:var(--line); }
.emo img { width:28px; height:28px; object-fit:contain; } .emo.txt { font-size:24px; }
.emo-btn { margin-left:6px; padding:0 6px; }
.emoji { width:1.3em; height:1.3em; vertical-align:-0.25em; object-fit:contain; }
.chips { display:flex; flex-wrap:wrap; gap:6px 14px; }

/* inicio de sesión con Discord y usuario actual */
.btn-discord { display:block; text-align:center; background:#5865f2; color:#fff; border-radius:6px; padding:10px 14px; font-weight:700; text-decoration:none; }
.btn-discord:hover { background:#4752c4; }
.or { text-align:center; color:var(--muted); font-size:12px; text-transform:uppercase; }
.who { display:inline-flex; align-items:center; gap:6px; font-size:13px; color:var(--muted); max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.who img { width:22px; height:22px; border-radius:50%; }
#form { display:grid; gap:10px; }


/* =========================================================
   RUMIC TOOLS — DARK REDESIGN
   Visual-only layer: editor functionality remains unchanged.
   ========================================================= */

:root {
  --bg: #090b10;
  --bg-deep: #06070b;
  --panel: #10131a;
  --panel2: #151923;
  --panel3: #1a1f2b;
  --line: #272d3a;
  --line-hover: #343c4d;
  --text: #edf0f6;
  --muted: #8992a3;
  --muted2: #646d7e;
  --brand: #7c6cff;
  --brand-hover: #9184ff;
  --brand-soft: rgba(124,108,255,.13);
  --red: #ff5d6c;
  --green: #35d07f;
  --yellow: #f4c95d;
  --cyan: #49c6ff;
  --shadow: 0 18px 50px rgba(0,0,0,.35);
}

html { background: var(--bg-deep); }
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% -10%, rgba(124,108,255,.11), transparent 30rem),
    radial-gradient(circle at 90% 0%, rgba(73,198,255,.055), transparent 25rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: .005em;
}

::selection { background: rgba(124,108,255,.35); color: #fff; }
* { scrollbar-width: thin; scrollbar-color: #343b4b transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #303746; border-radius: 99px; }
*::-webkit-scrollbar-thumb:hover { background: #414b5e; }

code {
  background: #0b0e14;
  border: 1px solid var(--line);
  color: #cdd3df;
  border-radius: 6px;
  padding: 2px 6px;
}

.muted { color: var(--muted); }
.spacer { flex: 1; }

/* Top navigation */
.top {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 64px;
  padding: 10px 18px;
  gap: 10px;
  background: rgba(9,11,16,.88);
  border-bottom: 1px solid rgba(255,255,255,.055);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 30px rgba(0,0,0,.22);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: #fff;
  margin-right: 8px;
}

.tabs {
  background: #0d1016;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  gap: 3px;
}

.tabs button {
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 7px 13px;
  transition: .18s ease;
}

.tabs button:hover { color: var(--text); background: rgba(255,255,255,.035); }
.tabs button.on {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #6759e9);
  box-shadow: 0 5px 18px rgba(124,108,255,.22);
}

.tabs.small { border-radius: 8px; }

.dest {
  position: sticky;
  top: 64px;
  z-index: 90;
  min-height: 58px;
  padding: 9px 18px;
  background: rgba(15,18,25,.92);
  border-bottom: 1px solid rgba(255,255,255,.05);
  backdrop-filter: blur(16px);
}

.dest select {
  background: #0c0f15;
  border-color: var(--line);
  border-radius: 8px;
  height: 38px;
}

.pill {
  background: var(--brand-soft);
  border: 1px solid rgba(124,108,255,.25);
  color: #c7c1ff;
  border-radius: 999px;
}

.cols {
  width: min(1480px, 100%);
  padding: 22px;
  gap: 20px;
}

@media (min-width:1000px) {
  .cols { grid-template-columns: minmax(0,1.08fr) minmax(420px,.92fr); }
  .right { top: 142px; max-height: calc(100vh - 160px); }
}

.card {
  background: linear-gradient(180deg, rgba(20,24,33,.98), rgba(15,18,25,.98));
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 17px;
  box-shadow: 0 10px 35px rgba(0,0,0,.16);
}

.card > h2, .card > .h {
  color: #a9b1c1;
  font-size: 11px;
  letter-spacing: .09em;
  margin-bottom: 13px;
}

/* Inputs */
input[type=text], input[type=url], input[type=password], input[type=number], textarea, select {
  background: #0b0e14;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 38px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

textarea { min-height: 78px; }
input:hover, textarea:hover, select:hover { border-color: var(--line-hover); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgba(124,108,255,.75);
  box-shadow: 0 0 0 3px rgba(124,108,255,.12);
  background: #0d1017;
}

.lbl { color: var(--muted); }
.chk { color: #9ba4b4; }

input[type=color] {
  border-radius: 8px;
  border-color: var(--line);
  background: #0b0e14;
}

/* Buttons */
button {
  border-radius: 8px;
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--brand), #6759e9);
  box-shadow: 0 5px 15px rgba(124,108,255,.12);
  transition: transform .12s ease, filter .12s ease, border-color .12s ease, background .12s ease;
}

button:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
button:active:not(:disabled) { transform: translateY(0); }

button.ghost, button.mini {
  background: #141923;
  border: 1px solid var(--line);
  color: #c9cfda;
  box-shadow: none;
}

button.ghost:hover:not(:disabled), button.mini:hover:not(:disabled) {
  background: #1a2030;
  border-color: var(--line-hover);
  color: #fff;
}

button.danger { background: transparent; box-shadow: none; }

.actions {
  gap: 7px;
}

/* Editor cards */
.etabs { margin-bottom: 14px; }
.etabs button {
  border-radius: 8px;
  background: #0d1016;
  border-color: var(--line);
}
.etabs button.on {
  background: var(--brand-soft);
  border-color: rgba(124,108,255,.4);
  color: #d8d4ff;
}

.item {
  background: #11151d;
  border-color: var(--line);
  border-radius: 10px;
  padding: 12px 13px 13px;
  box-shadow: inset 0 1px rgba(255,255,255,.015);
}

.item:hover { border-color: #303848; }
.item.container {
  background: #0f131b;
  border-left-color: var(--brand);
  box-shadow: inset 3px 0 rgba(124,108,255,.08);
}

.sub {
  background: #0b0e14;
  border-color: #222936;
  border-radius: 8px;
}

.addbar {
  padding-top: 3px;
}
.addbar span { color: var(--muted2); }

.palette {
  background: rgba(16,19,26,.97);
  border-bottom-color: var(--line);
  box-shadow: 0 12px 24px rgba(0,0,0,.22);
  border-radius: 10px 10px 0 0;
}

.pal-btn {
  background: #11151d;
  border-color: var(--line);
  border-radius: 8px;
}
.pal-btn:hover {
  background: var(--brand-soft);
  border-color: rgba(124,108,255,.4);
}

/* Code output */
pre {
  background: #080a0f;
  border-color: #202632;
  border-radius: 9px;
  color: #d7dbe4;
  box-shadow: inset 0 1px 8px rgba(0,0,0,.28);
}

/* Preview */
.discord {
  background:
    radial-gradient(circle at 20% 0%, rgba(124,108,255,.05), transparent 22rem),
    #0b0e13;
  border: 1px solid #202530;
  border-radius: 10px;
  padding: 18px;
}

.msg-head b { color: #f1f3f7; }
.msg-head .tag { background: #5865f2; }
.avatar { box-shadow: 0 0 0 2px #0b0e13, 0 0 0 3px #2b3140; }

.embed {
  background: #161a22;
  border-left-width: 4px;
  border-radius: 7px;
  box-shadow: 0 7px 24px rgba(0,0,0,.18);
}

.e-title { color: #f3f4f7; }
.e-field .n { color: #f0f2f5; }
.e-footer { color: #8f98a8; }

.v-cont {
  background: #161a22;
  border-left-color: #454c5b;
  box-shadow: 0 7px 24px rgba(0,0,0,.18);
}

.v-select, .v-file {
  background: #0c0f15;
  border-color: #252c38;
}

/* Dialogs */
dialog {
  background: #11151d;
  border-color: #303747;
  border-radius: 14px;
  box-shadow: 0 30px 90px rgba(0,0,0,.6);
}
dialog::backdrop {
  background: rgba(2,4,8,.78);
  backdrop-filter: blur(5px);
}
.dlg { padding: 20px; }
.dlg h3 { color: #fff; font-size: 18px; }

.lib-row, .ftile {
  background: #0d1118;
  border-color: var(--line);
  border-radius: 9px;
}
.lib-row:hover, .ftile:hover { border-color: #343c4d; }
.badge {
  background: #080b10;
  border: 1px solid #222936;
}

/* Toast */
.toast {
  bottom: 22px;
  background: #151a23;
  border-color: #333b4a;
  box-shadow: 0 15px 45px rgba(0,0,0,.5);
  border-radius: 10px;
}

/* Login */
.login-page {
  background:
    radial-gradient(circle at 50% 20%, rgba(124,108,255,.13), transparent 25rem),
    var(--bg-deep);
}

.login {
  width: min(420px, 92vw);
  padding: 28px;
  background: linear-gradient(180deg, #121620, #0d1016);
  border: 1px solid #2a3040;
  border-radius: 16px;
  box-shadow: 0 25px 80px rgba(0,0,0,.55);
}

.login h1 {
  font-size: 22px;
  letter-spacing: -.02em;
}

.btn-discord {
  border-radius: 9px;
  background: #5865f2;
  box-shadow: 0 8px 22px rgba(88,101,242,.22);
}
.btn-discord:hover { background: #6875f4; }

/* Files / emoji */
.fgrid, .egrid {
  background: #090c11;
  border: 1px solid #202632;
  border-radius: 9px;
}

.emo:hover {
  background: #171c26;
  border-color: #303847;
}

/* Small screens */
@media (max-width: 760px) {
  .top {
    position: relative;
    top: auto;
    padding: 10px 12px;
  }
  .dest {
    position: relative;
    top: auto;
    padding: 10px 12px;
  }
  .cols { padding: 12px; gap: 12px; }
  .card { padding: 13px; border-radius: 11px; }
  .top .tabs { order: 3; width: 100%; }
  .top .tabs button { flex: 1; }
  .brand { margin-right: 0; }
}

@media (max-width: 560px) {
  .top > button.ghost { padding: 7px 9px; font-size: 12px; }
  .who { max-width: 130px; }
  .dest select { flex: 1 1 100%; }
  .dest .spacer { display: none; }
  .dest button { flex: 1; }
}

/* Subtle entrance */
@keyframes rtFadeUp {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.cols > * { animation: rtFadeUp .25s ease both; }
.right { animation-delay: .035s; }


/* =========================================================
   RUMIC TOOLS — searchable dropdowns
   ========================================================= */
.rt-select {
  position: relative;
  min-width: 0;
  flex: 1 1 190px;
}
.rt-select > select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  inset: auto !important;
}
.rt-select-trigger {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #151923, #10131a);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.rt-select-trigger:hover,
.rt-select.open .rt-select-trigger {
  border-color: #4a5265;
  background: #171b25;
}
.rt-select.open .rt-select-trigger {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124,108,255,.12);
}
.rt-select-chevron {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 16px;
  transition: transform .15s ease;
}
.rt-select.open .rt-select-chevron { transform: rotate(180deg); }
.rt-select-panel {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 7px);
  left: 0;
  width: 100%;
  min-width: 220px;
  padding: 8px;
  background: #0e1118;
  border: 1px solid #303746;
  border-radius: 12px;
  box-shadow: 0 22px 55px rgba(0,0,0,.62);
  animation: rtDrop .13s ease both;
}
.rt-select-search {
  width: 100%;
  min-height: 38px;
  margin-bottom: 7px;
  padding: 8px 10px;
  border: 1px solid #303746;
  border-radius: 9px;
  background: #080a0f;
  color: var(--text);
  outline: none;
  box-sizing: border-box;
}
.rt-select-search:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124,108,255,.10);
}
.rt-select-options {
  max-height: 280px;
  overflow: auto;
  display: grid;
  gap: 3px;
}
.rt-select-option {
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.rt-select-option:hover,
.rt-select-option.selected {
  background: rgba(124,108,255,.13);
  color: #fff;
}
.rt-select-option.selected::after {
  content: '✓';
  float: right;
  color: var(--brand-hover);
}
.rt-select-option:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.rt-select-empty {
  padding: 14px 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
@keyframes rtDrop {
  from { opacity: 0; transform: translateY(-4px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Keep all destination controls and their dropdown panels above the floating preview. */
.dest { position: relative; z-index: 60; }
.dest .rt-select { position: relative; z-index: 61; }
.editor { position: relative; z-index: 30; }
.right { position: relative; z-index: 5; }

/* Destination bar: the two searchable dropdowns stay compact. */
.dest .rt-select { flex: 0 1 270px; }
.dest .rt-select-trigger { min-height: 38px; }

/* Login / start screen: centered titles and copy. */
.login-page .login {
  text-align: center;
}
.login-page .login h1,
.login-page .login .muted,
.login-page .login .or {
  text-align: center;
}
.login-page .login h1 {
  margin-left: auto;
  margin-right: auto;
}
.login-page .login form {
  text-align: center;
}
.login-page .login form input,
.login-page .login form button {
  width: 100%;
  box-sizing: border-box;
}
.login-page .login .status {
  text-align: center;
}

@media (max-width: 560px) {
  .dest .rt-select { flex: 1 1 100%; }
  .rt-select-panel { min-width: 0; }
}

/* =========================================================
   Rumic Tools — componentes minimizables
   ========================================================= */
.item .item-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.item .item-title > span:not(.badge) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.collapse-toggle {
  width: 24px;
  height: 24px;
  padding: 0 !important;
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  border-radius: 7px !important;
  color: var(--muted) !important;
  background: transparent !important;
  border-color: transparent !important;
  font-size: 15px !important;
}
.collapse-toggle:hover {
  color: var(--text) !important;
  background: var(--brand-soft) !important;
  border-color: var(--line) !important;
}
.item.is-collapsed {
  padding-bottom: 10px;
}
.item.is-collapsed .item-body {
  display: none;
}
.item.is-collapsed .tools {
  display: none;
}
.item.is-collapsed .head {
  min-height: 24px;
}

/* =========================================================
   Rumic Tools — selector de temas
   ========================================================= */
.theme-picker {
  position: relative;
  flex: 0 0 auto;
}
.theme-menu {
  position: absolute;
  z-index: 2000;
  right: 0;
  top: calc(100% + 8px);
  width: 190px;
  padding: 7px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 20px 50px rgba(0,0,0,.55);
}
.theme-menu-title {
  padding: 5px 8px 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.theme-menu button[data-theme-option] {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
}
.theme-menu button[data-theme-option]:hover,
.theme-menu button[data-theme-option].active {
  background: var(--brand-soft);
}
.theme-menu button[data-theme-option].active::after {
  content: '✓';
  color: var(--brand-hover);
}
.login-theme {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}

/* Tema gris inspirado en Discord: conserva el layout y reduce el contraste morado. */
body.theme-discord {
  --bg: #1e1f22;
  --bg-deep: #18191c;
  --panel: #2b2d31;
  --panel2: #313338;
  --panel3: #383a40;
  --line: #3f4147;
  --line-hover: #4e5058;
  --text: #dbdee1;
  --muted: #b5bac1;
  --muted2: #949ba4;
  --brand: #5865f2;
  --brand-hover: #7289da;
  --brand-soft: rgba(88,101,242,.16);
  --red: #ed4245;
  --green: #3ba55d;
  --yellow: #faa61a;
  --cyan: #00aff4;
  background: #1e1f22;
}
body.theme-discord .top,
body.theme-discord .dest {
  background: #2b2d31;
}
body.theme-discord .tabs,
body.theme-discord .etabs button,
body.theme-discord .item,
body.theme-discord .sub,
body.theme-discord .pal-btn,
body.theme-discord .rt-select-trigger,
body.theme-discord .theme-menu {
  background: #313338;
}
body.theme-discord .item.container,
body.theme-discord .card {
  background: #2b2d31;
}
body.theme-discord .item.container {
  box-shadow: inset 3px 0 rgba(88,101,242,.12);
}
body.theme-discord .palette {
  background: rgba(43,45,49,.97);
}
body.theme-discord .rt-select-panel {
  background: #2b2d31;
  border-color: #3f4147;
}
body.theme-discord .rt-select-search,
body.theme-discord input[type=text],
body.theme-discord input[type=url],
body.theme-discord input[type=password],
body.theme-discord input[type=number],
body.theme-discord textarea,
body.theme-discord select {
  background: #1e1f22;
  border-color: #3f4147;
}
body.theme-discord .rt-select-option:hover,
body.theme-discord .rt-select-option.selected,
body.theme-discord .theme-menu button[data-theme-option]:hover,
body.theme-discord .theme-menu button[data-theme-option].active {
  background: rgba(88,101,242,.18);
}
body.theme-discord pre {
  background: #1e1f22;
  border-color: #3f4147;
}
body.theme-discord .discord {
  background: #313338;
}
body.theme-discord .embed,
body.theme-discord .v-cont {
  background: #2b2d31;
}
body.theme-discord .v-select,
body.theme-discord .v-file {
  background: #1e1f22;
  border-color: #3f4147;
}
body.theme-discord .collapse-toggle:hover {
  background: rgba(88,101,242,.16) !important;
}

@media (max-width: 760px) {
  .theme-picker { order: 2; }
  .theme-menu { right: 0; }
}

/* =========================================================
   Rumic Tools — vista previa flotante
   ========================================================= */
.preview-dock {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1400;
  width: min(370px, calc(100vw - 40px));
  max-height: 285px;
  display: flex;
  flex-direction: column;
  background: rgba(13,16,23,.96);
  border: 1px solid #303747;
  border-radius: 14px;
  box-shadow: 0 22px 70px rgba(0,0,0,.58), 0 0 0 1px rgba(255,255,255,.02);
  backdrop-filter: blur(14px);
  overflow: hidden;
  transition: width .22s ease, max-height .22s ease, border-radius .22s ease, transform .22s ease, box-shadow .22s ease;
}
.preview-dock:hover {
  box-shadow: 0 25px 80px rgba(0,0,0,.66), 0 0 0 1px rgba(124,108,255,.08);
}
.preview-dock-head {
  min-height: 42px;
  padding: 8px 10px 8px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(18,22,31,.98);
  border-bottom: 1px solid #252c38;
  cursor: default;
}
.preview-dock-label {
  display: block;
  color: #aab2c2;
  font-size: 11px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: .09em;
}
.preview-dock-hint {
  display: block;
  margin-top: 2px;
  color: #697386;
  font-size: 10px;
}
.preview-dock-toggle {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 8px !important;
  font-size: 16px !important;
  line-height: 1 !important;
}
.preview-dock-body {
  padding: 10px;
  overflow: auto;
  overscroll-behavior: contain;
}
.preview-dock .discord {
  margin: 0;
  min-height: 110px;
}
.preview-dock .problems {
  margin: 8px 2px 0;
}

/* Ampliada: se convierte en un panel de lectura cómodo, sin ocupar toda la pantalla. */
.preview-dock.is-expanded {
  width: min(650px, calc(100vw - 40px));
  max-height: min(76vh, 720px);
  border-radius: 16px;
  box-shadow: 0 30px 100px rgba(0,0,0,.72), 0 0 0 1px rgba(124,108,255,.12);
}
.preview-dock.is-expanded .preview-dock-body {
  padding: 16px;
}
.preview-dock.is-expanded .discord {
  min-height: 170px;
}

body.theme-discord .preview-dock {
  background: rgba(43,45,49,.98);
  border-color: #4a4d54;
}
body.theme-discord .preview-dock-head {
  background: #313338;
  border-bottom-color: #3f4147;
}

@media (max-width: 760px) {
  .preview-dock {
    right: 12px;
    bottom: 12px;
    width: min(330px, calc(100vw - 24px));
    max-height: 245px;
  }
  .preview-dock.is-expanded {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    max-height: 78vh;
  }
  .preview-dock-body {
    padding: 8px;
  }
}

@media (max-width: 420px) {
  .preview-dock {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
  }
  .preview-dock.is-expanded {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
  }
}

/* =========================================================
   Rumic Tools — preview responsive tipo Dweeb
   PC: preview fijo a la izquierda + editor a la derecha.
   Móvil: miniatura cuadrada en esquina inferior derecha.
   ========================================================= */

@media (min-width: 901px) {
  /* Desktop: reserve a real left column so the preview can NEVER cover the editor. */
  .preview-dock {
    position: fixed;
    left: 18px;
    right: auto;
    top: 150px;
    bottom: 18px;
    width: min(520px, 34vw);
    max-height: none;
    border-radius: 16px;
    z-index: 40;
  }

  .preview-dock-head {
    cursor: default;
  }

  .preview-dock-hint,
  .preview-dock-toggle {
    display: none !important;
  }

  .preview-dock-body {
    flex: 1;
    min-height: 0;
    padding: 18px;
    overflow: auto;
  }

  .preview-dock .discord {
    min-height: 180px;
  }

  /* The editor/output occupy the right half of the desktop screen. */
  main.cols {
    margin-left: calc(min(520px, 34vw) + 36px);
    margin-right: 18px;
    width: calc(100% - min(520px, 34vw) - 54px);
    max-width: none;
    grid-template-columns: minmax(0, 1fr);
  }

  /* Output stays underneath the editor on the right side. */
  main.cols .right {
    min-width: 0;
  }

  /* If the preview was previously expanded, keep the desktop layout unchanged. */
  .preview-dock.is-expanded {
    left: 18px;
    right: auto;
    top: 150px;
    bottom: 18px;
    width: min(520px, 34vw);
    max-height: none;
    border-radius: 16px;
  }

  .preview-dock.is-expanded .preview-dock-body {
    padding: 18px;
  }
}

@media (max-width: 900px) {
  /* On phones/tablets the preview becomes a tiny floating thumbnail. */
  .preview-dock {
    right: 12px;
    left: auto;
    bottom: 12px;
    top: auto;
    width: 118px;
    height: 118px;
    max-height: 118px;
    border-radius: 13px;
    z-index: 1600;
  }

  .preview-dock-head {
    min-height: 28px;
    height: 28px;
    padding: 4px 6px 4px 8px;
  }

  .preview-dock-label {
    font-size: 8px;
  }

  .preview-dock-hint {
    display: none;
  }

  .preview-dock-toggle {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    font-size: 12px !important;
    border-radius: 6px !important;
  }

  .preview-dock-body {
    width: 118px;
    height: 90px;
    padding: 5px;
    overflow: hidden;
  }

  /* Scale the Discord message down into the thumbnail. */
  .preview-dock .discord {
    width: 300px;
    min-height: 220px;
    transform: scale(.35);
    transform-origin: top left;
  }

  .preview-dock .problems {
    display: none;
  }

  /* Expanded mobile preview returns to a readable panel. */
  .preview-dock.is-expanded {
    right: 10px;
    left: 10px;
    bottom: 10px;
    top: auto;
    width: auto;
    height: auto;
    max-height: 78vh;
    border-radius: 16px;
  }

  .preview-dock.is-expanded .preview-dock-head {
    min-height: 42px;
    height: auto;
    padding: 8px 10px 8px 13px;
  }

  .preview-dock.is-expanded .preview-dock-label {
    font-size: 11px;
  }

  .preview-dock.is-expanded .preview-dock-hint {
    display: block;
  }

  .preview-dock.is-expanded .preview-dock-body {
    width: auto;
    height: auto;
    padding: 10px;
    overflow: auto;
  }

  .preview-dock.is-expanded .discord {
    width: auto;
    min-height: 110px;
    transform: none;
  }

  .preview-dock.is-expanded .problems {
    display: block;
  }
}

/* =========================================================
   Rumic Tools 1259 — mejoras de escritorio únicamente.
   Las reglas de max-width existentes no se modifican.
   ========================================================= */
.lib-destination.card { margin: 0 0 12px; padding: 12px; }
.lib-row {
  display: grid;
  grid-template-columns: 22px 32px minmax(0,1fr) auto auto;
  align-items: center;
  gap: 8px;
}
.lib-order {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--panel2);
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}
.lib-order.on { background: var(--brand); color: #fff; }
.lib-row.is-selected {
  border-color: rgba(124,108,255,.42);
  background: rgba(124,108,255,.07);
}
.pal-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.pal-head .pal-top { flex:1 1 auto; margin-bottom:0; }
.pal-minimize {
  flex:0 0 30px; width:30px; height:30px; padding:0 !important;
  display:inline-grid; place-items:center; border-radius:8px !important;
  font-size:17px !important;
}
.palette.is-minimized { padding-bottom:8px; }
.palette.is-minimized .pal-top { margin-bottom:0; }

@media (min-width: 901px) {
  /* Solo escritorio: header y destino visibles mientras el editor se desplaza. */
  body > header.top {
    position: sticky;
    top: 0;
    z-index: 1100;
    background: rgba(9,12,18,.97);
    backdrop-filter: blur(12px);
  }
  body > .dest {
    position: sticky;
    top: 61px;
    z-index: 1050;
    box-shadow: 0 8px 20px rgba(0,0,0,.18);
  }
  main.cols {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    margin-left:calc(min(520px, 34vw) + 36px);
    margin-right:18px;
    width:calc(100% - min(520px, 34vw) - 54px);
    max-width:none;
    padding:16px 0 24px;
  }
  main.cols > .editor {
    min-height:0;
    max-height:calc(100vh - 150px);
    overflow:auto;
    overscroll-behavior:contain;
    scrollbar-gutter:stable;
    padding-right:4px;
    position:relative;
    z-index:70;
  }
  main.cols > .right {
    position:relative;
    z-index:5;
    min-height:0;
  }
  main.cols > .editor .palette {
    position:sticky;
    top:0;
    z-index:120;
  }
  .preview-dock {
    left:18px;
    right:auto;
    top:150px;
    bottom:18px;
    width:min(520px,34vw);
    max-height:none;
    z-index:40;
  }
  .dest,
  .dest .rt-select,
  .dest .rt-select-panel { z-index:1000; }
  .dest .rt-select-panel { position:absolute; }
}


/* =========================================================
   Rumic Tools 1261 — escritorio: barras realmente fijas + preview maximizable.
   IMPORTANTE: estas reglas solo aplican desde 901px; el layout móvil no se toca.
   ========================================================= */
@media (min-width: 901px) {
  :root {
    --rt-header-h: 64px;
    --rt-dest-h: 58px;
    --rt-preview-gap: 10px;
    --rt-preview-w: min(520px, 34vw);
  }

  body > header.top {
    position: sticky;
    top: 0;
    z-index: 1200;
  }

  body > .dest {
    position: sticky;
    top: var(--rt-header-h);
    z-index: 1100;
  }

  /* Solo el editor se desplaza; header, destino y preview permanecen visibles. */
  main.cols {
    margin-left: calc(var(--rt-preview-w) + 36px);
    margin-right: 18px;
    width: calc(100% - var(--rt-preview-w) - 54px);
    max-width: none;
    padding: 16px 0 24px;
    grid-template-columns: minmax(0, 1fr);
  }

  main.cols > .editor {
    max-height: calc(100vh - var(--rt-header-h) - var(--rt-dest-h) - 24px);
    overflow-y: auto;
    overflow-x: visible;
  }

  /* Preview fija a la izquierda, debajo de las barras superiores. */
  .preview-dock {
    left: 18px;
    right: auto;
    top: calc(var(--rt-header-h) + var(--rt-dest-h) + var(--rt-preview-gap));
    bottom: 18px;
    width: var(--rt-preview-w);
    max-height: none;
    z-index: 40;
  }

  /* El botón de maximizar SÍ es visible en PC. */
  .preview-dock-toggle {
    display: grid !important;
  }

  /* Maximizar = ampliar la columna izquierda, sin tapar el editor. */
  body.preview-expanded {
    --rt-preview-w: min(700px, 46vw);
  }

  body.preview-expanded .preview-dock,
  body.preview-expanded .preview-dock.is-expanded {
    left: 18px;
    right: auto;
    top: calc(var(--rt-header-h) + var(--rt-dest-h) + var(--rt-preview-gap));
    bottom: 18px;
    width: var(--rt-preview-w);
    max-height: none;
  }

  body.preview-expanded .preview-dock-body {
    padding: 18px;
  }

  /* Los menús de servidor/canal siempre quedan por encima de la preview. */
  .dest,
  .dest .rt-select,
  .dest .rt-select-panel {
    z-index: 1500;
  }
  .dest .rt-select-panel {
    position: absolute;
  }
}

/* 1262: el menú de componentes V2 permanece pegado al inicio del viewport de scroll del editor. */
@media (min-width: 901px) {
  main.cols > .editor {
    overflow-y: auto;
    overflow-x: hidden;
  }
  main.cols > .editor > .card {
    overflow: visible;
  }
  main.cols > .editor > .card > .palette {
    position: sticky !important;
    top: 0 !important;
    z-index: 300 !important;
  }
}

/* Inicio de sesión actualizado: Discord es la vía principal; la contraseña queda oculta tras un paso de prueba. */
.login-page .login { position:relative; }
.login-page .login h1 { font-size:24px; letter-spacing:-.02em; }
.login-description { line-height:1.5; font-size:12px; margin:0; }
.login-alt {
  border:1px solid var(--line);
  background:var(--panel2);
  color:var(--muted);
  border-radius:8px;
  padding:9px 12px;
  cursor:pointer;
}
.login-alt:hover { border-color:var(--brand); color:var(--text); background:var(--brand-soft); }
.password-gate {
  display:grid;
  gap:9px;
  padding-top:4px;
  border-top:1px solid var(--line);
  margin-top:2px;
}
.password-gate label { color:var(--muted); font-size:12px; }
.password-gate input { width:100%; }
.password-step { display:grid; gap:9px; margin-top:2px; }
.password-gate button:not(.login-alt) { width:100%; }

/* Biblioteca avanzada: búsqueda, filtros y acciones sin alterar el editor móvil. */
.lib-toolbar{display:grid;grid-template-columns:minmax(180px,1fr) auto auto;gap:9px;align-items:center;margin:0 0 10px;padding:10px 0}
.lib-toolbar input[type=search]{width:100%;border:1px solid var(--line);background:var(--panel2);color:var(--text);border-radius:8px;padding:9px 11px;outline:none}
.lib-toolbar input[type=search]:focus{border-color:var(--brand)}
.lib-filters,.lib-selection-tools{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.lib-filter{border:1px solid var(--line);background:var(--panel2);color:var(--muted);border-radius:8px;padding:8px 10px;cursor:pointer}
.lib-filter.active{background:rgba(119,85,255,.18);border-color:var(--brand);color:#fff}
.lib-selection-tools{justify-content:flex-end;color:var(--muted);font-size:11px}
.lib-selection-tools .small{padding:7px 9px;font-size:11px}
#btnLibAutomation:disabled{opacity:.45;cursor:not-allowed}
.lib-type-v2{border-color:#5b45d9!important;color:#bcaeff!important}
@media(max-width:760px){.lib-toolbar{grid-template-columns:1fr}.lib-selection-tools{justify-content:flex-start}.lib-filters{order:2}.lib-selection-tools{order:3}}
/* Temas globales del editor/login */
body.theme-light{background:#f3f5f8;color:#172033}body.theme-light .top,body.theme-light .dest,body.theme-light .card,body.theme-light .sub,body.theme-light .item.container{background:#fff;color:#172033;border-color:#dfe4ed}body.theme-light input,body.theme-light textarea,body.theme-light select{background:#f8f9fb;color:#172033;border-color:#d4dae5}body.theme-light .muted{color:#667085}
body.theme-midnight{background:#050b14;color:#edf6ff}body.theme-midnight .top,body.theme-midnight .dest,body.theme-midnight .card,body.theme-midnight .sub,body.theme-midnight .item.container{background:#0b1728;color:#edf6ff;border-color:#1b3853}body.theme-midnight input,body.theme-midnight textarea,body.theme-midnight select{background:#091625;color:#edf6ff;border-color:#24425d}
body.theme-emerald{background:#040a08;color:#ecfff8}body.theme-emerald .top,body.theme-emerald .dest,body.theme-emerald .card,body.theme-emerald .sub,body.theme-emerald .item.container{background:#0b1d18;color:#ecfff8;border-color:#1d4036}body.theme-emerald input,body.theme-emerald textarea,body.theme-emerald select{background:#081713;color:#ecfff8;border-color:#245044}body.theme-emerald button:not(.ghost){background:#138b67}

/* La contraseña es una vía secundaria: visible como botón, formulario oculto hasta activarlo. */
.login-page #btnPasswordAccess { display:block; width:100%; box-sizing:border-box; font-size:14px; font-weight:700; min-height:44px; }
.login-page #passwordGate[hidden], .login-page #passwordStep[hidden] { display:none !important; }
.login-page #passwordGate:not([hidden]) { display:grid; }


/* 1280 — branding unificado mediante /sources/icon.png. */
.brand-image{width:30px;height:30px;display:block;flex:none;object-fit:contain;border-radius:7px}.brand-link{display:inline-flex;align-items:center;gap:9px}
.login-brand{display:flex;align-items:center;justify-content:center;gap:10px;margin:0 0 18px}.login-brand .brand-image{width:48px;height:48px;border-radius:12px}.login-brand span{font-weight:800;font-size:22px}
.button-link { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; }
.attached-components { display:grid; gap:6px; margin:10px 0; }
.attached-row { display:flex; align-items:center; gap:10px; padding:8px 10px; background:var(--bg); border:1px solid var(--line); border-radius:6px; }
.attached-row > span:last-child { overflow:hidden; text-overflow:ellipsis; }
/* Biblioteca de componentes reutilizables */
.component-choice{display:grid;grid-template-columns:38px minmax(120px,1fr) minmax(100px,180px) auto;align-items:center;gap:10px;padding:10px 12px;min-height:62px}.component-choice-icon{width:34px;height:34px;border-radius:9px;background:#252050;color:#a895ff;display:grid;place-items:center;font-size:16px}.component-choice .name{display:grid;gap:2px}.component-choice .name strong{font-size:13px}.component-choice .name small{color:var(--muted);font-size:10px}.component-choice.legacy{opacity:.75}.attached-library-preview{min-width:0;overflow:hidden}.attached-library-preview .v-btn{margin:0;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.attached-library-preview .v-select{margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mini-add{padding:7px 11px;font-size:11px}.attached-row{justify-content:flex-start}.attached-row .attached-remove{margin-left:auto;flex:none}@media(max-width:640px){.component-choice{grid-template-columns:34px 1fr auto}.component-choice .attached-library-preview{grid-column:2 / -1}.component-choice .mini-add{grid-column:3;grid-row:1}.component-choice.legacy .attached-library-preview{display:none}}

/* Biblioteca dentro del editor: destino canal/hilo e IDs reutilizables. */
.lib-destination-choice{display:flex;align-items:center;gap:10px;min-height:40px}.lib-destination-choice label{display:inline-flex!important;flex-direction:row!important;align-items:center;gap:6px!important;cursor:pointer;color:var(--text)}.lib-destination-choice input{accent-color:var(--brand,#7755ff);margin:0}.lib-id{display:block;color:var(--muted);font-size:10px;margin-top:3px}.lib-id code,.library-id code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:#a99cff}.lib-row .name{min-width:0;display:block}.lib-row .name strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.lib-row .name small{display:block}.lib-destination #libChannel:disabled{opacity:.6;cursor:not-allowed}@media(max-width:720px){.lib-destination .row{display:grid;grid-template-columns:1fr!important}.lib-destination-choice{min-height:38px}.lib-row{grid-template-columns:22px 32px minmax(0,1fr) auto auto auto!important}.lib-row .ghost.small{grid-column:3}}

/* ======================================================================
   Rumic Tools v25 — editor/contructor: temas autónomos
   ====================================================================== */
body.theme-light{
  --bg:#f3f5f8;--bg-deep:#fff;--panel:#fff;--panel2:#f8f9fb;--panel3:#eef1f6;
  --line:#d8deea;--line-hover:#cfd6e3;--text:#172033;--muted:#667085;--muted2:#7b8495;
  --brand:#6366f1;--brand-hover:#4f46e5;--brand-soft:rgba(99,102,241,.12);
}
body.theme-midnight{
  --bg:#050b14;--bg-deep:#040913;--panel:#0b1728;--panel2:#0d1c2f;--panel3:#10223a;
  --line:#1b3853;--line-hover:#24425d;--text:#edf6ff;--muted:#91a6bd;--muted2:#728ba5;
  --brand:#3d82d9;--brand-hover:#55a7ff;--brand-soft:rgba(61,130,217,.14);
}
body.theme-emerald{
  --bg:#040a08;--bg-deep:#030706;--panel:#0b1d18;--panel2:#0d241e;--panel3:#0f2a23;
  --line:#1d4036;--line-hover:#245044;--text:#ecfff8;--muted:#8fb7a9;--muted2:#6f9f90;
  --brand:#159b70;--brand-hover:#2fc596;--brand-soft:rgba(21,155,112,.14);
}
body.theme-light .top,body.theme-light .dest,body.theme-light .card,body.theme-light .dlg,body.theme-light .lib-destination,body.theme-light .theme-menu,body.theme-light .preview-dock{background:#fff!important;color:#172033!important;border-color:#d8deea!important}
body.theme-light .tabs,body.theme-light .etabs button,body.theme-light .item,body.theme-light .sub,body.theme-light .lib-row,body.theme-light .pal-btn,body.theme-light .rt-select-trigger{background:#f8f9fb!important;color:#172033!important;border-color:#d8deea!important}
body.theme-light .item.container{background:#fff!important;border-color:#d8deea!important}
body.theme-light .palette,body.theme-light .rt-select-panel,body.theme-light .lib-toolbar,body.theme-light .fgrid,body.theme-light .emoji-free{background:#f8f9fb!important;border-color:#d8deea!important}
body.theme-light input[type=text],body.theme-light input[type=url],body.theme-light input[type=password],body.theme-light input[type=number],body.theme-light textarea,body.theme-light select,body.theme-light .rt-select-search{background:#fff!important;color:#172033!important;border-color:#cfd6e3!important}
body.theme-light code,body.theme-light pre{background:#f1f4f8!important;color:#253047!important;border-color:#d8deea!important}
body.theme-light .brand,body.theme-light .who,body.theme-light .muted,body.theme-light .lbl,body.theme-light .autosave,body.theme-light .preview-dock-hint,body.theme-light .preview-dock-label{color:#667085!important}
body.theme-light .tabs button,body.theme-light .etabs button{color:#667085!important}
body.theme-light .tabs button.on,body.theme-light .etabs button.on{background:#6366f1!important;color:#fff!important;border-color:#6366f1!important}
body.theme-light .top .ghost,body.theme-light .dest .ghost,body.theme-light .btn-discord,body.theme-light .preview-dock-toggle{background:#f8f9fb!important;color:#172033!important;border-color:#d8deea!important}
body.theme-light .btn-discord{background:#5865f2!important;color:#fff!important;border-color:#5865f2!important}
body.theme-light .v-select,body.theme-light .v-file{background:#fff!important;color:#344054!important;border-color:#d8deea!important}
body.theme-light .action{background:#eef1f6!important;border-color:#d8deea!important}
body.theme-light .preview-dock-head{background:#f8f9fb!important;border-color:#d8deea!important}

body.theme-midnight .top,body.theme-midnight .dest,body.theme-midnight .card,body.theme-midnight .dlg,body.theme-midnight .lib-destination,body.theme-midnight .theme-menu,body.theme-midnight .preview-dock{background:#0b1728!important;color:#edf6ff!important;border-color:#1b3853!important}
body.theme-midnight .tabs,body.theme-midnight .etabs button,body.theme-midnight .item,body.theme-midnight .sub,body.theme-midnight .lib-row,body.theme-midnight .pal-btn,body.theme-midnight .rt-select-trigger{background:#0d1c2f!important;color:#edf6ff!important;border-color:#24425d!important}
body.theme-midnight .item.container{background:#0b1728!important;border-color:#1b3853!important}
body.theme-midnight .palette,body.theme-midnight .rt-select-panel,body.theme-midnight .lib-toolbar,body.theme-midnight .fgrid,body.theme-midnight .emoji-free{background:#0d1c2f!important;border-color:#24425d!important}
body.theme-midnight input[type=text],body.theme-midnight input[type=url],body.theme-midnight input[type=password],body.theme-midnight input[type=number],body.theme-midnight textarea,body.theme-midnight select,body.theme-midnight .rt-select-search{background:#091625!important;color:#edf6ff!important;border-color:#24425d!important}
body.theme-midnight code,body.theme-midnight pre{background:#091625!important;color:#dcecff!important;border-color:#1b3853!important}
body.theme-midnight .brand,body.theme-midnight .who,body.theme-midnight .muted,body.theme-midnight .lbl,body.theme-midnight .autosave,body.theme-midnight .preview-dock-hint,body.theme-midnight .preview-dock-label{color:#91a6bd!important}
body.theme-midnight .tabs button,body.theme-midnight .etabs button{color:#91a6bd!important}
body.theme-midnight .tabs button.on,body.theme-midnight .etabs button.on{background:#3d82d9!important;color:#fff!important;border-color:#3d82d9!important}
body.theme-midnight .v-select,body.theme-midnight .v-file{background:#091625!important;color:#dcecff!important;border-color:#24425d!important}
body.theme-midnight .action{background:#10223a!important;border-color:#24425d!important}
body.theme-midnight .preview-dock-head{background:#0d1c2f!important;border-color:#1b3853!important}

body.theme-emerald .top,body.theme-emerald .dest,body.theme-emerald .card,body.theme-emerald .dlg,body.theme-emerald .lib-destination,body.theme-emerald .theme-menu,body.theme-emerald .preview-dock{background:#0b1d18!important;color:#ecfff8!important;border-color:#1d4036!important}
body.theme-emerald .tabs,body.theme-emerald .etabs button,body.theme-emerald .item,body.theme-emerald .sub,body.theme-emerald .lib-row,body.theme-emerald .pal-btn,body.theme-emerald .rt-select-trigger{background:#0d241e!important;color:#ecfff8!important;border-color:#245044!important}
body.theme-emerald .item.container{background:#0b1d18!important;border-color:#1d4036!important}
body.theme-emerald .palette,body.theme-emerald .rt-select-panel,body.theme-emerald .lib-toolbar,body.theme-emerald .fgrid,body.theme-emerald .emoji-free{background:#0d241e!important;border-color:#245044!important}
body.theme-emerald input[type=text],body.theme-emerald input[type=url],body.theme-emerald input[type=password],body.theme-emerald input[type=number],body.theme-emerald textarea,body.theme-emerald select,body.theme-emerald .rt-select-search{background:#081713!important;color:#ecfff8!important;border-color:#245044!important}
body.theme-emerald code,body.theme-emerald pre{background:#081713!important;color:#d9fff1!important;border-color:#1d4036!important}
body.theme-emerald .brand,body.theme-emerald .who,body.theme-emerald .muted,body.theme-emerald .lbl,body.theme-emerald .autosave,body.theme-emerald .preview-dock-hint,body.theme-emerald .preview-dock-label{color:#8fb7a9!important}
body.theme-emerald .tabs button,body.theme-emerald .etabs button{color:#8fb7a9!important}
body.theme-emerald .tabs button.on,body.theme-emerald .etabs button.on{background:#159b70!important;color:#fff!important;border-color:#159b70!important}
body.theme-emerald .v-select,body.theme-emerald .v-file{background:#081713!important;color:#d9fff1!important;border-color:#245044!important}
body.theme-emerald .action{background:#0f2a23!important;border-color:#245044!important}
body.theme-emerald .preview-dock-head{background:#0d241e!important;border-color:#1d4036!important}

/* Previsualizaciones: la interfaz del editor cambia, el contenido de Discord conserva contraste propio. */
body.theme-light .discord{background:#eef1f6!important;color:#172033!important}
body.theme-light .embed,body.theme-light .v-cont{background:#fff!important;color:#172033!important;border-left-color:#6366f1!important}
body.theme-light .msg-head b,body.theme-light .e-title,body.theme-light .e-author,body.theme-light .e-field .n,body.theme-light .discord .h1,body.theme-light .discord .h2,body.theme-light .discord .h3{color:#172033!important}
body.theme-light .msg-content,body.theme-light .e-desc,body.theme-light .e-field .v{color:#344054!important}
body.theme-light .discord a,body.theme-light .e-title a{color:#4f46e5!important}

/* Selector discreto de menciones para el texto que precede al embed o a componentes V2. */
.mention-tools{display:grid;gap:10px;min-width:0;margin:0 0 14px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--panel2)}
.mention-tools-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;flex-wrap:wrap}
.mention-tools-heading strong{font-size:13px;color:var(--text)}
.mention-tools-heading span,.mention-hint{font-size:11px;line-height:1.45;color:var(--muted)}
.mention-hint{margin:0}
.mention-quick{display:flex;gap:7px;flex-wrap:wrap}
.mention-chip,.mention-action{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:7px 11px;border:1px solid var(--line);border-radius:9px;background:var(--panel);color:var(--text);font:inherit;font-size:12px;cursor:pointer}
.mention-chip{font-weight:700;background:var(--brand-soft);border-color:var(--brand);color:var(--text)}
.mention-action{white-space:nowrap}
.mention-chip:hover,.mention-action:hover,.mention-result:hover{border-color:var(--brand)}
.mention-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;min-width:0}
.mention-row>select,.mention-row>.rt-select,.mention-search{box-sizing:border-box;width:100%;min-width:0}
.mention-search{min-height:38px;border:1px solid var(--line);border-radius:9px;background:var(--panel);color:var(--text);padding:8px 10px;font:inherit;font-size:13px;outline:none}
.mention-search:focus{border-color:var(--brand)}
.mention-results{display:grid;gap:5px;max-height:190px;overflow:auto;min-width:0}
.mention-result{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;min-width:0;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--text);text-align:left;cursor:pointer}
.mention-result-name{min-width:0;overflow-wrap:anywhere;font-size:12px;font-weight:600}
.mention-result small{flex:none;color:var(--muted);font-size:10px;overflow-wrap:anywhere;text-align:right;max-width:55%}
.mention-error{font-size:12px;line-height:1.4;color:#ff8993;overflow-wrap:anywhere}
.mention-tools select{border:1px solid var(--line);border-radius:9px;background:var(--panel);color:var(--text);padding:8px;min-height:38px}
.mention-tools .rt-select{min-width:0;width:100%}
.mention-tools .rt-select-trigger{width:100%;min-width:0;min-height:38px;padding:7px 10px;font-size:12px}
@media(max-width:560px){.mention-row{grid-template-columns:minmax(0,1fr)}.mention-action{width:100%}.mention-result{align-items:flex-start;flex-direction:column;gap:3px}.mention-result small{max-width:100%;text-align:left}.mention-tools{padding:10px}.mention-tools-heading{display:grid;gap:3px}}


/* Ajuste visual del encabezado de inicio de sesión. */
.login-page .login-brand {
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  margin: 0 0 10px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--line, #2a3040);
  box-sizing: border-box;
}
.login-page .login-brand .brand-image { width: 54px; height: 54px; }
.login-page .login-brand span { font-size: 25px; line-height: 1.15; }
.login-page .login > .btn-discord { margin-top: 2px; }
@media (max-width: 480px) {
  .login-page .login { padding: 24px 22px; }
  .login-page .login-brand { min-height: 68px; padding-bottom: 20px; margin-bottom: 10px; }
  .login-page .login-brand .brand-image { width: 52px; height: 52px; }
  .login-page .login-brand span { font-size: 24px; }
}
