/* AIM Prototipo · El taller: la conversación a la izquierda y la página, viva, a la derecha.
   Los mismos tokens que AIM Genera (grafito cálido y blanco papel; el acento, el de la estética
   elegida en la suite) con el azul petróleo de la app en la tesela y en la línea de progreso. */

@font-face {
  font-family: "Bricolage";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/fuentes/bricolage-latin.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/fuentes/bricolage-latin-ext.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --fondo: #121110;
  --hoja: #1a1816;
  --hoja-2: #232019;
  --linea: #35312b;
  --texto: #efe8dc;
  --tenue: #a49b8c;
  --app: #8fc3db;
  --peligro: #ff8a7a;
  --acento: #378ef0;
  --sobre-acento: #ffffff;
  --radio: 12px;
  --charla: 420px;
  color-scheme: dark;
}
:root[data-tema="claro"] {
  --fondo: #e9e8e4; --hoja: #f7f6f3; --hoja-2: #efede8; --linea: #d2cfc8; --texto: #191713; --tenue: #5e594f; --app: #24566e; --peligro: #b0281a;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-tema="oscuro"]) {
    --fondo: #e9e8e4; --hoja: #f7f6f3; --hoja-2: #efede8; --linea: #d2cfc8; --texto: #191713; --tenue: #5e594f; --app: #24566e; --peligro: #b0281a;
    color-scheme: light;
  }
}
html[data-estetica="futuristic"] { --acento: #00d6f0; --sobre-acento: #06070a; }
html[data-estetica="calm"] { --acento: #5896e6; --sobre-acento: #ffffff; }
html[data-estetica="focus"] { --acento: #34ba7c; --sobre-acento: #06070a; }
html[data-estetica="energy"] { --acento: #ff7a3e; --sobre-acento: #06070a; }
html[data-estetica="inspiration"] { --acento: #a076ff; --sobre-acento: #ffffff; }
html[data-estetica="joy"] { --acento: #f0ba1e; --sobre-acento: #06070a; }
html[data-estetica="serenity"] { --acento: #e876a4; --sobre-acento: #06070a; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--fondo);
  color: var(--texto);
  font-family: "Bricolage", system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.55; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--acento); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.saltar { position: absolute; left: 12px; top: -60px; padding: 10px 14px; background: var(--hoja); border-radius: 8px; z-index: 50; }
.saltar:focus { top: 12px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Barra (como en Genera) ---- */
.barra {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px;
  background: color-mix(in srgb, var(--fondo) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--linea);
}
.marca { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; }
.marca .tesela { width: 26px; height: 26px; flex: none; }
.marca-nombre { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.marca-nombre .aim { color: var(--tenue); }
.beta { font-size: 11px; font-weight: 650; padding: 3px 8px; border: 1px solid var(--linea); border-radius: 999px; color: var(--tenue); letter-spacing: 0.02em; }
.barra-der { display: flex; align-items: center; gap: 8px; }
.saldo { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 14px; border: 1px solid var(--linea); border-radius: 999px; background: var(--hoja); font-size: 14px; color: var(--tenue); }
.saldo-n { font-size: 16px; font-weight: 720; color: var(--texto); font-variant-numeric: tabular-nums; }
.icono { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid transparent; border-radius: 50%; background: none; color: var(--tenue); }
.icono:hover { color: var(--texto); background: var(--hoja-2); }
.cuenta { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--tenue); text-decoration: none; padding: 6px 4px; }
.aviso { margin: 12px 20px 0; padding: 12px 16px; border-radius: var(--radio); background: var(--hoja-2); border: 1px solid var(--linea); font-size: 15px; }
.aviso.error { border-color: color-mix(in srgb, var(--peligro) 50%, var(--linea)); }
.aviso a { color: var(--acento); font-weight: 600; }

/* ---- Botones ---- */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 16px;
  border: 1px solid var(--linea); border-radius: 999px; background: var(--hoja);
  font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.boton:hover:not(:disabled) { background: var(--hoja-2); }
.boton.principal { background: var(--acento); color: var(--sobre-acento); border-color: transparent; }
.boton.principal:hover:not(:disabled) { background: color-mix(in srgb, var(--acento) 86%, #000); }
.boton.suave { background: none; }
.chip { min-height: 34px; padding: 5px 12px; border: 1px solid var(--linea); border-radius: 999px; background: none; font-size: 14px; color: var(--tenue); }
.chip[aria-pressed="true"] { background: var(--hoja-2); color: var(--texto); border-color: color-mix(in srgb, var(--acento) 55%, var(--linea)); }

/* ---- Taller ---- */
.taller { display: grid; grid-template-columns: 1fr; }
@media (min-width: 1000px) {
  .taller { grid-template-columns: var(--charla) 1fr; height: calc(100vh - 59px); }
  .charla { border-right: 1px solid var(--linea); overflow-y: auto; scrollbar-width: thin; }
}
.charla { padding: 22px 22px 32px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.puerta { padding: 20px; border: 1px solid var(--linea); border-radius: var(--radio); background: var(--hoja); }
.puerta h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.02em; }
.puerta p { margin: 0 0 14px; color: var(--tenue); }
.puerta p:last-child { margin: 0; }

.mensajes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mensajes:empty { display: none; }
.msg { max-width: 92%; padding: 10px 14px; border-radius: 14px; font-size: 15px; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.yo { align-self: flex-end; background: var(--hoja-2); border-bottom-right-radius: 4px; }
.msg.app { align-self: flex-start; background: var(--hoja); border: 1px solid var(--linea); border-bottom-left-radius: 4px; }
.msg.app button.ver { margin-top: 6px; padding: 0; border: 0; background: none; color: var(--acento); font-weight: 600; font-size: 14px; }
.msg.error { border-color: color-mix(in srgb, var(--peligro) 50%, var(--linea)); }
.msg .imgs { display: flex; gap: 6px; margin-top: 6px; }
.msg .imgs img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.msg .meta { display: block; margin-top: 4px; font-size: 12px; color: var(--tenue); }
.msg.trabajando { color: var(--tenue); position: relative; overflow: hidden; }
.msg.trabajando::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 40%; background: var(--app); animation: avance 1.6s ease-in-out infinite; }
@keyframes avance { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .msg.trabajando::after { animation: none; width: 100%; opacity: 0.5; } }

.redactar { display: flex; flex-direction: column; gap: 12px; }
.redactar textarea {
  width: 100%; min-height: 112px; resize: vertical; padding: 12px 14px;
  border: 1px solid var(--linea); border-radius: var(--radio); background: var(--hoja);
  font-size: 17px; line-height: 1.45;
}
.redactar textarea:focus { outline: none; border-color: var(--acento); }
.ideas { display: flex; flex-wrap: wrap; gap: 6px; }
.ideas:empty { display: none; }
.fila { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.adjuntar { cursor: pointer; font-size: 14px; min-height: 38px; }
.coste { font-size: 13px; color: var(--tenue); }
.adjuntos { display: flex; gap: 8px; flex-wrap: wrap; }
.adjuntos:empty { display: none; }
.adjunto { position: relative; }
.adjunto img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--linea); display: block; }
.adjunto button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 1px solid var(--linea); background: var(--hoja); font-size: 13px; line-height: 1; }
.derechos { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--tenue); }
.derechos input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--acento); }
.enviar { width: 100%; min-height: 48px; font-size: 16px; }
.nota { margin: 0; font-size: 13px; color: var(--tenue); }

/* ---- Vista ---- */
.vista { display: flex; flex-direction: column; min-width: 0; min-height: 70vh; border-top: 1px solid var(--linea); }
@media (min-width: 1000px) { .vista { min-height: 0; border-top: 0; } }
.vista-barra { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--linea); }
.vista-barra h2 { margin: 0 auto 0 0; font-size: 15px; font-weight: 650; color: var(--tenue); }
.versiones, .anchos { display: flex; gap: 6px; flex-wrap: wrap; }
.marco { flex: 1; position: relative; display: flex; justify-content: center; background: var(--hoja-2); padding: 16px; min-height: 60vh; }
.marco iframe { width: 100%; height: 100%; min-height: 60vh; border: 0; border-radius: 10px; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.25); }
.marco.movil iframe { width: 390px; max-width: 100%; }
.vacio { align-self: center; max-width: 34ch; text-align: center; color: var(--tenue); }

@media (max-width: 600px) {
  .barra { padding: 8px 14px; }
  .cuenta, .marca .beta { display: none; }
  .charla { padding: 16px; }
  .marco { padding: 8px; }
}
