/* Jaque · la sala de juego: cada conversación es un tablero. Mismo lenguaje de la portada (negro, trama de puntos, verde y letra de cartel),
   para que entrar a trabajar se sienta igual de cuidado que llegar. Solo cambia los paneles de conversación; el resto del interior sigue claro. */
.tema { --peon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3.500a3 3 0 1 1 0 6 3 3 0 0 1 0-6zM9.6 10.500h4.800l1.8 6.500H7.800zM6 18h12v2.500H6z'/%3E%3C/svg%3E"); --caballo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 21h10v-2H7zm1-3h8c0-3.2-1-4.8-2.6-6.3 1.3-.300 2.6-1.1 2.6-3.2 0-2.6-2.1-4.7-5.2-5.200l-1 1.600L8.4 3.6 8 5.800C6.4 6.9 5.4 8.4 5.4 10l1.6 1.1 2.1-1c0 2.1-1.1 3.7-1.1 7.900z'/%3E%3C/svg%3E"); --torre: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 3.500h2.600v2h2v-2h2.800v2h2v-2H18V9l-2 1.500V16l2 2H6l2-2v-5.500L6 9zM5 19h14v2H5z'/%3E%3C/svg%3E"); --dama: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.800a1.7 1.7 0 1 1 0 3.4 1.7 1.7 0 0 1 0-3.400zM4.4 7.500l3.6 4 4-5 4 5 3.6-4L18 17H6zM5.5 18.500h13V21h-13z'/%3E%3C/svg%3E"); }

.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) {
  --ink: var(--crema); --ink-2: rgba(241, 237, 228, 0.78); --ink-3: rgba(241, 237, 228, 0.5);
  --surface: #101613; --bg: #161d19; --line: rgba(241, 237, 228, 0.1); --line-strong: rgba(241, 237, 228, 0.22); --brand-soft: rgba(0, 214, 143, 0.14); --brand-deep: #00d68f;
  position: relative; isolation: isolate; overflow: hidden; color: var(--ink);
  background: #070a09; box-shadow: 0 0 0 1px rgba(241, 237, 228, 0.08), 0 30px 60px rgba(5, 7, 6, 0.35);
  border-radius: 14px; padding: clamp(18px, 2.4vw, 30px);
}
/* Trama de puntos, como las imágenes de la portada, y un tablero que se asoma por la esquina */
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat)::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 88% -10%, rgba(0, 214, 143, 0.22), transparent 46%),
    radial-gradient(rgba(241, 237, 228, 0.07) 1px, transparent 1.4px) 0 0 / 14px 14px;
}
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat)::after {
  content: ""; position: absolute; top: -28px; right: -28px; width: 300px; height: 300px; z-index: -1; pointer-events: none;
  background: repeating-conic-gradient(rgba(241, 237, 228, 0.06) 0% 25%, transparent 0% 50%) 0 0 / 60px 60px;
  -webkit-mask-image: radial-gradient(circle at 100% 0, #000 10%, transparent 68%); mask-image: radial-gradient(circle at 100% 0, #000 10%, transparent 68%);
  transform: rotate(-8deg);
}
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) h3 { text-transform: uppercase; font-stretch: 122%; letter-spacing: -0.02em; font-size: clamp(19px, 2.2vw, 26px) !important; display: flex; align-items: center; gap: 12px; }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) h3::before { content: ""; width: 30px; height: 30px; flex: none; background: var(--brand); -webkit-mask: var(--caballo) center / contain no-repeat; mask: var(--caballo) center / contain no-repeat; }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .tag { background: rgba(241, 237, 228, 0.08); color: var(--ink-2); }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .tag-ok { background: rgba(0, 214, 143, 0.16); color: var(--brand); }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .tag-warn { background: rgba(255, 190, 92, 0.16); color: #ffcf8a; }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .hint, .tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .muted { color: var(--ink-3); }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) label { color: var(--ink-2); }

/* Qué necesitas: cada opción es una pieza */
.tema :is(#oferta-chat, #ej-chat, #bus-chat) [role="tablist"] { gap: 8px; }
.tema :is(#oferta-chat, #ej-chat, #bus-chat, #mer-chat, #def-chat) .chip { display: inline-flex; align-items: center; gap: 9px; background: rgba(241, 237, 228, 0.04); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-strong); border-radius: 6px; padding: 10px 14px; transition: background 0.25s, color 0.25s, box-shadow 0.25s, transform 0.25s; }
.tema :is(#oferta-chat, #ej-chat, #bus-chat, #mer-chat, #def-chat) .chip::before { content: ""; width: 17px; height: 17px; flex: none; background: currentColor; -webkit-mask: var(--peon) center / contain no-repeat; mask: var(--peon) center / contain no-repeat; transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.tema :is(#oferta-chat, #ej-chat, #bus-chat, #mer-chat, #def-chat) .chip:nth-child(3n + 2)::before { -webkit-mask-image: var(--torre); mask-image: var(--torre); }
.tema :is(#oferta-chat, #ej-chat, #bus-chat, #mer-chat, #def-chat) .chip:nth-child(3n)::before { -webkit-mask-image: var(--caballo); mask-image: var(--caballo); }
.tema :is(#oferta-chat, #ej-chat, #bus-chat, #mer-chat, #def-chat) .chip:last-child::before { -webkit-mask-image: var(--dama); mask-image: var(--dama); }
.tema :is(#oferta-chat, #ej-chat, #bus-chat, #mer-chat, #def-chat) .chip:hover { color: var(--crema); box-shadow: inset 0 0 0 1px rgba(0, 214, 143, 0.6); transform: translateY(-2px); }
.tema :is(#oferta-chat, #ej-chat, #bus-chat, #mer-chat, #def-chat) .chip:hover::before { transform: translateY(-3px); }
.tema :is(#oferta-chat, #ej-chat, #bus-chat, #mer-chat, #def-chat) .chip[aria-pressed="true"] { background: var(--brand); color: #04120c; box-shadow: 0 8px 24px rgba(0, 214, 143, 0.28); }

/* La conversación */
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .chat { gap: 16px; padding: 6px 2px; scrollbar-width: thin; scrollbar-color: rgba(241, 237, 228, 0.2) transparent; }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .chat-m { max-width: min(92%, 760px); }
/* Solo entra con movimiento la jugada más reciente; las anteriores se quedan quietas al repintar */
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .chat-m:last-child { animation: jugada 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .chat-m.jaque { grid-template-columns: 34px minmax(0, 1fr); column-gap: 12px; align-items: start; }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .chat-m.jaque::before { content: ""; grid-row: 1 / span 4; width: 34px; height: 34px; border-radius: 8px; background: var(--brand) var(--caballo) center / 62% no-repeat; background-blend-mode: normal;
  -webkit-mask: none; box-shadow: 0 0 0 1px rgba(0, 214, 143, 0.4), 0 6px 18px rgba(0, 214, 143, 0.22); }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .chat-m.jaque > * { grid-column: 2; }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .chat-b { border-radius: 4px 14px 14px 14px; background: #121815; color: var(--crema); box-shadow: inset 0 0 0 1px var(--line), inset 3px 0 0 var(--brand); padding: 14px 18px; line-height: 1.6; }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .chat-m.yo .chat-b { border-radius: 14px 4px 14px 14px; background: var(--brand); color: #04120c; box-shadow: none; font-weight: 500; }
@keyframes jugada { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Jaque pensando: un caballo que salta en L sobre tres casillas */
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .chat-b.muted { color: var(--ink-2); padding-left: 96px; position: relative; min-height: 52px; display: flex; align-items: center; }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .chat-b.muted::before { content: ""; position: absolute; left: 18px; top: 50%; width: 60px; height: 20px; transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, rgba(241, 237, 228, 0.16) 0 20px, rgba(241, 237, 228, 0.05) 20px 40px); border-radius: 3px; }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .chat-b.muted::after { content: ""; position: absolute; left: 20px; top: 50%; width: 16px; height: 16px; margin-top: -8px; background: var(--brand);
  -webkit-mask: var(--caballo) center / contain no-repeat; mask: var(--caballo) center / contain no-repeat; animation: salto-l 1.8s cubic-bezier(0.5, 0, 0.3, 1) infinite; }
@keyframes salto-l { 0%, 12% { transform: translate(0, 0); } 30% { transform: translate(0, -15px); } 48%, 60% { transform: translate(40px, -15px); } 78%, 100% { transform: translate(40px, 0); opacity: 1; } 99% { opacity: 0; } }

/* Escribir y adjuntar */
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) :is(textarea, input[type="text"], select) { background: rgba(241, 237, 228, 0.05); color: var(--crema); border: 1px solid var(--line-strong); border-radius: 8px; transition: border-color 0.25s, box-shadow 0.25s, background 0.25s; }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) :is(textarea, input[type="text"])::placeholder { color: var(--ink-3); }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) :is(textarea, input[type="text"], select):focus { border-color: var(--brand); background: rgba(241, 237, 228, 0.08); box-shadow: 0 0 0 4px rgba(0, 214, 143, 0.14); outline: none; }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) select option { color: #0c110f; }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) input[type="file"] { color: var(--ink-3); }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) input[type="file"]::file-selector-button { background: transparent; color: var(--crema); border: 1px solid var(--line-strong); }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) input[type="file"]::file-selector-button:hover { border-color: var(--brand); color: var(--brand); }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .btn { background: transparent; color: var(--crema); box-shadow: inset 0 0 0 1px var(--line-strong); }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .btn:hover { box-shadow: inset 0 0 0 1px var(--brand); color: var(--brand); }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .btn-primary { background: var(--brand); color: #04120c; box-shadow: 0 10px 26px rgba(0, 214, 143, 0.26); font-weight: 800; letter-spacing: 0.01em; transition: transform 0.25s, box-shadow 0.25s; }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .btn-primary:hover { color: #04120c; transform: translateY(-2px); box-shadow: 0 16px 34px rgba(0, 214, 143, 0.36); }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .btn-primary:disabled { opacity: 0.45; transform: none; box-shadow: none; }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .btn-dark { background: var(--crema); color: #050706; box-shadow: none; }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .btn-dark:hover { color: #050706; background: #ffffff; }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .archivo { background: rgba(0, 214, 143, 0.14); color: var(--crema); }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .archivo button { background: rgba(241, 237, 228, 0.14); color: var(--crema); }
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat).soltar { outline: 2px dashed var(--brand); outline-offset: 5px; background-image: none; }

/* Lo que es papel sigue siendo papel: el escrito redactado, el cálculo y las descargas van en hoja clara sobre el tablero */
.tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .doc-out { background: #fbfaf6; color: #0c110f; border-radius: 6px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); }
.tema #residual-chat, .tema #och-formatos, .tema #ej-chat > div:not(.chat):not(.row) {
  --ink: #0c110f; --ink-2: #3d4541; --ink-3: #6f7873; --surface: #f8f9f6; --bg: #e4e7e3; --line: rgba(12, 17, 15, 0.1); --line-strong: rgba(12, 17, 15, 0.24); --brand-soft: #d3f3e5; --brand-deep: #007a55;
  background: #f8f9f6; color: #0c110f; border-radius: 10px; padding: 16px 18px; }
.tema #residual-chat :is(input, select), .tema #och-formatos :is(input, select) { background: #ffffff; color: #0c110f; }
.tema #residual-chat .btn, .tema #och-formatos .btn, .tema #ej-chat > div:not(.chat):not(.row) .btn { background: #ffffff; color: #0c110f; box-shadow: inset 0 0 0 1px rgba(12, 17, 15, 0.24); }
.tema #residual-chat .btn-dark, .tema #och-formatos .btn-dark, .tema #ej-chat > div:not(.chat):not(.row) .btn-dark { background: #0c110f; color: #ffffff; }
.tema #residual-chat h3::before { display: none; }
.tema #residual-chat h3 { text-transform: none; font-size: 19px !important; }
.tema #residual-chat .tag, .tema #och-formatos .tag { background: #e9ece7; color: #3d4541; }
.tema #residual-chat .tag-ok, .tema #och-formatos .tag-ok { background: #d3f3e5; color: #007a55; }

/* Encabezado de página: una línea verde que se dibuja al entrar, como en la portada */
.tema .page-head { position: relative; }
.tema .page-head::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 72px; height: 3px; background: var(--brand); transform-origin: left; animation: trazo 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes trazo { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (max-width: 700px) {
  .tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .chat-m.jaque { grid-template-columns: 28px minmax(0, 1fr); column-gap: 9px; }
  .tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .chat-m.jaque::before { width: 28px; height: 28px; }
  .tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .chat-m { max-width: 100%; }
  .tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat)::after { width: 180px; height: 180px; }
}
@media (prefers-reduced-motion: reduce) {
  .tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .chat-m, .tema .page-head::after { animation: none; }
  .tema :is(#oferta-chat, #def-chat, #mer-chat, #ej-chat, #bus-chat) .chat-b.muted::after { animation: none; }
}

.tema #bus-chat .chat { max-height: 280px; overflow-y: auto; }

/* Aviso de adendas publicadas que la persona no le ha pasado a Jaque */
.tema .aviso-adendas { display: grid; gap: 8px; padding: 14px 16px; border-radius: 10px; background: rgba(255, 190, 92, 0.12); box-shadow: inset 0 0 0 1px rgba(255, 190, 92, 0.4), inset 3px 0 0 #ffbe5c; color: #ffe2b3; }
.tema .aviso-adendas b { color: #ffcf8a; }
.tema .aviso-adendas ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.tema .aviso-adendas a { color: var(--crema); text-decoration: underline; text-underline-offset: 3px; }
.tema .aviso-adendas li span, .tema .aviso-adendas > span { color: rgba(241, 237, 228, 0.7); font-size: 13.5px; }
/* Mientras Jaque trabaja, los botones rápidos se atenúan pero se siguen leyendo */
.tema :is(#oferta-chat, #ej-chat, #bus-chat, #mer-chat, #def-chat) .chip:disabled { opacity: 0.45; cursor: default; transform: none; }

/* Ejecución: la conversación vive en un panel con su propio scroll; la página no se alarga */
#ej-chat .chat { max-height: min(58vh, 560px); min-height: 200px; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; }
