/* Portal Vifer v3 · pantallas (parte 2): peticiones, documentos, mensajes, estado, seguridad, ajustes, informe,
   aprende (videos) y bienvenida. */
.screen--mid { max-width: 980px; }

/* PETICIONES */
.rq-top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.8fr); gap: 14px; align-items: stretch; }
.rq-top .hours { max-width: none; }
.rq-top .eq-sum { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
@media (max-width: 980px) { .rq-top { grid-template-columns: minmax(0, 1fr); } }
.rq-t__a { display: block; color: var(--fg); margin-bottom: 4px; }
.rq-t__a:hover { color: var(--cyan); }
.rq-head { display: grid; gap: 12px; }
.pdoc { display: grid; gap: 18px; padding: 22px; border: 1px solid var(--border-mid); border-radius: var(--r-lg); background: linear-gradient(180deg, rgba(var(--ink-rgb), 0.03), transparent 40%), var(--bg); }
.pdoc__h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border-subtle); }
.pdoc__h h2 { font-family: var(--font-display); font-size: 34px; font-weight: 400; line-height: 1; text-transform: uppercase; }
.pdoc__meta { display: grid; justify-items: end; gap: 2px; font-size: 12px; }
.pdoc__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 22px; }
.pdoc__grid .eyebrow { margin-bottom: 8px; }
.pdoc__files { padding-top: 12px; border-top: 1px dashed var(--border-subtle); }
.pdoc__sign { display: grid; gap: 8px; max-width: 560px; padding-top: 6px; }
.rq-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.rq-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border-mid); border-radius: var(--r-lg); cursor: pointer; }
.rq-opt:has(input:checked) { border-color: var(--cyan); background: var(--cyan-tint-08); }
.rq-opt input { margin-top: 4px; accent-color: var(--cyan); }
.rq-opt span { display: grid; gap: 2px; }
.rq-opt .dim { font-size: 13px; }
.stars { display: inline-flex; gap: 4px; }
.star { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--border-subtle); border-radius: var(--r-md); background: none; color: var(--fg-dim); }
.star.is-on { color: var(--warning); border-color: rgba(240, 179, 74, 0.4); }
.star.is-on .ico { fill: currentColor; }
.files { display: grid; gap: 6px; }
.file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border-subtle); border-radius: var(--r-md); font-size: 13.5px; }
.file span:first-of-type { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.file-up { position: relative; justify-self: start; cursor: pointer; }
.file-up:focus-within { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* DOCUMENTOS */
.docs { display: grid; }
.doc { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto 120px 16px; gap: 14px; align-items: center; width: 100%; padding: 12px 10px; border: 0; border-bottom: 1px solid var(--border-subtle); background: none; color: var(--fg); text-align: left; transition: background var(--dur-fast); }
.doc:hover { background: var(--surface-1); }
.doc__ico { display: grid; place-items: center; width: 40px; height: 48px; border: 1px solid var(--border-mid); border-radius: 6px 12px 6px 6px; background: var(--surface-2); color: var(--cyan); }
.doc__ico.is-invoice, .doc__ico.is-contract { color: var(--warning); } .doc__ico.is-dpa { color: var(--success); } .doc__ico.is-report { color: #b48cff; }
.doc__t { display: grid; min-width: 0; line-height: 1.35; }
.doc__t b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.doc__t .dim { font-size: 12.5px; }
.doc__d { font-size: 12px; text-align: right; }
.doc__go { color: var(--fg-dim); }
@media (max-width: 760px) { .doc { grid-template-columns: 40px minmax(0, 1fr) auto; } .doc__d, .doc__go { display: none; } }
.docv { display: grid; gap: 14px; }
.docv__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.docv__bar .dim { font-size: 12px; }
.paper { display: grid; gap: 16px; padding: 32px 34px 26px; border-radius: 6px; background: #f4efe6; color: #1b1c1f; box-shadow: 0 30px 60px rgba(16, 24, 40, 0.12); }
.paper .dim, .paper .muted { color: #5d5a55; }
.paper__h { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 2px solid #1b1c1f; }
.paper__brand { color: #008a95; font-weight: 500; letter-spacing: 0.2em; }
.paper__t { font-family: var(--font-display); font-size: 40px; font-weight: 400; line-height: 1; text-transform: uppercase; }
.paper__s { display: grid; gap: 6px; }
.paper__s h2 { color: #008a95; font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; }
.paper .facts { border-color: #d9d2c5; background: #ece6da; }
.paper .facts dt { color: #5d5a55; }
.paper .tbl th { color: #5d5a55; border-color: #c9c1b3; }
.paper .tbl td { border-color: #ddd6c8; }
.paper .ticks .ico { color: #008a95; }
.paper .bul { color: #3a3a3d; }
.paper .callout { border-color: #c98d1c; background: #f6e7c8; color: #3a2a06; }
.paper .callout .ico { color: #c98d1c; }
.paper .kc { background: #ece6da; border-color: #d9d2c5; min-height: 0; }
.paper .kc__v { color: #1b1c1f; }
.paper__f { padding-top: 10px; border-top: 1px solid #d9d2c5; font-size: 11.5px; }
@media (max-width: 640px) { .paper { padding: 22px 18px; } .paper__t { font-size: 30px; } }

/* MENSAJES */
.ms-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.8fr); gap: 22px; align-items: start; }
@media (max-width: 980px) { .ms-grid { grid-template-columns: minmax(0, 1fr); } }
.ms-main { display: grid; gap: 14px; }
.thread { display: grid; gap: 14px; max-height: 560px; padding: 6px 4px; overflow-y: auto; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg__b { display: grid; gap: 4px; max-width: 84%; padding: 12px 14px; border: 1px solid var(--border-subtle); border-radius: 4px 16px 16px 16px; background: var(--surface-2); font-size: 14.5px; line-height: 1.5; }
.msg__who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 12.5px; }
.msg.is-me { flex-direction: row-reverse; }
.msg.is-me .msg__b { border-color: var(--border-cyan); border-radius: 16px 4px 16px 16px; background: var(--cyan-tint-08); }
.composer { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
.live-chip.is-off { border-color: var(--border-mid); background: none; color: var(--fg-muted); }
.live-chip.is-off .live-chip__dot { background: var(--fg-dim); animation: none; }
.slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.slots__d { display: grid; gap: 6px; align-content: start; }
.slots__h { display: grid; text-align: center; line-height: 1.2; }
.slots__h b { text-transform: capitalize; }
.slots__h .dim { font-size: 12px; }
.slot { min-height: 40px; border: 1px solid var(--border-mid); border-radius: var(--r-md); background: var(--surface-1); color: var(--fg); font-family: var(--font-mono); font-size: 13px; }
.slot:hover:not([disabled]) { border-color: var(--cyan); }
.slot[aria-pressed="true"] { border-color: var(--cyan); background: var(--cyan); color: var(--fg-on-cyan); }
.slot[disabled] { opacity: 0.4; text-decoration: line-through; }
@media (max-width: 640px) { .slots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ESTADO */
.st-banner { display: flex; align-items: center; gap: 16px; padding: 20px 22px; border: 1px solid rgba(77, 213, 153, 0.35); border-radius: var(--r-xl); background: radial-gradient(60% 120% at 0% 0%, rgba(77, 213, 153, 0.14), transparent 60%), var(--surface-1); }
.st-banner b { font-size: 20px; }
.st-banner .status-line__dot { width: 14px; height: 14px; }
.st-banner.is-warn { border-color: rgba(240, 179, 74, 0.4); }
.uprs { display: grid; gap: 18px; }
.upr { display: grid; gap: 8px; }
.upr__h { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.upr__h a { color: var(--fg); }
.upr__h .dim { font-size: 12.5px; }
.upr__p { margin-left: auto; }

/* SEGURIDAD */
.sg-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.sg-card { display: grid; align-content: start; gap: 8px; padding: 18px; border: 1px solid var(--border-subtle); border-radius: var(--r-lg); background: linear-gradient(160deg, rgba(77, 213, 153, 0.06), var(--surface-1) 50%); }
.sg-card__ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-md); background: rgba(77, 213, 153, 0.12); color: var(--success); }
.sg-card .muted { font-size: 13.5px; }

/* AJUSTES */
.aj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
.aj-grid__full { grid-column: 1 / -1; align-items: center; flex-wrap: wrap; }
.aj-f { display: grid; gap: 2px; }
@media (max-width: 640px) { .aj-grid { grid-template-columns: minmax(0, 1fr); } }
.aj-inv { display: grid; grid-template-columns: 1fr 1.4fr 0.9fr auto; gap: 8px; }
@media (max-width: 760px) { .aj-inv { grid-template-columns: minmax(0, 1fr); } }

/* INFORME */
.rp-hero { display: grid; grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr); gap: 24px; padding: 24px; border: 1px solid var(--border-cyan); border-radius: var(--r-xl); background: radial-gradient(60% 120% at 0% 0%, rgba(0, 194, 209, 0.16), transparent 60%), var(--surface-1); }
.rp-hero__n { display: grid; align-content: center; gap: 6px; }
.rp-hero__n > b { color: var(--cyan-bright); font-family: var(--font-display); font-size: clamp(64px, 7vw, 96px); font-weight: 400; line-height: 0.9; }
.rp-hero__t { display: grid; align-content: center; gap: 8px; padding-left: 24px; border-left: 1px solid var(--border-subtle); }
.rp-sum { font-size: 17px; line-height: 1.6; }
.rp-fam { display: block; font-size: 11.5px; }
@media (max-width: 760px) { .rp-hero { grid-template-columns: minmax(0, 1fr); } .rp-hero__t { padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--border-subtle); } }

/* APRENDE */
.ap-hero { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.85fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .ap-hero { grid-template-columns: minmax(0, 1fr); } }
.ap-list { display: grid; gap: 10px; }
.films { display: grid; gap: 6px; }
.filmc { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid transparent; border-radius: var(--r-lg); color: var(--fg); }
.filmc:hover { background: var(--surface-1); color: var(--fg); }
.filmc.is-on { border-color: var(--border-cyan); background: var(--cyan-tint-08); }
.filmc__ico { position: relative; display: grid; place-items: center; width: 46px; height: 46px; border-radius: var(--r-md); background: linear-gradient(140deg, rgba(0, 194, 209, 0.25), rgba(0, 194, 209, 0.05)); color: var(--cyan); }
.filmc__play { position: absolute; right: -4px; bottom: -4px; display: grid; place-items: center; width: 20px; height: 20px; border: 2px solid var(--bg); border-radius: 50%; background: var(--cyan); color: var(--fg-on-cyan); }
.filmc__play .ico { fill: currentColor; }
.filmc__t { display: grid; min-width: 0; line-height: 1.3; }
.filmc__t .dim { overflow: hidden; font-size: 12.5px; white-space: nowrap; text-overflow: ellipsis; }
.filmc__len { font-size: 11.5px; }
.gloss { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; padding: 14px; border: 1px solid var(--border-subtle); border-radius: var(--r-lg); }
.gloss dt { font-weight: 600; }
@media (max-width: 640px) { .gloss { grid-template-columns: minmax(0, 1fr); } .gloss dd { margin-bottom: 8px; } }

/* REPRODUCTOR DE VIDEO */
.film { display: grid; gap: 0; margin: 0; overflow: hidden; border: 1px solid var(--border-mid); border-radius: var(--r-xl); background: var(--surface-1); box-shadow: var(--shadow-lg); outline: none; }
.film__stage { position: relative; }
.film__screen { --s: 0.5; position: relative; aspect-ratio: 1280 / 760; overflow: hidden; background: var(--bg); }
.film__if { position: absolute; left: 0; top: 0; width: 1280px; height: 760px; border: 0; transform: scale(var(--s)); transform-origin: 0 0; pointer-events: none; }
.film__shield { position: absolute; inset: 0; }
.film__cur { position: absolute; left: 0; top: 0; z-index: 2; color: #fff; filter: drop-shadow(0 2px 6px rgba(16, 24, 40, 0.12)); transform: translate(calc(var(--cx, 640px) * var(--s)), calc(var(--cy, 380px) * var(--s))); transition: transform 900ms var(--ease-out); opacity: 0; }
.film.is-pointing .film__cur { opacity: 1; }
.film__arrow { fill: #fff; stroke: var(--bg); stroke-width: 1.2; }
.film__cur::after { content: ""; position: absolute; left: -10px; top: -10px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--cyan); opacity: 0; }
.film__cur.is-click::after { animation: click 500ms var(--ease-out); }
@keyframes click { 0% { opacity: 1; transform: scale(0.4); } 100% { opacity: 0; transform: scale(1.8); } }
.film__ring { position: absolute; left: 0; top: 0; z-index: 1; width: calc(var(--rw, 0px) * var(--s)); height: calc(var(--rh, 0px) * var(--s)); border-radius: 10px; box-shadow: 0 0 0 2px var(--cyan), 0 0 0 9999px rgba(5, 6, 8, 0.42); transform: translate(calc(var(--rx, 0px) * var(--s)), calc(var(--ry, 0px) * var(--s))); opacity: 0; transition: opacity 300ms; }
.film.is-pointing .film__ring { opacity: 1; }
.film__big { position: absolute; left: 50%; top: 50%; z-index: 3; display: grid; place-items: center; width: 78px; height: 78px; border: 0; border-radius: 50%; background: var(--cyan); color: var(--fg-on-cyan); box-shadow: 0 0 0 10px rgba(0, 194, 209, 0.18), var(--shadow-lg); transform: translate(-50%, -50%); transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base); }
.film__big .ico { fill: currentColor; margin-left: 4px; }
.film__big:hover { transform: translate(-50%, -50%) scale(1.06); }
.film.is-playing .film__big { opacity: 0; pointer-events: none; }
.film__ui { display: grid; gap: 10px; padding: 14px 16px 12px; border-top: 1px solid var(--border-subtle); }
.film__cap { min-height: 3em; font-size: 16px; line-height: 1.5; }
.film__bar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
.film__bar li { height: 4px; overflow: hidden; border-radius: 2px; background: var(--surface-3); }
.film__bar li span { display: block; height: 100%; background: var(--cyan); transform: scaleX(0); transform-origin: left; }
.film__bar li.is-done span { transform: none; }
.film.is-playing .film__bar li.is-now span { animation: barfill 4s linear forwards; }
@keyframes barfill { to { transform: scaleX(1); } }
.film__ctl { display: flex; align-items: center; gap: 6px; }
.film__btn { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--border-mid); border-radius: 50%; background: none; color: var(--fg); }
.film__btn:hover { border-color: var(--cyan); color: var(--cyan); }
.film__btn--play { width: 42px; height: 42px; border: 0; background: var(--cyan); color: var(--fg-on-cyan); }
.film__btn--play .ico { fill: currentColor; }
.film__n { margin-left: 6px; color: var(--fg-dim); font-size: 12px; }
.film__try { margin-left: auto; font-size: 13px; }
.film__tx { padding: 0 16px 14px; font-size: 13.5px; }
.film__tx summary { color: var(--fg-muted); cursor: pointer; }
.film__tx ol { display: grid; gap: 4px; padding: 10px 0 0 18px; list-style: decimal; color: var(--fg-muted); }
@media (max-width: 640px) { .film__cap { font-size: 14px; } .film__big { width: 60px; height: 60px; } }

/* BIENVENIDA */
.welcome__h { display: grid; gap: 16px; justify-items: start; padding: 32px; border: 1px solid var(--border-cyan); border-radius: var(--r-xl); background: radial-gradient(70% 120% at 0% 0%, rgba(0, 194, 209, 0.16), transparent 60%), var(--surface-1); }
.welcome__t { font-family: var(--font-display); font-size: clamp(44px, 6vw, 80px); font-weight: 400; line-height: 0.95; text-transform: uppercase; }
.welcome__msg { display: flex; gap: 14px; align-items: flex-start; max-width: 70ch; font-size: 16px; line-height: 1.6; }
.wsteps { display: grid; gap: 10px; }
.wstep { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--border-subtle); border-radius: var(--r-lg); }
.wstep > span:last-child { display: grid; line-height: 1.35; }
.wstep .dim { font-size: 13px; }
.wstep__d { display: grid; place-items: center; padding: 6px 0; border-radius: var(--r-md); background: var(--surface-3); line-height: 1; }
.wstep__d b { font-size: 20px; }
.wstep__d span { color: var(--fg-dim); font-size: 10.5px; text-transform: uppercase; }
.wstep.is-now { border-color: var(--border-cyan); background: var(--cyan-tint-08); }
.wstep.is-now .wstep__d { background: var(--cyan); color: var(--fg-on-cyan); }
.wstep.is-now .wstep__d span { color: var(--fg-on-cyan); }

/* Modo video (dentro del reproductor): sin franja ni distracciones */
html.is-film .demo-strip { display: none; }
html.is-film .toasts { display: none; }

/* Imprimir: el informe o el documento abierto, en papel */
@media print {
  .top, .side, .tabs, .ctx, .demo-strip, .toasts, .ac-bar, .s-head__act, .ptabs, .film { display: none !important; }
  body { background: #fff; color: #000; }
  body.is-printing #app { display: none; }
  body.is-printing .overlay { position: static; background: none; }
  body.is-printing .drawer { position: static; width: auto; transform: none; box-shadow: none; border: 0; background: #fff; }
  body.is-printing .docv__bar, body.is-printing .drawer__x { display: none; }
  .paper { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { .film__cur, .film__ring, .film__big { transition: none; } .film.is-playing .film__bar li.is-now span, .film__cur.is-click::after { animation: none; } }

/* Pase 28b (evaluador): tablero sin solapes; en pantallas anchas, 5 columnas iguales que caben siempre */
.col, .req { min-width: 0; }
.req__top { flex-wrap: wrap; }
.req__when { white-space: nowrap; }
.req__t, .req__d { overflow-wrap: anywhere; }
@media (min-width: 1200px) { .board { grid-auto-columns: minmax(0, 1fr); overflow: visible; } }
@media (max-width: 420px) {
  .demo-strip { flex-wrap: wrap; row-gap: 2px; padding: 4px 10px; }
  .demo-strip > span:nth-child(2) { white-space: normal; text-align: center; }
  .lmap__col:not(.lmap__col--mid) .lmap__nt b { white-space: normal; line-height: 1.2; }
}
.col, .col__list, .req { grid-template-columns: minmax(0, 1fr); }
.req__foot { flex-wrap: wrap; row-gap: 6px; }
.track--mini { min-width: 0; }
