/* ViceClips Studio — hoja única con tokens. Modo oscuro, paleta "Vice City" neón. */
@font-face { font-family: Inter; src: url(/fonts/Inter.ttf) format('truetype'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Anton; src: url(/fonts/Anton-Regular.ttf) format('truetype'); font-display: swap; }
@font-face { font-family: 'Bebas Neue'; src: url(/fonts/BebasNeue-Regular.ttf) format('truetype'); font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #0a0b10; --bg-2: #0f1017; --panel: #14151e; --panel-2: #1b1d29; --panel-3: #232636; --line: #23253a; --line-2: #32354b;
  --hi: rgba(255, 255, 255, .045); --glass: rgba(20, 21, 31, .72);
  /* --faint: 4,6:1 sobre --panel (antes #6c7086 ≈ 3,7:1, por debajo de WCAG AA para texto pequeño). */
  --text: #f3f2f8; --muted: #9b9eb2; --faint: #858aa3;
  --pink: #ff5fa2; --violet: #b57bff; --orange: #ffb347; --yellow: #ffd23f; --mint: #5fe3b3; --red: #ff6b6b; --blue: #6cb8ff;
  --on-accent: #14121c;
  /* Colores de marca de cada plataforma (insignias del Radar y la Biblioteca). */
  --twitch: #9146ff; --kick: #53fc18; --youtube: #ff0033;
  --fs-xs: 11px; --fs-sm: 12px; --fs-md: 13px; --fs-lg: 14px;
  --grad: linear-gradient(120deg, var(--pink), var(--violet) 55%, var(--orange));
  --radius: 12px; --radius-sm: 8px; --radius-lg: 18px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35); --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: Inter, 'Segoe UI', system-ui, sans-serif; --display: Anton, Impact, sans-serif;
  --sidebar: 236px;
  font-family: var(--font); font-size: 14px; line-height: 1.5; font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--violet); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
h1 { font-family: var(--display); font-weight: 400; font-size: clamp(30px, 4vw, 46px); letter-spacing: .5px; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
code, kbd, .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
code { background: var(--panel-2); padding: 1px 6px; border-radius: 5px; }
kbd { border: 1px solid var(--line-2); border-bottom-width: 2px; padding: 0 5px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s4) 0; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--violet); color: #000; padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12.5px; }
.error-text { color: var(--red); }
.link { color: var(--violet); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; font-size: 13px; }
.link:hover { text-decoration: underline; }
.row { display: flex; align-items: center; gap: var(--s2); flex-wrap: nowrap; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.center { justify-content: center; }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.spacer { flex: 1; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: var(--s3); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
ul.plain { list-style: none; padding: 0; margin: 0; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: var(--s5); padding: var(--s5) var(--s4); background: var(--bg-2); border-right: 1px solid var(--line); z-index: 20; }
.brand { display: flex; align-items: center; gap: var(--s3); color: var(--text); text-decoration: none; padding: 0 var(--s2); }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-family: var(--display); font-size: 24px; color: #14121c; background: var(--grad); box-shadow: 0 0 24px rgba(255, 95, 162, .35); }
.brand-text { font-weight: 800; letter-spacing: 1.5px; font-size: 15px; line-height: 1.1; }
.brand-text small { display: block; font-size: 9px; font-weight: 600; letter-spacing: 2px; color: var(--muted); margin-top: 3px; }
.nav { display: grid; gap: 3px; }
.nav a { display: flex; align-items: center; gap: var(--s3); padding: 10px 12px; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a.active { background: linear-gradient(90deg, rgba(181, 123, 255, .18), rgba(255, 95, 162, .08)); color: var(--text); box-shadow: inset 2px 0 0 var(--pink); }
.nav-icon { width: 20px; display: grid; place-items: center; }
.nav-badge { margin-left: auto; font-size: 11px; background: var(--pink); color: #14121c; padding: 0 7px; border-radius: 10px; font-weight: 700; }
.nav-badge.busy { background: var(--violet); }
.sidebar-foot { margin-top: auto; display: grid; gap: var(--s3); padding: 0 var(--s2); }
.sidebar-foot small { color: var(--faint); font-size: 9px; letter-spacing: 1.5px; }
.local-badge { font-size: 9.5px; letter-spacing: 1.2px; color: var(--mint); font-weight: 600; }
.local-badge i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); margin-right: 6px; box-shadow: 0 0 8px var(--mint); }
.health { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 11px; color: var(--muted); }
.dot { display: inline-flex; align-items: center; gap: 5px; }
.dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok::before { background: var(--mint); } .dot.bad::before { background: var(--red); } .dot.warn::before { background: var(--orange); } .dot.off::before { background: var(--line-2); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 15; height: 60px; display: flex; align-items: center; gap: var(--s4); padding: 0 var(--s6); background: rgba(13, 14, 20, .85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.crumbs { display: flex; gap: 10px; color: var(--muted); font-size: 13px; }
.crumbs strong { color: var(--text); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--s3); }
.task-pill, .countdown-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 30px; color: var(--text); text-decoration: none; background: var(--panel); }
.countdown-pill { border-color: rgba(255, 95, 162, .5); color: #ffd0e4; }
.countdown-pill.live { background: var(--grad); color: #14121c; font-weight: 700; }
.pill-count { color: var(--muted); }
.topbar .menu-toggle { display: none; }
.view { padding: var(--s6); max-width: 1560px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: var(--s5); outline: none; }
.view-editor { max-width: none; padding: var(--s3) var(--s4); gap: 0; }
.page-head { display: flex; gap: var(--s4); align-items: flex-end; }
.page-head .lead { margin-top: var(--s2); }
.eyebrow { font-size: 11px; letter-spacing: 2.2px; font-weight: 700; color: var(--pink); margin-bottom: var(--s2); }
.lead { color: var(--muted); font-size: 15px; max-width: 720px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-top: var(--s3); }
.footnote { color: var(--faint); font-size: 12px; text-align: center; }
.loading { display: flex; gap: var(--s3); align-items: center; color: var(--muted); padding: var(--s6); justify-content: center; }

/* ---------- Controles ---------- */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 9px 16px; font-weight: 600; font-size: 13.5px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .08s, background .15s, border-color .15s; color: var(--text); }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.primary { background: var(--grad); color: #15121d; box-shadow: 0 4px 18px rgba(255, 95, 162, .25); }
.button.primary:hover { filter: brightness(1.08); }
.button.subtle { background: var(--panel-2); border-color: var(--line-2); }
.button.subtle:hover { border-color: var(--violet); }
.button.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.button.ghost:hover { color: var(--text); border-color: var(--line-2); background: var(--panel); }
.button.danger { background: rgba(255, 107, 107, .12); border-color: rgba(255, 107, 107, .4); color: #ffb3b3; }
.button.small { padding: 5px 10px; font-size: 12px; }
.button.active { border-color: var(--violet); color: var(--text); }
.icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; text-decoration: none; font-size: 15px; flex: none; }
.icon-button:hover { border-color: var(--line-2); background: var(--panel-2); }
.icon-button:disabled { opacity: .35; cursor: default; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]), select, textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px 10px; min-height: 36px; }
input:focus, select:focus, textarea:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 3px rgba(181, 123, 255, .18); }
textarea { resize: vertical; }
input[type=color] { width: 100%; height: 34px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg-2); padding: 2px; }
input[type=range] { width: 100%; accent-color: var(--pink); -webkit-appearance: none; appearance: none; height: 18px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--violet), var(--pink)) 0 / var(--fill, 0%) 100% no-repeat, var(--line-2); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 3px rgba(255, 95, 162, .35), 0 2px 6px rgba(0, 0, 0, .5); transition: transform .12s var(--ease); }
input[type=range]:hover::-webkit-slider-thumb, input[type=range]:active::-webkit-slider-thumb { transform: scale(1.18); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line-2); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--violet), var(--pink)); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 3px rgba(255, 95, 162, .35); }
select { -webkit-appearance: none; appearance: none; padding-right: 30px !important; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2712%27 height=%2712%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%239b9eb2%27 stroke-width=%272.5%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M6 9l6 6 6-6%27/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-position: right 10px center !important; }
select option { background: var(--panel-2); color: var(--text); }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #4a4e68; }
::-webkit-scrollbar-corner { background: transparent; }
::selection { background: rgba(255, 95, 162, .35); }
input[type=checkbox] { accent-color: var(--pink); width: 16px; height: 16px; }
input.search { max-width: 340px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-size: 13px; }
progress { width: 100%; height: 6px; appearance: none; border: 0; border-radius: 6px; background: var(--line); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--grad); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips-label { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: 1px; min-width: 76px; }
.chip { border: 1px solid var(--line-2); background: transparent; color: var(--muted); border-radius: 30px; padding: 4px 12px; font-size: 12.5px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip:hover { color: var(--text); border-color: var(--violet); }
.chip.active { background: rgba(181, 123, 255, .18); border-color: var(--violet); color: var(--text); }
.chip-count { font-size: 10.5px; background: var(--panel-2); border-radius: 10px; padding: 0 6px; color: var(--muted); }
.chip.active .chip-count { background: var(--pink); color: #14121c; }
.filter-chips { display: grid; gap: 8px; padding: var(--s3) var(--s4); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.toolbar { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }

.tabs-nav { display: block; }
.tabs-nav::part(tabs) { gap: 2px; }
.tabs-nav::part(body) { display: none; }
.segmented { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.segmented button { background: none; border: 0; padding: 7px 12px; color: var(--muted); cursor: pointer; font-size: 12.5px; }
.segmented button.active { background: var(--panel-2); color: var(--text); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4) var(--s5); }
.notice { background: rgba(108, 184, 255, .08); border: 1px solid rgba(108, 184, 255, .25); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; white-space: pre-line; color: #cfe5ff; }
.notice.warn { background: rgba(255, 179, 71, .08); border-color: rgba(255, 179, 71, .35); color: #ffe0b3; }
.notice.error { background: rgba(255, 107, 107, .08); border-color: rgba(255, 107, 107, .35); color: #ffc9c9; }
.badge { font-size: 10.5px; font-weight: 700; letter-spacing: .6px; background: rgba(0, 0, 0, .65); color: #fff; padding: 2px 7px; border-radius: 5px; }
.mini-tag { font-size: 11px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); padding: 0 7px; border-radius: 10px; }
.mini-tag.good { color: var(--yellow); border-color: rgba(255, 210, 63, .35); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line-2); border-top-color: var(--pink); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; flex: none; }
.spinner.small { width: 11px; height: 11px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: var(--s7) var(--s4); border: 1px dashed var(--line-2); border-radius: var(--radius-lg); display: grid; gap: var(--s2); justify-items: center; grid-column: 1 / -1; }
.empty-icon { font-size: 30px; color: var(--violet); display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: rgba(181, 123, 255, .1); }
.empty p { color: var(--muted); max-width: 420px; }
.skeleton { background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); min-height: 260px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Modales (sl-dialog) ---------- */
.modal-body { display: grid; gap: var(--s3); }
.modal-title { display: flex; align-items: center; gap: 8px; }
.modal-title svg { color: var(--pink); }
sl-dialog.modal::part(overlay) { backdrop-filter: blur(3px); }
.list-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; color: var(--text); }
.list-item small { margin-left: auto; color: var(--muted); }
.list-item:hover, .list-item.active { border-color: var(--violet); }
.upload-drop { display: grid; justify-items: center; gap: 4px; padding: var(--s5); border: 1px dashed var(--line-2); border-radius: var(--radius); cursor: pointer; text-align: center; }
.upload-drop:hover { border-color: var(--pink); }
.upload-drop.small { padding: var(--s3); }
.upload-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.upload-drop small { color: var(--muted); }
.upload-icon { font-size: 24px; color: var(--pink); }

/* ---------- Inicio ---------- */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--s5); padding: var(--s6); border-radius: var(--radius-lg); border: 1px solid var(--line); position: relative; overflow: hidden;
  background: radial-gradient(800px 380px at 85% 0%, rgba(255, 95, 162, .25), transparent 60%), radial-gradient(600px 300px at 100% 100%, rgba(255, 179, 71, .18), transparent 60%), linear-gradient(160deg, #1a1426, #11121a); }
.hero h1 { font-size: clamp(34px, 5vw, 60px); }
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-copy { display: grid; gap: var(--s4); align-content: center; }
.hero-countdown { align-self: center; background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .08); border-radius: var(--radius-lg); padding: var(--s5); display: grid; gap: var(--s3); }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); }
.cd-cell { text-align: center; background: rgba(255, 255, 255, .04); border-radius: var(--radius-sm); padding: var(--s3) 0; }
.cd-cell strong { display: block; font-family: var(--display); font-size: clamp(30px, 4vw, 48px); font-weight: 400; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.1; }
.cd-cell span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; }
.cd-live { grid-column: 1 / -1; font-family: var(--display); font-size: 44px; text-align: center; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); display: grid; gap: 2px; }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); }
.stat-value { font-family: var(--display); font-weight: 400; font-size: 32px; }
.stat.hot .stat-value { color: var(--pink); }
.stat small { color: var(--faint); }

/* ---------- Tarjetas ---------- */
.grid { display: grid; gap: var(--s4); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid.projects { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid.media-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.grid.collections, .grid.drafts { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid.exports { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.clip-card, .media-card, .export-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.clip-card:hover, .media-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.clip-card.selected { border-color: var(--pink); box-shadow: 0 0 0 2px rgba(255, 95, 162, .35); }
.clip-card.dimmed { opacity: .55; }
.clip-card[tabindex] { cursor: pointer; }
.thumb, .media-cover { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #2a1c3c, #3a1f2c); overflow: hidden; display: grid; place-items: center; }
.thumb img, .media-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.media-cover img { object-fit: cover; object-position: 0 0; }
.clip-card:hover .thumb img { transform: scale(1.06); }
.thumb img.strip { object-position: 0 0; }
.thumb-glyph { font-size: 28px; color: rgba(255, 255, 255, .6); }
.thumb-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.thumb .badge, .media-cover .badge { position: absolute; }
.badge.platform { top: 8px; left: 8px; }
.badge.duration { bottom: 8px; right: 8px; }
.badge.new { top: 8px; right: 8px; background: var(--pink); color: #14121c; }
.badge.local { bottom: 8px; left: 8px; background: rgba(95, 227, 179, .9); color: #0a2a1f; }
.card-body { padding: var(--s3) var(--s4) var(--s4); display: grid; gap: 6px; }
.card-channel { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.avatar-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grad); }
.card-title { font-size: 14px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.card-stats { display: flex; gap: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.score { color: var(--yellow); font-weight: 600; font-size: 12px; }
.card-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.card-actions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.dup-note { font-size: 11.5px; color: var(--orange); }
.selection-bar { position: sticky; bottom: 16px; z-index: 10; display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; background: var(--panel-2); border: 1px solid var(--pink); border-radius: var(--radius); padding: 10px 14px; box-shadow: var(--shadow); }
.list { display: grid; gap: 4px; }
.list-row { display: flex; align-items: center; gap: var(--s3); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; }
.list-row.selected { border-color: var(--pink); }
.list-row > progress { max-width: 140px; }
.list-main { flex: 1; min-width: 0; display: grid; }
.list-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-main small { color: var(--muted); }
.platform-tag { font-size: 10px; font-weight: 800; color: var(--violet); width: 22px; }
.trend { font-weight: 700; color: var(--mint); min-width: 70px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.status-dot.running { background: var(--violet); box-shadow: 0 0 8px var(--violet); } .status-dot.done { background: var(--mint); } .status-dot.error { background: var(--red); } .status-dot.queued { background: var(--orange); }
.project-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); display: grid; gap: 6px; text-decoration: none; color: var(--text); }
.project-link { display: grid; gap: 6px; color: var(--text); text-decoration: none; }
.project-card:hover { border-color: var(--violet); }
.project-card small { color: var(--muted); }
.project-cover { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: linear-gradient(135deg, #261b36, #1b1424); display: grid; place-items: center; }
.project-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 0 0; opacity: .85; }
.project-cover .badge { position: absolute; top: 8px; left: 8px; }
.collection-covers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; border-radius: var(--radius-sm); overflow: hidden; height: 70px; margin-bottom: 6px; }
.collection-covers img, .collection-covers span { width: 100%; height: 100%; object-fit: cover; background: var(--panel-2); }
.draft-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }
.draft-list li small { display: block; color: var(--muted); }
.export-cover { aspect-ratio: 16 / 9; background: #000; display: grid; place-items: center; }
.export-cover.f9x16 video, .export-cover.f9x16 img { object-fit: contain; }
.export-cover video, .export-cover img { width: 100%; height: 100%; object-fit: contain; background: #000; }
.export-progress { display: grid; gap: 8px; justify-items: center; color: var(--muted); width: 70%; }
.export-error { color: var(--red); display: grid; justify-items: center; gap: 4px; padding: var(--s3); text-align: center; }
.export-card.error { border-color: rgba(255, 107, 107, .4); }

/* ---------- Plantillas ---------- */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s2); }
.preset { display: grid; gap: 4px; justify-items: start; text-align: left; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); cursor: pointer; color: var(--text); }
.preset small { color: var(--muted); font-size: 11.5px; }
.preset.active { border-color: var(--pink); background: rgba(255, 95, 162, .08); }
.preset-frame { display: grid; place-items: center; border: 2px solid var(--violet); border-radius: 5px; color: var(--violet); font-weight: 800; margin-bottom: 4px; }
.preset-frame.f9x16 { width: 24px; height: 40px; } .preset-frame.f16x9 { width: 48px; height: 27px; } .preset-frame.f1x1 { width: 34px; height: 34px; }

/* ---------- Ajustes ---------- */
.settings { display: grid; gap: var(--s4); max-width: 980px; }
.storage-bar { display: flex; height: 14px; border-radius: 8px; overflow: hidden; background: var(--line); }
.seg.auto, .legend .auto::before { background: var(--pink); } .seg.manual, .legend .manual::before { background: var(--violet); } .seg.exports, .legend .exports::before { background: var(--orange); } .seg.cache, .legend .cache::before { background: var(--blue); } .seg.assets, .legend .assets::before { background: var(--mint); }
.legend { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--muted); }
.legend li::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.tools { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s3); }
.tools li { display: flex; gap: var(--s3); align-items: flex-start; }
.tools li div { display: grid; gap: 2px; }
.tools small { color: var(--muted); }
.chat-session { display: grid; gap: 6px; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 60px; background: var(--bg-2); border-radius: var(--radius-sm); padding: 6px; }
.spark span { flex: 1; background: var(--violet); border-radius: 2px 2px 0 0; min-height: 2px; opacity: .7; }
.spark span.peak { background: var(--pink); opacity: 1; }
.candidate .field { max-width: 100px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  body.menu-open .sidebar { transform: none; }
  .topbar .menu-toggle { display: inline-grid; }
  .topbar { padding: 0 var(--s3); }
  .countdown-pill { display: none; }
  .view { padding: var(--s4); }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .page-head.row { flex-direction: column; align-items: flex-start; }
  .chips-label { min-width: 0; width: 100%; }
}
@media (max-width: 520px) {
  .grid-2, .grid-3, .grid-4, .stats { grid-template-columns: 1fr; }
  .grid.cards { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  /* Sin el giro no habría ninguna señal de que algo está cargando: se mantiene, más lento. */
  .spinner { animation: spin 1.6s linear infinite !important; }
}
@supports (height: 100dvh) {
  /* En el móvil (túnel) 100vh queda por debajo de la barra del navegador. */
  body, .shell { min-height: 100dvh; }
  .sidebar { height: 100dvh; }
}

/* ---------- Login remoto ---------- */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: var(--s4); background: radial-gradient(700px 400px at 80% 0%, rgba(255, 95, 162, .2), transparent 60%), var(--bg); }
.login-card { width: min(400px, 100%); display: grid; gap: var(--s3); justify-items: start; padding: var(--s6); }
.login-card form { width: 100%; }

/* ---------- Auto-edición ---------- */
.button.magic { border-color: rgba(255, 210, 63, .5); color: var(--yellow); }
.button.magic:hover { background: rgba(255, 210, 63, .1); }
.zoom-wrap { position: absolute; inset: 0; transition: transform .12s linear; transform-origin: center; }
.tl-zoom { position: absolute; top: 2px; height: 14px; font-size: 9px; line-height: 14px; background: rgba(255, 210, 63, .85); border-radius: 3px; text-align: center; pointer-events: none; z-index: 1; }
.editor { position: relative; }
.editor-busy { position: absolute; inset: 0; z-index: 30; background: rgba(8, 8, 14, .72); backdrop-filter: blur(3px); display: grid; place-items: center; border-radius: var(--radius); }
.busy-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: var(--s5); display: grid; gap: var(--s3); justify-items: center; width: min(420px, 90%); text-align: center; box-shadow: var(--shadow); }

/* ---------- Acceso remoto ---------- */
.remote-panel { border-color: rgba(181, 123, 255, .45); }
.remote-url { font-size: 13px; padding: 6px 10px; user-select: all; word-break: break-all; }
.remote-on { display: grid; gap: 8px; padding: 12px; border-radius: var(--radius-sm); background: rgba(95, 227, 179, .08); border: 1px solid rgba(95, 227, 179, .35); }
.steps-list { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }

/* ---------- Editor: sin selección de texto, menú contextual, zooms y subtítulos arrastrables ---------- */
.editor, .editor * { -webkit-user-select: none; user-select: none; }
.editor input, .editor textarea, .editor select, .editor [contenteditable] { -webkit-user-select: text; user-select: text; }
.editor img, .editor video { -webkit-user-drag: none; }
.tl-zoom { pointer-events: auto; cursor: grab; display: flex; align-items: center; justify-content: center; }
.tl-zoom:hover { background: var(--yellow); box-shadow: 0 0 0 1px #000; }
.tl-zoom .zoom-handle { position: absolute; right: 0; top: 0; bottom: 0; width: 6px; cursor: ew-resize; background: rgba(0, 0, 0, .35); border-radius: 0 3px 3px 0; }
.sub-item { cursor: grab; }
.sub-item .tl-handle { width: 6px; }
.sub-item.selected { border-color: #fff; background: rgba(108, 184, 255, .35); }
.context-menu { position: fixed; z-index: 300; animation: pop-in .12s var(--ease); }
.context-menu sl-menu { box-shadow: var(--shadow); }
.context-menu sl-menu-item.danger::part(label) { color: #ffb3b3; }
.context-menu kbd { font-size: 10.5px; color: var(--muted); }
@keyframes pop-in { from { opacity: 0; transform: scale(.97); } }

/* ---------- Aviso de actualización ---------- */
.update-bar { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 250; display: flex; gap: 10px; align-items: center; background: var(--panel-2); border: 1px solid var(--violet); border-radius: 30px; padding: 6px 8px 6px 16px; box-shadow: var(--shadow); font-size: 13px; max-width: calc(100vw - 24px); flex-wrap: wrap; }
.update-bar .icon-button { width: 26px; height: 26px; }
.layer-main.standby { visibility: hidden; position: absolute; inset: 0; pointer-events: none; }
.layer-game .layer-main { position: absolute; inset: 0; }

/* ---------- Textos y subtítulos arrastrables en la vista previa ---------- */
.ov.text, .ov.subtitle { cursor: grab; pointer-events: auto; touch-action: none; }
.ov.pos-custom { left: 50%; right: auto; transform: translate(-50%, -50%); width: max-content; max-width: 92%; margin: 0; animation: none; }
.ov.dragging-ov { cursor: grabbing; outline: 2px dashed var(--yellow); outline-offset: 4px; animation: none; }
.ov.subtitle:hover, .ov.text:hover { outline: 1px dashed rgba(255, 255, 255, .55); outline-offset: 4px; }
.snap-guide { position: absolute; background: var(--pink); pointer-events: none; z-index: 5; }
.snap-guide.vertical { left: 50%; top: 0; bottom: 0; width: 1px; }
.snap-guide.horizontal { left: 0; right: 0; height: 1px; }

/* ---------- IA ---------- */
.ai-panel { border-color: rgba(95, 227, 179, .4); }
.badge.ok { background: var(--mint); color: #0a2a1f; }

/* ---------- Publicar (TikTok / YouTube) ---------- */
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: var(--s4); }
.account-card { position: relative; display: grid; gap: var(--s3); align-content: start; padding: var(--s5); border-radius: var(--radius-lg); border: 1px solid var(--line); overflow: hidden;
  background: radial-gradient(420px 160px at 100% 0%, var(--glow, rgba(181, 123, 255, .14)), transparent 70%), linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 40%), var(--panel); }
.account-card.tiktok { --glow: rgba(37, 244, 238, .13); }
.account-card.youtube { --glow: rgba(255, 48, 64, .14); }
.account-card.connected { border-color: rgba(95, 227, 179, .35); }
.account-card.warn { border-color: rgba(255, 179, 71, .45); }
.account-head { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s3); align-items: center; }
.account-head small { color: var(--muted); font-size: 12.5px; display: block; margin-top: 2px; }
.platform-logo { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 20px; font-weight: 900; color: #fff; flex: none; }
.platform-logo.tiktok { background: #000; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), -2px -2px 0 rgba(37, 244, 238, .7), 2px 2px 0 rgba(254, 44, 85, .7); }
.platform-logo.youtube { background: #ff0033; font-size: 16px; box-shadow: 0 6px 20px rgba(255, 0, 51, .3); }
.platform-logo.small { width: 26px; height: 26px; border-radius: 8px; font-size: 12px; box-shadow: none; }
.platform-logo.small.tiktok { box-shadow: -1px -1px 0 rgba(37, 244, 238, .8), 1px 1px 0 rgba(254, 44, 85, .8); }
.state-pill { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.state-pill.ok { color: var(--mint); border-color: rgba(95, 227, 179, .45); background: rgba(95, 227, 179, .08); }
.state-pill.warn { color: var(--orange); border-color: rgba(255, 179, 71, .45); background: rgba(255, 179, 71, .08); }
.account-user { display: flex; align-items: center; gap: var(--s3); padding: 10px 12px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); }
.account-user img, .account-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; }
.account-avatar { display: grid; place-items: center; background: var(--grad); color: #15121d; font-weight: 800; }
.account-user > div { display: grid; min-width: 0; }
.account-user small { color: var(--muted); font-size: 12px; }
.account-setup { border-top: 1px solid var(--line); padding-top: var(--s3); display: grid; gap: var(--s3); }
.account-setup summary { cursor: pointer; color: var(--violet); font-size: 13px; font-weight: 600; }
.account-setup[open] summary { margin-bottom: 4px; }
.copy-inline { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.copy-inline code { user-select: all; word-break: break-all; }
.auto-panel h2 { display: flex; align-items: center; gap: 8px; }
.auto-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: rgba(255, 210, 63, .14); color: var(--yellow); }
.ready-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.ready-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.ready-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.ready-cover { position: relative; aspect-ratio: 16 / 9; background: #000; }
.ready-cover.f9x16 { aspect-ratio: 4 / 5; }
.ready-cover video { width: 100%; height: 100%; object-fit: contain; display: block; }
.ready-cover .badge { position: absolute; }
.ready-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.dest-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font-size: 12.5px; font-weight: 650; cursor: pointer; transition: border-color .15s, background .15s; }
.dest-button.tiktok:hover:not(:disabled) { border-color: #25f4ee; background: rgba(37, 244, 238, .08); }
.dest-button.youtube:hover:not(:disabled) { border-color: #ff3355; background: rgba(255, 51, 85, .08); }
.dest-button.sent { color: var(--mint); border-color: rgba(95, 227, 179, .4); }
.dest-button:disabled { opacity: .4; cursor: not-allowed; }
.dest-check { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); }
.upload-row .list-main small.ok-text { color: var(--mint); }
.upload-row.error { border-color: rgba(255, 107, 107, .35); }
.upload-row.done { border-color: rgba(95, 227, 179, .25); }
.upload-row > progress { max-width: 160px; }
@media (max-width: 520px) { .account-grid { grid-template-columns: 1fr; } .account-head { grid-template-columns: auto 1fr; } .account-head .state-pill { grid-column: 1 / -1; justify-self: start; } }

/* ---------- Radar y tarjetas de clip (v2) ---------- */
/* Insignias sobre la miniatura: por encima de la vista previa en video y con el color de cada plataforma. */
.thumb .badge { z-index: 2; }
.badge.platform[data-p="twitch"] { background: var(--twitch); color: #fff; }
.badge.platform[data-p="kick"] { background: var(--kick); color: var(--on-accent); }
.badge.platform[data-p="youtube"] { background: var(--youtube); color: #fff; }
.badge.new { color: var(--on-accent); }
.badge.lang { top: 8px; left: auto; right: 8px; background: rgba(0, 0, 0, .7); }
.badge.new + .badge.lang, .thumb:has(.badge.new) .badge.lang { top: 32px; }
.thumb.no-image { background: linear-gradient(135deg, #2a1c3c, #3a1f2c); }
.platform-tag[data-p="twitch"] { color: var(--twitch); } .platform-tag[data-p="kick"] { color: var(--kick); } .platform-tag[data-p="youtube"] { color: var(--youtube); }
/* Tarjetas: acciones siempre al pie (rejilla pareja) y renderizado perezoso de las que están fuera de pantalla. */
.clip-card { content-visibility: auto; contain-intrinsic-size: auto 340px; }
.clip-card .card-body { flex: 1; align-content: start; }
.clip-card .card-actions { margin-top: auto; padding-top: 4px; }
.clip-card:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.pace { color: var(--mint); font-weight: 600; }
.score-button { background: none; border: 1px solid rgba(255, 210, 63, .35); border-radius: 10px; color: var(--yellow); font-weight: 700; font-size: var(--fs-xs); padding: 0 7px; cursor: pointer; }
.score-button[aria-expanded="true"] { background: rgba(255, 210, 63, .12); }
.card-reasons { margin: 0; padding-left: 16px; font-size: var(--fs-xs); color: var(--muted); display: grid; gap: 2px; }
.mini-tag.auto { border-style: dashed; }
/* Casilla de selección visible en la miniatura (antes solo se seleccionaba haciendo clic en la tarjeta, sin pista visual). */
.card-check { position: absolute; top: 6px; left: 6px; z-index: 3; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .15s; cursor: pointer; }
.card-check input { margin: 0; width: 16px; height: 16px; }
.clip-card:hover .card-check, .clip-card:focus-within .card-check, .clip-card.selected .card-check, .selecting .card-check { opacity: 1; }
/* La insignia de plataforma deja sitio a la casilla solo cuando esta se ve. */
.clip-card .card-check + .badge.platform { transition: left .15s; }
:is(.clip-card:hover, .clip-card:focus-within, .clip-card.selected, .selecting .clip-card) .card-check + .badge.platform { left: 40px; }
/* Esqueletos con forma de tarjeta (antes: barras de 260 px en una sola columna). */
.skeleton-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: grid; }
.skeleton-card sl-skeleton { display: block; margin: 10px 14px 0; height: 12px; --border-radius: 6px; }
.skeleton-card sl-skeleton.thumb { margin: 0; height: auto; aspect-ratio: 16 / 9; --border-radius: 0; }
.skeleton-card sl-skeleton.short { width: 55%; margin-bottom: 14px; }
.view-error { display: grid; gap: var(--s3); justify-items: center; text-align: center; padding: var(--s7) var(--s4); }
.list-row input[type=checkbox] { flex: none; }
.radar-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
/* Móvil (túnel): objetivos táctiles cómodos y filtros desplazables en una sola fila. */
@media (pointer: coarse) {
  .button.small, .chip, .score-button { min-height: 40px; min-width: 40px; }
  .card-check { opacity: 1; width: 36px; height: 36px; }
  .clip-card .card-check + .badge.platform { left: 48px; }
}
/* Tableta (761–860 px): la barra lateral es un cajón. Velo detrás al abrirlo y, cerrado, fuera del orden de tabulación.
   Por debajo de 760 px manda mobile.css (barra de navegación inferior), que no debe ocultarse. */
@media (min-width: 761px) and (max-width: 860px) {
  body.menu-open::after { content: ''; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 15; }
  body:not(.menu-open) .sidebar { visibility: hidden; transition: transform .2s, visibility 0s .2s; }
}

/* ---------- Componentes (Shoelace) y movimiento ---------- */
vc-select { display: block; min-width: 0; }
.field vc-select { width: 100%; }
h2.with-icon, .with-icon { display: flex; align-items: center; gap: 8px; }
h2.with-icon svg { color: var(--violet); }
.notice > svg, p.notice > svg { vertical-align: -3px; }
a.link svg, .button svg { vertical-align: -2px; }
.button, .chip, .pill, .icon-button, .list-item, .clip-card, .project-card { transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .2s var(--ease), transform .15s var(--ease); }
.button:active:not(:disabled) { transform: translateY(1px); }
.view-enter { animation: view-in .22s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

/* Cápsulas de filtro con desplegable («Estado: Pendientes»). */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.pill:hover, .pill-dropdown[open] .pill { border-color: var(--violet); color: var(--text); }
.pill .pill-label { color: var(--faint); }
.pill .pill-value { color: var(--text); font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.pill .pill-caret { transition: transform .15s var(--ease); color: var(--faint); }
.pill-dropdown[open] .pill-caret { transform: rotate(180deg); }
.pill.active { border-color: transparent; background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--grad) border-box; border: 1px solid transparent; box-shadow: 0 0 0 1px rgba(255, 95, 162, .08), 0 4px 18px rgba(255, 95, 162, .12); }
.pill.active .pill-label { color: var(--pink); }
.pill-dropdown sl-menu { min-width: 230px; }
.pill-dropdown .menu-extra { display: grid; gap: 10px; padding: 8px 14px 10px; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.active-filters .hint { margin-right: 2px; }
.toolbar .search { flex: 1 1 220px; min-width: 180px; }
.toolbar vc-select { flex: 0 1 200px; min-width: 150px; }
.card-actions .button.small { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.card-actions .button.small.icon-only { width: 32px; padding: 0; justify-content: center; }
.tag-select { flex: 0 1 260px; min-width: 160px; }
.tag-select sl-select { --sl-input-height-small: 34px; }

/* Selector de vista (cuadrícula / lista): misma altura que los desplegables de la barra. */
.view-toggle { display: inline-flex; flex: none; height: 36px; padding: 3px; gap: 2px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg-2); }
.view-toggle button { display: grid; place-items: center; width: 34px; height: 100%; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; transition: background-color .15s var(--ease), color .15s var(--ease); }
.view-toggle button:hover { color: var(--text); background: var(--hi); }
.view-toggle button.active { background: var(--panel-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

/* Radar: formulario con aire entre filas, burbuja de aviso temporal sobre «Período» e interruptor de idioma. */
.search-form { display: grid; gap: var(--s3); }
.search-form .hint { margin-top: -4px; }
.has-tip { position: relative; }
.radar-tip { position: absolute; right: 0; bottom: calc(100% + 10px); z-index: 30; width: max-content; max-width: min(440px, 80vw); padding: 10px 14px; border-radius: var(--radius-sm); background: var(--panel-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); color: var(--text); font-size: 12.5px; line-height: 1.45; white-space: pre-line; animation: tip-in .25s var(--ease); }
.radar-tip::after { content: ''; position: absolute; right: 28px; top: 100%; border: 7px solid transparent; border-top-color: var(--panel-3); }
.radar-tip.leaving { opacity: 0; transform: translateY(-4px); transition: opacity .3s var(--ease), transform .3s var(--ease); }
@keyframes tip-in { from { opacity: 0; transform: translateY(6px); } }
.search-actions { align-items: center; gap: var(--s3); }
.lang-toggle { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 12px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2); }
.lang-toggle > svg { color: var(--violet); flex: none; }
.lang-toggle > div { display: grid; gap: 4px; }
.lang-toggle .hint { font-size: 11.5px; }
.lang-toggle:has(sl-switch[checked]) { border-color: rgba(255, 95, 162, .45); background: linear-gradient(90deg, rgba(255, 95, 162, .08), rgba(181, 123, 255, .05)); }
.lang-toggle:has(sl-switch[disabled]) { opacity: .55; }

/* Editor: revertir lo que hizo la IA y aviso de cambios detectados. */
.revert-ai { white-space: nowrap; }
/* Las acciones de cada tarjeta quedan abajo y a la misma altura en toda la fila. */
.clip-card { display: flex; flex-direction: column; }
.clip-card .card-body { display: flex; flex-direction: column; gap: 6px; }
.clip-card .card-actions { margin-top: auto; padding-top: 8px; }
