/* Portal de Mercatoria · paleta «Mar y cobre» (elegida por el usuario el 31/10/2026):
     #0A0F14 noche · #0F3D3E abismo · #2E6F73 mar · #7FB3B8 bruma · #EADCC8 arena · #C6601F cobre
   Columna lateral en abismo, fondo arena (claro) o noche (oscuro), cobre solo para la acción principal y lo que más espera,
   mar para lo secundario. Los demás tonos son mezclas de estos seis. Logos oficiales de cada aplicación en img/. */
@font-face { font-family: "Hubot Sans"; src: url("/fonts/HubotSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Hubot Sans"; src: url("/fonts/HubotSans-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Hubot Sans"; src: url("/fonts/HubotSans-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Hubot Sans"; src: url("/fonts/HubotSans-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --noche: #0A0F14; --abismo: #0F3D3E; --mar: #2E6F73; --bruma: #7FB3B8; --arena: #EADCC8; --cobre: #C6601F;

  --fondo: #F4EEE5; --superficie: #FFFDF9; --superficie-2: #FAF5EE; --hundido: #EFE6DA;
  --borde: #E4D8C7; --borde-fuerte: #D3C3AD;
  --tinta: var(--noche); --suave: #3A4B50; --tenue: #56676B;
  --acento: #B25419; --acento-hover: #964512;   /* el cobre algo más hondo: texto blanco a 4.5:1 */ --acento-suave: #F6E2D2; --acento-tinta: #8B3F12;
  --sec: var(--mar); --sec-suave: #DDEBEB; --sec-tinta: #1F5154;
  --ok: #2E6F73; --error: #B3261E; --error-suave: #FBE9E7;

  --lateral: var(--abismo); --lateral-tinta: var(--arena); --lateral-tenue: var(--bruma);
  --lateral-fila: rgba(234, 220, 200, .06); --lateral-fila-hover: rgba(234, 220, 200, .11); --lateral-borde: rgba(127, 179, 184, .18);

  --radio: 14px; --letra: "Hubot Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;   /* la de la marca (la misma que Mercatoria Truck) */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: var(--noche); --superficie: #111A20; --superficie-2: #0E161B; --hundido: #17232A;
    --borde: #1F2E35; --borde-fuerte: #2C3E46;
    --tinta: var(--arena); --suave: #BCC6C3; --tenue: #7F9699;
    --acento: #B25419; --acento-hover: #C6601F; --acento-suave: #2B1A10; --acento-tinta: #F1B58E;
    --sec: var(--bruma); --sec-suave: #12302F; --sec-tinta: var(--bruma);
    --ok: var(--bruma); --error: #F2938C; --error-suave: #3A1E1C;
    --lateral: #0B2E2F;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--fondo); color: var(--tinta); font: 16px/1.5 var(--letra); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
a { color: inherit; }
.sprite { position: absolute; }
.ico { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--sec); outline-offset: 2px; }

.marca { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.marca img { display: block; }
.marca-sub { font-weight: 400; opacity: .7; }

.boton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border: 0; border-radius: 12px;
  background: var(--acento); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s; white-space: nowrap; }
.boton:hover { background: var(--acento-hover); }
.boton:disabled { opacity: .55; cursor: default; }
.boton .ico { width: 17px; height: 17px; }
.boton-grande { padding: 15px 20px; width: 100%; font-size: 16px; }
.boton-icono { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--borde); border-radius: 50%;
  background: var(--superficie); color: var(--suave); cursor: pointer; font: inherit; transition: color .15s, border-color .15s; }
.boton-icono:hover { color: var(--tinta); border-color: var(--borde-fuerte); }
.boton-icono:disabled .ico { animation: girar 1s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ── Entrar ── */
.entrar { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.entrar-marca { background: var(--abismo); color: var(--arena); padding: 56px clamp(24px, 6vw, 88px); display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.marca-grande { font-size: 24px; margin-bottom: 24px; }
.entrar-marca h1 { font-size: clamp(34px, 4.4vw, 52px); line-height: 1.08; letter-spacing: -.025em; font-weight: 700; max-width: 12ch; }
.entrar-marca > p { font-size: 18px; color: var(--bruma); max-width: 34ch; }
.entrar-apps { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.entrar-apps li { display: flex; align-items: center; gap: 14px; font-weight: 500; }
.entrar-apps img { border-radius: 10px; display: block; }
.entrar-lado { display: grid; place-items: center; padding: 40px 20px; }
.entrar-caja { width: 100%; max-width: 400px; }
.entrar-caja h2 { font-size: 28px; letter-spacing: -.02em; margin-bottom: 6px; }
.entrar-caja > p { color: var(--suave); margin-bottom: 24px; }
.nota { font-size: 14px; color: var(--tenue) !important; margin: 20px 0 0 !important; }
.nota a { color: var(--sec-tinta); }
.aviso { color: var(--error) !important; background: var(--error-suave); padding: 10px 12px; border-radius: 10px; font-size: 14px; margin: 12px 0 0 !important; }

/* ── App ── */
.app { min-height: 100%; display: grid; grid-template-columns: 290px minmax(0, 1fr); }

/* Columna lateral */
.lateral { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 30px; padding: 24px 18px 18px;
  background: var(--lateral); color: var(--lateral-tinta); }
.lateral .marca { padding: 0 6px; }
.grupo h2 { font-size: 14px; font-weight: 500; color: var(--lateral-tenue); margin: 0 6px 10px; }
.apps, .cuentas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.app-fila { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; background: var(--lateral-fila); text-decoration: none; transition: background .15s; }
.app-fila:hover { background: var(--lateral-fila-hover); }
.app-logo { width: 36px; height: 36px; border-radius: 9px; display: block; flex-shrink: 0; }
.app-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-txt strong { font-weight: 600; font-size: 15px; }
.app-txt span { font-size: 13px; color: var(--lateral-tenue); }
.app-abrir { width: 16px; height: 16px; color: var(--lateral-tenue); opacity: 0; transition: opacity .15s; }
.app-fila:hover .app-abrir, .app-fila:focus-visible .app-abrir { opacity: 1; }

.cuenta { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; background: var(--lateral-fila); font-size: 14px; }
.cuenta-txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cuenta-tipo { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 7px; letter-spacing: .02em; }
.cuenta-zoho { background: var(--cobre); color: #fff; }
.cuenta-gmail { background: var(--bruma); color: var(--noche); }
.cuenta-vacia { color: var(--lateral-tenue); }
.cuenta-mal { display: block; font-size: 12px; color: #F2B08C; }
.punto-ok { width: 8px; height: 8px; border-radius: 50%; background: var(--bruma); flex-shrink: 0; }
.cuenta-quitar { border: 0; background: none; color: var(--lateral-tenue); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
.cuenta-quitar:hover { color: var(--arena); }
.cuentas-gmail { margin-top: 6px; }
.cuentas-gmail:empty { display: none; }
.boton-lateral { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 8px; padding: 9px 10px; border: 1px dashed var(--lateral-borde); border-radius: 10px;
  background: none; color: var(--lateral-tinta); font: inherit; font-size: 14px; cursor: pointer; }
.boton-lateral:hover { background: var(--lateral-fila); }

.pie-lateral { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--lateral-borde); }
.usuario { display: flex; align-items: center; gap: 10px; padding: 0 2px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--cobre); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.usuario-nombre { flex: 1; min-width: 0; font-weight: 500; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usuario .boton-icono { width: 34px; height: 34px; background: transparent; border-color: var(--lateral-borde); color: var(--lateral-tenue); }
.usuario .boton-icono:hover { color: var(--arena); border-color: var(--bruma); }
.version { font-size: 12px; color: var(--lateral-tenue); margin: 12px 2px 0; opacity: .8; }

/* Principal */
.principal { padding: 36px clamp(20px, 4vw, 56px) 56px; min-width: 0; max-width: 1080px; width: 100%; }
.cabecera { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.fecha { font-size: 14px; color: var(--tenue); margin-bottom: 4px; }
.saludo { font-size: clamp(28px, 3.4vw, 40px); font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.estado { font-size: 18px; color: var(--suave); margin-top: 8px; max-width: 60ch; }

.bloque-cabecera { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.bloque-cabecera h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; margin-right: auto; }
.actualizado { font-size: 13px; color: var(--tenue); }
.resumen-urgente { font-size: 15px; color: var(--suave); margin-bottom: 14px; min-height: 1px; }
.filtro { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.filtro button { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--borde); background: var(--superficie); font: inherit; font-size: 14px;
  color: var(--suave); padding: 6px 8px 6px 14px; border-radius: 99px; cursor: pointer; transition: border-color .15s; }
.filtro button:hover { border-color: var(--borde-fuerte); color: var(--tinta); }
.filtro .n { min-width: 24px; padding: 0 7px; border-radius: 99px; background: var(--hundido); font-size: 13px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.filtro button[aria-pressed="true"] { background: var(--abismo); border-color: var(--abismo); color: var(--arena); }
.filtro button[aria-pressed="true"] .n { background: rgba(234, 220, 200, .16); color: var(--arena); }

/* Lista de urgentes: una tarjeta con filas */
.urgentes { list-style: none; margin: 0; padding: 0; background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; }
.urgente + .urgente { border-top: 1px solid var(--borde); }
.urgente a { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; text-decoration: none; transition: background .12s; }
.urgente a:hover { background: var(--superficie-2); }
.urgente-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 700; flex-shrink: 0;
  background: var(--sec-suave); color: var(--sec-tinta); }
.fuente-gmail .urgente-avatar { background: var(--hundido); color: var(--suave); }
.urgente-cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.urgente-linea { display: flex; align-items: baseline; gap: 10px; }
.urgente-de { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.urgente-cuando { margin-left: auto; font-size: 13px; color: var(--tenue); white-space: nowrap; }
.nivel-alta a { box-shadow: inset 3px 0 0 var(--acento); }
.nivel-alta .urgente-cuando { color: var(--acento-tinta); font-weight: 600; }
.urgente-asunto { overflow-wrap: anywhere; }
.urgente-resumen { font-size: 14px; color: var(--tenue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.urgente-pie { display: flex; gap: 6px; margin-top: 6px; }
.chip { font-size: 12px; font-weight: 600; border-radius: 6px; padding: 1px 8px; }
.chip-zoho { background: var(--acento-suave); color: var(--acento-tinta); }
.chip-gmail { background: var(--sec-suave); color: var(--sec-tinta); }

.cargando { color: var(--tenue); padding: 18px; list-style: none; }
.vacio { text-align: center; color: var(--suave); padding: 52px 16px; }
.vacio .ico { width: 34px; height: 34px; color: var(--sec); margin-bottom: 10px; }
.vacio strong { display: block; color: var(--tinta); font-size: 20px; margin-bottom: 6px; font-weight: 600; }
.msg-error { color: var(--error); background: var(--error-suave); padding: 12px 16px; font-size: 14px; list-style: none; }

.ocultos { margin-top: 14px; font-size: 14px; color: var(--tenue); }
.ocultos summary { cursor: pointer; width: fit-content; }
.ocultos summary:hover { color: var(--suave); }
.ocultos ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ocultos li { overflow-wrap: anywhere; }
.ocultos li span { color: var(--suave); margin-left: 6px; }

.aviso-portal { margin-bottom: 18px; padding: 11px 16px; border-radius: 12px; font-size: 14px; background: var(--sec-suave); color: var(--sec-tinta); }
.aviso-error { background: var(--error-suave); color: var(--error); }

.nueva-version { position: fixed; right: 16px; bottom: 16px; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px;
  background: var(--abismo); color: var(--arena); border-radius: 14px; font-size: 14px; max-width: calc(100% - 32px); }
.nueva-version .boton { padding: 7px 14px; font-size: 14px; }

/* ── Leer un correo ── */
.lector { width: min(860px, calc(100% - 32px)); max-height: 88vh; padding: 0; border: 1px solid var(--borde); border-radius: 18px;
  background: var(--superficie); color: var(--tinta); display: none; flex-direction: column; overflow: hidden; }
.lector[open] { display: flex; }
.lector::backdrop { background: rgba(10, 15, 20, .55); }
.lector-cabecera { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--borde); }
.lector-cabecera h2 { flex: 1; min-width: 0; font-size: 18px; line-height: 1.3; font-weight: 700; overflow-wrap: anywhere; }
.lector-cerrar { font-size: 15px; }
.lector-cuerpo { overflow-y: auto; padding: 16px 20px 24px; display: flex; flex-direction: column; gap: 10px; }
.lector-n { font-size: 13px; color: var(--tenue); }
.lector-msg { border: 1px solid var(--borde); border-radius: 12px; background: var(--superficie-2); }
.lector-msg summary { display: flex; gap: 10px; align-items: baseline; padding: 12px 14px; cursor: pointer; list-style: none; }
.lector-msg summary::-webkit-details-marker { display: none; }
.lector-msg summary strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lector-tuyo summary strong { color: var(--sec-tinta); }
.lector-fecha { margin-left: auto; font-size: 13px; color: var(--tenue); white-space: nowrap; }
.lector-dir { font-size: 13px; color: var(--tenue); padding: 0 14px 8px; overflow-wrap: anywhere; }
.lector-texto { padding: 4px 14px 16px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.6; }
.lector-adjuntos { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 14px; }
.lector-adjuntos span { font-size: 13px; background: var(--hundido); border-radius: 8px; padding: 3px 9px; color: var(--suave); overflow-wrap: anywhere; }

/* ── Página de privacidad ── */
.legal { max-width: 720px; margin: 0 auto; padding: 40px 16px 64px; }
.legal h1 { font-size: 30px; letter-spacing: -.02em; margin: 28px 0 16px; }
.legal h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--tenue); margin: 28px 0 8px; }
.legal p { color: var(--suave); margin: 0 0 12px; }
.legal a { color: var(--sec-tinta); }

@media (prefers-reduced-motion: reduce) {
  .boton, .app-fila, .urgente a, .app-abrir, .boton-icono, .filtro button { transition: none; }
  .boton-icono:disabled .ico { animation: none; }
}

/* ── Móvil ── */
@media (max-width: 900px) {
  .entrar { grid-template-columns: 1fr; }
  .entrar-marca { padding: 40px 20px 32px; }
  .entrar-marca h1 { font-size: 34px; }
  .entrar-apps { flex-direction: row; flex-wrap: wrap; gap: 10px 18px; margin-top: 12px; }
  .entrar-apps li { font-size: 14px; gap: 8px; }
  .entrar-apps img { width: 28px; height: 28px; border-radius: 7px; }
  .entrar-lado { place-items: start center; padding: 28px 16px 40px; }

  .app { grid-template-columns: 1fr; }
  .lateral { position: static; height: auto; order: 2; gap: 22px; padding: 22px 16px; }
  .principal { padding: 22px 16px 32px; }
  .cabecera { flex-direction: column; gap: 14px; margin-bottom: 20px; }
  .boton-claude { width: 100%; }
  .actualizado { display: none; }
  .urgente a { padding: 14px; gap: 12px; }
  .urgente-avatar { width: 34px; height: 34px; font-size: 13px; }
  .lector { width: 100%; max-width: 100%; max-height: 100%; height: 100%; border-radius: 0; }
  .lector-cabecera { flex-wrap: wrap; padding: 14px 16px; }
  .lector-cabecera h2 { flex-basis: calc(100% - 50px); }
  .lector-cerrar { order: 1; }
  #lector-responder { order: 2; width: 100%; }
  .lector-cuerpo { padding: 12px 16px 20px; }
}
.msg-error a { color: inherit; font-weight: 600; }

@media (prefers-color-scheme: dark) {
  .filtro button[aria-pressed="true"] { background: var(--bruma); border-color: var(--bruma); color: var(--noche); }
  .filtro button[aria-pressed="true"] .n { background: rgba(10, 15, 20, .14); color: var(--noche); }
}
