/* «Mi biblioteca» y «Administración»: estilo blanco del panel, pensado para móvil. */
.lib-main { padding-top: 40px; padding-bottom: 60px; }
.lib-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.lib-head h1 { margin: 6px 0 4px; font-size: clamp(30px, 6vw, 44px); letter-spacing: -1px; color: #10233a; }
.lib-head p { margin: 0; color: #5b6d80; font-size: 15px; max-width: 60ch; }
.lib-back { font-size: 14px; color: #0a4f86; text-decoration: none; font-weight: 600; }
.lib-card { background: #fff; border: 1px solid #dfe7ef; border-radius: 16px; padding: 16px; margin-bottom: 16px; box-shadow: 0 6px 20px rgba(16, 35, 58, .05); }
.lib-card h2 { margin: 0 0 10px; font-size: 18px; color: #10233a; }
.lib-upload { display: grid; gap: 10px; grid-template-columns: minmax(170px, 240px) 1fr auto; align-items: end; }
.lib-upload label { display: grid; gap: 4px; font-size: 13px; color: #33465a; font-weight: 600; min-width: 0; }
.lib-upload input[type=text], .lib-upload select, .lib-field input, .lib-field select, .lib-field textarea { font: 500 15px/1.3 var(--font, 'DM Sans', sans-serif); padding: 9px 11px; border: 1px solid #cfdae6; border-radius: 10px; background: #fff; color: #10233a; min-width: 0; width: 100%; box-sizing: border-box; }
.lib-file { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; grid-column: 1 / -1; }
.lib-file input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.lib-file label.lib-btn { cursor: pointer; }
.lib-file input[type=file]:focus-visible + label { outline: 3px solid #0a6fa8; outline-offset: 2px; }
.lib-note-small { font-size: 12.5px; color: #5b6d80; margin: 6px 0 0; }
.lib-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid #0a4f86; background: #0a4f86; color: #fff !important; font: 700 14px/1 var(--font, 'DM Sans', sans-serif); cursor: pointer; text-decoration: none; white-space: nowrap; }
.lib-btn.ghost { background: #fff; color: #0a4f86 !important; }
.lib-btn.danger { background: #fff; color: #9b1c1c !important; border-color: #e7b4b4; }
.lib-btn.small { min-height: 32px; padding: 0 11px; font-size: 13px; }
.lib-btn[disabled] { opacity: .55; cursor: not-allowed; }
.lib-btn:focus-visible, .lib-tab:focus-visible { outline: 3px solid #0a6fa8; outline-offset: 2px; }
.lib-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.lib-tab { border: 1px solid #cfdae6; background: #fff; color: #33465a; border-radius: 999px; padding: 6px 12px; font: 600 13px/1 var(--font, 'DM Sans', sans-serif); cursor: pointer; }
.lib-tab[aria-pressed="true"] { background: #e8f1fa; border-color: #0a4f86; color: #0a4f86; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.lib-item { margin: 0; background: #fff; border: 1px solid #dfe7ef; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.lib-item img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: #eef3f8; }
.lib-item figcaption { padding: 9px 10px 10px; display: grid; gap: 6px; min-width: 0; }
.lib-tag { justify-self: start; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; color: #0a4f86; background: #e8f1fa; border-radius: 999px; padding: 3px 8px; }
.lib-tag.ia { color: #6b3fa0; background: #f2eafb; }
.lib-tag.mascot { color: #11603a; background: #e6f6ed; }
.lib-item p { margin: 0; font-size: 13.5px; color: #33465a; line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lib-item .lib-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.lib-item small { font-size: 12px; color: #6b7a8c; }
.lib-used { justify-self: start; font-size: 11.5px; font-weight: 700; color: #7a5200; background: #fff8e6; border-radius: 999px; padding: 2px 8px; }
.lib-empty { padding: 30px 10px; text-align: center; color: #5b6d80; }
.lib-msg { min-height: 1.2em; font-size: 14px; color: #33465a; margin: 6px 0 0; }
.lib-msg.error { color: #9b1c1c; }
.lib-meter { height: 6px; border-radius: 99px; background: #e6edf4; overflow: hidden; margin-top: 6px; }
.lib-meter i { display: block; height: 100%; background: #0a6fa8; }
/* Diálogo de confirmación */
.lib-dialog { border: 0; border-radius: 16px; padding: 0; max-width: min(420px, 92vw); box-shadow: 0 20px 60px rgba(16, 35, 58, .3); }
.lib-dialog::backdrop { background: rgba(16, 35, 58, .45); }
.lib-dialog form { padding: 18px; display: grid; gap: 12px; }
.lib-dialog h3 { margin: 0; font-size: 18px; color: #10233a; }
.lib-dialog p { margin: 0; color: #33465a; font-size: 15px; line-height: 1.45; }
.lib-dialog menu { display: flex; justify-content: flex-end; gap: 8px; margin: 0; padding: 0; flex-wrap: wrap; }
/* Admin */
.adm-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm-table th, .adm-table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid #e6edf4; vertical-align: top; }
.adm-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #5b6d80; white-space: nowrap; }
.adm-table td b { color: #10233a; }
.adm-table tr:hover td { background: #f7fafd; }
.adm-pill { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 8px; background: #eef2f6; color: #33465a; white-space: nowrap; }
.adm-pill.ok { background: #e6f6ed; color: #11603a; }
.adm-pill.warn { background: #fff8e6; color: #7a5200; }
.adm-pill.no { background: #fdecec; color: #9b1c1c; }
.adm-pill.plus { background: #f2eafb; color: #6b3fa0; }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.adm-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 14px; margin: 0; }
.adm-kv dt { color: #5b6d80; } .adm-kv dd { margin: 0; color: #10233a; overflow-wrap: anywhere; }
.adm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.lib-field { display: grid; gap: 4px; font-size: 13px; color: #33465a; font-weight: 600; margin-bottom: 8px; }
.lib-field textarea { min-height: 70px; resize: vertical; }
.adm-mascot { width: 120px; height: 120px; object-fit: contain; border-radius: 12px; background: #eef3f8; border: 1px solid #dfe7ef; }
.adm-log { list-style: none; margin: 0; padding: 0; font-size: 13px; color: #33465a; display: grid; gap: 4px; }
.adm-search { width: 100%; max-width: 320px; }
@media (max-width: 640px) {
  .lib-upload { grid-template-columns: 1fr; }
  .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .lib-item p { font-size: 13px; }
  .adm-table thead { display: none; }
  .adm-table, .adm-table tbody, .adm-table tr, .adm-table td { display: block; width: 100%; box-sizing: border-box; }
  .adm-table tr { border: 1px solid #dfe7ef; border-radius: 12px; margin-bottom: 10px; padding: 6px 4px; }
  .adm-table td { border: 0; padding: 4px 8px; }
  .adm-table td[data-label]::before { content: attr(data-label) ' · '; color: #5b6d80; font-size: 12px; }
}
/* Programar publicaciones */
.pg-accounts { font-size: 14px; color: #33465a; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.pg-form { display: grid; gap: 14px; }
.pg-step { border: 1px solid #e3eaf1; border-radius: 14px; padding: 12px 14px 14px; margin: 0; min-width: 0; }
.pg-step legend { padding: 0 6px; font-weight: 700; color: #10233a; font-size: 15px; }
.pg-step legend b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 99px; background: #0a4f86; color: #fff; font-size: 12px; margin-right: 4px; }
.pg-sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; max-height: 360px; overflow: auto; padding: 2px; }
.pg-src { position: relative; display: grid; gap: 4px; text-align: left; padding: 6px; border: 2px solid #e3eaf1; border-radius: 12px; background: #fff; cursor: pointer; font: 500 12.5px/1.3 var(--font, 'DM Sans', sans-serif); color: #33465a; min-width: 0; }
.pg-src[aria-checked="true"] { border-color: #0a4f86; background: #f2f7fc; }
.pg-src:focus-visible { outline: 3px solid #0a6fa8; outline-offset: 2px; }
.pg-src img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: #eef3f8; border-radius: 8px; display: block; }
.pg-src span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.pg-src .pg-kind { position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 700; background: rgba(255,255,255,.94); color: #0a4f86; border-radius: 99px; padding: 2px 7px; }
.pg-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.pg-chip { border: 1px solid #cfdae6; background: #fff; color: #33465a; border-radius: 999px; padding: 8px 14px; font: 700 14px/1 var(--font, 'DM Sans', sans-serif); cursor: pointer; }
.pg-chip[aria-checked="true"] { background: #0a4f86; border-color: #0a4f86; color: #fff; }
.pg-chip[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.pg-chip:focus-visible { outline: 3px solid #0a6fa8; outline-offset: 2px; }
.pg-when { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pg-days { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.pg-days button { border: 1px solid #cfdae6; background: #fff; border-radius: 99px; padding: 7px 11px; font: 700 13px/1 var(--font, 'DM Sans', sans-serif); cursor: pointer; color: #33465a; }
.pg-days button[aria-pressed="true"] { background: #e8f1fa; border-color: #0a4f86; color: #0a4f86; }
.pg-summary { margin: 4px 0 0; padding: 9px 12px; border-radius: 10px; background: #f2f7fc; color: #10233a; font-size: 14px; }
.pg-summary:empty { display: none; }
.pg-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 14px; }
.pg-calendar .pg-dayname { font-size: 11px; font-weight: 700; color: #5b6d80; text-align: center; text-transform: uppercase; }
.pg-calendar .pg-cell { min-height: 46px; border: 1px solid #e6edf4; border-radius: 8px; padding: 3px 4px; font-size: 11px; color: #5b6d80; background: #fff; overflow: hidden; }
.pg-calendar .pg-cell.today { border-color: #0a4f86; }
.pg-calendar .pg-cell.has { background: #f2f7fc; }
.pg-calendar .pg-cell i { display: block; font-style: normal; font-weight: 700; color: #0a4f86; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-list { display: grid; gap: 10px; }
.pg-item { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 10px; border: 1px solid #e3eaf1; border-radius: 14px; align-items: start; }
.pg-item img, .pg-item .pg-vthumb { width: 72px; height: 72px; object-fit: contain; border-radius: 10px; background: #eef3f8; display: grid; place-items: center; font-size: 26px; }
.pg-item h3 { margin: 0 0 4px; font-size: 15px; color: #10233a; }
.pg-item p { margin: 0 0 4px; font-size: 13.5px; color: #33465a; overflow-wrap: anywhere; }
.pg-item .pg-next { color: #0a4f86; font-weight: 700; }
.pg-item .pg-err { color: #9b1c1c; }
.pg-help ul { margin: 0; padding-left: 18px; color: #33465a; font-size: 14px; line-height: 1.5; }
@media (max-width: 640px) {
  .pg-when { grid-template-columns: 1fr 1fr; }
  .pg-when .lib-field:nth-child(3) { grid-column: 1 / -1; }
  .pg-sources { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pg-calendar .pg-cell { min-height: 38px; font-size: 10px; }
  .pg-item { grid-template-columns: 56px 1fr; } .pg-item img, .pg-item .pg-vthumb { width: 56px; height: 56px; }
}
.lib-tab[aria-selected="true"] { background: #e8f1fa; border-color: #0a4f86; color: #0a4f86; }
.lib-msg.is-error { color: #9b1c1c; }
/* Mi cuenta */
.ac-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ac-mini h2 { font-size: 15px; margin: 0 0 6px; } .ac-mini p { margin: 0 0 4px; }
.ac-form { display: grid; gap: 4px; max-width: 560px; }
.ac-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ac-details summary { cursor: pointer; font-weight: 700; color: #0a4f86; padding: 8px 0; }
.ac-type { border: 1px solid #e3eaf1; border-radius: 12px; padding: 8px 12px; margin: 0 0 8px; }
.ac-radio { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; font-size: 14px; }
.contract-mini-link { border: 0; background: none; color: #0a4f86; font: 700 14px/1.3 var(--font, 'DM Sans', sans-serif); padding: 0; cursor: pointer; text-decoration: underline; }
.ac-contract-dialog { border: 0; border-radius: 16px; padding: 20px; max-width: min(460px, 92vw); }
.ac-contract-dialog menu { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 14px 0 0; }
.ac-confirm { border-color: #0a4f86; }
.lib-head #ac-logout { align-self: flex-start; }
@media (max-width: 640px) { .ac-summary, .ac-grid { grid-template-columns: 1fr; } }
.pg-sources > .lib-empty { grid-column: 1 / -1; }
/* Vídeos en «Mi biblioteca»: póster entero, ▶ y duración; reproductor 9:16 a pantalla. */
.lib-subtabs { margin-top: -4px; }
.lib-tab.small { padding: 5px 10px; font-size: 12px; }
.lib-vthumb { position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; padding: 0; border: 0; background: #0f1d2c; cursor: pointer; overflow: hidden; }
.lib-vthumb img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; background: #0f1d2c; }
.lib-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #0a4f86; display: grid; place-items: center; font-size: 20px; padding-left: 4px; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.lib-vthumb:hover .lib-play, .lib-vthumb:focus-visible .lib-play { background: #fff; transform: translate(-50%, -50%) scale(1.06); }
.lib-vthumb:focus-visible { outline: 3px solid #0a6fa8; outline-offset: -3px; }
.lib-dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .72); color: #fff; font: 700 12px/1 var(--font, 'DM Sans', sans-serif); padding: 4px 7px; border-radius: 6px; }
.lib-tag.video { color: #8a3b00; background: #fff1e6; }
.lib-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.lib-player { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
.lib-player::backdrop { background: rgba(6, 14, 24, .82); }
.lib-player-in { background: #fff; border-radius: 16px; padding: 12px; display: grid; gap: 8px; }
.lib-player-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lib-player-head h3 { margin: 0; font-size: 16px; }
.lib-player-x { border: 0; background: #eef3f8; width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; color: #10233a; }
.lib-player-box { aspect-ratio: 9 / 16; height: min(74vh, 820px); max-width: 90vw; background: #000; border-radius: 12px; overflow: hidden; margin: 0 auto; }
.lib-player-box video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
@media (max-width: 560px) { .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .lib-actions .lib-btn.small { padding: 0 9px; font-size: 12.5px; } .lib-player-box { height: min(70vh, 160vw); } }
.lib-video .lib-actions { display: grid; grid-template-columns: 1fr 1fr; }
.lib-video .lib-actions > a:first-child { grid-column: 1 / -1; }
.lib-video .lib-actions .lib-btn { width: 100%; }
