/* ============ Calendario ============ */
/* switch de calendario (Contenido / Personal) */
.cal-switch{margin-bottom:16px}
.cal-seg{display:inline-flex;background:var(--surface-inset);border-radius:12px;padding:4px;gap:3px}
.cal-seg button{height:34px;padding:0 16px;border:0;background:transparent;color:var(--text-2);
  font:600 13px var(--font-body);border-radius:9px;cursor:pointer;transition:.15s;
  display:inline-flex;align-items:center;gap:8px}
.cal-seg button:hover{color:var(--text)}
.cal-seg button.on{background:var(--surface);color:var(--text);box-shadow:var(--shadow-sm)}
[data-theme="dark"] .cal-seg button.on{background:var(--surface-2)}
.cal-seg .cs-dot{width:9px;height:9px;border-radius:3px;flex:0 0 9px}

.cal{display:grid;grid-template-columns:minmax(0,1fr) 322px;gap:var(--gap);align-items:start}
.cal>div{min-width:0}

/* toolbar */
.cal-bar{display:flex;align-items:center;gap:12px;margin-bottom:18px;flex-wrap:wrap}
.cal-bar .month{font-family:var(--font-head);font-size:21px;font-weight:600;letter-spacing:-.01em;
  min-width:158px}
.navg{display:flex;gap:4px}
.navg button{width:34px;height:34px;border-radius:10px;border:1px solid var(--border);background:var(--surface);
  color:var(--text-2);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:.15s}
.navg button:hover{background:var(--surface-inset);color:var(--text)}
.navg button:active{transform:scale(.94)}
.navg button svg{width:18px;height:18px}
.btn{height:36px;padding:0 14px;border-radius:11px;font:600 13px var(--font-body);cursor:pointer;
  display:inline-flex;align-items:center;gap:7px;border:1px solid var(--border);background:var(--surface);
  color:var(--text);transition:.15s;white-space:nowrap}
.btn:hover{background:var(--surface-inset)}
.btn:active{transform:scale(.97)}
.btn svg{width:16px;height:16px}
.btn.primary{background:var(--accent);border-color:transparent;color:var(--on-accent);box-shadow:var(--shadow-sm)}
.btn.primary:hover{opacity:.86}
.grow{flex:1}

/* segmented */
.seg{display:flex;background:var(--surface-inset);border-radius:11px;padding:3px;gap:2px}
.seg button{height:30px;padding:0 14px;border:0;background:transparent;color:var(--text-2);
  font:600 13px var(--font-body);border-radius:8px;cursor:pointer;transition:.15s}
.seg button:hover{color:var(--text)}
.seg button.on{background:var(--surface);color:var(--text);box-shadow:var(--shadow-sm)}
[data-theme="dark"] .seg button.on{background:var(--surface-2)}

/* filter chips */
.filters{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:16px}
.filters .lbl{font-size:12px;color:var(--text-3);font-weight:600;margin-right:2px}
.fchip{display:inline-flex;align-items:center;gap:7px;height:30px;padding:0 12px;border-radius:999px;
  border:1px solid var(--border);background:var(--surface);color:var(--text-2);font:600 12.5px var(--font-body);
  cursor:pointer;transition:.15s;user-select:none}
.fchip .tag{width:8px;height:8px;border-radius:3px}
.fchip:hover{border-color:var(--border-2)}
.fchip.off{opacity:.42}
.fchip.off .tag{filter:grayscale(1)}

/* month grid (cuadrado original) */
.cal-grid{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);
  overflow:hidden;box-shadow:var(--shadow-sm)}
.cal-dow{display:grid;grid-template-columns:repeat(7,1fr);border-bottom:1px solid var(--border)}
.cal-dow div{padding:11px 12px;font-size:11px;letter-spacing:.06em;text-transform:uppercase;
  color:var(--text-3);font-weight:600}
.cal-dow div:nth-child(n+6){color:color-mix(in srgb,var(--accent) 60%,var(--text-3))}
.cal-rows{display:grid;grid-template-columns:repeat(7,1fr)}
.cal-rows .cell{min-height:118px;border-right:1px solid var(--border);border-bottom:1px solid var(--border);
  padding:7px 7px 9px;display:flex;flex-direction:column;gap:4px;cursor:pointer;position:relative;
  transition:background .14s;min-width:0;overflow:hidden}
.cal-rows .cell:nth-child(7n){border-right:0}
.cal-rows .cell:hover{background:var(--surface-2)}
.cal-rows .cell.weekend{background:color-mix(in srgb,var(--bg) 55%,transparent)}
.cal-rows .cell.weekend:hover{background:var(--surface-2)}
.cal-rows .cell.out{background:var(--surface-2);cursor:default;opacity:.55}
.cal-rows .cell.out:hover{background:var(--surface-2)}
.cal-rows .cell.selected{box-shadow:inset 0 0 0 2px var(--accent);z-index:1}
.cell-h{display:flex;align-items:center;justify-content:space-between;margin-bottom:2px}
.cell-rt{display:flex;align-items:center;gap:5px}
.cell-add{width:20px;height:20px;border-radius:6px;border:1px solid var(--border-2);background:var(--surface);
  color:var(--text-3);display:flex;align-items:center;justify-content:center;cursor:pointer;opacity:0;
  transition:.14s;flex:0 0 auto}
.cell-add svg{width:13px;height:13px}
.cell:hover .cell-add,.wcol:hover .cell-add,.wcol-h:hover .cell-add{opacity:1}
.cell-add:hover{color:var(--accent);border-color:var(--accent)}
.cnum{font-family:var(--font-head);font-size:13px;font-weight:600;color:var(--text-2);
  width:26px;height:24px;display:flex;align-items:center;justify-content:center}
.cal-rows .cell.today .cnum{background:var(--accent);color:var(--on-accent);border-radius:8px}
.rec-dot{display:inline-flex;align-items:center;gap:4px;font-size:10px;font-weight:700;color:var(--warn);
  background:var(--warn-soft);padding:2px 6px;border-radius:6px}
.rec-dot svg{width:11px;height:11px}

.ev{display:flex;align-items:center;gap:6px;padding:3px 7px;border-radius:7px;font-size:11px;font-weight:500;
  background:var(--surface-inset);border:1px solid var(--border);color:var(--text);line-height:1.25;
  white-space:nowrap;overflow:hidden}
[data-theme="dark"] .ev{background:var(--surface-2)}
.ev .tag{width:6px;height:6px;border-radius:2px;flex:0 0 6px}
.ev .ev-t{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}
.ev.pub{opacity:.5}
.ev.pub .tag{filter:grayscale(.3)}
.ev.rec{background:var(--warn-soft);border-color:transparent;color:var(--warn);font-weight:600}
.ev.yt{font-weight:600}
.more{font-size:10.5px;color:var(--text-3);font-weight:600;padding:1px 7px;cursor:pointer}
.more:hover{color:var(--accent)}

/* week view */
.cal-week{display:grid;grid-template-columns:repeat(7,1fr);gap:10px}
.wcol{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md);
  box-shadow:var(--shadow-sm);overflow:hidden;display:flex;flex-direction:column;min-height:360px}
.wcol-h{padding:10px 12px;border-bottom:1px solid var(--border);display:flex;align-items:center;
  justify-content:space-between;gap:6px;cursor:pointer}
.wcol-hd{display:flex;flex-direction:column;gap:1px;min-width:0}
.wcol-h.today{background:var(--accent-soft)}
.wcol-h .dow{font-size:10px;text-transform:uppercase;letter-spacing:.06em;color:var(--text-3);font-weight:700}
.wcol-h .num{font-family:var(--font-head);font-size:17px;font-weight:600}
.wcol-h.today .num{color:var(--accent)}
.wcol-b{padding:8px;display:flex;flex-direction:column;gap:6px;flex:1}
.wev{padding:7px 8px;border-radius:9px;background:var(--surface-inset);border:1px solid var(--border);
  display:flex;flex-direction:column;gap:3px}
[data-theme="dark"] .wev{background:var(--surface-2)}
.wev.rec{background:var(--warn-soft);border-color:transparent}
.wev .wev-top{display:flex;align-items:center;gap:6px;font-size:10.5px;color:var(--text-3);font-weight:600}
.wev .wev-top .tag{width:7px;height:7px;border-radius:2px}
.wev .wev-t{font-size:12px;font-weight:500;line-height:1.3;text-wrap:pretty}
.wev.pub{opacity:.55}

/* agenda view */
.agenda{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);
  box-shadow:var(--shadow-sm);overflow:hidden}
.ag-day{display:grid;grid-template-columns:128px 1fr;border-bottom:1px solid var(--border)}
.ag-day:last-child{border-bottom:0}
.ag-date{padding:18px 20px;border-right:1px solid var(--border)}
.ag-date.today{background:var(--accent-soft)}
.ag-date .big{font-family:var(--font-head);font-size:26px;font-weight:600;line-height:1}
.ag-date.today .big{color:var(--accent)}
.ag-date .sm{font-size:12px;color:var(--text-3);font-weight:600;text-transform:capitalize;margin-top:3px}
.ag-list{padding:12px 16px;display:flex;flex-direction:column}
.ag-row{display:flex;align-items:center;gap:12px;padding:9px 4px;border-bottom:1px solid var(--border)}
.ag-row:last-child{border-bottom:0}
.ag-time{font-size:12px;font-weight:600;color:var(--text-3);width:48px;font-variant-numeric:tabular-nums}
.ag-row .tag{width:8px;height:8px;border-radius:3px;flex:0 0 8px}
.ag-row .ag-t{flex:1;font-size:13.5px;font-weight:500}
.ag-empty{padding:14px 4px;font-size:13px;color:var(--text-3)}

/* right rail */
.cal-rail{display:flex;flex-direction:column;gap:var(--gap);position:sticky;top:0}
.rail-card{padding:18px}
.rail-h{display:flex;align-items:center;gap:8px;margin-bottom:14px}
.rail-h h3{font-size:14px;font-family:var(--font-head)}
.rail-h .date-pill{margin-left:auto;font-size:11px;font-weight:600;color:var(--accent);
  background:var(--accent-soft);padding:3px 9px;border-radius:999px}
.summary{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.sm-stat{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r-sm);
  padding:12px 10px;display:flex;flex-direction:column;gap:3px}
[data-theme="dark"] .sm-stat{background:var(--surface-inset)}
.sm-stat .v{font-family:var(--font-head);font-size:22px;font-weight:600;line-height:1}
.sm-stat .k{font-size:10.5px;color:var(--text-3);font-weight:600;line-height:1.2}
.sm-stat .tag{width:8px;height:8px;border-radius:3px}

.day-detail{display:flex;flex-direction:column;gap:9px}
.dd-row{display:flex;gap:11px;align-items:flex-start;padding:10px;border-radius:11px;background:var(--surface-2);
  border:1px solid var(--border)}
[data-theme="dark"] .dd-row{background:var(--surface-inset)}
.dd-row.rec{background:var(--warn-soft);border-color:transparent}
.dd-time{font-size:11.5px;font-weight:700;color:var(--text-3);width:42px;flex:0 0 42px;
  font-variant-numeric:tabular-nums;padding-top:1px}
.dd-body{flex:1;min-width:0}
.dd-body .pl{display:flex;align-items:center;gap:6px;font-size:10.5px;color:var(--text-3);font-weight:700;
  text-transform:uppercase;letter-spacing:.03em;margin-bottom:2px}
.dd-body .pl .tag{width:7px;height:7px;border-radius:2px}
.dd-body .tt{font-size:13px;font-weight:500;line-height:1.35;text-wrap:pretty}
.dd-status{font-size:10.5px;font-weight:700;padding:2px 7px;border-radius:6px;white-space:nowrap;height:fit-content}
.dd-status.pub{color:var(--ok);background:var(--ok-soft)}
.dd-status.prog{color:var(--accent);background:var(--accent-soft)}
.dd-status.draft{color:var(--text-2);background:var(--idle-soft)}
.dd-empty{text-align:center;padding:18px 8px;color:var(--text-3);font-size:13px}
.add-piece{margin-top:4px;width:100%;justify-content:center}

.rec-list{display:flex;flex-direction:column;gap:8px}
.rec-item{display:flex;align-items:center;gap:11px;padding:10px;border-radius:11px;background:var(--surface-2);
  border:1px solid var(--border)}
[data-theme="dark"] .rec-item{background:var(--surface-inset)}
.rec-cal{width:42px;height:42px;border-radius:11px;background:var(--warn-soft);color:var(--warn);
  display:flex;flex-direction:column;align-items:center;justify-content:center;flex:0 0 42px;line-height:1}
.rec-cal .d{font-family:var(--font-head);font-size:16px;font-weight:700}
.rec-cal .m{font-size:8.5px;font-weight:700;text-transform:uppercase}
.rec-item .info{flex:1;min-width:0}
.rec-item .info .a{font-size:13px;font-weight:600}
.rec-item .info .b{font-size:11.5px;color:var(--text-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rec-item{cursor:pointer;transition:.14s}
.rec-item:hover{border-color:var(--border-2)}

/* status dinámico (color desde config) */
.dd-status{font-size:10.5px;font-weight:700;padding:2px 7px;border-radius:6px;white-space:nowrap;height:fit-content;
  color:var(--text-2);background:var(--idle-soft)}
.ev,.wev,.dd-row,.ag-row{cursor:pointer}
.ag-row{transition:.12s}.ag-row:hover{background:var(--surface-2)}
.rail-sub{font-size:12px;color:var(--text-3);font-weight:600;margin:-8px 0 12px}
.pl-mini{font-size:11px;color:var(--text-3);margin-top:3px}
.dd-row{transition:.14s}.dd-row:hover{border-color:var(--border-2)}

/* loading / empty */
.cal-loading{padding:60px;text-align:center;color:var(--text-3);font-size:14px}
.cal-empty{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);
  box-shadow:var(--shadow-sm);padding:56px 24px;text-align:center;display:flex;flex-direction:column;
  align-items:center;gap:6px}
.cal-empty .ce-ic{width:54px;height:54px;border-radius:16px;background:var(--surface-inset);color:var(--text-3);
  display:flex;align-items:center;justify-content:center;margin-bottom:8px}
.cal-empty .ce-ic svg{width:26px;height:26px}
.cal-empty h3{font-family:var(--font-head);font-size:16px;font-weight:600}
.cal-empty p{font-size:13px;color:var(--text-3);max-width:320px;line-height:1.5;margin-bottom:8px}

.wcol-add{margin:auto;width:30px;height:30px;border-radius:9px;border:1px dashed var(--border-2);
  background:transparent;color:var(--text-3);display:flex;align-items:center;justify-content:center;
  cursor:pointer;opacity:0;transition:.15s}
.wcol-add svg{width:15px;height:15px}
.wcol:hover .wcol-add{opacity:1}
.wcol-add:hover{color:var(--accent);border-color:var(--accent)}

.btn.danger{color:var(--warn);border-color:transparent;background:var(--warn-soft)}
.btn.danger:hover{background:color-mix(in srgb,var(--warn) 22%,transparent)}
.btn:disabled{opacity:.5;cursor:default}

/* ============ side-peek (panel estilo Notion) ============ */
.peek-scrim{position:fixed;inset:0;background:rgba(17,24,39,.42);z-index:90;
  animation:peekFade .18s ease-out}
[data-theme="dark"] .peek-scrim{background:rgba(0,0,0,.58)}
.peek{position:fixed;top:0;right:0;bottom:0;width:min(460px,94vw);background:var(--surface);
  border-left:1px solid var(--border);box-shadow:var(--shadow-lg);z-index:91;display:flex;flex-direction:column;
  animation:peekIn .22s cubic-bezier(.22,1,.36,1)}
@keyframes peekFade{from{opacity:0}to{opacity:1}}
@keyframes peekIn{from{transform:translateX(24px);opacity:.4}to{transform:translateX(0);opacity:1}}
@media (prefers-reduced-motion:reduce){.peek,.peek-scrim{animation:none}}

.peek-h{display:flex;align-items:center;justify-content:space-between;padding:16px 18px;border-bottom:1px solid var(--border)}
.peek-tag{font:700 11px var(--font-body);text-transform:uppercase;letter-spacing:.06em;color:var(--text-3)}
.peek-x{width:32px;height:32px;border-radius:9px;border:1px solid var(--border);background:var(--surface);
  color:var(--text-2);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:.15s}
.peek-x:hover{background:var(--surface-inset);color:var(--text)}
.peek-x svg{width:16px;height:16px}

.peek-body{flex:1;overflow-y:auto;padding:18px}
.fld-title input{width:100%;border:0;background:transparent;font:600 22px var(--font-head);color:var(--text);
  padding:4px 0;letter-spacing:-.01em}
.fld-title input::placeholder{color:var(--text-3);font-weight:500}
.fld-title input:focus{outline:none}
.fld-title input.bad{border-bottom:2px solid var(--warn)}
.fld-err{font-size:12px;color:var(--warn);font-weight:600;margin:4px 0 0}

.props{display:flex;flex-direction:column;gap:2px;margin-top:14px}
.prop{display:grid;grid-template-columns:128px 1fr;gap:10px;align-items:center;padding:6px 0;min-height:40px}
.prop.top{align-items:flex-start}
.prop-k{display:flex;align-items:center;gap:8px;font-size:12.5px;font-weight:600;color:var(--text-3)}
.prop-k svg{width:15px;height:15px}
.prop.top .prop-k{padding-top:9px}
.prop-v{min-width:0}

/* inputs de línea */
.fld-line,.dt input,.fld-area{width:100%;border:1px solid var(--border);background:var(--surface-2);
  border-radius:9px;padding:8px 10px;font:500 13px var(--font-body);color:var(--text);transition:.15s;
  -webkit-appearance:none;appearance:none;box-shadow:none}
[data-theme="dark"] .fld-line,[data-theme="dark"] .dt input,[data-theme="dark"] .fld-area{background:var(--surface-inset)}
.fld-area::placeholder,.fld-line::placeholder{color:var(--text-3)}
.fld-line:focus,.dt input:focus,.fld-area:focus{outline:none;border-color:var(--accent);background:var(--surface)}
.fld-area{resize:vertical;line-height:1.45;font-family:var(--font-body)}
.dt{display:flex;gap:8px}
.dt input{font-variant-numeric:tabular-nums}

/* plataformas multi-toggle */
.plat-tags{display:flex;flex-wrap:wrap;gap:6px}
.ptag{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 11px;border-radius:8px;
  border:1px solid var(--border);background:var(--surface-2);color:var(--text-2);font:600 12px var(--font-body);
  cursor:pointer;transition:.14s}
[data-theme="dark"] .ptag{background:var(--surface-inset)}
.ptag .dot{width:8px;height:8px;border-radius:3px;filter:grayscale(.6);opacity:.7}
.ptag.on{color:var(--text)}
.ptag.on .dot{filter:none;opacity:1}
.ptag:hover{border-color:var(--border-2)}

/* PropSelect (dropdown Notion) */
.psel{position:relative}
.psel-btn{display:flex;align-items:center;gap:8px;width:100%;height:36px;padding:0 10px;border-radius:9px;
  border:1px solid var(--border);background:var(--surface-2);color:var(--text);font:500 13px var(--font-body);
  cursor:pointer;transition:.14s;text-align:left}
[data-theme="dark"] .psel-btn{background:var(--surface-inset)}
.psel-btn:hover{border-color:var(--border-2)}
.psel-btn.open{border-color:var(--accent);background:var(--surface)}
.psel-btn .dot{width:9px;height:9px;border-radius:3px;flex:0 0 9px}
.psel-btn .dot.empty,.psel-opt .dot.empty{background:transparent;border:1.5px solid var(--border-2)}
.psel-btn .ph{color:var(--text-3)}
.psel-btn .caret{margin-left:auto;color:var(--text-3);display:flex;transform:rotate(90deg);transition:.18s}
.psel-btn .caret svg{width:15px;height:15px}
.psel-btn.open .caret{transform:rotate(-90deg)}
.psel-pop{position:absolute;top:calc(100% + 5px);left:0;right:0;z-index:40;background:var(--surface);
  border:1px solid var(--border-2);border-radius:11px;box-shadow:var(--shadow-lg);padding:5px;
  max-height:240px;overflow-y:auto;animation:peekFade .14s ease-out;transform:translateZ(0)}
.psel-opt{display:flex;align-items:center;gap:9px;width:100%;padding:7px 9px;border:0;border-radius:8px;
  background:transparent;color:var(--text);font:500 13px var(--font-body);cursor:pointer;text-align:left;transition:.12s}
.psel-opt:hover{background:var(--surface-inset)}
.psel-opt.on{background:var(--accent-soft)}
.psel-opt .dot{width:9px;height:9px;border-radius:3px;flex:0 0 9px}
.psel-opt svg{width:15px;height:15px;margin-left:auto;color:var(--accent)}

/* icono dentro del trigger (date/time picker) */
.psel-btn .ic{display:flex;align-items:center;color:var(--text-3);flex:0 0 auto}
.psel-btn .ic svg{width:15px;height:15px}

/* date picker propio */
.dp-pop{position:absolute;top:calc(100% + 5px);left:0;z-index:40;width:252px;background:var(--surface);
  border:1px solid var(--border-2);border-radius:14px;box-shadow:var(--shadow-lg);padding:10px;
  animation:peekFade .14s ease-out;transform:translateZ(0)}
.dp-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.dp-head>span{font:600 13px var(--font-head);text-transform:capitalize}
.dp-head button{width:28px;height:28px;border-radius:8px;border:1px solid var(--border);background:var(--surface);
  color:var(--text-2);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:.14s}
.dp-head button:hover{background:var(--surface-inset);color:var(--text)}
.dp-head button svg{width:15px;height:15px}
.dp-dow{display:grid;grid-template-columns:repeat(7,1fr);margin-bottom:4px}
.dp-dow span{text-align:center;font-size:10px;font-weight:700;color:var(--text-3);text-transform:uppercase}
.dp-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}
.dp-cell{height:30px;border:0;background:transparent;border-radius:8px;font:500 12.5px var(--font-body);
  color:var(--text);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:.12s}
.dp-cell:hover{background:var(--surface-inset)}
.dp-cell.out{visibility:hidden;cursor:default}
.dp-cell.today{color:var(--accent);font-weight:700}
.dp-cell.sel{background:var(--accent);color:var(--on-accent);font-weight:600}
.dp-cell.sel:hover{background:var(--accent);opacity:.92}

/* time picker propio */
.tp-pop{width:150px;max-height:240px;font-variant-numeric:tabular-nums}
.tp-pop .psel-opt{justify-content:flex-start;gap:6px}

.peek-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 18px;
  border-top:1px solid var(--border)}
.peek-foot .foot-r{display:flex;gap:8px;margin-left:auto}

/* ===== guion: editor enriquecido ===== */
.guion{margin-top:18px;border-top:1px solid var(--border);padding-top:14px}
.guion-h{display:flex;align-items:center;justify-content:space-between;margin-bottom:9px}
.guion-h .prop-k{font-size:12.5px;font-weight:600;color:var(--text-3)}
.guion-exp{height:30px;padding:0 10px;border-radius:8px;border:1px solid var(--border);background:var(--surface-2);
  color:var(--text-2);display:inline-flex;align-items:center;gap:6px;cursor:pointer;transition:.14s;
  font:600 12px var(--font-body)}
[data-theme="dark"] .guion-exp{background:var(--surface-inset)}
.guion-exp:hover{color:var(--accent);border-color:var(--border-2)}
.guion-exp svg{width:15px;height:15px}

.rt{border:1px solid var(--border);border-radius:11px;background:var(--surface-2);overflow:hidden;transition:.15s}
[data-theme="dark"] .rt{background:var(--surface-inset)}
.rt:focus-within{border-color:var(--accent);background:var(--surface)}
.rt-bar{display:flex;align-items:center;gap:3px;padding:6px;border-bottom:1px solid var(--border);flex-wrap:wrap}
.rt-bar button{height:28px;min-width:28px;padding:0 8px;border:0;border-radius:7px;background:transparent;
  color:var(--text-2);font:600 13px var(--font-body);cursor:pointer;display:inline-flex;align-items:center;
  gap:5px;transition:.12s}
.rt-bar button:hover{background:var(--surface-inset);color:var(--text)}
[data-theme="dark"] .rt-bar button:hover{background:var(--surface-2)}
.rt-bar button b,.rt-bar button i,.rt-bar button s{font-size:14px;line-height:1}
.rt-bar button .lbl{font-size:12px;font-weight:600}
.rt-bar button svg{width:14px;height:14px}
.rt-sep{width:1px;height:18px;background:var(--border);margin:0 4px}
.rt-area{padding:12px 13px;min-height:120px;max-height:260px;overflow-y:auto;
  font:400 13.5px/1.65 var(--font-body);color:var(--text);outline:none;text-wrap:pretty}
.rt-area:empty:before{content:attr(data-ph);color:var(--text-3)}
.rt-area b,.rt-area strong{font-weight:700}
.rt-area i,.rt-area em{font-style:italic}
.rt-area s,.rt-area strike,.rt-area del{text-decoration:line-through}
.rt-task{display:flex;align-items:flex-start;gap:9px;margin:4px 0}
.rt-box{flex:0 0 17px;width:17px;height:17px;border:1.5px solid var(--border-2);border-radius:5px;margin-top:3px;
  cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:.12s;background:var(--surface)}
.rt-box:hover{border-color:var(--accent)}
.rt-task.done .rt-box{background:var(--accent);border-color:var(--accent)}
.rt-task.done .rt-box:after{content:"";width:5px;height:9px;border:solid var(--on-accent);
  border-width:0 2px 2px 0;transform:rotate(45deg) translateY(-1px)}
.rt-task.done .rt-tx{text-decoration:line-through;color:var(--text-3)}

/* guion a pantalla completa */
.sm-scrim{z-index:94}
.script-modal{position:fixed;top:5vh;left:50%;transform:translateX(-50%);width:min(760px,92vw);max-height:90vh;
  background:var(--surface);border:1px solid var(--border-2);border-radius:18px;box-shadow:var(--shadow-lg);
  z-index:95;display:flex;flex-direction:column;overflow:hidden;animation:smIn .22s cubic-bezier(.22,1,.36,1)}
@keyframes smIn{from{transform:translateX(-50%) scale(.97);opacity:0}to{transform:translateX(-50%) scale(1);opacity:1}}
@media (prefers-reduced-motion:reduce){.script-modal{animation:none}}
.sm-h{display:flex;align-items:center;justify-content:space-between;padding:16px 18px;border-bottom:1px solid var(--border)}
.sm-t{display:flex;align-items:center;gap:8px;font:600 14px var(--font-head)}
.sm-t svg{width:16px;height:16px;color:var(--text-3)}
.script-modal .rt{border:0;border-radius:0;background:var(--surface);flex:1;display:flex;flex-direction:column;min-height:0}
.script-modal .rt:focus-within{background:var(--surface)}
.script-modal .rt-area{max-height:none;flex:1;min-height:320px;font-size:14.5px;padding:18px 22px}

/* ===== panel de configuración (catálogos) ===== */
.cfg-tabs{margin-bottom:16px;flex-wrap:wrap}
.cfg-list{display:flex;flex-direction:column;gap:8px}
.cfg-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;gap:9px;align-items:center}
.cfg-sw{position:relative;flex:0 0 auto}
.cfg-sw-btn{width:30px;height:30px;border-radius:8px;border:1px solid var(--border-2);cursor:pointer;transition:.14s;padding:0}
.cfg-sw-btn:hover{transform:scale(1.06)}
.cfg-pal{display:grid;grid-template-columns:repeat(5,1fr);gap:6px;width:190px;left:0;right:auto;padding:8px}
.cfg-chip{width:26px;height:26px;border-radius:7px;border:2px solid transparent;cursor:pointer;transition:.12s;padding:0}
.cfg-chip:hover{transform:scale(1.1)}
.cfg-chip.on{border-color:var(--surface);box-shadow:0 0 0 2px var(--text)}
.cfg-ord{display:flex;flex-direction:column;gap:2px}
.cfg-ord button{width:24px;height:16px;border:1px solid var(--border);background:var(--surface-2);color:var(--text-3);
  border-radius:5px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:.12s;padding:0}
[data-theme="dark"] .cfg-ord button{background:var(--surface-inset)}
.cfg-ord button:hover:not(:disabled){color:var(--text);border-color:var(--border-2)}
.cfg-ord button:disabled{opacity:.35;cursor:default}
.cfg-ord button svg{width:12px;height:12px}
.cfg-del{width:30px;height:30px;border:1px solid var(--border);background:var(--surface-2);color:var(--text-3);
  border-radius:8px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:.14s;flex:0 0 auto}
[data-theme="dark"] .cfg-del{background:var(--surface-inset)}
.cfg-del:hover{color:var(--warn);border-color:var(--warn-soft)}
.cfg-del svg{width:15px;height:15px}
.cfg-add{margin-top:12px;width:100%;justify-content:center;border-style:dashed}
.cfg-hint{font-size:12px;color:var(--text-3)}

/* ===== C2c: aviso de solape + toggle de conflicto ===== */
.fld-warn{grid-column:1/-1;display:flex;align-items:center;gap:8px;font-size:12px;font-weight:600;
  color:var(--warn);background:var(--warn-soft);border-radius:10px;padding:9px 12px;line-height:1.4}
.fld-warn svg{width:14px;height:14px;flex:0 0 14px}
.cfg-flag{display:flex;align-items:center;gap:14px;background:var(--surface-2);border:1px solid var(--border);
  border-radius:12px;padding:12px 14px;margin-bottom:14px}
[data-theme="dark"] .cfg-flag{background:var(--surface-inset)}
.cfg-flag .t{font-size:13px;font-weight:600}
.cfg-flag .m{font-size:11.5px;color:var(--text-3);margin-top:2px;line-height:1.45}
.flag-sw{margin-left:auto;width:40px;height:23px;border-radius:999px;border:1px solid var(--border);
  background:var(--track);position:relative;cursor:pointer;transition:.18s;flex:0 0 40px}
.flag-sw i{position:absolute;top:2px;left:2px;width:17px;height:17px;border-radius:50%;background:var(--surface);
  box-shadow:var(--shadow-sm);transition:.18s}
.flag-sw.on{background:var(--accent);border-color:var(--accent)}
.flag-sw.on i{left:19px}
